dedsudiyu преди 1 месец
родител
ревизия
3a5a07487d
променени са 3 файла, в които са добавени 58 реда и са изтрити 18 реда
  1. 46 13
      pages/component/topWarn.vue
  2. 11 5
      pages_manage/views/emergencyEvacuationBig.vue
  3. 1 0
      pages_manage/views/emergencyEvacuationSubList.vue

+ 46 - 13
pages/component/topWarn.vue

@@ -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);

+ 11 - 5
pages_manage/views/emergencyEvacuationBig.vue

@@ -156,7 +156,9 @@
 </template>
 
 <script>
-  import { controlsRestrictVerify} from '@/utils/index'
+	import {
+		itoOrVideoLimits
+	} from '@/utils/index'
 	import $mqtt from '@/utils/mqtt.min.js';
 	import {
 		textParseUrlIps,
@@ -211,6 +213,7 @@
 				fjListArray: [],
 				//接收参数
 				subId: "",
+				adminId: "",
 				subName: "",
 				title: "",
 				type: "",
@@ -254,6 +257,7 @@
 		onLoad(option) {
 			if (option.item) {
 				let obj = JSON.parse(decodeURIComponent(option.item));
+			console.log('obj',obj)
 				// console.log('obj',obj)
 				if(obj.type == 'skip'){
 					// 新实验室列表跳转进入逻辑
@@ -262,6 +266,7 @@
 					this.$set(this, 'deptId', obj.buildId);
 					this.$set(this, 'floorId', obj.floorId);
 					this.$set(this, 'subId', obj.subId);
+					this.$set(this, 'adminId', obj.adminId);
 					this.$set(this.itemData, 'subjectId', obj.subId);
 					this.$set(this, 'pageType', 2);
 				}else{
@@ -270,6 +275,7 @@
 					this.$set(this, 'deptId', obj.buildId);
 					this.$set(this, 'floorId', obj.floorId);
 					this.$set(this, 'subId', obj.subId);
+					this.$set(this, 'adminId', obj.adminId);
 					this.$set(this.itemData, 'subjectId', obj.subId);
 					this.$set(this, 'groupId', obj.groupId);
 					this.$set(this, 'pageType', 2);
@@ -340,7 +346,7 @@
 			//结束预案
 			closePlan() {
 				let self = this;
-				if(!controlsRestrictVerify('performEvacuation')){
+				if(!itoOrVideoLimits(this.adminId)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",
@@ -362,7 +368,7 @@
 			},
 			//获取视频数据
 			getVideo(){
-				if (!controlsRestrictVerify('subVideo')) {
+				if(!itoOrVideoLimits(this.adminId)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",
@@ -466,7 +472,7 @@
 				this.$set(this.itemData, 'subjectId', this.fjListArray[e.detail.value].subId);
 			},
 			shadeTypeClick() {
-				if(!controlsRestrictVerify('performEvacuation')){
+				if(!itoOrVideoLimits(this.adminId)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",
@@ -981,7 +987,7 @@
 			//结束疏散
 			evacuationButton() {
 				let self = this;
-				if(!controlsRestrictVerify('performEvacuation')){
+				if(!itoOrVideoLimits(this.adminId)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",

+ 1 - 0
pages_manage/views/emergencyEvacuationSubList.vue

@@ -100,6 +100,7 @@
 					buildId: item.buildId,
 					floorId: item.floorId,
 					subId: item.subId,
+					adminId: item.adminId,
 				};
 				this.laboratoryBigViewGetFloorByBigView(obj);
 			},