dedsudiyu 2 jaren geleden
bovenliggende
commit
de4df8ea53
3 gewijzigde bestanden met toevoegingen van 198 en 49 verwijderingen
  1. 8 0
      src/api/evacuationBigData/index.js
  2. 59 11
      src/layout/components/AppMain.vue
  3. 131 38
      src/views/newEvacuationBigData.vue

+ 8 - 0
src/api/evacuationBigData/index.js

@@ -172,4 +172,12 @@ export function selectTriggerInfo(query) {
     params: query
   })
 }
+//标记查看的预案
+export function riskPlanId(query) {
+  return request({
+    url: '/zd-laboratory/plan/writerEnterRiskPlan?riskPlanId=113&ifcheck=1',
+    method: 'get',
+    params: query
+  })
+}
 

+ 59 - 11
src/layout/components/AppMain.vue

@@ -21,6 +21,7 @@
 
 <script>
   import { getListStatus,closeRiskPlan } from '@/api/bigData/index.js'
+  import { selectTriggerInfo} from '@/api/evacuationBigData/index.js'
   import store from '@/store'
   import mqtt from 'mqtt'
 export default {
@@ -47,10 +48,14 @@ export default {
       buttonId:"",
       buildingId:"",
       address:"",
+      buildId:null,
+      floorId:null,
+      subId:null,
     }
   },
   created() {
-    this.getListStatus();
+    // this.getListStatus();
+    this.selectTriggerInfo();
   },
   mounted(){
     this.userType = localStorage.getItem('userType')
@@ -89,7 +94,6 @@ export default {
     },
     //MQTT订阅
     subscriptionMQTT(){
-
       let self = this;
       this.client = mqtt.connect(localStorage.getItem('mqttUrl'), {
         username: localStorage.getItem('mqttUser'),
@@ -117,6 +121,7 @@ export default {
             //报警
             // this.getListStatus();
             store.dispatch('settings/setPlanData', data)
+            self.selectTriggerInfo();
           }
           if(topic == this.mtopicTwo){
             //工作通知
@@ -178,20 +183,17 @@ export default {
           h('p', { style:'font-size:16px;margin:20px 0;' }, self.text+',是否立即查看? '),
         ]),
         showCancelButton: true,
-        confirmButtonText: '执行',
-        cancelButtonText: '查看',
+        confirmButtonText: '查看',
+        cancelButtonText: '取消',
         beforeClose: (action, instance, done) => {
           if (action === 'confirm') {
             //执行
             this.$router.push({
               path: "/emergencyManagement/evacuation/newPerformEvacuation",
               query: {
-                subId: self.subjectId,
-                text:self.textName,
-                buttonId:self.buttonId,
-                buildingId:self.buildingId,
-                address:self.address,
-                type:"1",
+                buildId: self.buildId,
+                floorId:self.floorId,
+                subId:self.subId,
               }
             })
             done();
@@ -215,7 +217,53 @@ export default {
         //成功回掉
       });
     },
-    //跳转分级管控工作
+    //查询当前用户下的预案触发数据
+    selectTriggerInfo(){
+      let self = this;
+      selectTriggerInfo().then(response => {
+        if(response.data[0]){
+          this.$set(this,'text',response.data.length>1?'有多个实验室发生预案':'有实验室发生预案');
+          this.$set(this,'buildId',response.data[0].buildId);
+          this.$set(this,'floorId',response.data[0].floorId);
+          this.$set(this,'subId',response.data[0].subId);
+          if(response.data[0].riskAttribute == 1){
+            this.$set(this,'closePlan',true);
+          }
+          this.$set(this,'textType',true);
+          for(let i=0;i<response.data.length;i++){
+            if(response.data[i].riskAttribute == '1'&&response.data[i].ifcheck != '1'){
+              this.$router.push({
+                path: "/emergencyManagement/evacuation/newPerformEvacuation",
+                query: {
+                  buildId: response.data[i].buildId,
+                  floorId:response.data[i].floorId,
+                  subId:response.data[i].subId,
+                  riskPlanId:response.data[i].riskPlanId,
+                }
+              })
+              return
+            }
+          }
+          //没有火焰预案并且没有查看过
+          for(let i=0;i<response.data.length;i++){
+            if(response.data[i].riskAttribute != '1'&&response.data[i].ifcheck != '1'){
+              this.$router.push({
+                path: "/emergencyManagement/evacuation/newPerformEvacuation",
+                query: {
+                  buildId: response.data[i].buildId,
+                  floorId:response.data[i].floorId,
+                  subId:response.data[i].subId,
+                  riskPlanId:response.data[i].riskPlanId,
+                }
+              })
+              return
+            }
+          }
+        }else{
+          this.$set(this,'textType',false);
+        }
+      })
+    },
   }
 }
 </script>

+ 131 - 38
src/views/newEvacuationBigData.vue

@@ -174,7 +174,11 @@
                 </div>
                 <div class="plan-time-box">
                   <img src="@/assets/ZDimages/bigData3_2/icon_dp_bjsj.png">
-                  <p>2022年12月12日 17:34:03</p>
+                  <p>{{item.riskPlanTriggerTime}}</p>
+                </div>
+                <div class="plan-text-box">
+                  <p class="plan-title-p" :class="item.riskPlanLevel==1?'color-type-1':(item.riskPlanLevel==2?'color-type-2':(item.riskPlanLevel==3?'color-type-3':(item.riskPlanLevel==4?'color-type-4':'')))">{{item.riskPlanLevelName}}</p>
+                  <p class="plan-text-p">{{item.riskPlanLevel==1?'发生风险:火灾预警':'发生风险预警'}}</p>
                 </div>
               </div>
             </div>
@@ -419,7 +423,7 @@
   import { getDeviceList,addHxpChemical,getHornLastMess, subOnlineUser,
            exitHazardTotal,getFireStatus,getFloorData,getBuildOrFloorList,
            executeEvacuation,endEvacuation,openLight,closeLight,getRedisEvacuation,
-           outfirepc,isCancelOutFile,selectTriggerInfo} from '@/api/evacuationBigData/index.js'
+           outfirepc,isCancelOutFile,selectTriggerInfo,riskPlanId} from '@/api/evacuationBigData/index.js'
   export default {
     name: 'newEvacuationBigData',
     props:{
@@ -552,6 +556,8 @@
         shadeMapList:[],
         //实验室选中/报警数据
         checkSubId:null,
+        //传参状态
+        planDataType:false,
       }
     },
     created() {
@@ -560,14 +566,38 @@
       }else{
         this.$set(this,'routeType',false);
       }
+      if(this.$route.query.subId){
+        this.$set(this,'buildingId',this.$route.query.buildingId);
+        this.$set(this,'floorId',this.$route.query.floorId);
+        this.$set(this,'subId',this.$route.query.subId);
+        this.$set(this,'checkSubId',this.$route.query.subId);
+        if(this.$route.query.riskPlanId){
+          this.riskPlanId(this.$route.query.riskPlanId);
+        }
+        this.$set(this,'planDataType',true);
+        this.initialization();
+        console.log('有参数',this.$route.query);
+      }else{
+        this.$set(this,'planDataType',false);
+        this.initialization();
+        console.log('无参数',this.$route.query);
+      }
     },
     mounted(){
       //全局类MQTT
       // this.onAllMQTT('on');
       //初始化
-      this.initialization();
+      // this.initialization();
     },
     methods:{
+      //标记当前查看的预案
+      riskPlanId(riskPlanId){
+        let obj = {
+          riskPlanId:riskPlanId,
+          ifcheck:1,
+        };
+        riskPlanId(obj).then(response => {})
+      },
       //初始化
       initialization(){
         getBuildOrFloorList({type:2,parentId:''}).then(response => {
@@ -576,17 +606,21 @@
               response.data[i].planType = false
             }
             this.$set(this,'buildingOptions',response.data);
-            //处理实验室数量多的楼栋优先选择
-            let num = 0;
-            let index = null;
-            for(let i=0;i<response.data.length;i++){
-              if(response.data[i].subNum>num){
-                num = response.data[i].subNum;
-                index = i;
+            if(this.planDataType){
+              this.getBuildOrFloorList();
+            }else{
+              //处理实验室数量多的楼栋优先选择
+              let num = 0;
+              let index = null;
+              for(let i=0;i<response.data.length;i++){
+                if(response.data[i].subNum>num){
+                  num = response.data[i].subNum;
+                  index = i;
+                }
               }
+              this.$set(this,'buildingId',response.data[index].id);
+              this.getBuildOrFloorList('automatic');
             }
-            this.$set(this,'buildingId',response.data[index].id);
-            this.getBuildOrFloorList('automatic');
           }
         })
       },
@@ -615,13 +649,12 @@
               this.$set(this,'subText',subText);
               this.buttonSubject();
             }
