dedsudiyu 11 miesięcy temu
rodzic
commit
035ae9f6f1

+ 6 - 1
pages/component/topWarn.vue

@@ -8,6 +8,7 @@
 
 <script>
 	import $mqtt from '@/utils/mqtt.min.js';
+  import { controlsRestrictVerify} from '@/utils/index'
 	import {
 		laboratoryBigViewSelectTriggerInfo,
 		laboratoryPlanCloseRiskPlan,
@@ -105,7 +106,11 @@
 			buttonClick() {
 				let self = this;
 				let list = [];
-				list = ['查看', '结束预案'];
+				if(!controlsRestrictVerify('performEvacuation')){
+					list = ['查看'];
+				}else{
+					list = ['查看', '结束预案'];
+				}
 				uni.showActionSheet({
 					itemList: list,
 					success: function(res) {

+ 1 - 0
pages/views/login/login.vue

@@ -139,6 +139,7 @@
 				} = await systemAppletRolePermission();
 				if (data.code == 200) {
 					uni.setStorageSync('permissions', data.data.data)
+					uni.setStorageSync('controlsRestrict', data.data.roleKeys?data.data.roleKeys:[])
 				}
 			},
 			switchClick() {

+ 28 - 0
pages_manage/views/emergencyEvacuationBig.vue

@@ -154,6 +154,7 @@
 </template>
 
 <script>
+  import { controlsRestrictVerify} from '@/utils/index'
 	import $mqtt from '@/utils/mqtt.min.js';
 	import {
 		textParseUrlIps,
@@ -324,6 +325,15 @@
 			//结束预案
 			closePlan() {
 				let self = this;
+				if(!controlsRestrictVerify('performEvacuation')){
+					uni.showToast({
+						title: '没有相关操作权限,请联系管理员',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
 				uni.showModal({
 					content: '传感器数据监测异常,确定要强制结束预案?关闭报警后,3分钟内系统不再触发预案报警,请核实确认后再执行此操作?',
 					cancelColor: "#999",
@@ -420,6 +430,15 @@
 				this.$set(this.itemData, 'subjectId', this.fjListArray[e.detail.value].subId);
 			},
 			shadeTypeClick() {
+				if(!controlsRestrictVerify('performEvacuation')){
+					uni.showToast({
+						title: '没有相关操作权限,请联系管理员',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
 				this.broadcastType = !this.broadcastType
 			},
 			//获取预案数据
@@ -995,6 +1014,15 @@
 			//结束疏散
 			evacuationButton() {
 				let self = this;
+				if(!controlsRestrictVerify('performEvacuation')){
+					uni.showToast({
+						title: '没有相关操作权限,请联系管理员',
+						icon: "none",
+						mask: true,
+						duration: 2000
+					});
+					return
+				}
 				if (this.isEvacuate) {
 					let obj = {
 						buildingId: this.buildingId,

+ 13 - 0
utils/index.js

@@ -0,0 +1,13 @@
+/*            操作权限验证
+* str 为权限字符 用于匹配操作角色的字符
+* str === performEvacuation   应急疏散操作权限
+* str === checkGentle         安全检查
+*/
+export function controlsRestrictVerify(str) {
+  if(str){
+    let controlsRestrict = uni.getStorageSync('controlsRestrict');
+    return controlsRestrict.indexOf(str) != -1;
+  }else{
+    return false
+  }
+}