|
|
@@ -258,9 +258,13 @@ export default {
|
|
|
}
|
|
|
if (this.linkDeviceMap) {
|
|
|
if (this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] > Status.NONE && this.$multiCard) {
|
|
|
- const switchStatus = this.$multiCard.switchStatus
|
|
|
- const powerStatus = switchStatus === Power.ON ? Status.OK : switchStatus === Power.OFF ? Status.ERROR : Status.WARNING
|
|
|
- this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = this.$multiCard.status === Status.OK ? powerStatus : Status.WARNING
|
|
|
+ const multiCardStatus = this.$multiCard.status
|
|
|
+ if (multiCardStatus === Status.OK) {
|
|
|
+ const switchStatus = this.$multiCard.switchStatus
|
|
|
+ this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = switchStatus === Power.ON ? Status.OK : switchStatus === Power.OFF ? Status.ERROR : Status.WARNING
|
|
|
+ } else {
|
|
|
+ this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = multiCardStatus
|
|
|
+ }
|
|
|
}
|
|
|
if (this.linkDeviceMap[ThirdPartyDevice.RECEIVING_CARD] > Status.NONE && this.$receiverStatus >= Status.OK) {
|
|
|
this.linkDeviceMap[ThirdPartyDevice.RECEIVING_CARD] = this.$receiverStatus
|
|
|
@@ -312,9 +316,13 @@ export default {
|
|
|
} else if (nodeType === ThirdPartyDevice.MULTI_FUNCTION_CARD) {
|
|
|
if (instance) {
|
|
|
if (multiCard) {
|
|
|
- const switchStatus = multiCard.switchStatus
|
|
|
- const powerStatus = switchStatus === Power.ON ? Status.OK : switchStatus === Power.OFF ? Status.ERROR : Status.WARNING
|
|
|
- linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = multiCard.status === Status.OK ? powerStatus : Status.WARNING
|
|
|
+ const multiCardStatus = multiCard.status
|
|
|
+ if (multiCardStatus === Status.OK) {
|
|
|
+ const switchStatus = multiCard.switchStatus
|
|
|
+ linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = switchStatus === Power.ON ? Status.OK : switchStatus === Power.OFF ? Status.ERROR : Status.WARNING
|
|
|
+ } else {
|
|
|
+ linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = multiCardStatus
|
|
|
+ }
|
|
|
} else {
|
|
|
linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = Status.LOADING
|
|
|
}
|
|
|
@@ -336,6 +344,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
+ if (linkDeviceMap[ThirdPartyDevice.RECEIVING_CARD] > Status.NONE) {
|
|
|
+ linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = Status.NONE
|
|
|
+ }
|
|
|
this.linkDeviceMap = {
|
|
|
msr: Status.OK,
|
|
|
led: Status.ERROR,
|
|
|
@@ -348,9 +359,6 @@ export default {
|
|
|
[ThirdPartyDevice.MULTI_FUNCTION_CARD]: Status.NONE,
|
|
|
...linkDeviceMap
|
|
|
}
|
|
|
- if (this.linkDeviceMap[ThirdPartyDevice.RECEIVING_CARD] > Status.NONE && this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] > Status.NONE) {
|
|
|
- this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = Status.NONE
|
|
|
- }
|
|
|
this.led = {
|
|
|
id: this.targetId,
|
|
|
onlineStatus: 0,
|
|
|
@@ -397,17 +405,15 @@ export default {
|
|
|
const mutliStatus = this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD]
|
|
|
const linkError = by.some(key => linkDeviceMap[key] === Status.ERROR)
|
|
|
const isOK = (mutliStatus === Status.NONE || mutliStatus === Status.OK) && !by.some(key => linkDeviceMap[key] !== Status.OK)
|
|
|
- this.linkDeviceMap.led = mutliStatus === Status.ERROR || linkError ? Status.ERROR : isOK ? Status.OK : Status.WARNING
|
|
|
+ this.linkDeviceMap.led = linkError ? Status.ERROR : isOK ? Status.OK : Status.WARNING
|
|
|
this.led.onlineStatus = isOK ? 1 : 0
|
|
|
- this.led.powerStatus = linkError
|
|
|
- ? ''
|
|
|
- : mutliStatus === Status.LOADING
|
|
|
- ? 'el-icon-loading'
|
|
|
- : mutliStatus === Status.ERROR
|
|
|
- ? 'off'
|
|
|
- : mutliStatus === Status.WARNING
|
|
|
- ? 'power el-icon-warning u-color--warning'
|
|
|
- : ''
|
|
|
+ this.led.powerStatus = mutliStatus === Status.LOADING
|
|
|
+ ? 'el-icon-loading'
|
|
|
+ : mutliStatus === Status.ERROR
|
|
|
+ ? 'off'
|
|
|
+ : mutliStatus === Status.WARNING
|
|
|
+ ? 'power el-icon-warning u-color--warning'
|
|
|
+ : ''
|
|
|
},
|
|
|
onClick (item) {
|
|
|
if (!item.canClick) {
|