<template>
    <div class="newEvacuationBigPage">
      <new-evacuation-big-data-home
        v-if="pageType == 1">
      </new-evacuation-big-data-home>
      <emergency-evacuation-big
        :propsBigData="propsBigData"
        v-if="pageType == 2">
      </emergency-evacuation-big>
    </div>
</template>

<script>
  import emergencyEvacuationBig from "@/views/newEvacuationBigData.vue"
  import newEvacuationBigDataHome from "@/views/newEvacuationBigDataHome.vue"
  export default {
    name: 'newEvacuationBigPage',
    components: {
      newEvacuationBigDataHome,
      emergencyEvacuationBig,
    },
    data() {
      return {
        pageType:null,
        propsBigData:null,
      }
    },
    created() {
      if(this.$route.query.subId){
        this.$set(this,'pageType',2);
      }else{
        this.$set(this,'pageType',1);
      }
    },
    methods:{
      goPage(type,data){
        console.log('type',type)
        console.log('data',data)
        if(type == 1){
          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;
          }
          this.$set(this,'propsBigData',null);
          this.$set(this,'pageType',type);
        } else if(type == 2){
          this.$set(this,'propsBigData',data);
          this.$set(this,'pageType',type);
        }
      },
    },
  }
</script>

<style scoped lang="scss">
  .newPerformEvacuation{
    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>
