dedsudiyu před 11 měsíci
rodič
revize
e9f108b877
1 změnil soubory, kde provedl 40 přidání a 9 odebrání
  1. 40 9
      pages_manage/views/laboratory/iotControl.vue

+ 40 - 9
pages_manage/views/laboratory/iotControl.vue

@@ -52,6 +52,9 @@
 </template>
 
 <script>
+	import {
+		controlsRestrictVerify
+	} from '@/utils/index'
 	import $mqtt from '@/utils/mqtt.min.js';
 	import {
 		iotAppSensorFindBySubId,
@@ -111,16 +114,44 @@
 			//物联控制设备
 			deviceTypeFun(item) {
 				if (item.type == 'video') {
-
-				} else if (item.type == 'speech') {
-					//语音广播弹窗开启
-					this.$parent.buttonClick('broadcastOpen', '');
-				} else if (item.type == 'conditioning') {
-					//空调弹窗开启
-					this.$parent.buttonClick('conditioningOpen', '');
+					if (!controlsRestrictVerify('subVideo')) {
+						uni.showToast({
+							title: '没有相关操作权限,请联系管理员',
+							icon: "none",
+							mask: true,
+							duration: 2000
+						});
+						return
+					}
+				} else {
+					if (!controlsRestrictVerify('subHardwareControl')) {
+						uni.showToast({
+							title: '没有相关操作权限,请联系管理员',
+							icon: "none",
+							mask: true,
+							duration: 2000
+						});
+						return
+					}
+					if (item.type == 'speech') {
+						//语音广播弹窗开启
+						this.$parent.buttonClick('broadcastOpen', '');
+					} else if (item.type == 'conditioning') {
+						//空调弹窗开启
+						this.$parent.buttonClick('conditioningOpen', '');
+					}
 				}
 			},
 			buttonClick(type, row, status) {
+				if (!controlsRestrictVerify('subHardwareControl')) {
+					uni.showToast({
+						title: '没有相关操作权限,请联系管理员',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
 				let self = this;
 				if (type == 'switch') {
 					//开关
@@ -229,8 +260,8 @@
 					});
 				});
 				this.client.on("message", (topic, message) => {
-							console.log('message',message);
-							console.log('topic,',topic);
+					console.log('message', message);
+					console.log('topic,', topic);
 					if (message) {
 						if (topic == this.mtopic + this.subId) {
 							//传感器