dedsudiyu 10 hónapja
szülő
commit
2ae235c96f

+ 16 - 0
src/api/index.js

@@ -124,6 +124,22 @@ export function securityCheckOptionList(query) {
         params: query
     })
 }
+//实验室-传感器
+export function laboratoryBigViewFindSubSensor(data) {
+    return request({
+        url: '/laboratory/bigView/findSubSensor',
+        method: 'post',
+        data: data
+    })
+}
+//查询当前正在发生的预案
+export function laboratoryBigViewSelectTriggerInfo(query) {
+    return request({
+        url: '/laboratory/bigView/selectTriggerInfo',
+        method: 'get',
+        params: query
+    })
+}
 
 
 

+ 25 - 31
src/components/subSensorComponent.vue

@@ -6,26 +6,22 @@
          ref="scrollDiv">
         <div class="sub-sensor-for-box" v-for="(item,index) in dataList" :key="index">
             <div class="sub-sensor-for-name">
-                <p>实验室名称</p>
-                <p>楼栋</p>
-                <p>楼层</p>
-                <p>房间号</p>
+                <p>{{item.subName}}</p>
+                <p>{{item.buildName}}</p>
+                <p>{{item.floorName}}</p>
+                <p>{{item.roomNum}}</p>
             </div>
             <div class="sub-sensor-for-list">
-                <!--<p v-for="(minItem,minIndex) in item.list" :key="minIndex">{{item.percentage}}</p>-->
-                <p>{{item.percentage}}</p>
-                <p>{{item.percentage}}</p>
-                <p>{{item.percentage}}</p>
+                <p v-for="(minItem,minIndex) in item.sensorModelList" :key="minIndex">{{minItem.deviceName}}:{{minItem.deviceValue?minItem.deviceValue:'-'}}{{minItem.unit}}</p>
             </div>
         </div>
         <p v-if="!dataList[0]" class="null-p">- 暂无数据 -</p>
     </div>
 </template>
 <script>
