|
|
@@ -96,8 +96,8 @@ const LinkItems = Object.freeze([
|
|
|
{
|
|
|
key: ThirdPartyDevice.RECEIVING_CARD,
|
|
|
alias: 'receiving_card',
|
|
|
- label: '接收卡'/* ,
|
|
|
- canClick: true */
|
|
|
+ label: '接收卡',
|
|
|
+ canClick: true
|
|
|
}
|
|
|
])
|
|
|
|
|
|
@@ -191,6 +191,7 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
lines () {
|
|
|
+ console.log('line', this.linkDeviceMap)
|
|
|
const state = this.linkState
|
|
|
return Object.keys(LineFromeTo).map(key => {
|
|
|
const from = LineFromeTo[key][0]
|
|
|
@@ -205,7 +206,7 @@ export default {
|
|
|
className: [
|
|
|
`l${key}`,
|
|
|
enable
|
|
|
- ? state[from] === 1 && to.some(({ key, enable }) => enable && state[key] === 1)
|
|
|
+ ? state[from] > 0 && to.some(({ key, enable }) => enable && state[key] > 0)
|
|
|
? 'linked'
|
|
|
: ''
|
|
|
: 'u-hidden'
|
|
|
@@ -239,12 +240,16 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
onMessage (value) {
|
|
|
- if (value.length) {
|
|
|
- this.$powerStatus = value
|
|
|
- if (this.linkDeviceMap) {
|
|
|
- this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = value[0].switchStatus === 255 ? 0 : 1
|
|
|
- this.led.status = value[0].switchStatus === 255 ? 'off' : value[0].switchStatus === 0 ? 'on' : 'half'
|
|
|
- }
|
|
|
+ console.log('power', value)
|
|
|
+ this.$powerStatus = value[ThirdPartyDevice.MULTI_FUNCTION_CARD]
|
|
|
+ if (this.linkDeviceMap && this.$powerStatus.length) {
|
|
|
+ const switchStatus = this.$powerStatus[0].switchStatus
|
|
|
+ this.linkDeviceMap[ThirdPartyDevice.MULTI_FUNCTION_CARD] = switchStatus === 255 ? 0 : 1
|
|
|
+ this.led.status = switchStatus === 255 ? 'off' : switchStatus === 0 ? 'on' : 'half'
|
|
|
+ }
|
|
|
+ this.$receiverStatus = value[ThirdPartyDevice.RECEIVING_CARD]?.status
|
|
|
+ if (this.linkDeviceMap && this.$receiverStatus >= 0) {
|
|
|
+ this.linkDeviceMap[ThirdPartyDevice.RECEIVING_CARD] = this.$receiverStatus
|
|
|
}
|
|
|
},
|
|
|
checkScale () {
|
|
|
@@ -297,15 +302,17 @@ export default {
|
|
|
nodes.forEach(({ nodeType, instance }) => {
|
|
|
if (nodeType === ThirdPartyDevice.RECEIVING_CARD) {
|
|
|
// 需对接接收卡
|
|
|
- map[nodeType] = 1
|
|
|
+ map[nodeType] = this.$receiverStatus ?? -1
|
|
|
by.push(ThirdPartyDevice.RECEIVING_CARD)
|
|
|
} else if (nodeType === ThirdPartyDevice.MULTI_FUNCTION_CARD) {
|
|
|
- by.push(ThirdPartyDevice.MULTI_FUNCTION_CARD)
|
|
|
- if (data[0] && data[0].switchStatus >= 0) {
|
|
|
- map[ThirdPartyDevice.MULTI_FUNCTION_CARD] = data[0].switchStatus === 255 ? 0 : 1
|
|
|
- statusKey = data[0].switchStatus === 255 ? 'off' : data[0].switchStatus === 0 ? 'on' : 'half'
|
|
|
- } else {
|
|
|
- map[ThirdPartyDevice.MULTI_FUNCTION_CARD] = -1
|
|
|
+ if (instance) {
|
|
|
+ by.push(ThirdPartyDevice.MULTI_FUNCTION_CARD)
|
|
|
+ if (data[0] && data[0].switchStatus >= 0) {
|
|
|
+ map[ThirdPartyDevice.MULTI_FUNCTION_CARD] = data[0].switchStatus === 255 ? 0 : 1
|
|
|
+ statusKey = data[0].switchStatus === 255 ? 'off' : data[0].switchStatus === 0 ? 'on' : 'half'
|
|
|
+ } else {
|
|
|
+ map[ThirdPartyDevice.MULTI_FUNCTION_CARD] = -1
|
|
|
+ }
|
|
|
}
|
|
|
} else if (nodeType === ThirdPartyDevice.SENDING_CARD) {
|
|
|
map[nodeType] = 1
|
|
|
@@ -548,6 +555,7 @@ export default {
|
|
|
|
|
|
.o-link-item {
|
|
|
position: absolute;
|
|
|
+ text-align: center;
|
|
|
background-position: 0 0;
|
|
|
background-size: 100% 100%;
|
|
|
background-repeat: no-repeat;
|
|
|
@@ -627,7 +635,7 @@ export default {
|
|
|
position: absolute;
|
|
|
top: 42%;
|
|
|
left: 46%;
|
|
|
- color: #606266;
|
|
|
+ color: #fff;
|
|
|
font-size: 32px;
|
|
|
font-family: element-icons !important;
|
|
|
animation: rotating 2s linear infinite;
|
|
|
@@ -641,8 +649,14 @@ export default {
|
|
|
z-index: 9;
|
|
|
}
|
|
|
|
|
|
- &.led.tip::before {
|
|
|
- display: none;
|
|
|
+ &.led {
|
|
|
+ &.tip::before {
|
|
|
+ display: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.loading::after {
|
|
|
+ color: #606266;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
&__warning {
|