dedsudiyu 2 年之前
父節點
當前提交
58939a2c79

+ 118 - 110
App.vue

@@ -4,21 +4,20 @@
 	export default {
 		onLaunch: function() {
 			console.log('App Launch')
-      //获取openid
-      uni.login({
-        success(loginRes) {
-          console.log('获取code成功');
-          uni.setStorageSync('code', loginRes.code);
-        }
-      })
+			//获取openid
+			uni.login({
+				success(loginRes) {
+					console.log('获取code成功');
+					uni.setStorageSync('code', loginRes.code);
+				}
+			})
 		},
 		onShow: function() {
-			this.onMQTT();
-
+			// this.onMQTT();
 			console.log('App Show')
 		},
 		onHide: function() {
-            this.offMQTT();
+            // this.offMQTT();
 			console.log('App Hide')
 		},
         data(){
@@ -32,6 +31,8 @@
 				mtopicLine:"lab/exit/line",
                 //监听数据
                 watchObj:{},
+				//当前通道数组
+				mqttIdList:[],
             }
         },
         globalData:{
@@ -42,7 +43,6 @@
 			lineData:{},
         },
         methods: {
-
 			//删除报警监听
 			delWarnData(){
 				delete this.watchObj.warnData;
@@ -80,7 +80,19 @@
                     }
                 })
             },
-            //MQTT订阅
+            // 子页面调用
+            appMqttOn(type,list){
+            	let self = this;
+            	if(this.mqttIdList){
+            		this.offMQTT();
+            	}
+            	uni.setStorageSync('mqttIdList',JSON.stringify(list));
+            	this.mqttIdList = list;
+            	setTimeout(function(){
+            		self.subscriptionMQTT();
+            	},100);
+            },
+			//MQTT订阅
             subscriptionMQTT(){
                 let self = this;
                 const mqttOptions = {
@@ -97,27 +109,39 @@
                 this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
                 this.client.on('connect', () => {
                     // 这是为了给自己发条消息,其它无作用
-                    this.client.subscribe(this.mtopicBigview, (err) => {
-                        if (!err) {
-                            console.log("报警信息订阅成功",this.mtopicBigview)
-                        }
-                    });
-                    this.client.subscribe(this.mtopicFunction, (err) => {
-                        if (!err) {
-                            console.log("传感器信息订阅成功",this.mtopicFunction)
-                        }
-                    });
-                    this.client.subscribe(this.mtopicHardware, (err) => {
-                        if (!err) {
-                            console.log("设备信息订阅成功",this.mtopicHardware)
-                        }
-                    });
-					//订阅应急疏散变更信息
-                    this.client.subscribe(this.mtopicLine, (err) => {
-                        if (!err) {
-                            console.log("设备信息订阅成功",this.mtopicLine)
-                        }
-                    });
+					for(let i=0;i<self.mqttIdList.length;i++){
+						if(self.mqttIdList[i].type == 'lab/function/data'){
+							//传感器
+							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
+								self.client.subscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], (err) => {
+								    if (!err) {
+								        console.log("传感器信息订阅成功",self.mqttIdList[i].type+self.mqttIdList[i].idList[o])
+								    }
+								});
+							}
+						}else if(self.mqttIdList[i].type == 'lab/hardware/data'){
+							//传感器
+							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
+								self.client.subscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], (err) => {
+								    if (!err) {
+								        console.log("硬件订阅成功",self.mqttIdList[i].type+self.mqttIdList[i].idList[o])
+								    }
+								});
+							}
+						}else if(self.mqttIdList[i].type == 'lab/bigview'){
+							self.client.subscribe(self.mqttIdList[i].type, (err) => {
+							    if (!err) {
+							        console.log("报警信息订阅成功",self.mqttIdList[i].type)
+							    }
+							});
+						}else if(self.mqttIdList[i].type == 'lab/exit/line'){
+							self.client.subscribe(self.mqttIdList[i].type, (err) => {
+							    if (!err) {
+							        console.log("应急疏散订阅成功",self.mqttIdList[i].type)
+							    }
+							});
+						}
+					}
                 });
                 // 自动重连
                 this.client.on('reconnect', (msg) => {
@@ -137,93 +161,77 @@
                 });
                 // 收到消息
                 this.client.on('message', (topic, message) => {
-                    // 把arrayBuffer转成字符串
                     let data = JSON.parse(message)
-                    if(topic == this.mtopicBigview){
-                        console.log("报警",data);
-                        if(data.data == 'SUB_RISKPLAN_GROUP'){
-                            this.globalData.mqttAlarmData = data.data;
-                        }
-                    }
-                    if(topic == this.mtopicFunction){
-                        // console.log("传感器",data);
-                        this.globalData.mqttSensorData = data.data;
-                    }
-                    if(topic == this.mtopicHardware){
-                        // console.log("设备开关",data);
-                        this.globalData.mqttDeviceData = data.data;
-                    }
-                    if(topic == this.mtopicLine){
-                        console.log("应急",data);
-                        this.globalData.lineData = data.data;
-                    }
-                    // if(data.data.subId){
-                    // 	for(let i=0;i<self.dataList.length;i++){
-                    // 		if(self.dataList[i].id == data.data.subId){
-                    // 		    self.$set(self.dataList[i],'sensorFunctionStatusList',data.data.functionStatuses);
-                    // 		    console.log("找到了",data)
-                    // 		}
-                    // 	}
-                    // }
+					console.log('消息message',data);
+					if(data){
+						if(topic == 'lab/exit/line'){
+							// console.log("应急",data);
+							this.globalData.lineData = data.data;
+						}else if(topic == 'lab/bigview'){
+							// console.log("报警",data);
+							if(data.data == 'SUB_RISKPLAN_GROUP'){
+								this.globalData.mqttAlarmData = data.data;
+							}
+						}else {
+							if(data.data.subId){
+								// console.log('传感器',data);
+							    this.globalData.mqttSensorData = data.data;
+							}else{
+								// console.log("设备开关",data);
+								this.globalData.mqttDeviceData = data.data;
+							}
+						}
+					}
                 })
                 // 全局监听是否有关闭mqtt的消息的事件
                 uni.$on('closeMqtt',() => {
                     this.client.end(true); // 主动断开连接
                 })
             },
