|
|
@@ -5,7 +5,13 @@
|
|
|
ref="powerTable"
|
|
|
class="c-sibling-item--v near"
|
|
|
:schema="powerSchema"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <template #empty>
|
|
|
+ <div class="u-font-size--md u-color--warning has-padding">
|
|
|
+ {{ emptyWarningTip }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </schema-table>
|
|
|
<template v-if="hasMulti">
|
|
|
<div class="l-flex--row c-sibling-item--v u-color--black u-font-size--sm u-bold">
|
|
|
<div class="c-sibling-item">定时任务</div>
|
|
|
@@ -64,6 +70,7 @@ export default {
|
|
|
data () {
|
|
|
return {
|
|
|
actionInfo: ['开启', '关闭'],
|
|
|
+ emptyWarningTip: '',
|
|
|
hasMulti: false,
|
|
|
hasRelay: false,
|
|
|
powerSchema: {
|
|
|
@@ -135,7 +142,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
onPowerMessage (value, key) {
|
|
|
- if (this.hasMulti || key && key !== ThirdPartyDevice.MULTI_FUNCTION_CARD) {
|
|
|
+ if (key && key !== ThirdPartyDevice.MULTI_FUNCTION_CARD) {
|
|
|
return
|
|
|
}
|
|
|
const multiCard = value[ThirdPartyDevice.MULTI_FUNCTION_CARD]
|
|
|
@@ -159,6 +166,7 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
this.$typeMap = map
|
|
|
+ this.emptyWarningTip = `直至 ${timestamp} 未收到上报数据`
|
|
|
this.hasMulti = multiCard.status === Status.OK
|
|
|
this.$refs.powerTable?.pageTo()
|
|
|
}
|
|
|
@@ -244,9 +252,6 @@ export default {
|
|
|
}
|
|
|
let tableData = []
|
|
|
switch (message.function) {
|
|
|
- case GET_POWER_STATUS:
|
|
|
- tableData = this.setPowerStatus(data)
|
|
|
- break
|
|
|
case GET_MULTI_POWER_TIMING:
|
|
|
tableData = this.setMultiPowerTasks(data.data)
|
|
|
break
|
|
|
@@ -256,42 +261,6 @@ export default {
|
|
|
this.$tableData[status.key] = tableData
|
|
|
status.resolve({ data: tableData })
|
|
|
},
|
|
|
- getPowers () {
|
|
|
- return this.getData(GET_POWER_STATUS)
|
|
|
- },
|
|
|
- setPowerStatus ({ current_status_info }) {
|
|
|
- const map = {}
|
|
|
- const powers = []
|
|
|
- let hasMulti = false
|
|
|
- let hasRelay = false
|
|
|
- current_status_info.forEach(({ connectIndex, portIndex, updatePowerIndexStates }) => {
|
|
|
- updatePowerIndexStates.forEach(({ powerIndex, type, action }) => {
|
|
|
- if (portIndex === RELAY_KEY) {
|
|
|
- return
|
|
|
- }
|
|
|
- const key = portIndex === RELAY_KEY ? RELAY_KEY : `${connectIndex}_${portIndex}_${type}`
|
|
|
- if (!map[key]) {
|
|
|
- map[key] = {
|
|
|
- connectIndex,
|
|
|
- portIndex,
|
|
|
- type,
|
|
|
- label: portIndex === RELAY_KEY ? '' : `${portIndex} ${type}`
|
|
|
- }
|
|
|
- if (portIndex === RELAY_KEY) {
|
|
|
- hasRelay = true
|
|
|
- } else {
|
|
|
- hasMulti = true
|
|
|
- }
|
|
|
- }
|
|
|
- powers.push({ connectIndex, portIndex, powerIndex, type, action })
|
|
|
- })
|
|
|
- })
|
|
|
- this.$typeMap = map
|
|
|
- this.hasMulti = hasMulti
|
|
|
- this.hasRelay = !hasMulti && hasRelay
|
|
|
- this.$hasRelay = hasRelay
|
|
|
- return powers
|
|
|
- },
|
|
|
getMultiTasks () {
|
|
|
return this.getData(GET_MULTI_POWER_TIMING)
|
|
|
},
|