-
-            for(let i=0;i<self.planMapList.length;i++){
-              if(self.planMapList[i].subId == item.subId){
-                this.$set(self.planMapList[i],'planType',true)
-              }
-            }
             if(item.planType){
+              for(let i=0;i<self.planMapList.length;i++){
+                if(self.planMapList[i].subId == item.subId){
+                  this.$set(self.planMapList[i],'planType',true)
+                }
+              }
             }
           }else{
             this.msgError('操作失败,您不是该实验室的管理人员。')
@@ -1511,13 +1544,25 @@
             }
             this.$set(this,'floorText',floorText);
             //自动选中楼层中该用户有权限的第一个实验室
-            for(let i=0;i<response.data.buildFloorLayoutVoList.length;i++){
-              if(response.data.buildFloorLayoutVoList[i].loginAdmin === true){
-                let subText = response.data.buildFloorLayoutVoList[i].roomType == '-99'?response.data.buildFloorLayoutVoList[i].roomName:response.data.buildFloorLayoutVoList[i].subName +' - '+ response.data.buildFloorLayoutVoList[i].roomNum;
-                this.$set(this,'subText',subText);
-                this.$set(this,'subId',response.data.buildFloorLayoutVoList[i].subId);
-                this.$set(this,'checkSubId',response.data.buildFloorLayoutVoList[i].subId);
-                break
+            if(!this.planDataType){
+              console.log('无传参');
+              for(let i=0;i<response.data.buildFloorLayoutVoList.length;i++){
+                if(response.data.buildFloorLayoutVoList[i].loginAdmin === true){
+                  let subText = response.data.buildFloorLayoutVoList[i].roomType == '-99'?response.data.buildFloorLayoutVoList[i].roomName:response.data.buildFloorLayoutVoList[i].subName +' - '+ response.data.buildFloorLayoutVoList[i].roomNum;
+                  this.$set(this,'subText',subText);
+                  this.$set(this,'subId',response.data.buildFloorLayoutVoList[i].subId);
+                  this.$set(this,'checkSubId',response.data.buildFloorLayoutVoList[i].subId);
+                  break
+                }
+              }
+            }else{
+              console.log('传参');
+              for(let i=0;i<response.data.buildFloorLayoutVoList.length;i++){
+                if(response.data.buildFloorLayoutVoList[i].subId == self.subId){
+                  let subText = response.data.buildFloorLayoutVoList[i].roomType == '-99'?response.data.buildFloorLayoutVoList[i].roomName:response.data.buildFloorLayoutVoList[i].subName +' - '+ response.data.buildFloorLayoutVoList[i].roomNum;
+                  this.$set(this,'subText',subText);
+                  break
+                }
               }
             }
             //处理实验室弹窗数据
@@ -1556,10 +1601,13 @@
               }
             }
             this.$set(this,'planMapList',roomList);