-			onMQTT(){
-				console.log("onMQTT");
-				if(this.client.unsubscribe){
-					this.client.unsubscribe(this.mtopicBigview, error => {
-						if (error) {
-							console.log('Unsubscribe error mtopicBigview', error)
-						}
-					})
-					this.client.unsubscribe(this.mtopicFunction, error => {
-						if (error) {
-							console.log('Unsubscribe error mtopicFunction', error)
-						}
-					})
-					this.client.unsubscribe(this.mtopicHardware, error => {
-						if (error) {
-							console.log('Unsubscribe error mtopicHardware', error)
-						}
-					})
-					this.client.unsubscribe(this.mtopicLine, error => {
-						if (error) {
-							console.log('Unsubscribe error mtopicLine', error)
-						}
-					})
-					this.client.end();
-					this.client = {};
-				}
-				this.subscriptionMQTT();
-			},
             //取消订阅关闭MQTT连接
             offMQTT(){
-                console.log("offMQTT");
-				this.client.unsubscribe(this.mtopicBigview, error => {
-					if (error) {
-						console.log('Unsubscribe error mtopicBigview', error)
-					}
-				})
-				this.client.unsubscribe(this.mtopicFunction, error => {
-					if (error) {
-						console.log('Unsubscribe error mtopicFunction', error)
-					}
-				})
-				this.client.unsubscribe(this.mtopicHardware, error => {
-					if (error) {
-						console.log('Unsubscribe error mtopicHardware', error)
-					}
-				})
-				this.client.unsubscribe(this.mtopicLine, error => {
-					if (error) {
-						console.log('Unsubscribe error mtopicLine', error)
+				let self = this;
+				if(self.mqttIdList[0]){
+					uni.removeStorageSync('mqttIdList')
+					for(let i=0;i<self.mqttIdList.length;i++){
+						if(self.mqttIdList[i].type == 'lab/function/data'){
+							//断开传感器
+							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
+								self.client.unsubscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], error => {
+									if (error) {
+										console.log('Unsubscribe error mtopicBigview', error)
+									}
+								})
+							}
+						}else if(self.mqttIdList[i].type == 'lab/hardware/data'){
+							//断开硬件
+							for(let o=0;o<self.mqttIdList[i].idList.length;o++){
+								self.client.unsubscribe(self.mqttIdList[i].type+self.mqttIdList[i].idList[o], error => {
+									if (error) {
+										console.log('Unsubscribe error mtopicBigview', error)
+									}
+								})
+							}
+						}else if(self.mqttIdList[i].type == 'lab/bigview'){
+							//断开报警
+							self.client.unsubscribe(self.mqttIdList[i].type, error => {
+								if (error) {
+									console.log('Unsubscribe error mtopicBigview', error)
+								}
+							})
+						}else if(self.mqttIdList[i].type == 'lab/exit/line'){
+							//断开疏散
+							self.client.unsubscribe(self.mqttIdList[i].type, error => {
+								if (error) {
+									console.log('Unsubscribe error mtopicBigview', error)
+								}
+							})
+						}
 					}
-				})
-				this.client.end();
-				this.client = {};
+					this.client.end(true);
+					this.client = null;
+					this.mqttIdList = [];
+				}
             },
         }
 	}

+ 11 - 9
api/request/config.js

@@ -1,16 +1,17 @@
 const config = {
-     //base_url: 'http://192.168.1.9:8080',//柴
-     // base_url: 'http://192.168.1.7:8080',//刘波
-	//base_url: 'http://192.168.1.17:8080',//周攀
+	// base_url: 'http://192.168.1.9:8080',//柴
+	// base_url: 'http://192.168.1.7:8080',//刘波
+	// base_url: 'http://192.168.1.17:8080',//周攀
     // base_url: 'http://192.168.1.8:8080',//高升
-	//base_url: 'http://192.168.1.29:8080',//何成
-     // base_url: 'http://192.168.1.43:9800',//43服务器
+	// base_url: 'http://192.168.1.29:8080',//何成
+    // base_url: 'http://192.168.1.43:9800',//43服务器
 	// base_url: 'https://demo.sxitdlc.com/xzgd/',
 	
 	// base_url: 'https://lab.sxitdlc.com/labNhSystem/',//43服务器高升测试
-	//base_url: 'https://lab.sxitdlc.com/labAppTest/',//43服务器线上
-     base_url: 'https://lab.sxitdlc.com/appTest/',//88服务器线上
-	// base_url: 'https://lab.sxitdlc.com/labSystem/', //线上地址
+	// base_url: 'https://lab.sxitdlc.com/labAppTest/',//43服务器线上
+    // base_url: 'https://lab.sxitdlc.com/appTest/',//88服务器线上
+	// base_url: 'https://lab.sxitdlc.com/labSystem/', //矿大地址
+	base_url: 'https://lab.sxitdlc.com/jdlabSystem/', //交大地址
 	
 	
 	//视频地址
@@ -18,7 +19,8 @@ const config = {
 	
 	//MQTT
 	// mqtt_url :'192.168.1.43:1883', //43MQTT
-	mqtt_url: 'lab.sxitdlc.com/nhmqtt', //正式MQTT
+	// mqtt_url: 'lab.sxitdlc.com/nhmqtt', //矿大MQTT
+	mqtt_url: 'lab.sxitdlc.com/jdmqtt', //矿大MQTT
     username: 'mqtt',
     password: 'mqtt@zd1883',
 }

+ 7 - 1
pages/emergencyEvacuationBig.vue

@@ -267,12 +267,16 @@
 			}
 		},
 		onShow(){
-			
+			this.getAppExitLine();
 			this.lablayout();
             getApp().watch(this.getMqttLineData,'lineData');
 			this.getCameraByFloor();
 		},
 		methods: {
+			getAppExitLine(){
+				let list = [{type:"lab/exit/line"}];
+				getApp().appMqttOn(1,list);
+			},
 			shadeTypeClick(){
 				this.broadcastType = !this.broadcastType
 			},
@@ -770,6 +774,8 @@
 			},
 		},
         beforeDestroy(){
+			//断开mqtt连接
+			getApp().offMQTT();
             //删除应急疏散监听
             getApp().deleteLineData();
         }

