dedsudiyu hai 3 meses
pai
achega
00f555892b

+ 2 - 2
api/request/config.js

@@ -2,7 +2,7 @@ const config = {
 	/************************************ 后台服务地址 ************************************/
 	
 	// base_url: 'http://192.168.1.43/api', //43服务器
-	// base_url: 'http://192.168.1.8/api',//1.8服务器
+	base_url: 'http://192.168.1.8/api',//1.8服务器
 	// base_url: 'http://192.168.1.88/labSystem',//1.88服务器
 	// base_url: 'http://192.168.1.9:8080',//柴
 	// base_url: 'http://192.168.1.24:8080',//林总
@@ -16,7 +16,7 @@ const config = {
 	// base_url: 'https://lab.zjznai.com/labNhSystem/',//43服务器高升测试
 	// base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
 	// base_url: 'https://lab.zjznai.com/labapp/',//43服务器线上
-	base_url: 'https://lasfl.sxau.edu.cn/api',//山西农大
+	// base_url: 'https://lasfl.sxau.edu.cn/api',//山西农大
 	// base_url: 'https://lab.zjznai.com/labSystem/', //矿大地址
 	// base_url: 'https://lab.zjznai.com/jdlabSystem/', //交大地址
 	// base_url: 'https://lab.zjznai.com/jndxlabSystem/', //暨大地址

+ 3 - 3
pages/component/topWarn.vue

@@ -108,7 +108,7 @@
 						let list1 = [];
 						let list2 = [];
 						data.data.forEach((item)=>{
-							if(itoOrVideoLimits(item.adminId)){
+							if(itoOrVideoLimits(item.adminId,item.safeIds)){
 								list1.push(item);
 							}else{
 								list2.push(item);
@@ -173,7 +173,7 @@
 								groupId: self.planData[res.tapIndex].eventId,
 							}
 							let buttonList = [];
-							if (!itoOrVideoLimits(self.planData[res.tapIndex].adminId)) {
+							if (!itoOrVideoLimits(self.planData[res.tapIndex].adminId,self.planData[res.tapIndex].safeIds)) {
 								buttonList = ['查看'];
 							} else {
 								buttonList = ['查看', '结束预案'];
@@ -218,7 +218,7 @@
 						groupId: self.planData[0].eventId,
 					}
 					let buttonList = [];
-					if (!itoOrVideoLimits(self.planData[0].adminId)) {
+					if (!itoOrVideoLimits(self.planData[0].adminId,self.planData[0].safeIds)) {
 						buttonList = ['查看'];
 					} else {
 						buttonList = ['查看', '结束预案'];

+ 7 - 4
pages_manage/views/emergencyEvacuationBig.vue

@@ -219,6 +219,7 @@
 				//接收参数
 				subId: "",
 				adminId: "",
+				safeIds:[],
 				subName: "",
 				roomNum: "",
 				title: "",
@@ -285,6 +286,7 @@
 					this.$set(this, 'floorId', obj.floorId);
 					this.$set(this, 'subId', obj.subId);
 					this.$set(this, 'adminId', obj.adminId);
+					this.$set(this, 'safeIds', obj.safeIds);
 					this.$set(this.itemData, 'subjectId', obj.subId);
 					this.$set(this, 'pageType', 2);
 				}else{
@@ -294,6 +296,7 @@
 					this.$set(this, 'floorId', obj.floorId);
 					this.$set(this, 'subId', obj.subId);
 					this.$set(this, 'adminId', obj.adminId);
+					this.$set(this, 'safeIds', obj.safeIds);
 					this.$set(this.itemData, 'subjectId', obj.subId);
 					this.$set(this, 'groupId', obj.groupId);
 					this.$set(this, 'pageType', 2);
@@ -369,7 +372,7 @@
 			//结束预案
 			closePlan() {
 				let self = this;
-				if(!itoOrVideoLimits(this.adminId)){
+				if(!itoOrVideoLimits(this.adminId,this.safeIds)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",
@@ -391,7 +394,7 @@
 			},
 			//获取视频数据
 			getVideo(){
-				if(!itoOrVideoLimits(this.adminId)){
+				if(!itoOrVideoLimits(this.adminId,this.safeIds)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",
@@ -495,7 +498,7 @@
 				this.$set(this.itemData, 'subjectId', this.fjListArray[e.detail.value].subId);
 			},
 			shadeTypeClick() {
-				if(!itoOrVideoLimits(this.adminId)){
+				if(!itoOrVideoLimits(this.adminId,this.safeIds)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",
@@ -1011,7 +1014,7 @@
 			//结束疏散
 			evacuationButton() {
 				let self = this;
-				if(!itoOrVideoLimits(this.adminId)){
+				if(!itoOrVideoLimits(this.adminId,this.safeIds)){
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",

+ 13 - 4
pages_manage/views/laboratory/iotControl.vue

@@ -106,8 +106,13 @@
 		methods: {
 			//物联控制设备
 			deviceTypeFun(item) {
+				let self = this;
+				let safeIds = [];
+				for(let i=0;i<self.newData.safeUserList.length;i++){
+					safeIds.push(self.newData.safeUserList[i].safeUserId);
+				}
 				if (item.type == 'video') {
-					if (!itoOrVideoLimits(this.newData.adminId)) {
+					if (!itoOrVideoLimits(this.newData.adminId,safeIds)) {
 						uni.showToast({
 							title: '没有相关操作权限,请联系管理员',
 							icon: "none",
@@ -123,7 +128,7 @@
 					this.$parent.goVideoPage();
 					// #endif
 				} else {
-					if (!itoOrVideoLimits(this.newData.adminId)) {
+					if (!itoOrVideoLimits(this.newData.adminId,safeIds)) {
 						uni.showToast({
 							title: '没有相关操作权限,请联系管理员',
 							icon: "none",
@@ -152,7 +157,12 @@
 				}
 			},
 			buttonClick(type, row, status) {
-				if (!itoOrVideoLimits(this.newData.adminId)) {
+				let self = this;
+				let safeIds = [];
+				for(let i=0;i<self.newData.safeUserList.length;i++){
+					safeIds.push(self.newData.safeUserList[i].safeUserId);
+				}
+				if (!itoOrVideoLimits(this.newData.adminId,safeIds)) {
 					uni.showToast({
 						title: '没有相关操作权限,请联系管理员',
 						icon: "none",
@@ -161,7 +171,6 @@
 					});
 					return
 				}
-				let self = this;
 				if (type == 'switch') {
 					//开关
 					let text = '';

+ 9 - 1
utils/index.js

@@ -31,10 +31,18 @@ export function pageRestrictVerify(str) {
   userInfo.position   当前用户身份ID (系统用户为NULL)
   userInfo.userId     当前用户userID
 */
-export function itoOrVideoLimits(subAdminId) {
+export function itoOrVideoLimits(subAdminId,safeIds) {
   let userInfo = uni.getStorageSync('user');
   let schoolId = config.schoolId;
   let collegeId = config.collegeId;
+		//如果 当前用户userId 与 安全员ID相等
+	if(safeIds){
+		for(let i=0;i<safeIds.length;i++){
+			if( userInfo.userId == safeIds[i]){
+				return true
+			}
+		}
+	}
   if(userInfo.position == null){
     //如果是管理员(系统用户)
     return true