<!-- 应急疏散 -->
<template>
  <div class="performEvacuation scrollbar-box">
    <div style="position: relative">
      <perform-evacuation-home
        v-if="pageType == 1" :propsBigData="propsBigData"
        style="transform: scale(0.822);position: absolute;top:50%;left:50%;margin-top:-95px;margin-left:-960px;">
      </perform-evacuation-home>
      <perform-evacuation-data
        v-if="pageType == 2" :propsBigData="propsBigData"
        style="transform: scale(0.822);position: absolute;top:50%;left:50%;margin-top:-95px;margin-left:-960px;">
      </perform-evacuation-data>
    </div>
  </div>
</template>
<script>
  import performEvacuationHome from "./performEvacuationHome.vue"
  import performEvacuationData from "./performEvacuationData.vue"
  export default {
    name: 'performEvacuation',
    components: {
      performEvacuationHome,
      performEvacuationData
    },
    data () {
      return {
        pageType:null,
        propsBigData:{
          buildId:null,
          floorId:null,
        },
      }
    },
    created () {
      if(this.$route.query.type == 2){
        this.$set(this,'propsBigData',{
          buildId:this.$route.query.buildId,
          floorId:this.$route.query.floorId,
        });
        this.$set(this,'pageType',2);
      }else if(this.$route.query.type == 1){
        this.$set(this,'propsBigData',{
          buildId:this.$route.query.buildId,
          floorId:this.$route.query.floorId,
        });
        this.$set(this,'pageType',1);
      }else {
        this.$set(this,'pageType',1);
      }
    },
    mounted () {

    },
    methods: {
      goPage(type,data){
        if(this.$route.query.buildId){
          delete this.$route.query.buildId;
        }
        if(this.$route.query.subId){
          delete this.$route.query.subId;
        }
        if(this.$route.query.floorId){
          delete this.$route.query.floorId;
        }
        if(this.$route.query.groupId){
          delete this.$route.query.groupId;
        }
        if(type == 1){
          //二级返回至一级
          this.$set(this,'propsBigData',JSON.parse(JSON.stringify(data)));
          this.$set(this,'pageType',type);
        } else if(type == 2){
          //一级跳转至二级
          this.$set(this,'propsBigData',JSON.parse(JSON.stringify(data)));
          this.$set(this,'pageType',type);
        }
      },
    },
  }
</script>
<style scoped lang="scss">
  .performEvacuation{
    flex:1;
    display: flex;
    flex-direction: column;
    margin:5px 20px 20px 10px;
    box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
    border-radius:10px;
  }
</style>
