dedsudiyu 10 kuukautta sitten
vanhempi
commit
247ed06c64

+ 2 - 2
api/request/config.js

@@ -6,12 +6,12 @@ const config = {
 	// base_url: 'http://192.168.1.7:8080',//刘波
 	//base_url: 'http://192.168.1.17:8080',//小飞
 	//base_url: 'http://192.168.1.43/api',//小飞
-	// base_url: 'http://192.168.1.20:8080',//志伟
+	base_url: 'http://192.168.1.20:8080',//志伟
 	//  base_url: 'http://192.168.1.39:8080',//高升
 	// base_url: 'http://192.168.1.29:8080',//何成
 	// base_url: 'https://demo.zjznai.com/xzgd/',
 	// base_url: 'https://lab.zjznai.com/labNhSystem/',//43服务器高升测试
-	 base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
+	 // base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
 	// base_url: 'https://lab.zjznai.com/labAppTest/',//43服务器线上
 	// base_url: 'https://lab.zjznai.com/appTest/',//88服务器线上
 	// base_url: 'https://lab.zjznai.com/labSystem/', //矿大地址

+ 42 - 21
pages_manage/views/laboratory/airConditioning.vue

@@ -8,10 +8,10 @@
 				<view>{{infraredControllerForm.name}}</view>
 				<view @click="switchFun()" :class="infraredControllerForm.switchType==1?'color-A':'color-B'">{{infraredControllerForm.switchType==1?'开启':'关闭'}}</view>
 			</view>
-			<view class="panel-m" >
-				<view @click="temperatureFun(index)" :class="infraredControllerForm.functionType==item.value?'color-C':''" v-for="(item,index) in infraredControllerData.functionList" :key="index">{{item.label}}</view>
+			<view class="panel-m" v-if="infraredControllerForm.switchType == 1">
+				<view @click="temperatureFun(item.value)" :class="infraredControllerForm.functionType==item.value?'color-C':''" v-for="(item,index) in infraredControllerData.functionList" :key="index">{{item.label}}</view>
 			</view>
-			<view class="panel-b">
+			<view class="panel-b" v-if="infraredControllerForm.switchType == 1 && infraredControllerForm.functionType != 3">
 				<view @click="subtract">-</view>
 				<view v-for="(item,index) in infraredControllerData.orderList" :key="index" v-if="item.value == infraredControllerForm.orderType">{{item.value}}</view>
 				<view @click="add">+</view>
@@ -68,13 +68,32 @@
 
 		},
 		mounted() {
-			this.$set(this,'infraredControllerForm',{
-				name:this.airConditioningData.hardwareName,
-				switchType:parseInt(this.airConditioningData.switchType),
-				functionType:this.airConditioningData.switchType == 0 ? 1 : parseInt(this.airConditioningData.functionType),
-				orderType:this.airConditioningData.switchType == 1 && this.airConditioningData.functionType !=3 ? parseInt(this.airConditioningData.orderType):18,
-				hardwareNo:this.airConditioningData.hardwareNo,
-			});
+			if(this.airConditioningData.reservedThree == 0){
+				this.$set(this,'infraredControllerForm',{
+					name:this.airConditioningData.hardwareName,
+					switchType:0,
+					functionType:1,
+					orderType:18,
+					hardwareNo:this.airConditioningData.hardwareNo,
+				});
+			}else if(this.airConditioningData.reservedThree == 2){
+				this.$set(this,'infraredControllerForm',{
+					name:this.airConditioningData.hardwareName,
+					switchType:1,
+					functionType:3,
+					orderType:18,
+					hardwareNo:this.airConditioningData.hardwareNo,
+				});
+			}else if(this.airConditioningData.reservedThree.indexOf('-') != -1){
+				let list = this.airConditioningData.reservedThree.split('-');
+				this.$set(this,'infraredControllerForm',{
+					name:this.airConditioningData.hardwareName,
+					switchType:1,
+					functionType:list[0]==3?1:(list[0]==4?2:''),
+					orderType:list[1]?list[1]:'',
+					hardwareNo:this.airConditioningData.hardwareNo,
+				});
+			}
 		},
 		methods: {
 			// 返回按钮
@@ -82,14 +101,14 @@
 			  this.$parent.buttonClick('conditioningClose','');
 			},
 			switchFun(){
-				if(this.switchStatus==0){
-					this.$set(this, 'switchStatus',1);
+				if(this.infraredControllerForm.switchType==0){
+					this.$set(this.infraredControllerForm, 'switchType',1);
 				}else{
-					this.$set(this, 'switchStatus',0);
+					this.$set(this.infraredControllerForm, 'switchType',0);
 				}
 			},
-			temperatureFun(index){
-				this.$set(this, 'keystrokeIndex',index);
+			temperatureFun(value){
+				this.$set(this.infraredControllerForm, 'functionType',value);
 			},
 			add() {
         if(this.infraredControllerForm.orderType<27){
@@ -106,10 +125,12 @@
 			async mangerControl() {
         let text = '';
         if(this.infraredControllerForm.switchType == 1){
-          if(this.infraredControllerForm.functionType != 3){
-            text = '1-' + this.infraredControllerForm.functionType + '-' + this.infraredControllerForm.orderType;
-          }else {
-            text = '1-3';
+          if(this.infraredControllerForm.functionType == 1){
+            text = '3-' + this.infraredControllerForm.orderType;
+          }else if(this.infraredControllerForm.functionType == 2){
+            text = '4-' + this.infraredControllerForm.orderType;
+          }else if(this.infraredControllerForm.functionType == 3){
+            text = '2';
           }
         }else if(this.infraredControllerForm.switchType == 0){
           text = '0';
@@ -128,6 +149,7 @@
 						mask: true,
 						duration: 2000
 					});
+					this.$parent.getIotControlData();
 					this.backPage();
 				}
 			},
@@ -152,10 +174,9 @@
 		/* 空调面板 */
 		.panel{
 			width: 710rpx;
-			height: 530rpx;
 			background: #FFFFFF;
 			border-radius: 20rpx;
-			padding:34rpx 30rpx 0rpx;
+			padding:34rpx 30rpx 34rpx;
 			box-sizing: border-box;
 			position: absolute;
 			top: 320rpx;

+ 4 - 2
pages_manage/views/laboratory/infoPage.vue

@@ -25,7 +25,7 @@
 				@click="tabFun(index)">{{item}}</view>
 		</view>
 		<!-- 物联控制 -->
-		<iotControl v-if="pageType == 2" :subjectData="subjectData"></iotControl>
+		<iotControl ref="iotControl" v-if="pageType == 2" :subjectData="subjectData"></iotControl>
 		<!-- 安全信息牌 -->
 		<safetyCard v-if="pageType == 3" :subjectData="subjectData"></safetyCard>
 		<!-- 进出记录 -->
@@ -99,7 +99,9 @@
 
 		},
 		methods: {
-
+			getIotControlData(){
+				this.$refs['iotControl'].iotAppHardwareFindByType();
+			},
 			tabFun(index) {
 				this.$set(this, 'currentIndex', index);
 				if (index == 0) {

+ 48 - 26
pages_manage/views/laboratory/iotControl.vue

@@ -81,17 +81,7 @@
 				client: {},
 				newData: {},
 				subId: '',
-				deviceType: [{
-						type: 'video',
-						hardwareName: '视频监控',
-						img: require('@/pages_manage/images/icon_xq_spjk.png'),
-					},
-					{
-						type: 'speech',
-						hardwareName: '语音广播',
-						img: require('@/pages_manage/images/icon_sskz_xz.png'),
-					},
-				],
+				deviceType: [],
 				sensorData: [],
 				labHardwareVOList: [],
 				terminalData: [{
@@ -221,26 +211,44 @@
 				if (data.code == 200) {
 					data.data.forEach((item) => {
 						if (item.hardwareTypeKey == 'airConditioner') {
-							if (item.reservedThree.indexOf('-') != -1) {
-								let list = item.reservedThree.split('-');
-								item.switchType = list[0] ? list[0] : '';
-								item.functionType = list[1] ? list[1] : '';
-								item.orderType = list[2] ? list[2] : '';
-							} else {
-								item.switchType = '';
-								item.functionType = '';
-								item.orderType = '';
-							}
+              if(item.reservedThree == 0){
+                item.switchType = 0;
+              }else if(item.reservedThree == 2){
+                item.switchType = 1;
+                item.functionType = 3;
+              }else if(item.reservedThree.indexOf('-') != -1){
+                let list = item.reservedThree.split('-');
+                item.switchType = 1;
+                item.functionType = list[0]==3?1:(list[0]==4?2:'');
+                item.orderType = list[1]?list[1]:'';
+              }else{
+                item.switchType = '';
+                item.functionType = '';
+                item.orderType = '';
+              }
 						}
 					})
 					this.$set(this, 'labHardwareVOList', data.data);
+					let list = [
+							{
+								type: 'video',
+								hardwareName: '视频监控',
+								img: require('@/pages_manage/images/icon_xq_spjk.png'),
+							},
+							{
+								type: 'speech',
+								hardwareName: '语音广播',
+								img: require('@/pages_manage/images/icon_sskz_xz.png'),
+							},
+						];
 					for (let i = 0; i < data.data.length; i++) {
 						if (data.data[i].hardwareTypeKey == 'airConditioner') {
 							data.data[i].type = 'conditioning';
 							data.data[i].img = require('@/pages_manage/images/icon_xq_kt.png');
-							this.deviceType.push(data.data[i])
+							list.push(data.data[i])
 						}
 					}
+					this.$set(this,'deviceType',list);
 				}
 			},
 			//查询物联设备
@@ -301,10 +309,24 @@
 							list.forEach((item) => {
 								if (item.hardwareNo == data.hardwareNo) {
 									if (item.hardwareTypeKey == 'airConditioner') {
-										let list = data.command.split('-');
-										item.switchType = list[0] ? list[0] : '';
-										item.functionType = list[1] ? list[1] : '';
-										item.orderType = list[2] ? list[2] : '';
+                  if(data.command == 0){
+                    item.switchType = 0;
+                    item.functionType = '';
+                    item.orderType = '';
+                  }else if(data.command == 2){
+                    item.switchType = 1;
+                    item.functionType = 3;
+                    item.orderType = '';
+                  }else if(data.command.indexOf('-') != -1){
+                    let list = data.command.split('-');
+                    item.switchType = 1;
+                    item.functionType = list[0]==3?1:(list[0]==4?2:'');
+                    item.orderType = list[1]?list[1]:'';
+                  }else{
+                    item.switchType = '';
+                    item.functionType = '';
+                    item.orderType = '';
+                  }
 									} else {
 										item.operatingState = data.operatingState;
 										item.online = data.online;