Prechádzať zdrojové kódy

perf: ux

use - placeholder when a column in the table has no value
Casper Dai 3 rokov pred
rodič
commit
05253fef6d

+ 3 - 3
src/components/table/Table/Column.vue

@@ -102,7 +102,7 @@ export default {
             break
         }
       }
-      return null
+      return '-'
     },
     renderChildren (data) {
       const { type, render } = this.schema
@@ -140,11 +140,11 @@ export default {
         }
         return this.renderTag(tags, data)
       }
-      return null
+      return '-'
     },
     renderTag (tag, data) {
       if (!tag) {
-        return null
+        return '-'
       }
       const { label, ...tagProps } = tag
       const { on } = this.schema

+ 6 - 6
src/views/device/detail/components/DeviceAlarm.vue

@@ -48,12 +48,12 @@ export default {
           type: AssetType.IMAGE,
           url: picUrl
         } : null,
-        type: ['疑似黑屏', '设备离线', '屏幕拓扑结构异常'][type],
-        handle: ['应用重启', '设备重启', '恢复出厂', '未干预'][handle],
-        status: {
-          type: ['primary', 'success', 'danger', 'primary'][status],
-          label: ['处理中', '成功', '失败', '无'][status]
-        },
+        type: ['疑似黑屏', '设备离线', '屏幕拓扑结构异常'][type] || '-',
+        handle: ['应用重启', '设备重启', '恢复出厂', '未干预'][handle] || '-',
+        status: handle <= 2 && status <= 2 ? {
+          type: ['primary', 'success', 'danger'][status],
+          label: ['处理中', '成功', '失败'][status]
+        } : null,
         note: {
           type: ['danger', 'success'][note],
           label: ['否', '是'][note]