|
@@ -3,11 +3,14 @@
|
|
|
<view class="top-warn" v-if="pageType">
|
|
|
<view class="left-title">预警</view>
|
|
|
<view class="text-view">{{text}}</view>
|
|
|
- <view class="button-view" @click="buttonClick">处置</view>
|
|
|
+ <view class="button-view" @click="buttonClick" v-if="buttonType">处置</view>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+ import {
|
|
|
+ itoOrVideoLimits
|
|
|
+ } from '@/utils/index'
|
|
|
import $mqtt from '@/utils/mqtt.min.js';
|
|
|
import {
|
|
|
controlsRestrictVerify
|
|
@@ -22,6 +25,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
pageType: false,
|
|
|
+ buttonType:false,
|
|
|
text: "",
|
|
|
buildId: "",
|
|
|
floorId: "",
|
|
@@ -94,22 +98,49 @@
|
|
|
if (data.code == 200) {
|
|
|
// console.log('条幅触发',data.data);
|
|
|
if (data.data[0]) {
|
|
|
- // console.log('条幅触发-有');
|
|
|
- this.$set(this, 'planData', data.data);
|
|
|
- this.$set(this, 'text', data.data[1] ? '有多个实验室发生预案' : '有实验室发生预案');
|
|
|
- this.$set(this, 'pageType', true);
|
|
|
- //传感器
|
|
|
- let planSensorList = [];
|
|
|
- data.data.forEach((item) => {
|
|
|
- let list = JSON.parse(item.triggerUploadData)
|
|
|
- list.forEach((minItem) => {
|
|
|
- planSensorList.push(minItem.deviceNo)
|
|
|
- })
|
|
|
+ let list1 = [];
|
|
|
+ let list2 = [];
|
|
|
+ data.data.forEach((item)=>{
|
|
|
+ if(itoOrVideoLimits(item.adminId)){
|
|
|
+ list1.push(item);
|
|
|
+ }else{
|
|
|
+ list2.push(item);
|
|
|
+ }
|
|
|
})
|
|
|
- uni.setStorageSync("planSensorList", planSensorList);
|
|
|
+ if(list1[0]){
|
|
|
+ // console.log('条幅触发-有');
|
|
|
+ this.$set(this, 'planData', list1);
|
|
|
+ this.$set(this, 'text', list1[1] ? '有多个实验室发生预案' : '有实验室发生预案');
|
|
|
+ this.$set(this, 'pageType', true);
|
|
|
+ this.$set(this, 'buttonType', true);
|
|
|
+ //传感器
|
|
|
+ let planSensorList = [];
|
|
|
+ list1.forEach((item) => {
|
|
|
+ let list = JSON.parse(item.triggerUploadData)
|
|
|
+ list.forEach((minItem) => {
|
|
|
+ planSensorList.push(minItem.deviceNo)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ uni.setStorageSync("planSensorList", planSensorList);
|
|
|
+ }else{
|
|
|
+ this.$set(this, 'planData', list2);
|
|
|
+ this.$set(this, 'text', list2[1] ? '有多个实验室发生预案' : '有实验室发生预案');
|
|
|
+ this.$set(this, 'pageType', true);
|
|
|
+ this.$set(this, 'buttonType', false);
|
|
|
+ //传感器
|
|
|
+ let planSensorList = [];
|
|
|
+ list2.forEach((item) => {
|
|
|
+ let list = JSON.parse(item.triggerUploadData)
|
|
|
+ list.forEach((minItem) => {
|
|
|
+ planSensorList.push(minItem.deviceNo)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ uni.setStorageSync("planSensorList", planSensorList);
|
|
|
+ }
|
|
|
} else {
|
|
|
// console.log('条幅触发-无');
|
|
|
this.$set(this, 'pageType', false);
|
|
|
+ this.$set(this, 'buttonType', false);
|
|
|
this.$set(this, 'planData', []);
|
|
|
this.$set(this, 'text', '');
|
|
|
uni.setStorageSync("planSensorList", []);
|
|
@@ -257,6 +288,7 @@
|
|
|
buildId: self.planData[res.tapIndex].buildId,
|
|
|
floorId: self.planData[res.tapIndex].floorId,
|
|
|
subId: self.planData[res.tapIndex].subId,
|
|
|
+ adminId: self.planData[res.tapIndex].adminId,
|
|
|
groupId: self.planData[res.tapIndex].eventId,
|
|
|
}
|
|
|
self.laboratoryBigViewGetFloorByBigView(obj);
|
|
@@ -270,6 +302,7 @@
|
|
|
buildId: self.planData[0].buildId,
|
|
|
floorId: self.planData[0].floorId,
|
|
|
subId: self.planData[0].subId,
|
|
|
+ adminId: self.planData[0].adminId,
|
|
|
groupId: self.planData[0].eventId,
|
|
|
}
|
|
|
self.laboratoryBigViewGetFloorByBigView(obj);
|