|
|
@@ -63,17 +63,38 @@ export default {
|
|
|
name () {
|
|
|
return this.device.name
|
|
|
},
|
|
|
- online () {
|
|
|
- return this.device.activate && this.device.onlineStatus === 1
|
|
|
+ isActivated () {
|
|
|
+ return this.device.activate === 2
|
|
|
+ },
|
|
|
+ isOnline () {
|
|
|
+ return this.device.onlineStatus === 1
|
|
|
},
|
|
|
statusClass () {
|
|
|
- return this.online ? 'u-color--success' : this.device.activate ? 'u-color--error' : 'u-color--warning'
|
|
|
+ return this.isActivated
|
|
|
+ ? this.isOnline
|
|
|
+ ? 'u-color--success'
|
|
|
+ : 'u-color--error'
|
|
|
+ : this.device.activate
|
|
|
+ ? 'u-color--primary'
|
|
|
+ : 'u-color--warning'
|
|
|
},
|
|
|
statusType () {
|
|
|
- return this.online ? '' : this.device.activate ? 'error' : 'warning'
|
|
|
+ return this.isActivated
|
|
|
+ ? this.isOnline
|
|
|
+ ? 'success'
|
|
|
+ : 'error'
|
|
|
+ : this.device.activate
|
|
|
+ ? 'primary'
|
|
|
+ : 'warning'
|
|
|
},
|
|
|
statusTip () {
|
|
|
- return this.online ? '在线' : this.device.activate ? '离线' : '未激活'
|
|
|
+ return this.isActivated
|
|
|
+ ? this.isOnline
|
|
|
+ ? '在线'
|
|
|
+ : '离线'
|
|
|
+ : this.device.activate
|
|
|
+ ? '已激活'
|
|
|
+ : '未激活'
|
|
|
},
|
|
|
address () {
|
|
|
// return `位置:${this.device.address}`
|
|
|
@@ -120,6 +141,10 @@ export default {
|
|
|
border-radius: 9px 0 0 9px;
|
|
|
background-color: $success--dark;
|
|
|
|
|
|
+ &.primary {
|
|
|
+ background-color: $primary;
|
|
|
+ }
|
|
|
+
|
|
|
&.error {
|
|
|
background-color: $error;
|
|
|
}
|