|
@ -64,20 +64,21 @@ |
|
|
<div v-if="item.list.length > 0"> |
|
|
<div v-if="item.list.length > 0"> |
|
|
<el-checkbox-group class="deviceList" v-model="checkedDeviceIds" @change="____onSelectDevices"> |
|
|
<el-checkbox-group class="deviceList" v-model="checkedDeviceIds" @change="____onSelectDevices"> |
|
|
<el-checkbox v-for="(itm, index) in item.list" :label="itm.iotDeviceId" :key="index" |
|
|
<el-checkbox v-for="(itm, index) in item.list" :label="itm.iotDeviceId" :key="index" |
|
|
:disabled="!itm.iotDeviceId || itm.iotDeviceId.includes('null') || itm.deviceState == 0 || itm.deviceState == null"> |
|
|
:disabled="!itm.iotDeviceId || itm.iotDeviceId.includes('null') || deviceStateLatest[itm.iotDeviceId]===false || (itm.deviceState == 0 || itm.deviceState == null)"> |
|
|
<el-tooltip content="设备未接入" placement="top" |
|
|
<el-tooltip content="设备未接入" placement="top" |
|
|
v-if="!itm.iotDeviceId || itm.iotDeviceId.includes('null_')"> |
|
|
v-if="!itm.iotDeviceId || itm.iotDeviceId.includes('null_')"> |
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
</el-tooltip> |
|
|
</el-tooltip> |
|
|
<el-tooltip content="设备离线" placement="top" |
|
|
<el-tooltip content="设备离线" placement="top" |
|
|
v-else-if="itm.deviceState == 0 || itm.deviceState == null"> |
|
|
v-else-if="deviceStateLatest[itm.iotDeviceId]===false || (itm.deviceState == 0 || itm.deviceState == null)"> |
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
</el-tooltip> |
|
|
</el-tooltip> |
|
|
<div v-else class="title">{{ itm.deviceName }}</div> |
|
|
<div v-else class="title">{{ itm.deviceName }}</div> |
|
|
<el-tooltip :content="(itm.deviceState == 0 || itm.deviceState == null) ? '离线' : '在线'" |
|
|
<el-tooltip |
|
|
|
|
|
:content="(deviceStateLatest[itm.iotDeviceId]===false || (itm.deviceState == 0 || itm.deviceState == null)) ? '离线' : '在线'" |
|
|
placement="top"> |
|
|
placement="top"> |
|
|
<img src="@/assets/jihe/images/offline.svg" class="state" |
|
|
<img src="@/assets/jihe/images/offline.svg" class="state" |
|
|
v-if="itm.deviceState == '0' || itm.deviceState == null"> |
|
|
v-if="deviceStateLatest[itm.iotDeviceId]===false || (itm.deviceState == 0 || itm.deviceState == null) "> |
|
|
<img src="@/assets/jihe/images/online.svg" class="state" v-else> |
|
|
<img src="@/assets/jihe/images/online.svg" class="state" v-else> |
|
|
</el-tooltip> |
|
|
</el-tooltip> |
|
|
<el-tooltip content="回读" placement="top"> |
|
|
<el-tooltip content="回读" placement="top"> |
|
@ -308,6 +309,7 @@ export default { |
|
|
scrollOptions, |
|
|
scrollOptions, |
|
|
boardItemEdtingIndex: -1, |
|
|
boardItemEdtingIndex: -1, |
|
|
isHideCtt: false, |
|
|
isHideCtt: false, |
|
|
|
|
|
deviceStateLatest:{} |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
@ -346,9 +348,26 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
mounted(){ |
|
|
mounted(){ |
|
|
|
|
|
this.EventBus.$on("deviceState", deviceList => { |
|
|
|
|
|
deviceList.forEach(item=>{ |
|
|
|
|
|
if(item.deviceType == "2"){ |
|
|
|
|
|
let bool; |
|
|
|
|
|
if (item.deviceState === '0' || item.deviceState===null){ |
|
|
|
|
|
bool = false; |
|
|
|
|
|
}else{ |
|
|
|
|
|
bool = true; |
|
|
|
|
|
} |
|
|
|
|
|
this.$set(this.deviceStateLatest, item.iotDeviceId, bool); |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
// this.rowDrop(); |
|
|
// this.rowDrop(); |
|
|
this.hideScrollFn(); |
|
|
this.hideScrollFn(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
destroyed(){ |
|
|
|
|
|
this.EventBus.$off("deviceState"); |
|
|
|
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
____boardScale() { |
|
|
____boardScale() { |
|
|
let arr = this.selectedSize.split("*"); |
|
|
let arr = this.selectedSize.split("*"); |
|
@ -513,6 +532,12 @@ export default { |
|
|
this.$message.warning("设备未接入!"); |
|
|
this.$message.warning("设备未接入!"); |
|
|
return; |
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (this.deviceStateLatest[deviceFrom.iotDeviceId] === false){ |
|
|
|
|
|
this.$message.warning("设备已离线!"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
this.selectedBdMsg = []; |
|
|
this.selectedBdMsg = []; |
|
|
getBoardDeviceInfo(deviceFrom.iotDeviceId, deviceFrom.id) |
|
|
getBoardDeviceInfo(deviceFrom.iotDeviceId, deviceFrom.id) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|