|
|
@ -64,20 +64,21 @@ |
|
|
|
<div v-if="item.list.length > 0"> |
|
|
|
<el-checkbox-group class="deviceList" v-model="checkedDeviceIds" @change="____onSelectDevices"> |
|
|
|
<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" |
|
|
|
v-if="!itm.iotDeviceId || itm.iotDeviceId.includes('null_')"> |
|
|
|
<div class="title">{{ itm.deviceName }}</div> |
|
|
|
</el-tooltip> |
|
|
|
<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> |
|
|
|
</el-tooltip> |
|
|
|
<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"> |
|
|
|
<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> |
|
|
|
</el-tooltip> |
|
|
|
<el-tooltip content="回读" placement="top"> |
|
|
@ -308,6 +309,7 @@ export default { |
|
|
|
scrollOptions, |
|
|
|
boardItemEdtingIndex: -1, |
|
|
|
isHideCtt: false, |
|
|
|
deviceStateLatest:{} |
|
|
|
}; |
|
|
|
}, |
|
|
|
watch: { |
|
|
@ -346,9 +348,26 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
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.hideScrollFn(); |
|
|
|
}, |
|
|
|
destroyed(){ |
|
|
|
this.EventBus.$off("deviceState"); |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
____boardScale() { |
|
|
|
let arr = this.selectedSize.split("*"); |
|
|
@ -513,6 +532,12 @@ export default { |
|
|
|
this.$message.warning("设备未接入!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.deviceStateLatest[deviceFrom.iotDeviceId] === false){ |
|
|
|
this.$message.warning("设备已离线!"); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.selectedBdMsg = []; |
|
|
|
getBoardDeviceInfo(deviceFrom.iotDeviceId, deviceFrom.id) |
|
|
|
.then((res) => { |
|
|
|