heyang 2 vuotta sitten
vanhempi
commit
dfcc4c4443

+ 36 - 5
pages/emergencyEvacuationBig.vue

@@ -261,6 +261,7 @@
 				},
 				broadcastType:false,
 				address:"",
+				videoHardwareNUM:[],//实验室和楼道摄像头编码
 			}
 		},
         onLoad(option) {
@@ -392,6 +393,7 @@
 				this.itemData.name=this.fjListArray[e.detail.value].subjectName
 				this.itemData.floorId=this.fjListArray[e.detail.value].floorId
 				this.itemData.id=this.fjListArray[e.detail.value].id
+				this.itemData.subjectId=this.fjListArray[e.detail.value].subjectId
 			},
 			getAppExitLine(){
 				let list = [{type:"lab/exit/line"}];
@@ -421,14 +423,44 @@
 			        url:'/pages_manage/workbench/laboratory/monitor?item='+encodeURIComponent(JSON.stringify(this.itemData))+'&deptId='+this.deptId
 			    })
 			},
+			//获取实验室摄像头
+			async laboratoryInfo(){
+				
+			  let _this = this;
+			  const {data} = await laboratoryInfo(_this.itemData.subjectId);
+			  if(data.code == 200){
+				 let list = data.data[0];
+				 list.labHardwareVOList.forEach(function(item){
+					 if(item.hardwareTypeEnum.enumName=='VIDEO_MONITOR'){
+						 console.log(item.hardwareNUM)
+						 _this.videoHardwareNUM.push(item.hardwareNUM)
+					 }
+				 })
+				 
+				 this.getCameraByFloor();
+			 
+			  }
+			},
 			//获取楼层摄像头列表
 			async getCameraByFloor(){
+				let _this=this;
 				const {data} = await getCameraByFloor({floorId:this.floorId})
 				if(data.code == 200){
 					if(data.data[0]){
-						this.itemData.hardwareNUM=data.data.join(',')
-						this.wenchangGetStartList(data.data);
-						// this.startUrl(response.data);
+						let list=_this.videoHardwareNUM.concat(data.data)
+						let qc=[]
+						for(var i = 0; i < list.length-1; i++){
+							for(var j = i+1; j < list.length; j++){
+								if(list[i]===list[j]){
+									list.splice(j,1);
+									j--;
+								}
+							}
+						}
+						console.log(list)
+					
+					
+						this.wenchangGetStartList(list);
 					}
 				}
 			},
@@ -742,7 +774,7 @@
 				}
 				this.address = this.buildingName+''+this.floorName
 				this.lineEvacuateTow();
-				this.getCameraByFloor();
+				this.laboratoryInfo();
 			},
 			/* 2.5获取疏散线路 */
 			async lineEvacuateTow(){
@@ -849,7 +881,6 @@
 				this.pageType = 2;
 				this.$forceUpdate();
 				this.getDeviceList();
-				this.getCameraByFloor();
 			},
 			async getDeviceList(){
 				let obj ={

+ 37 - 5
pages/emergencyEvacuationBig/emergencyEvacuationBig.vue

@@ -178,7 +178,7 @@
 
 <script>
     import { config } from '@/api/request/config.js'
-    import { lablayout,evacuate,closure,lineEvacuate,getRedis,getDeviceList,textParseUrlIps,getCameraByFloor,jinanGetStartList,nanhuGetStartList,lineEvacuateTow} from '@/api/index.js'
+    import { lablayout,evacuate,closure,lineEvacuate,getRedis,getDeviceList,textParseUrlIps,getCameraByFloor,jinanGetStartList,nanhuGetStartList,lineEvacuateTow,laboratoryInfo} from '@/api/index.js'
     export default {
         data() {
             return {
@@ -251,6 +251,7 @@
 					name:'',
 				},
 				broadcastType:false,
+				videoHardwareNUM:[],//实验室和楼道摄像头编码
 			}
 		},
         onLoad(option) {
@@ -271,7 +272,6 @@
 			this.getAppExitLine();
 			this.lablayout();
             getApp().watch(this.getMqttLineData,'lineData');
-			this.getCameraByFloor();
 		},
 		methods: {
 			getAppExitLine(){
@@ -303,14 +303,44 @@
 			        url:'/pages_manage/workbench/laboratory/monitor?item='+encodeURIComponent(JSON.stringify(this.itemData))+'&deptId='+this.deptId
 			    })
 			},
+			//获取实验室摄像头
+			async laboratoryInfo(){
+				
+			  let _this = this;
+			  const {data} = await laboratoryInfo(_this.itemData.subjectId);
+			  if(data.code == 200){
+				 let list = data.data[0];
+				 list.labHardwareVOList.forEach(function(item){
+					 if(item.hardwareTypeEnum.enumName=='VIDEO_MONITOR'){
+						 console.log(item.hardwareNUM)
+						 _this.videoHardwareNUM.push(item.hardwareNUM)
+					 }
+				 })
+				 
+				 this.getCameraByFloor();
+			 
+			  }
+			},
 			//获取楼层摄像头列表
 			async getCameraByFloor(){
+				let _this=this;
 				const {data} = await getCameraByFloor({floorId:5})
 				if(data.code == 200){
 					if(data.data[0]){
-						//this.nanhuGetStartList(data.data);
-						 this.itemData.hardwareNUM=data.data.join(',')
-						// this.startUrl(response.data);
+						let list=_this.videoHardwareNUM.concat(data.data)
+						let qc=[]
+						for(var i = 0; i < list.length-1; i++){
+							for(var j = i+1; j < list.length; j++){
+								if(list[i]===list[j]){
+									list.splice(j,1);
+									j--;
+								}
+							}
+						}
+						console.log(list)
+					
+					
+						this.nanhuGetStartList(list);
 					}
 				}
 			},
@@ -565,6 +595,7 @@
 				this.itemData.name=this.fjListArray[e.detail.value].subjectName
 				this.itemData.floorId=this.fjListArray[e.detail.value].floorId
 				this.itemData.id=this.fjListArray[e.detail.value].id
+				this.itemData.subjectId=this.fjListArray[e.detail.value].subjectId
 
 				console.log(this.fjListArray[e.detail.value])
 			},
@@ -631,6 +662,7 @@
 				}
 
 				this.lineEvacuateTow();
+				this.laboratoryInfo();
 			},
 			/* 2.5获取疏散线路 */
 			async lineEvacuateTow(){