+            //获取相关实验室数据
             this.buttonSubject();
+            //查询当前是否有进行中的疏散
             this.getRedisEvacuation();
             //测试查询预案
             this.selectTriggerInfo();
+            this.$set(this,'planDataType',false);
           }
         })
       },
@@ -1626,19 +1674,19 @@
               response.data[i].planType = false
             }
             this.$set(this,'floorOptions',response.data);
-            if(type == 'automatic'){
-              //处理实验室数量多的楼层优先选择
-              let num = 0;
-              let index = null;
-              for(let i=0;i<response.data.length;i++){
-                if(response.data[i].subNum>num){
-                  num = response.data[i].subNum;
-                  index = i;
+            if(!this.planDataType){
+              if(type == 'automatic'){
+                //处理实验室数量多的楼层优先选择
+                let num = 0;
+                let index = null;
+                for(let i=0;i<response.data.length;i++){
+                  if(response.data[i].subNum>num){
+                    num = response.data[i].subNum;
+                    index = i;
+                  }
                 }
+                this.$set(this,'floorId',response.data[index].id);
               }
-              this.$set(this,'floorId',response.data[index].id);
-            }else{
-              this.$set(this,'floorId',response.data[0].id);
             }
             //获取楼层消息
             this.getHornLastMess();
@@ -1685,10 +1733,19 @@
               let num = 0;
               for(let i=0;i<response.data.length;i++){
                 if(response.data[i].subId == self.mapList[o].subId){
-                  num++
+                  self.mapList[o].planType = true;
+                  for(let x=0;x<self.planMapList.length;x++){
+                    if(self.planMapList[x].subId == self.mapList[o].subId){
+                      self.planMapList[x].riskPlanTriggerTime = response.data[i].riskPlanTriggerTime;
+                      self.planMapList[x].riskAttribute = response.data[i].riskAttribute;
+                      self.planMapList[x].riskPlanLevel = response.data[i].riskPlanLevel;
+                      self.planMapList[x].riskPlanLevelName = response.data[i].riskPlanLevelName;
+                      self.planMapList[x].planType = true;
+                    }
+                  }
                 }
               }
-              self.mapList[o].planType = num != 0;
+              // self.mapList[o].planType = num != 0;
             }
           }
           //浮层实验室预案标记
@@ -2536,6 +2593,42 @@
                   font-size:14px;
                 }
               }
+              .plan-text-box{
+                display: flex;
+                color:#fff;
+                margin-top:22px;
+                overflow: hidden;
+                .plan-title-p{
+                  width:60px;
+                  height:20px;
+                  line-height:20px;
+                  font-size:14px;
+                  text-align: center;
+                  margin:0 10px 0 18px;
+                  border-radius:15px;
+                }
+                .plan-text-p{
+                  width:170px;
+                  height:20px;
+                  line-height:20px;
+                  font-size:14px;
+                  overflow:hidden;
+                  text-overflow:ellipsis;
+                  white-space:nowrap;
+                }
+                .color-type-1{
+                  background: #0183FA;
+                }
+                .color-type-2{
+                  background: #FF9900;
+                }
+                .color-type-3{
+                  background: #FF4800;
+                }
+                .color-type-4{
+                  background: #FF0000;
+                }
+              }
             }
             .check-plan-map-for-box{
               z-index:1000!important;