+ 28 - 0
pages/manageWorkbench.vue

@@ -215,6 +215,7 @@ export default {
     },
     //监听传感器信息
     getMqttSensorData(val){
+		console.log("val",val);
       let self = this;
       // console.log('页面获取的-传感器信息',val)
       if(val.subId){
@@ -345,6 +346,30 @@ export default {
           }
         }
         this.dataList = data.data;
+		let list = [];
+		let obj = {
+			type:"lab/function/data",
+			idList:[],
+		}
+		let objOne = {
+			type:"lab/bigview",
+		}
+		for(let i=0;i<self.dataList.length;i++){
+			let num = 0;
+			for(let o=0;o<obj.idList.length;o++){
+				if(obj.idList[o] == self.dataList[i].id){
+					num++
+				}
+			}
+			if(num == 0){
+				obj.idList.push(self.dataList[i].id)
+			}
+		}
+		list.push(obj);
+		list.push(objOne);
+		list.push({type:"lab/bigview",});
+		list.push({type:"lab/exit/line",});
+		getApp().appMqttOn(1,list);
       }
     },
     //获取输入数量
@@ -469,10 +494,13 @@ export default {
     },
   },
   beforeDestroy(){
+	//断开mqtt连接
+	getApp().offMQTT();
     //删除报警监听
     getApp().deleteAlarmWatch();
     //删除传感器监听
     getApp().deleteSensorWatch();
+	console.log("beforeDestroy");
   }
 }
 </script>

+ 1 - 3
pages_manage/workbench/laboratory/laboratoryInfo.vue

@@ -288,7 +288,7 @@ export default {
     //监听设备信息
     getMqttDeviceData(val){
       let self = this;
-      console.log('页面获取的-设备信息',val)
+      // console.log('页面获取的-设备信息',val)
       for(let i=0;i<val.length;i++){
         for(let k=0;k<self.itemData.labHardwareVOList.length;k++){
           if(val[i].num == self.itemData.labHardwareVOList[k].id){
@@ -476,7 +476,6 @@ export default {
     },
   },
   onHide(){
-    // this.offMQTT();
     // //删除传感器监听
     getApp().deleteSensorWatch();
     // //删除设备监听
@@ -484,7 +483,6 @@ export default {
     console.log("onHide",this.mtopic);
   },
   beforeDestroy(){
-    // this.offMQTT();
     // //删除传感器监听
     getApp().deleteSensorWatch();
     // //删除设备监听

+ 30 - 75
pages_manage/workbench/laboratory/meLaboratory.vue

@@ -55,9 +55,8 @@
                 dataList:[],
                 subject_classData:[],
                 //MQTT请求参数-传感器
-                mtopic:"lab/function/data",
-                msg:"",
                 client:{},
+				mqttIdList:[],
                 //院系选择器数据
                 facultyList:[],
                 facultyArray:[],
@@ -134,75 +133,6 @@
                     this.laboratoryList();
                 }
             },
-            //MQTT订阅-传感器
-            subscriptionMQTT(){
-                let self = this;
-                const mqttOptions = {
-                    keepalive: 30,
-                    clean: false,//保留会话
-                    connectTimeout: 5000, // 超时时间
-                    reconnectPeriod:5000, // 重连间隔
-                    clientId: 'lab/function/data',
-                    username: config.username,
-                    password: config.password,
-                }
-				
-                const connectUrl = config.mqtt_url;
-                this.client = $mqtt.connect('wxs://' + connectUrl, mqttOptions);
-                this.client.on('connect', () => {
-                    // 这是为了给自己发条消息,其它无作用
-                    this.client.subscribe(this.mtopic, (err) => {
-                        if (!err) {
-                            console.log("订阅传感器成功",this.mtopic)
-                        }
-                    })
-                });
-                // 自动重连
-                this.client.on('reconnect', (msg) => {
-                    console.log('reconnect', msg)
-                });
-                // 错误
-                this.client.on('error', () => {
-                    console.log('error')
-                });
-                // 断开
-                this.client.on('end', () => {
-                    console.log('end')
-                });
-                // 掉线
-                this.client.on('offline', (msg) => {
-                    console.log('offline',msg)
-                });
-                // 收到消息
-                this.client.on('message', (topic, message) => {
-                    let data = JSON.parse(message)
-                    console.log('topic',topic)
-                    console.log('data',data)
-                    if(topic == this.mtopic){
-                        if(data.data.subId){
-                            for(let i=0;i<self.dataList.length;i++){
-                                if(self.dataList[i].id == data.data.subId){
-                                    self.$set(self.dataList[i],'sensorFunctionList',data.data.functionStatuses);
-                                }
-                            }
-                        }
-                    }
-                })
-                // 全局监听是否有关闭mqtt的消息的事件
-                uni.$on('closeMqtt',() => {
-                    this.client.end(true); // 主动断开连接
-                })
-            },
-            //取消订阅关闭MQTT连接
-            offMQTT(){
-                this.client.unsubscribe(this.mtopic, error => {
-                    if (error) {
-                        console.log('Unsubscribe error', error)
-                    }
-                })
-                this.client.end();
-                this.client = {};
-            },
             //设备开关按钮
             hardwareButton(minItem,command){
                 let self = this;
@@ -274,9 +204,7 @@
                     list.unshift('全部分类');
                     this.subjectList = data.data;
                     this.subjectList.unshift({dictLabel:"全部分类", dictValue:""})
-                    this.laboratoryList().then(res => {
-                        // this.subscriptionMQTT()
-                    });
+                    this.laboratoryList()
                 }
             },
             //获取实验室列表
@@ -313,19 +241,46 @@
                         }
                     }
                     this.dataList = data.data;
-                    return data.data;
+					let list = [];
+					let obj = {
+						type:"lab/function/data",
+						idList:[],
+					}
+					let objOne = {
+						type:"lab/hardware/data",
+						idList:[],
+					}
+					for(let i=0;i<self.dataList.length;i++){
+						let num = 0;
+						for(let o=0;o<obj.idList.length;o++){
+							if(obj.idList[o] == self.dataList[i].id){
+								num++
+							}
+						}
+						if(num == 0){
+							obj.idList.push(self.dataList[i].id)
+							objOne.idList.push(self.dataList[i].id)
+						}
+					}
+					list.push(obj);
+					list.push(objOne);
+					this.$set(self,'mqttIdList',list);
+					getApp().appMqttOn(1,list);
+					// self.subscriptionMQTT();
                 }
             },
         },
         onHide(){
             // this.offMQTT();
             // //删除传感器监听
+			// getApp().appMqttOn(2);
             getApp().deleteSensorWatch();
             console.log("onHide",this.mtopic);
         },
         beforeDestroy(){
             // this.offMQTT();
             // //删除传感器监听
+			getApp().offMQTT();
             getApp().deleteSensorWatch();
             console.log("beforeDestroy",this.mtopic);
         }

