Răsfoiți Sursa

fix: status tag of inactive device

Casper Dai 3 ani în urmă
părinte
comite
db5a1163dd

+ 7 - 16
src/views/device/index.vue

@@ -70,22 +70,13 @@ export default {
           { type: 'tag', 'width': 100, render ({ empty, activate, onlineStatus }) {
             return empty
               ? null
-              : {
-                type: activate
-                  ? activate === 1
-                    ? void 0
-                    : onlineStatus === 1
-                      ? 'success'
-                      : 'danger'
-                  : 'warning',
-                label: activate
-                  ? activate === 1
-                    ? '已激活'
-                    : onlineStatus === 1
-                      ? '在线'
-                      : '离线'
-                  : '未激活'
-              }
+              : activate
+                ? activate === 1
+                  ? { type: 'primary', label: '已激活' }
+                  : onlineStatus === 1
+                    ? { type: 'success', label: '在线' }
+                    : { type: 'danger', label: '离线' }
+                : { type: 'warning', label: '未激活' }
           }, on: this.onTagClick },
           { type: 'invoke', width: canEdit ? 160 : 120, render: [
             { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },

+ 7 - 16
src/views/realm/device/Device.vue

@@ -145,22 +145,13 @@ export default {
           { type: 'tag', 'width': 100, render ({ empty, activate, onlineStatus }) {
             return empty
               ? null
-              : {
-                type: activate
-                  ? activate === 1
-                    ? void 0
-                    : onlineStatus === 1
-                      ? 'success'
-                      : 'danger'
-                  : 'warning',
-                label: activate
-                  ? activate === 1
-                    ? '已激活'
-                    : onlineStatus === 1
-                      ? '在线'
-                      : '离线'
-                  : '未激活'
-              }
+              : activate
+                ? activate === 1
+                  ? { type: 'primary', label: '已激活' }
+                  : onlineStatus === 1
+                    ? { type: 'success', label: '在线' }
+                    : { type: 'danger', label: '离线' }
+                : { type: 'warning', label: '未激活' }
           }, on: this.onTagClick },
           { type: 'invoke', width: 240, render: [
             { label: '详情', render ({ empty }) { return !empty }, on: this.onViewDevice },

+ 7 - 16
src/views/realm/device/Group.vue

@@ -54,22 +54,13 @@ export default {
           { type: 'tag', 'width': 100, render ({ empty, activate, onlineStatus }) {
             return empty
               ? null
-              : {
-                type: activate
-                  ? activate === 1
-                    ? void 0
-                    : onlineStatus === 1
-                      ? 'success'
-                      : 'danger'
-                  : 'warning',
-                label: activate
-                  ? activate === 1
-                    ? '已激活'
-                    : onlineStatus === 1
-                      ? '在线'
-                      : '离线'
-                  : '未激活'
-              }
+              : activate
+                ? activate === 1
+                  ? { type: 'primary', label: '已激活' }
+                  : onlineStatus === 1
+                    ? { type: 'success', label: '在线' }
+                    : { type: 'danger', label: '离线' }
+                : { type: 'warning', label: '未激活' }
           }, on: this.onTagClick },
           { type: 'invoke', render: [
             { label: '详情', render ({ empty }) { return !empty }, on: this.onViewDevice }