|
@@ -14,9 +14,10 @@
|
|
</view>
|
|
</view>
|
|
<view class="sensor">
|
|
<view class="sensor">
|
|
<view v-for="(item,index) in sensorData" :key="index">
|
|
<view v-for="(item,index) in sensorData" :key="index">
|
|
- <img class="sensor-l" :src="baseUrl+item.icon"/>
|
|
|
|
- <view class="sensor-r">{{item.deviceName}}:
|
|
|
|
- {{item.deviceValue?item.deviceValue:''}}{{item.unit?item.unit:''}}</view>
|
|
|
|
|
|
+ <img class="sensor-l" :src="baseUrl+item.icon" />
|
|
|
|
+ <view class="sensor-r" :class="item.type?'color-B':'color-A'">{{item.deviceName}}:
|
|
|
|
+ {{item.deviceValue?item.deviceValue:''}}{{item.unit?item.unit:''}}
|
|
|
|
+ </view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<!-- 智能控制 -->
|
|
<!-- 智能控制 -->
|
|
@@ -88,10 +89,11 @@
|
|
name: '智能管控一体机',
|
|
name: '智能管控一体机',
|
|
pcType: 1,
|
|
pcType: 1,
|
|
}],
|
|
}],
|
|
|
|
+ planSensorList: [],
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
-
|
|
|
|
|
|
+ this.planSensorList = uni.getStorageSync("planSensorList");
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
this.$set(this, 'newData', this.subjectData);
|
|
this.$set(this, 'newData', this.subjectData);
|
|
@@ -159,9 +161,9 @@
|
|
success: function(res) {
|
|
success: function(res) {
|
|
if (res.confirm) {
|
|
if (res.confirm) {
|
|
self.mangerControl(row, status);
|
|
self.mangerControl(row, status);
|
|
- setTimeout(function(){
|
|
|
|
|
|
+ setTimeout(function() {
|
|
self.iotAppHardwareFindByType();
|
|
self.iotAppHardwareFindByType();
|
|
- },200)
|
|
|
|
|
|
+ }, 200)
|
|
|
|
|
|
console.log('用户点击确定');
|
|
console.log('用户点击确定');
|
|
} else if (res.cancel) {
|
|
} else if (res.cancel) {
|
|
@@ -192,12 +194,25 @@
|
|
},
|
|
},
|
|
//查询传感器状态
|
|
//查询传感器状态
|
|
async iotAppSensorFindBySubId() {
|
|
async iotAppSensorFindBySubId() {
|
|
|
|
+ let self = this;
|
|
const {
|
|
const {
|
|
data
|
|
data
|
|
} = await iotAppSensorFindBySubId({
|
|
} = await iotAppSensorFindBySubId({
|
|
subId: this.subId
|
|
subId: this.subId
|
|
});
|
|
});
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
|
|
+ data.data.forEach((item) => {
|
|
|
|
+ let num = 0;
|
|
|
|
+ if (self.planSensorList[0]) {
|
|
|
|
+ self.planSensorList.forEach((minItem) => {
|
|
|
|
+ if (item.deviceNo == minItem) {
|
|
|
|
+ num++
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ item.type = num != 0;
|
|
|
|
+ })
|
|
this.$set(this, 'sensorData', data.data);
|
|
this.$set(this, 'sensorData', data.data);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -211,36 +226,35 @@
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
data.data.forEach((item) => {
|
|
data.data.forEach((item) => {
|
|
if (item.hardwareTypeKey == 'airConditioner') {
|
|
if (item.hardwareTypeKey == 'airConditioner') {
|
|
- 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 = '';
|
|
|
|
- }
|
|
|
|
|
|
+ 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);
|
|
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'),
|
|
|
|
- },
|
|
|
|
- ];
|
|
|
|
|
|
+ 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++) {
|
|
for (let i = 0; i < data.data.length; i++) {
|
|
if (data.data[i].hardwareTypeKey == 'airConditioner') {
|
|
if (data.data[i].hardwareTypeKey == 'airConditioner') {
|
|
data.data[i].type = 'conditioning';
|
|
data.data[i].type = 'conditioning';
|
|
@@ -248,7 +262,7 @@
|
|
list.push(data.data[i])
|
|
list.push(data.data[i])
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- this.$set(this,'deviceType',list);
|
|
|
|
|
|
+ this.$set(this, 'deviceType', list);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
//查询物联设备
|
|
//查询物联设备
|
|
@@ -305,28 +319,28 @@
|
|
//智能控制
|
|
//智能控制
|
|
let data = JSON.parse(message)
|
|
let data = JSON.parse(message)
|
|
let list = JSON.parse(JSON.stringify(this.labHardwareVOList))
|
|
let list = JSON.parse(JSON.stringify(this.labHardwareVOList))
|
|
- console.log('智能控制',data)
|
|
|
|
|
|
+ console.log('智能控制', data)
|
|
list.forEach((item) => {
|
|
list.forEach((item) => {
|
|
if (item.hardwareNo == data.hardwareNo) {
|
|
if (item.hardwareNo == data.hardwareNo) {
|
|
if (item.hardwareTypeKey == 'airConditioner') {
|
|
if (item.hardwareTypeKey == 'airConditioner') {
|
|
- 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 = '';
|
|
|
|
- }
|
|
|
|
|
|
+ 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 {
|
|
} else {
|
|
item.operatingState = data.operatingState;
|
|
item.operatingState = data.operatingState;
|
|
item.online = data.online;
|
|
item.online = data.online;
|
|
@@ -482,7 +496,7 @@
|
|
font-family: PingFang SC;
|
|
font-family: PingFang SC;
|
|
font-weight: 500;
|
|
font-weight: 500;
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
- color: #222222;
|
|
|
|
|
|
+
|
|
line-height: 30rpx;
|
|
line-height: 30rpx;
|
|
overflow: hidden;
|
|
overflow: hidden;
|
|
|
|
|
|
@@ -490,6 +504,14 @@
|
|
|
|
|
|
white-space: nowrap;
|
|
white-space: nowrap;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .color-A {
|
|
|
|
+ color: #222222;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .color-B {
|
|
|
|
+ color: red;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|