소스 검색

Merge branch 'web-v2' of http://192.168.1.43:3000/git/sass-lab-web into web-v2

dedsudiyu 2 년 전
부모
커밋
ea40328e4f
2개의 변경된 파일78개의 추가작업 그리고 6개의 파일을 삭제
  1. 7 0
      src/layout/components/AppMain.vue
  2. 71 6
      src/views/comprehensive/laboratoryManagement/subject/index.vue

+ 7 - 0
src/layout/components/AppMain.vue

@@ -227,7 +227,14 @@ export default {
     selectTriggerInfo(){
       let self = this;
       selectTriggerInfo().then(response => {
+        //预案发生时候,存储值用于实验室配置传感器状态
+        let arr=[];
+        if(response.data){
+          arr=JSON.stringify(response.data)
+        }
+        localStorage.setItem('selectTriggerList',arr)
         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);

+ 71 - 6
src/views/comprehensive/laboratoryManagement/subject/index.vue

@@ -138,7 +138,7 @@
                       <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4" >{{item.state.name}}</p>
                     </div>
                     <div class="switch-for-min-box_b">
-                      <p class="switch-null-ventilate">预案排风</p>
+                      <p class="switch-null-ventilate" v-if="item.hardwareTypeEnum.hardwareTypeCode==2 && item.state.code==3">{{item.dictLabel}}</p>
                       <el-switch
                         v-if="item.state.code == 3||item.state.code == 4"
                         class="switch"
@@ -158,7 +158,7 @@
                       <p class="switch-null-p" v-if="item.state.code != 3 && item.state.code != 4">{{item.state.name}}</p>
                     </div>
                     <div class="switch-for-min-box_b">
-                      <p class="switch-null-ventilate">预案排风</p>
+                      <p class="switch-null-ventilate" v-if="item.hardwareTypeEnum.hardwareTypeCode==2 && item.state.code==3">{{item.dictLabel}}</p>
                       <el-switch
                         v-if="item.state.code == 3||item.state.code == 4"
                         class="switch"
@@ -290,13 +290,15 @@ import {
   startUrl,
   queryHardByTypeList, getHaikangUserList
 } from '@/api/laboratory/subject'
+import { listData} from "@/api/system/dict/data";
 import { filterDept } from "@/api/medicUniversity-3_1/index";
 import addSubject from "./addSubject.vue";
 import deviceList from "./deviceList.vue";
 import admissionConfiguration from "./admissionConfiguration.vue";
 import associationConfiguration from "./associationConfiguration.vue";
 import infoPage from "./infoPage.vue";
-import { getHxpAlarmRecordNoAuthList,getEnablelist } from "@/api/medicUniversity-3_1/index";
+import { getHxpAlarmRecordNoAuthList,getEnablelist} from "@/api/medicUniversity-3_1/index";
+import store from '@/store'
 export default {
   filters:{
     ellipsis(value){
@@ -383,6 +385,8 @@ export default {
       mtopic:"lab/function/data",
       //MQTT请求参数-硬件
       mtopicOne:"lab/hardware/data",
+      //MQTT请求参数-传感器-预案
+      mtopicTow:"lab/riskPlan/trigger/notice",
       msg:"",
       client:{},
       videoList:[],
@@ -396,6 +400,9 @@ export default {
       hardwareData:[],
       //mqtt实验室id
       mqttIdList:[],
+      //字典排风扇数组
+      fanList:[],
+      selectTriggerList:[],//预案触发下,预案数据存储
     }
   },
   created() {
@@ -404,9 +411,38 @@ export default {
     this.getDeptList();
     // this.subscriptionMQTT();
     this.getList();
+    this.getlistData();
     // this.queryHardByTypeList();
   },
   methods:{
+    //查询当前用户下的预案触发数据
+    selectTriggerFun(data){
+      let self = this;
+      let dataArr=data;
+      let list=JSON.parse(localStorage.getItem('selectTriggerList'));
+      for(let i=0;i<list.length;i++){
+        if(self.subId==list[i].subId){//如果当前选中的实验室和预案触发的实验室id
+          for(let b=0;b<dataArr.length;b++){
+            if(list[i].funNum==dataArr[b].funNum){
+
+              if(list[i].minMonitor<dataArr[b].roundVlue<list[i].maxMonitor){//传感器值正常
+                dataArr[b].type=1
+              }else{//传感器值异常
+
+              }
+            }
+          }
+        }
+      }
+      return dataArr;
+    },
+    /** 查询字典数据列表 */
+    getlistData() {
+      this.loading = true;
+      listData({pageNum:1,pageSize:20,dictType:'trigger_modes'}).then(response => {
+        this.fanList=response.rows
+      });
+    },
     goAlarmRecord(){
       this.$router.push({
         path: `/chemicalLibrary/alarmRecord`,
@@ -760,6 +796,16 @@ export default {
           }else{
             this.$set(this.checkedSubject,'videoData',[]);
           }
+        }else if(type==2){
+          for(let i=0;i<self.checkedSubject.VOlist.length;i++){
+            if(self.checkedSubject.VOlist[i].hardwareTypeEnum.hardwareTypeCode == '2'){
+              for(let b=0;b<self.fanList.length;b++){
+                if(self.fanList[b].dictValue==self.checkedSubject.VOlist[i].triggerModes){
+                  self.checkedSubject.VOlist[i].dictLabel=self.fanList[b].dictLabel
+                }
+              }
+            }
+          }
         }else if(type==5){
           this.queryHardByTypeList();
         }
@@ -796,6 +842,15 @@ export default {
             }
           }
         }
+        //判断传感器是否在线如果不在线type为2
+        if(response.data.sensorFunctionStatusList){
+          obj.sensorFunctionStatusList.forEach(function(item) {
+            if(item.formatVal.indexOf("--") != -1){
+              item.type=2
+            }
+          })
+          obj.sensorFunctionStatusList=this.selectTriggerFun(obj.sensorFunctionStatusList)
+        }
         this.$set(this,'checkedSubject',obj);
         this.$set(this.checkedSubject,'videoData',[]);
         this.rightButtonType = 1;
@@ -945,6 +1000,13 @@ export default {
               if(data.data.subId&&data.data.subId == self.checkedSubject.id){
                 self.$set(self.checkedSubject,'sensorFunctionStatusList',data.data.functionStatuses);
                 self.$set(self.checkedSubject.sensorFunctionStatusList[0],'sendDate',data.sendDate);
+                //判断传感器是否在线如果不在线type为2
+                self.checkedSubject.sensorFunctionStatusList.forEach(function(item) {
+                  if(item.formatVal.indexOf("--") != -1){
+                    item.type=2
+                  }
+                })
+                self.checkedSubject.sensorFunctionStatusList=self.selectTriggerFun(self.checkedSubject.sensorFunctionStatusList)
               }
             }
             if(self.newData.id){
@@ -1281,8 +1343,11 @@ export default {
             margin:0 30px;
           }
           .switch-for-max-box{
+            width: 424px;
+            display: flex;
+            justify-content: flex-start;
+            flex-wrap: wrap;
             .switch-for-big-box{
-              display: inline-block;
               .switch-for-min-box{
                 width:180px;
                 height:70px;
@@ -1312,8 +1377,6 @@ export default {
                   }
                 }
                 .switch-for-min-box_b{
-                  display: flex;
-                  justify-content: space-between;
                   margin-top: 10px;
                   .switch-null-ventilate{
                     width: 62px;
@@ -1326,8 +1389,10 @@ export default {
                     color: #0183FA;
                     line-height: 15px;
                     text-align: center;
+                    float: left;
                   }
                   .switch{
+                    float: right;
                   }
                 }