+ 0 - 951
pages_manage/workbench/workbench.vue

@@ -1,951 +0,0 @@
-<!-- 管理端工作台 -->
-<template>
-	<view class="manage-workbench">
-		<!-- <img class="top-big-img" src="@/images/Version2.2/ing_bg_banner.png"> -->
-		<img class="top-big-img" :src="homepageBanner">
-		<top-warn></top-warn>
-		<view class="min-icon-button-box" style="margin-bottom: 0;">
-			<view @click="goPage('casuallyPat')">
-				<img src="@/images/Version2.2/icon_sy_ssp.png">
-				<view>随手拍</view>
-			</view>
-			<view @click="goPage('safetyInspect')">
-				<img src="@/images/Version2.2/icon_sy_aqjc.png">
-				<view>安全检查</view>
-			</view>
-			<!-- <view class="position-button" style="position: relative;" v-if="buttonArray[1]">
-				<picker @change="buttonChange" :range-key="'name'" :value="id" :range="buttonArray">
-					<img src="@/images/Version2.2/icon_sy_aqjc.png">
-					<view>安全检查</view>
-					<view v-if="userInfo.list>0" style="position: absolute;top:40rpx;right:56rpx;height:15rpx;width:15rpx;border-radius:50%;background: red;"></view>
-				</picker>
-			</view>
-			<view style="position: relative;" @click="goCheckPage" v-if="!buttonArray[1]">
-				<img src="@/images/Version2.2/icon_sy_aqjc.png">
-				<view>安全检查</view>
-				<view v-if="userInfo.list>0" style="position: absolute;top:40rpx;right:56rpx;height:15rpx;width:15rpx;border-radius:50%;background: red;"></view>
-			</view> -->
-			<view @click="goPage('photoInspection')">
-				<img src="@/images/icon_dzt_pzjc.png">
-				<view>拍照检查</view>
-			</view>
-			<view @click="goPage('accessQualification')">
-				<img src="@/images/Version2.2/icon_sy_zrsq.png">
-				<view>准入审核</view>
-			</view>
-			<!-- <view @click="goPage('alarm')">
-				<img src="@/images/Version2.2/icon_sy_aqbj.png">
-				<view>安全报警</view>
-			</view> -->
-		</view>
-		<!-- <view class="min-icon-button-box" style="margin-top: 0;"> -->
-			<!-- <view @click="goPage('emergencyEvacuation')">
-				<img src="@/images/Version2.3/icon_sy_yjss.png">
-				<view>应急疏散</view>
-			</view> -->
-		<!-- </view> -->
-		<view class=big-icon-button-box>
-			<!-- 安全报警 -->
-			<img src="@/images/Version2.3/button_1.png" @click="goPage('alarm')">
-			<!-- 应急疏散 -->
-			<img src="@/images/Version2.3/button_2.png" @click="goPage('emergencyEvacuation')">
-		</view>
-		<!-- 分级管控 -->
-		<view class="grading">
-			<img class="grading_l" src="@/images/icon_sy_fjgk.png"/>
-			<view class="grading_c">分级管控</view>
-			<view class="grading_r" @click="goPage('grading')">{{gradingCount>0?gradingCount+'项工作待完成':''}}<img src="@/images/icon_wdwg_gd.png"/></view>
-		</view>
-		
-		<view class="for-title-p" @click="goSecurityAlertList" v-if="alarmList[0]">
-			<img class="left-img" src="@/images/Version2.2/icon_aqbj.png">
-			<view class="name-view">安全报警</view>
-			<view class="num-view">{{securityAlertNum}}</view>
-			<view class="null-view"></view>
-			<img class="right-img" src="@/images/icon_04.png">
-		</view>
-		<view class="for-max-box-one" v-if="alarmList[0]">
-			<view class="for-box" v-for="(item,index) in alarmList" :key="index">
-				<view class="title-box">
-					<view :style="'border:1rpx solid '+item.subDiyVo.fiedColor+';background:#fff;color:'+item.subDiyVo.fiedColor+';'">{{item.subDiyVo.levelName}}</view>
-					<view>{{item.subDiyVo.name}}</view>
-				</view>
-				<view class="address-box"><span>{{item.subDiyVo.typeName}}</span>{{item.subDiyVo.deptName}}</view>
-				<view class="address-box-two">
-					<img src="@/images/icon_14.png">
-					<view>{{item.subDiyVo.subAddrrStr}}</view>
-				</view>
-				<view class="for-img-box">
-					<view class="for-img-min-box" v-for="(minItem,index) in item.sensorSet" :key="index">
-						<img src="@/images/icon_15.png">
-						<view>{{minItem}}</view>
-					</view>
-				</view>
-				<view class="button-view" @click="laboratoryInfo(item)">查看详情</view>
-			</view>
-		</view>
-		<view class="for-title-p" v-if="dataList[0]">
-			<img class="left-img" src="@/images/Version2.2/icon_sy_wdsys.png">
-			<view class="name-view">我的实验室</view>
-		</view>
-		<view class="for-max-box" v-if="dataList[0]">
-			<img class="null-img" v-if="!dataList[0]" src="@/images/null-data-1.png">
-			<view class="for-box" v-for="(item,index) in dataList" :key="index" @click="laboratoryInfoOne(item)">
-				<view class="title-box">
-					<view :style="'border:1rpx solid '+item.fiedColor+';background:#fff;color:'+item.fiedColor+';'">{{item.levelName}}</view>
-					<view>{{item.name}}</view>
-					<img src="@/images/icon_04.png">
-				</view>
-				<view class="address-box"><span>{{item.typeName}}</span>{{item.deptName}}</view>
-				<view class="address-box-two">
-					<img src="@/images/icon_14.png">
-					<view>{{item.subAddrrStr}}</view>
-				</view>
-			</view>
-		</view>
-		<tab-bar></tab-bar>
-	</view>
-</template>
-
-<script>
-    import $mqtt from '@/utils/mqtt.min.js';
-    import { config } from '@/api/request/config.js'
-    import { appReceivePhotoNote,getApprovalCount,subject_class,getSafeWarnList,laboratoryInfo,laboratoryList,getLoginUserInfo,outSubjectPhoto,gradingControl} from '@/api/index.js'
-    import { tabBar } from '@/component/tabBar.vue'
-	import { topWarn } from '@/component/topWarn.vue'
-	export default {
-        components: {
-            tabBar,
-			topWarn
-        },
-		data() {
-			return {
-			    //随手拍数量
-                appReceivePhotoNoteNum:0,
-				//准入数量
-                passedNum:"",
-                subject_classData:[],
-                securityAlertNum:"",
-				//MQTT请求参数
-                mtopic:"lab/bigview",
-                mtopicOne:"lab/function/data",
-                msg:"",
-                client:{},
-				//报警数据
-                alarmList:[],
-				//实验室数据
-                dataList:[],
-				//用户信息数据(用来决定是否可以跳转检查项)
-				userInfo:{
-					isadmin:null,
-					ischeck:null,
-					list:null,
-				},
-				buttonArray:[],
-				gradingCount:0,//分级管控未完成总数
-				homepageBanner:uni.getStorageSync('homepageBanner'),
-			}
-		},
-        created() {
-
-		},
-        mounted(){
-            this.appReceivePhotoNote();
-            this.getApprovalCount();
-            this.subject_class();
-            this.laboratoryList();
-            this.getSafeWarnList();
-			this.getLoginUserInfo();
-			this.getGrading();
-            //监听报警信息
-            getApp().watch(this.getSafeWarnList,'mqttAlarmData');
-            //监听传感器信息
-            getApp().watch(this.getMqttSensorData,'mqttSensorData');
-		},
-		methods: {
-			//跳转选择器
-			buttonChange(e){
-				
-				/* if(this.buttonArray[e.detail.value].id == 1){
-					//检查记录
-					uni.navigateTo({
-						url: '/pages_manage/workbench/securityCheck/inspectionRecords'
-					});
-				}else if(this.buttonArray[e.detail.value].id == 2){
-					//问题整改
-					uni.navigateTo({
-					    url: '/pages_manage/workbench/problemRectification/rectifyList'
-					});
-				} */
-			},
-            //暂无提示
-            goCheckPage(){
-				if(this.userInfo.isadmin){
-					uni.navigateTo({
-					    url: '/pages_manage/workbench/problemRectification/rectifyList'
-					});
-				}else if(this.userInfo.ischeck == 1){
-					uni.navigateTo({
-						url: '/pages_manage/workbench/securityCheck/inspectionRecords'
-					});
-				}else{
-					uni.showToast({
-						title: '您没有该权限',
-						icon:"none",
-						mask:true,
-						duration: 2000
-					});
-				}
-            },
-            //监听传感器信息
-            getMqttSensorData(val){
-                let self = this;
-                // console.log('页面获取的-传感器信息',val)
-                if(val.subId){
-                    for(let i=0;i<self.dataList.length;i++){
-                        if(self.dataList[i].id == val.subId){
-                            self.$set(self.dataList[i],'sensorFunctionList',val.functionStatuses);
-                        }
-                    }
-                }
-            },
-			//获取分级管控未完成总数
-			async getGrading(){
-			    let obj = {
-			       
-			    }
-			    const {data} = await gradingControl(obj)
-			    if(data.code==200){
-			        this.gradingCount=data.count;	
-			    }
-			
-			},
-			async getLoginUserInfo(){
-				const {data} = await getLoginUserInfo();
-				if(data.code == 200){
-					this.userInfo = data.data;
-					let list = [];
-					if(data.data.isadmin){
-						//实验室负责人
-						let obj = {
-							id:"1",
-							name:"检查记录",
-						}
-						list.push(obj)
-					}
-					if(data.data.ischeck == 1){
-						//检查者
-						let obj = {
-							id:"2",
-							name:"问题整改",
-						}
-						list.push(obj)
-					}
-					this.$set(this,'buttonArray',list);
-					console.log("data",data)
-				}
-			},
-            //获取报警信息详情
-            async laboratoryInfo(item){
-                const {data} = await laboratoryInfo(item.subDiyVo.id);
-                if(data.code == 200){
-                    let obj = data.data[0];
-                    obj.subClassVO = item.subDiyVo.subClassVO;
-                    obj.name = item.subDiyVo.name;
-                    obj.subTypeLable = item.subDiyVo.subTypeLable;
-                    obj.deptName = item.subDiyVo.deptName;
-                    obj.subAddrrStr = item.subDiyVo.subAddrrStr;
-                    uni.navigateTo({
-                        url: '/pages_manage/workbench/laboratory/laboratoryInfo?item='+encodeURIComponent(JSON.stringify(obj))
-                    });
-                }
-            },
-            //获取实验室详情
-            async laboratoryInfoOne(item){
-                const {data} = await laboratoryInfo(item.id);
-                if(data.code == 200){
-                    let obj = data.data[0];
-                    obj.subClassVO = item.subClassVO;
-                    obj.name = item.name;
-                    obj.subTypeLable = item.subTypeLable;
-                    obj.deptName = item.deptName;
-                    obj.subAddrrStr = item.subAddrrStr;
-					obj.sensorFunctionList = item.sensorFunctionList;
-                    uni.navigateTo({
-                        url: '/pages_manage/workbench/laboratory/laboratoryInfo?item='+encodeURIComponent(JSON.stringify(obj))+'&deptId='+item.deptId
-                    });
-                }
-            },
-            //获取报警信息列表
-            async getSafeWarnList(){
-                let obj = {
-                    pageNum:1,
-                    pageSize:1,
-                    count:0,
-                    groupStatus:1,
-				};
-                const {data} = await getSafeWarnList(obj);
-                if(data.code == 200){
-					this.alarmList = data.rows;
-					if(data.rows[0]){
-                        this.securityAlertNum = data.rows[0].todayHappenCount;
-					}else{
-                        this.securityAlertNum = 0;
-					}
-                }
-            },
-            //获取实验室列表
-            async laboratoryList(){
-                let self = this;
-                let obj = {
-                    deptId:this.facultyIndex?this.facultyList[this.facultyIndex].deptId:'',
-                    subDept:this.subjectIndex?this.subjectList[this.subjectIndex].dictValue:'',
-                    level:this.levelIndex?this.levelList[this.levelIndex].dictValue:'',
-                };
-                const {data} = await laboratoryList(obj);
-                if(data.code == 200){
-                    for(let o=0;o<data.data.length;o++){
-                        if(data.data[o].labHardwareVOList){
-                            data.data[o].hardwareList = [];
-                            for(let i=0;i<data.data[o].labHardwareVOList.length;i++){
-                                if(data.data[o].labHardwareVOList[i].hardwareTypeEnum.code == 4 &&data.data[o].labHardwareVOList[i].hardwareNUM){
-                                    if(data.data[o].hardwareNUM){
-                                        data.data[o].hardwareNUM = data.data[o].hardwareNUM + ',' + data.data[o].labHardwareVOList[i].hardwareNUM
-                                    }else{
-                                        data.data[o].hardwareNUM = data.data[o].labHardwareVOList[i].hardwareNUM
-                                    }
-                                }else{
-                                    let obj = {
-                                        name:"",
-                                        type:"",
-                                    };
-                                    obj.name = data.data[o].labHardwareVOList[i].hardwareTypeEnum.hardwareTypeName
-                                    obj.type = data.data[o].labHardwareVOList[i].state.code;
-                                    obj.id = data.data[o].labHardwareVOList[i].id;
-                                    data.data[o].hardwareList.push(obj);
-                                }
-                            }
-                        }
-                    }
-                    this.dataList = data.data;
-                }
-            },
-			//获取输入数量
-            async getApprovalCount(){
-                const {data} = await getApprovalCount()
-				if(data.code == 200){
-				    this.passedNum = data.data.passed + '人已获得';
-				}
-            },
-            //获取管理员工作台随手拍数量数据
-            async appReceivePhotoNote(){
-                const {data} = await appReceivePhotoNote();
-                if(data.code == 200){
-                    this.appReceivePhotoNoteNum = data.data.photoCount;
-                }
-            },
-            //获取学科字典
-            async subject_class(){
-                const {data} = await subject_class();
-                if(data.code == 200){
-                    this.subject_classData = data.data;
-                }
-            },
-            //去安全警报
-            goSecurityAlertList(){
-                uni.navigateTo({
-                    url: '/pages_manage/workbench/securityAlert/securityAlertList',//安全警报
-                });
-			},
-            //页面跳转
-            goPage(type){
-                if(type=='casuallyPat'){
-                    uni.navigateTo({
-                        url: '/pages/casuallyPat',//随手拍
-                    });
-				}else if(type=='receiveCasuallyPat'){//收到随手拍
-                    uni.navigateTo({
-                        url: '/pages_manage/workbench/receiveCasuallyPat/receiveCasuallyPat',
-                    });
-				}else if(type=='accessQualification'){//收到随手拍
-                    uni.navigateTo({
-                        url: '/pages_manage/workbench/accessQualification/accessQualification',
-                    });
-					
-				}else if(type == 'safetyInspect'){//安全检查
-                
-					uni.navigateTo({
-					    url: '/pages_manage/workbench/securityCheck/safetyInspect',//安全警报
-					});
-                }
-				else if(type == 'alarm'){
-                    uni.navigateTo({
-                        url: '/pages_manage/workbench/securityAlert/securityAlertList',//安全警报
-                    });
-                }else if(type == 'emergencyEvacuation'){
-                    uni.navigateTo({
-                        url: '/pages/emergencyEvacuationBig',//安全警报
-                    });
-				}else if(type == 'photoInspection'){
-					this.outSubjectPhoto();
-				}else if(type == 'grading'){
-					uni.navigateTo({
-					    url: '/pages/gradingControl/gradingControl',//分级管控
-					});
-				}
-			},//获取拍照检查配置
-			async outSubjectPhoto(){
-			    const {data} = await outSubjectPhoto();
-			    if(data.code == 200){
-			        if(data.data == null){
-			            //需要检查(重新填写)
-						let obj = {
-							sub:"实验室照片",
-							subUrl:"",
-							garbage:"垃圾桶清理后照片",
-							garbageUrl:"",
-							dangerous:"使用危险设备照片(选填)",
-							dangerousUrl:"",
-							sourceRisk:"危险源设备使用登记本照片(选填)",
-							sourceRiskUrl:"",
-						};
-						uni.navigateTo({
-							url: '/pages_student/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
-						});
-					}else if(data.data == false){
-			            //不需要检查
-						uni.showToast({
-							title: '暂无检查数据',
-							icon:"none",
-							mask:true,
-							duration: 2000
-						});
-					}else{
-						//需要检查(修改内容)
-						let obj = {
-							id:data.data.id,
-							sub:"实验室照片",
-							subUrl:data.data.subUrl,
-							garbage:"垃圾桶清理后照片",
-							garbageUrl:data.data.garbageUrl,
-							dangerous:"使用危险设备照片(选填)",
-							dangerousUrl:data.data.dangerousUrl,
-							sourceRisk:"危险源设备使用登记本照片(选填)",
-							sourceRiskUrl:data.data.sourceRiskUrl,
-						};
-						uni.navigateTo({
-							url: '/pages_student/workbench/photoInspection?newData='+encodeURIComponent(JSON.stringify(obj)),
-						});
-					}
-			    }
-			},
-		},
-        beforeDestroy(){
-            //删除报警监听
-            getApp().deleteAlarmWatch();
-            //删除传感器监听
-            getApp().deleteSensorWatch();
-        }
-	}
-</script>
-
-<style lang="stylus" scoped>
-	.manage-workbench{
-		height:100%;
-		width:100%;
-		overflow-y:scroll;
-		.top-big-img{
-			height:342rpx;
-			width:750rpx;
-		}
-		.min-icon-button-box{
-			display flex
-			width:710rpx;
-			margin:20rpx;
-			background :#ffffff;
-			border-radius:20rpx;
-			height:170rpx;
-			view{
-				flex:1;
-				img{
-					height:75rpx;
-					width:75rpx;
-					margin:30rpx auto 10rpx;
-				}
-				view{
-					text-align center
-					font-size:24rpx;
-				}
-			}
-		}
-		.big-icon-button-box{
-			display flex;
-			margin:20rpx;
-			img{
-				width:350rpx;
-				height:150rpx;
-			}
-			img:nth-child(2){
-				margin-left:10rpx;
-			}
-		}
-		/* 分级管控 */
-		.grading{
-			width :712rpx;
-			height :80rpx;
-			background: #FFFFFF;
-			border-radius: 20rpx;
-			margin-left:20rpx;
-			margin-bottom :20rpx;
-			display:flex;
-			justify-content :flex-start;
-			align-items :center;
-			.grading_l{
-				width :34rpx;
-				height :34rpx;
-				margin-left:16rpx;
-			}
-			.grading_c{
-				font-size: 28rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #333333;
-				margin-left:16rpx;
-			}
-			.grading_r{
-				width :504rpx;
-				height :80rpx;
-				font-size: 26rpx;
-				font-family: PingFang SC;
-				font-weight: 500;
-				color: #EE3A3A;
-				display :flex;
-				justify-content :flex-end;
-				align-items: center;
-				>img{
-					width: 20rpx;
-					height: 20rpx;
-					margin-left :20rpx;
-					margin-top :8rpx;
-				}
-			}
-		}
-		
-		.top-max-box{
-			height:300rpx;
-			.top-min-box{
-				display: flex
-				margin:20rpx;
-				.left-box{
-					background #fff
-					height:130rpx;
-					width:345rpx;
-					border-radius: 10px;
-					display flex
-					.left-img{
-						height:80rpx;
-						width:80rpx;
-						margin:25rpx 30rpx;
-					}
-					view{
-						line-height:130rpx;
-						font-size: 28rpx;
-						color:#333;
-						flex:1;
-					}
-					.right-img{
-						width:20rpx;
-						height:20rpx;
-						margin:55rpx 30rpx 0 0;
-					}
-				}
-				.right-box{
-					background #fff
-					height:130rpx;
-					width:345rpx;
-					margin-left:20rpx;
-					border-radius: 10rpx;
-					display flex
-					.left-img{
-						height:80rpx;
-						width:80rpx;
-						margin:25rpx 30rpx;
-					}
-					.right-min-view{
-						flex:1;
-						.right-min-title{
-							line-height:28rpx;
-							font-size: 28rpx;
-							margin-top:32rpx;
-							color: #333333;
-						}
-						.right-bottom-min-box{
-							display flex
-							view{
-								flex:1;
-								text-align right
-								margin:25rpx 14rpx 0 0;
-								font-size: 22rpx;
-								color: #999999;
-								line-height: 22rpx;
-							}
-							img{
-								width:20rpx;
-								height:20rpx;
-								margin:27rpx 80rpx 0 0;
-							}
-						}
-					}
-
-				}
-			}
-			.bottom-min-box{
-				background #fff
-				height:130rpx;
-				width:710rpx;
-				border-radius: 10px;
-				margin:0 20rpx;
-				display flex
-				.left-img{
-					height:80rpx;
-					width:80rpx;
-					margin:25rpx 30rpx;
-				}
-				view{
-					flex:1;
-					line-height:130rpx;
-				}
-				view:nth-child(2){
-					font-size: 28rpx;
-					color:#333;
-				}
-				view:nth-child(3){
-					text-align right
-					font-size: 22rpx;
-					color:#999;
-					margin-right:12rpx;
-				}
-				.right-img{
-					width:20rpx;
-					height:20rpx;
-					margin:55rpx 30rpx 0 0;
-				}
-			}
-		}
-		.for-title-p{
-			border-top-left-radius 20rpx
-			border-top-right-radius 20rpx
-			background #fff
-			padding-left:25rpx;
-			display flex
-			margin:0 20rpx;
-			border-bottom:1rpx solid #e0e0e0;
-			.left-img{
-				height:34rpx;
-				width:34rpx;
-				margin:22rpx 10rpx 0 0;
-			}
-			.name-view{
-				line-height:77rpx;
-				font-size:30rpx;
-				color:#333;
-			}
-			.num-view{
-				width:28rpx;
-				height:28rpx;
-				font-size:20rpx;
-				background:#EE3A3A;
-				border-radius:50%;
-				text-align :center;
-				line-height:24rpx;
-				color:#fff;
-				margin:26rpx 0 0 10rpx;
-			}
-			.null-view{
-				flex:1;
-			}
-			.right-img{
-				height:20rpx;
-				width:10rpx;
-				margin:28rpx 19rpx 0 0;
-			}
-		}
-		.for-max-box-one{
-			margin:0 20rpx;
-			border-bottom-left-radius 20rpx
-			border-bottom-right-radius 20rpx
-			.for-box:nth-child(1){
-				border-top:none;
-			}
-			.for-box{
-				border-top:4rpx solid #dedede;
-				background #fff
-				margin-bottom:20rpx;
-				overflow: hidden
-				.title-box{
-					margin:20rpx 20rpx 0;
-					display flex
-					view:nth-child(1){
-						height:40rpx;
-						line-height:40rpx;
-						font-size:20rpx;
-						border-radius:10rpx;
-						padding:0 20rpx;
-						color:#fff;
-						margin-right:20rpx;
-					}
-					view:nth-child(2){
-						line-height:42rpx;
-						font-size:30rpx;
-						color:#333;
-						max-width:600rpx;
-						flex:1;
-					}
-					.colorA{
-						background:#aa2315;
-					}
-					.colorB{
-						background:#ff9b09;
-					}
-					.colorC{
-						background:#3ea3e9;
-					}
-					.colorD{
-						background:#3ea34c;
-					}
-
-				}
-				.address-box{
-					margin:20rpx 20rpx;
-					font-size:26rpx;
-					color:#999999;
-					span{
-						margin-right:60rpx;
-					}
-				}
-				.address-box-two{
-					display flex
-					margin:0 20rpx 20rpx 20rpx;
-					img{
-						width:28rpx;
-						height:30rpx;
-						margin-right:18rpx;
-					}
-					view{
-						line-height:30rpx;
-						font-size:24rpx;
-						color:#999999;
-					}
-				}
-				.for-img-box{
-					border-top:1rpx solid #e0e0e0;
-					margin:0 20rpx;
-					.for-img-min-box{
-						display flex
-						img{
-							width:30rpx;
-							height:27rpx;
-							margin-top:24rpx;
-							margin-right:10rpx;
-						}
-						view{
-							line-height:74rpx;
-							text-align center
-							font-size:28rpx;
-							color:#EE3A3A;
-						}
-					}
-				}
-				.button-view{
-					margin:0 20rpx;
-					border-top:1rpx dashed #e0e0e0;
-					line-height:90rpx;
-					text-align :center;
-					font-size:26rpx;
-					color:#333;
-				}
-			}
-			.get-null-box{
-				height:100rpx;
-				line-height:100rpx;
-				color:#999;
-				text-align center
-			}
-		}
-		.for-max-box{
-			margin:0 20rpx 120rpx;
-			background: #fff
-			overflow: hidden
-			border-bottom-left-radius 20rpx
-			border-bottom-right-radius 20rpx
-			.null-img{
-				display block
-				width:276rpx;
-				height:321rpx;
-				margin:40rpx auto;
-			}
-			.for-box:nth-child(1){
-				border-top:none;
-			}
-			.for-box{
-				border-top:4rpx solid #dedede;
-				overflow hidden
-				background #ffffff
-				margin-bottom:20rpx;
-				.title-box{
-					margin:20rpx 20rpx 0;
-					display flex
-					view:nth-child(1){
-						height:40rpx;
-						line-height:40rpx;
-						font-size:20rpx;
-						border-radius:10rpx;
-						padding:0 20rpx;
-						color:#fff;
-						margin-right:20rpx;
-					}
-					view:nth-child(2){
-						line-height:42rpx;
-						font-size:30rpx;
-						color:#333;
-						max-width:600rpx;
-						flex:1;
-					}
-					img{
-						width:12rpx;
-						height:20rpx;
-						margin-top:11rpx;
-					}
-					.colorA{
-						background:#aa2315;
-					}
-					.colorB{
-						background:#ff9b09;
-					}
-					.colorC{
-						background:#3ea3e9;
-					}
-					.colorD{
-						background:#3ea34c;
-					}
-
-				}
-				.address-box{
-					margin:20rpx 20rpx;
-					font-size:26rpx;
-					color:#999999;
-					span{
-						margin-right:60rpx;
-					}
-				}
-				.address-box-two{
-					display flex
-					margin:0 20rpx 20rpx 20rpx;
-					img{
-						width:28rpx;
-						height:30rpx;
-						margin-right:18rpx;
-					}
-					view{
-						line-height:30rpx;
-						font-size:24rpx;
-						color:#999999;
-					}
-				}
-				.text-box{
-					/*border-top:1rpx dashed #e0e0e0;*/
-					border-top:1rpx solid #E0E0E0;
-					padding:0 20rpx;
-					/*
-                    overflow-x:scroll;
-                    overflow-y:hidden;
-                    white-space: nowrap;
-                    */
-					.min-box{
-						display inline-block
-						/*padding:0 30rpx 0 10rpx;*/
-						width:355rpx;
-						.min-min-box{
-							display: flex
-							img{
-								width:30rpx;
-								height:27rpx;
-								margin-top:24rpx;
-								margin-right:10rpx;
-							}
-							view{
-								line-height:74rpx;
-								text-align center
-								font-size:28rpx;
-								color:#333;
-							}
-							.colorA{
-								color:#EE3A3A;
-							}
-						}
-					}
-				}
-				.sensor-max-box{
-					margin:0 20rpx;
-					border-top:1rpx solid #e0e0e0;
-					border-bottom:1rpx solid #e0e0e0;
-					display flex
-					.for-sensor-box{
-						flex:1;
-						display flex
-						font-size:28rpx;
-						line-height:94rpx;
-						view{
-							margin-left:20rpx;
-							font-size:25rpx;
-							line-height:94rpx;
-							color:#0183FA;
-						}
-					}
-				}
-				.button-max-box{
-					.button-box{
-						display flex
-						view:nth-child(1){
-							flex:1;
-							line-height:90rpx;
-							color:#333333;
-							margin-left:30rpx;
-							font-size:28rpx;
-						}
-						view:nth-child(2){
-							width:142rpx;
-							line-height:42rpx;
-							border:4rpx solid #0183FA;
-							border-radius:25rpx;
-							color: #0183FA;
-							font-size: 30rpx;
-							text-align center;
-							margin:20rpx 20rpx 20rpx 0;
-						}
-					}
-					.for-button-box{
-						display flex
-						view{
-							flex:1;
-							line-height:90rpx;
-							color:#333333;
-							margin-left:30rpx;
-							font-size:28rpx;
-						}
-						img{
-							height:50rpx;
-							width:100rpx;
-							margin:20rpx 20rpx 20rpx 0;
-						}
-						view:nth-child(2){
-							text-align right
-							color:#999;
-							margin-right:30rpx;
-						}
-					}
-				}
-			}
-		}
-	}
-</style>