-    // import {
-    //     queryHazardList,
-    // } from "@/api/http"
-
+    import {
+        laboratoryBigViewFindSubSensor
+    } from "@/api/index";
     export default {
         name: 'subSensorComponent',
         data() {
@@ -45,31 +41,31 @@
 
         },
         mounted() {
-            // this.getList();
+            this.getList();
         },
         methods: {
             //获取数据
             getList(){
                 window.clearInterval(this.tableTimer);
-                queryHazardList(this.queryParams).then(response => {
-                    if(response.rows.length == this.queryParams.pageSize || this.queryParams.pageNum == 1){
+                laboratoryBigViewFindSubSensor(this.queryParams).then(response => {
+                    if(response.data.records.length == this.queryParams.pageSize || this.queryParams.pageNum == 1){
                         let list = JSON.parse(JSON.stringify(this.dataListA));
-                        let newList = JSON.parse(JSON.stringify(list.concat(response.rows)));
-                        if(response.rows.length == 2){
-                            this.$set(this,'dataListA',response.rows);
+                        let newList = JSON.parse(JSON.stringify(list.concat(response.data.records)));
+                        if(response.data.records.length == 2){
+                            this.$set(this,'dataListA',response.data.records);
                         }else{
-                            this.$set(this,'dataListA',response.rows.slice(-2));
+                            this.$set(this,'dataListA',response.data.records.slice(-2));
                         }
                         this.$set(this,'dataList',newList);
-                        this.$set(this, 'total', response.total);
+                        this.$set(this, 'total', response.data.total);
                         this.tableActionFun();
                     }else{
                         let obj = JSON.parse(JSON.stringify(this.queryParams));
                         obj.pageNum = 1;
-                        queryHazardList(obj).then(responseOne => {
+                        laboratoryBigViewFindSubSensor(obj).then(responseOne => {
                             let list = JSON.parse(JSON.stringify(this.dataListA));
-                            let ListA = response.rows;
-                            let ListB = responseOne.rows;
+                            let ListA = response.data.records;
+                            let ListB = responseOne.data.records;
                             let newList = JSON.parse(JSON.stringify(ListA.concat(ListB)));
                             if(ListB.length == 2){
                                 this.$set(this,'dataListA',ListB);
@@ -77,7 +73,7 @@
                                 this.$set(this,'dataListA',ListB.slice(-2));
                             }
                             this.$set(this,'dataList',list.concat(newList));
-                            this.$set(this, 'total', response.total);
+                            this.$set(this, 'total', response.data.total);
                             this.$set(this.queryParams,'pageNum',1);
                             this.tableActionFun();
                         });
@@ -88,9 +84,9 @@
             tableActionFun() {
                 let self = this;
                 this.$refs.scrollDiv.scrollTop = 0;
-                if(this.dataList[1]){
+                if(this.dataList[2]){
                     this.tableTimerFun();
-                }else if(!this.dataList[1] && this.queryParams.pageNum != 1){
+                }else if(!this.dataList[2] && this.queryParams.pageNum != 1){
                     setTimeout(function(){
                         self.tableTimerFun();
                     },2000);
@@ -99,9 +95,9 @@
             //暂停后开始
             tableActionStart(){
                 let self = this;
-                if(this.dataList[1]){
+                if(this.dataList[2]){
                     this.tableTimerFun();
-                }else if(!this.dataList[1] && this.queryParams.pageNum != 1){
+                }else if(!this.dataList[2] && this.queryParams.pageNum != 1){
                     setTimeout(function(){
                         self.tableTimerFun();
                     },2000);
@@ -166,7 +162,6 @@
             margin:0;
         }
         .sub-sensor-for-box {
-            height:30px;
             margin: 0 30px 6px;
             padding: 10px 0;
             background: rgba(30, 118, 142, 0.2);
@@ -193,7 +188,6 @@
             }
             .sub-sensor-for-list {
                 padding:0 20px;
-                /*margin-top:10px;*/
                 p {
                     margin:0;
                     display: inline-block;
@@ -202,7 +196,7 @@
                     font-weight: 400;
                     color: #FFFFFF;
                     line-height: 14px;
-                    margin-right: 30px;
+                    margin-right: 10px;
                 }
             }
         }

+ 5 - 5
src/components/subUserComponent.vue

@@ -21,7 +21,7 @@
             return {
                 queryParams: {
                     page: 1,
-                    pageSize: 8,
+                    pageSize: 10,
                 },
                 dataList:[],
                 total:0,
@@ -78,9 +78,9 @@
             tableActionFun() {
                 let self = this;
                 this.$refs.scrollDiv.scrollTop = 0;
-                if(this.dataList[2]){
+                if(this.dataList[4]){
                     this.tableTimerFun();
-                }else if(!this.dataList[2] && this.queryParams.page != 1){
+                }else if(!this.dataList[4] && this.queryParams.page != 1){
                     setTimeout(function(){
                         self.tableTimerFun();
                     },2000);
@@ -89,9 +89,9 @@
             //暂停后开始
             tableActionStart(){
                 let self = this;
-                if(this.dataList[2]){
+                if(this.dataList[4]){
                     this.tableTimerFun();
-                }else if(!this.dataList[2] && this.queryParams.page != 1){
+                }else if(!this.dataList[4] && this.queryParams.page != 1){
                     setTimeout(function(){
                         self.tableTimerFun();
                     },2000);

+ 10 - 12
src/views/courtyardManage/courtyardHome.vue

@@ -180,7 +180,7 @@
             <i @click="openRiskPlanUrl(item)">查看详情 >></i>
           </li>
         </div>
-        <div class="risk_one"  >
+        <div class="risk_one"  v-if="warningList[0]">
           <!--:class="index==1:one_top risk_li"-->
           <li  v-for='(item,index9) in warningList' :key="index9">
             <img src="@/assets/image/index_icon14.png"/>
@@ -298,7 +298,8 @@ import {
 import {
     systemNotifyList,
     laboratoryGradeManageList,
-    laboratoryBigViewSubTotalUserCount
+    laboratoryBigViewSubTotalUserCount,
+    laboratoryBigViewSelectTriggerInfo
 } from "@/api/index"
 import {
   laboratoryBigViewsSubTypeLevelCount,
@@ -319,8 +320,6 @@ export default {
   },
   data(){
     return {
-      //MQTT请求参数-传感器
-      mtopic:"lab/bigview",
       mtopicTwo:"manage/work"+localStorage.getItem('userId'),
       timer: null,//定时器
       chartReload: null,//定时器
@@ -364,6 +363,8 @@ export default {
       labTypeList:[],
       //v3
       classifyList:[],
+      //MQTT请求参数-预案
+      mtopic:"lab/risk/plan/change",
 
 
 
@@ -379,7 +380,7 @@ export default {
     self.workPlanFun();
     self.laboratoryGradeManageList();
     self.laboratoryBigViewSubTotalUserCount();
-
+    self.laboratoryBigViewSelectTriggerInfo();
     /*let self=this;
     self.getAjaxData();
     self.warningInfoFun();
@@ -558,10 +559,8 @@ export default {
 
           if(topic == this.mtopic){
             //报警
-            if(data.data == 'SUB_RISKPLAN_GROUP'){
-              console.log("预案信息",data);
-              self.warningInfoFun();
-            }
+            console.log("预案信息",data);
+            self.laboratoryBigViewSelectTriggerInfo();
           }
         }
       });
@@ -884,10 +883,9 @@ export default {
 
     },
     //获取报警信息
-    warningInfoFun:function(){
+      laboratoryBigViewSelectTriggerInfo:function(){
       let self=this
-
-      groupGetList({status:1}).then((res) =>{
+      laboratoryBigViewSelectTriggerInfo().then((res) =>{
         if(res.code==200) {
           let data = res.data
           if (res.data.length > 0) {