Procházet zdrojové kódy

perf: ux

table style and ratio tree
Casper Dai před 3 roky
rodič
revize
059260e97f

+ 3 - 5
src/components/Schedule/ScheduleSwiper/index.vue

@@ -123,11 +123,9 @@ export default {
         cols: [
           { type: 'selection' },
           { prop: 'name', label: '节目名称' },
-          {
-            type: 'invoke', width: 80, render: [
-              { label: '查看', on: this.onView }
-            ]
-          }
+          { type: 'invoke', width: 80, render: [
+            { label: '查看', on: this.onView }
+          ] }
         ]
       }
     }

+ 1 - 1
src/components/dialog/EventTargetDialog/index.vue

@@ -43,7 +43,7 @@ export default {
         ],
         cols: [
           { prop: 'name', label: '节目名称' },
-          { type: 'invoke', width: 180, render: [
+          { type: 'invoke', render: [
             { label: '查看', on: this.onView }
           ] }
         ]

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

@@ -54,6 +54,7 @@ export default {
       return h('el-table-column', {
         props: {
           'class-name': 'c-thumbnail-col',
+          label: '文件',
           align: 'center',
           width: 100,
           ...props
@@ -195,10 +196,10 @@ export default {
           }
         })
       case 'tag':
-        defaultProps = { label: '状态', align: 'center' }
+        defaultProps = { label: '状态' }
         break
       case 'invoke':
-        defaultProps = { label: '操作', align: 'center' }
+        defaultProps = { label: '操作', align: render?.length > 1 ? 'right' : 'center', width: 120 }
         break
       default:
         defaultProps = { 'show-overflow-tooltip': true }

+ 63 - 12
src/components/tree/DeviceGroupTree/index.vue

@@ -3,11 +3,25 @@
     v-loading="loading"
     class="l-flex--col c-tree"
   >
+    <el-tabs
+      v-if="__STAGING__"
+      v-model="active"
+      class="c-tabs has-bottom-padding"
+    >
+      <el-tab-pane
+        label="分组"
+        name="group"
+      />
+      <el-tab-pane
+        label="分辨率"
+        name="ratio"
+      />
+    </el-tabs>
     <warning
       v-if="error"
       @click="getDevices"
     />
-    <template v-else-if="!loading">
+    <template v-else>
       <template v-if="groups.length">
         <div class="l-flex__none l-flex--row has-bottom-padding">
           <div class="l-flex__auto" />
@@ -100,12 +114,6 @@ import { getDeviceTree } from '@/api/device'
 
 export default {
   name: 'DeviceGroupTree',
-  props: {
-    showRatio: {
-      type: [Boolean, String],
-      default: false
-    }
-  },
   data () {
     return {
       loading: false,
@@ -113,11 +121,22 @@ export default {
       deviceName: '',
       isAll: false,
       isIndeterminate: false,
-      groups: []
+      groups: [],
+      active: 'group'
     }
   },
-  created () {
-    this.getDevices()
+  computed: {
+    showRatio () {
+      return this.active === 'group'
+    }
+  },
+  watch: {
+    active: {
+      handler () {
+        this.getDevices()
+      },
+      immediate: true
+    }
   },
   methods: {
     emitChange () {
@@ -185,8 +204,8 @@ export default {
     getDevices () {
       this.loading = true
       this.error = false
-      getDeviceTree().then(
-        ({ data }) => {
+      this.getDevicesByActive().then(
+        data => {
           this.$groups = data
           this.onSearch()
         },
@@ -197,6 +216,38 @@ export default {
         this.loading = false
       })
     },
+    getDevicesByActive () {
+      const key = `$${this.active}Cache`
+      if (this[key]) {
+        return Promise.resolve(this[key])
+      }
+      return getDeviceTree().then(({ data }) => {
+        this.$groupCache = data
+        if (__STAGING__) {
+          const map = {}
+          const cache = []
+          const ids = {}
+          data.forEach(({ list }) => {
+            list.forEach(device => {
+              const resolutionRatio = device.resolutionRatio
+              if (!ids[device.id]) {
+                if (!map[resolutionRatio]) {
+                  map[resolutionRatio] = []
+                  cache.push({
+                    name: resolutionRatio,
+                    list: map[resolutionRatio]
+                  })
+                }
+                ids[device.id] = 1
+                map[resolutionRatio].push(device)
+              }
+            })
+          })
+          this.$ratioCache = cache
+        }
+        return this[key]
+      })
+    },
     onSearch () {
       this.isAll = false
       this.isIndeterminate = false

+ 23 - 20
src/scss/bem/_component.scss

@@ -100,6 +100,29 @@
     min-width: 0;
   }
 
+  &__btn {
+    display: inline-block;
+    position: relative;
+    padding: 2px 0;
+    color: $blue;
+    font-size: 14px;
+
+    & + & {
+      margin-left: 16px;
+    }
+
+    & + &::before {
+      content: "";
+      display: inline-block;
+      position: absolute;
+      top: 50%;
+      left: -8px;
+      height: 12px;
+      border-left: 1px solid $gray;
+      transform: translateY(-50%);
+    }
+  }
+
   &.prevent-copy {
     .el-table__body-wrapper {
       .el-table__row {
@@ -132,25 +155,6 @@
     min-height: 0;
     overflow-y: auto;
   }
-
-  &__btn {
-    display: inline-block;
-    position: relative;
-    padding: 0 8px;
-    color: $blue;
-    font-size: 14px;
-
-    & + &::before {
-      content: "";
-      display: inline-block;
-      position: absolute;
-      top: 50%;
-      left: 0;
-      height: 12px;
-      border-left: 1px solid $gray;
-      transform: translateY(-50%);
-    }
-  }
 }
 
 .c-grid {
@@ -396,7 +400,6 @@
   grid-template-rows: max-content;
   grid-row-gap: 8px;
   grid-column-gap: 10px;
-  justify-content: center;
 }
 
 .c-tree-sidebar {

+ 1 - 1
src/utils/index.js

@@ -72,7 +72,7 @@ export function parseByte (byte) {
 
 export function parseDuration (duration) {
   if (!duration) {
-    return '未知'
+    return '-'
   }
   const seconds = `${duration % 60}`
   const minutes = `${duration / 60 | 0}`

+ 6 - 8
src/views/device/detail/components/DeviceInvoke/mixins/task.js

@@ -46,14 +46,12 @@ export default {
           { prop: 'executeTime', label: '执行时间', attrs },
           { prop: 'type', label: '重复方式' },
           { prop: 'tag', type: 'tag' },
-          {
-            type: 'invoke', render: [
-              { label: '编辑', on: this.onEdit },
-              { label: '启用', render: this.canActivate, on: this.onActivate },
-              { label: '停用', render: this.canDeactivate, on: this.onDeactivate },
-              { label: '删除', on: this.onDel }
-            ]
-          }
+          { type: 'invoke', width: 160, render: [
+            { label: '编辑', on: this.onEdit },
+            { label: '启用', render: this.canActivate, on: this.onActivate },
+            { label: '停用', render: this.canDeactivate, on: this.onDeactivate },
+            { label: '删除', on: this.onDel }
+          ] }
         ]
       }
     },

+ 25 - 17
src/views/device/group/index.vue

@@ -77,13 +77,11 @@ export default {
         cols: [
           { prop: 'name', label: '分组名称' },
           { prop: 'remark', label: '备注' },
-          {
-            type: 'invoke', render: [
-              { label: '编辑', on: this.onEdit },
-              { label: '设备', on: this.onViewDevices },
-              { label: '删除', on: this.onDel }
-            ]
-          }
+          { type: 'invoke', width: 160, render: [
+            { label: '编辑', on: this.onEdit },
+            { label: '设备', on: this.onViewDevices },
+            { label: '删除', on: this.onDel }
+          ] }
         ]
       },
       subDeviceSchema: {
@@ -99,11 +97,9 @@ export default {
           { prop: 'mac', label: 'MAC' },
           { prop: 'resolutionRatio', label: '分辨率' },
           { prop: 'remark', label: '地址' },
-          {
-            type: 'invoke', width: 100, render: [
-              { label: '移除', on: this.onDelDevice }
-            ]
-          }
+          { type: 'invoke', width: 100, render: [
+            { label: '移除', on: this.onDelDevice }
+          ] }
         ]
       },
       deviceSchema: {
@@ -195,12 +191,24 @@ export default {
     onAddDevice () {
       this.$refs.deviceDialog.show()
     },
-    onChoosenDevice ({ value: { id }, done }) {
+    canJoin (device) {
+      const data = this.$refs.subDeviceDialog.getTable().getData()
+      if (data.length === 0 || data.some(({ resolutionRatio }) => device.resolutionRatio === resolutionRatio)) {
+        return Promise.resolve()
+      }
+      return this.$confirm(
+        `设备 ${device.name} 与分组中的设备分辨率不一致,确定加入分组?`,
+        { type: 'warning' }
+      )
+    },
+    onChoosenDevice ({ value, done }) {
       const table = this.$refs.subDeviceDialog.getTable()
-      addDeviceToGroup(table.getCondition().id, id).then(() => {
-        done()
-        this.$devices = null
-        table.pageTo(1)
+      this.canJoin(value).then(() => {
+        addDeviceToGroup(table.getCondition().id, value.id).then(() => {
+          done()
+          this.$devices = null
+          table.pageTo(1)
+        })
       })
     }
   }

+ 37 - 45
src/views/device/index.vue

@@ -47,6 +47,8 @@ export default {
       label: 'name'
     }
 
+    const canEdit = this.accessSet.has(Access.MANAGE_DEVICE)
+
     return {
       ratio: null,
       schema: {
@@ -60,53 +62,43 @@ export default {
           { key: 'name', type: 'search', placeholder: '设备名称' }
         ],
         cols: [
-          {
-            type: 'refresh',
-            render (data, h) {
-              return data.isMaster
-                ? h('i', {
-                  staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
-                  class: { expand: data.expand }
-                })
-                : null
-            }
-          },
-          { label: '设备名称', 'min-width': 120,
-            render (data, h) {
-              return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
-            }
-          },
-          { prop: 'productName', label: '产品', 'min-width': 80 },
+          { type: 'refresh', render (data, h) {
+            return data.isMaster
+              ? h('i', {
+                staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
+                class: { expand: data.expand }
+              })
+              : null
+          } },
+          { label: '设备名称', 'min-width': 120, render (data, h) {
+            return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
+          } },
+          { prop: 'productName', label: '产品' },
           { prop: 'serialNumber', label: '序列号', 'min-width': 100 },
           { prop: 'mac', label: 'MAC', 'min-width': 100 },
-          { prop: 'remark', label: '地址', 'min-width': 80 },
-          {
-            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
-                      ? '在线'
-                      : '离线'
-                  : '未激活'
-              }
-            },
-            on: this.onTagClick
-          },
-          {
-            type: 'invoke', width: 160, render: [
-              { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
-              this.accessSet.has(Access.MANAGE_DEVICE) ? { label: '默认播放', render ({ isMaster, activate }) { return isMaster && activate }, on: this.onSetDefaultProgram } : null
-            ].filter(val => val)
-          }
+          { prop: 'remark', label: '地址' },
+          { 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
+                    ? '在线'
+                    : '离线'
+                : '未激活'
+            }
+          }, on: this.onTagClick },
+          { type: 'invoke', width: canEdit ? 160 : 120, render: [
+            { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
+            canEdit ? { label: '默认播放', render ({ isMaster, activate }) { return isMaster && activate }, on: this.onSetDefaultProgram } : null
+          ].filter(val => val) }
         ]
       }
     }

+ 4 - 6
src/views/external/transmitter/index.vue

@@ -123,12 +123,10 @@ export default {
             return tags
           }, on: this.onClickTag },
           { prop: 'remark', label: '备注' },
-          {
-            type: 'invoke', render: [
-              { label: '编辑', on: this.onEdit },
-              { label: '删除', on: this.onDel }
-            ]
-          }
+          { type: 'invoke', render: [
+            { label: '编辑', on: this.onEdit },
+            { label: '删除', on: this.onDel }
+          ] }
         ]
       }
     }

+ 12 - 12
src/views/platform/media/mixin.js

@@ -47,6 +47,8 @@ export default {
   },
   computed: {
     schema () {
+      const canEdit = this.active === `${State.READY}`
+
       return {
         list: getAssets,
         transform: this.transform,
@@ -54,8 +56,8 @@ export default {
           { key: 'originalName', type: 'search', placeholder: '媒资名称' }
         ] : [],
         cols: [
-          { prop: 'file', label: '文件', type: 'asset', on: this.onViewAsset },
-          { prop: 'name', 'min-width': 120, render: this.active === `${State.READY}` ? (data, h) => {
+          { prop: 'file', type: 'asset', on: this.onViewAsset },
+          { prop: 'name', 'min-width': 100, render: canEdit ? (data, h) => {
             return h('edit-input', {
               model: {
                 value: data.name,
@@ -68,16 +70,14 @@ export default {
               }
             })
           } : null },
-          this.isImage ? null : { prop: 'duration', label: '时长', 'min-width': 60 },
-          { prop: 'size', label: '文件大小', 'min-width': 60 },
-          { prop: 'createTime', label: '上传时间', 'min-width': 80 },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', on: this.onView },
-              { label: '提交', render ({ status }) { return status === State.READY }, on: this.onSubmit },
-              { label: '删除', render ({ del }) { return del }, on: this.onDel }
-            ]
-          }
+          this.isImage ? null : { prop: 'duration', label: '时长' },
+          { prop: 'size', label: '文件大小' },
+          { prop: 'createTime', label: '上传时间' },
+          { type: 'invoke', align: 'center', width: 140, render: [
+            { label: '查看', on: this.onView },
+            canEdit ? { label: '提交', on: this.onSubmit } : null,
+            { label: '删除', render ({ del }) { return del }, on: this.onDel }
+          ].filter(val => val) }
         ]
       }
     },

+ 3 - 5
src/views/realm/assign/Device.vue

@@ -54,11 +54,9 @@ export default {
           { prop: 'serialNumber', label: '序列号' },
           { prop: 'mac', label: 'MAC' },
           { prop: 'remark', label: '地址' },
-          {
-            type: 'invoke', width: 100, render: [
-              { label: '移除', on: this.onDel }
-            ]
-          }
+          { type: 'invoke', width: 100, render: [
+            { label: '移除', on: this.onDel }
+          ] }
         ]
       }
     }

+ 35 - 46
src/views/realm/device/Device.vue

@@ -100,54 +100,43 @@ export default {
           { key: 'name', type: 'search', placeholder: '设备名称' }
         ],
         cols: [
-          {
-            type: 'refresh',
-            render (data, h) {
-              return data.isMaster
-                ? h('i', {
-                  staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
-                  class: { expand: data.expand }
-                })
-                : null
-            }
-          },
-          { label: '设备名称', 'min-width': 120,
-            render (data, h) {
-              return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
-            }
-          },
-          { prop: 'productName', label: '产品', 'min-width': 80 },
+          { type: 'refresh', render (data, h) {
+            return data.isMaster
+              ? h('i', {
+                staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
+                class: { expand: data.expand }
+              })
+              : null
+          } },
+          { label: '设备名称', 'min-width': 120, render (data, h) {
+            return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
+          } },
+          { prop: 'productName', label: '产品' },
           { prop: 'serialNumber', label: '序列号', 'min-width': 100 },
           { prop: 'mac', label: 'MAC', 'min-width': 100 },
-          {
-            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
-                      ? '在线'
-                      : '离线'
-                  : '未激活'
-              }
-            },
-            on: this.onTagClick
-          },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
-              { label: '添加备份', render ({ isMaster }) { return isMaster }, on: this.onAddSubDevice },
-              { label: '删除', render ({ empty }) { return !empty }, on: this.onDelDevice }
-            ]
-          }
+          { 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
+                    ? '在线'
+                    : '离线'
+                : '未激活'
+            }
+          }, on: this.onTagClick },
+          { type: 'invoke', width: 180, render: [
+            { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice },
+            { label: '添加备份', render ({ isMaster }) { return isMaster }, on: this.onAddSubDevice },
+            { label: '删除', render ({ empty }) { return !empty }, on: this.onDelDevice }
+          ] }
         ]
       }
     }

+ 34 - 45
src/views/realm/device/Group.vue

@@ -45,52 +45,41 @@ export default {
           { key: 'name', type: 'search', placeholder: '设备名称' }
         ],
         cols: [
-          {
-            type: 'refresh',
-            render (data, h) {
-              return data.isMaster
-                ? h('i', {
-                  staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
-                  class: { expand: data.expand }
-                })
-                : null
+          { type: 'refresh', render (data, h) {
+            return data.isMaster
+              ? h('i', {
+                staticClass: `o-expand-icon u-pointer ${data.loading ? 'el-icon-loading' : 'el-icon-arrow-right'}`,
+                class: { expand: data.expand }
+              })
+              : null
+          } },
+          { label: '设备名称', 'min-width': 120, render (data, h) {
+            return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
+          } },
+          { prop: 'productName', label: '产品' },
+          { prop: 'serialNumber', label: '序列号', 'min-width': 100 },
+          { prop: 'mac', label: 'MAC', 'min-width': 100 },
+          { 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
+                    ? '在线'
+                    : '离线'
+                : '未激活'
             }
-          },
-          { label: '设备名称', 'min-width': 120,
-            render (data, h) {
-              return data.empty ? h('span', { staticClass: 'u-color--info' }, '暂无备份设备') : data.name
-            }
-          },
-          { prop: 'productName', label: '产品', 'min-width': 100 },
-          { prop: 'serialNumber', label: '序列号', 'min-width': 120 },
-          { prop: 'mac', label: 'MAC', 'min-width': 120 },
-          {
-            type: 'tag', 'width': 120,
-            render ({ empty, activate, onlineStatus }) {
-              return empty ? null : {
-                type: activate
-                  ? activate === 1
-                    ? void 0
-                    : onlineStatus === 1
-                      ? 'success'
-                      : 'danger'
-                  : 'warning',
-                label: activate
-                  ? activate === 1
-                    ? '已激活'
-                    : onlineStatus === 1
-                      ? '在线'
-                      : '离线'
-                  : '未激活'
-              }
-            },
-            on: this.onTagClick
-          },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice }
-            ]
-          }
+          }, on: this.onTagClick },
+          { type: 'invoke', render: [
+            { label: '查看', render ({ empty }) { return !empty }, on: this.onViewDevice }
+          ] }
         ]
       }
     }

+ 5 - 7
src/views/realm/device/Product.vue

@@ -123,13 +123,11 @@ export default {
               label: fpga ? '有' : '无'
             }
           } },
-          { prop: 'remark', label: '备注', 'min-width': 80 },
-          {
-            type: 'invoke', width: 120, render: [
-              { label: '编辑', on: this.onEdit },
-              { label: '删除', on: this.onDel }
-            ]
-          }
+          { prop: 'remark', label: '备注' },
+          { type: 'invoke', render: [
+            { label: '编辑', on: this.onEdit },
+            { label: '删除', on: this.onDel }
+          ] }
         ]
       }
     }

+ 4 - 6
src/views/realm/device/ProductType.vue

@@ -57,12 +57,10 @@ export default {
         cols: [
           { prop: 'name', label: '类型名称' },
           { prop: 'remark', label: '备注' },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '编辑', on: this.onEdit },
-              { label: '删除', on: this.onDel }
-            ]
-          }
+          { type: 'invoke', render: [
+            { label: '编辑', on: this.onEdit },
+            { label: '删除', on: this.onDel }
+          ] }
         ]
       }
     }

+ 1 - 1
src/views/realm/tenant/Tenant.vue

@@ -72,7 +72,7 @@ export default {
         cols: [
           { prop: 'name', label: '标识' },
           { prop: 'remark', label: '名称' },
-          { type: 'invoke', render: [
+          { type: 'invoke', width: 180, render: [
             { label: '编辑', on: this.onEdit },
             { label: '新增下级', render ({ parentGroup }) { return !parentGroup }, on: this.onAddSub },
             { label: '删除', on: this.onDel }

+ 3 - 5
src/views/realm/upgrade/deploy/index.vue

@@ -163,11 +163,9 @@ export default {
               label: [null, '待升级', '已升级', '已废弃'][status]
             }
           } },
-          {
-            type: 'invoke', width: 120, render: [
-              { label: '删除', on: this.onDel }
-            ]
-          }
+          { type: 'invoke', render: [
+            { label: '删除', on: this.onDel }
+          ] }
         ]
       },
       groups: [],

+ 5 - 7
src/views/realm/upgrade/index.vue

@@ -159,13 +159,11 @@ export default {
               label: status ? '启用' : '禁用'
             }
           }, on: this.onTagClick },
-          {
-            type: 'invoke', width: 120, render: [
-              { label: '禁用', render ({ status }) { return status === 1 }, on: this.onDeactive },
-              { label: '启用', render ({ status }) { return status === 0 }, on: this.onActive },
-              { label: '删除', on: this.onDel }
-            ]
-          }
+          { type: 'invoke', render: [
+            { label: '禁用', render ({ status }) { return status === 1 }, on: this.onDeactive },
+            { label: '启用', render ({ status }) { return status === 0 }, on: this.onActive },
+            { label: '删除', on: this.onDel }
+          ] }
         ]
       }
     }

+ 10 - 22
src/views/review/components/ReviewAsset.vue

@@ -30,29 +30,17 @@ export default {
         transform: this.transform,
         cols: [
           { prop: 'typeName', label: '类型', align: 'center', width: 80 },
-          { prop: 'file', label: '文件', type: 'asset', on: this.onViewAsset },
-          { label: '', 'min-width': 80, render: (data, h) => {
-            return h('span', {
-              staticClass: 'u-ellipsis u-pointer',
-              on: {
-                click ($event) {
-                  $event.stopPropagation()
-                  this.onViewAsset(data)
-                }
-              }
-            }, data.originalName)
-          } },
-          { prop: 'duration', label: '时长', align: 'center', 'min-width': 80 },
-          { prop: 'size', label: '文件大小', 'min-width': 80 },
-          { prop: 'createBy', label: '申请人', 'min-width': 80 },
+          { prop: 'file', type: 'asset', on: this.onViewAsset },
+          { prop: 'originalName', label: '' },
+          { prop: 'duration', label: '时长' },
+          { prop: 'size', label: '文件大小' },
+          { prop: 'createBy', label: '申请人' },
           { prop: 'createTime', label: '提交时间', 'min-width': 100 },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', on: this.onView },
-              { label: '通过', on: this.onResolve },
-              { label: '驳回', on: this.onReject }
-            ]
-          }
+          { type: 'invoke', width: 160, render: [
+            { label: '查看', on: this.onView },
+            { label: '通过', on: this.onResolve },
+            { label: '驳回', on: this.onReject }
+          ] }
         ]
       }
     }

+ 8 - 10
src/views/review/components/ReviewProgram.vue

@@ -24,16 +24,14 @@ export default {
         transform: this.transform,
         cols: [
           { prop: 'name', label: '节目名称', 'min-width': 100 },
-          { prop: 'resolutionRatio', label: '分辨率', 'min-width': 80 },
-          { prop: 'createBy', label: '申请人', 'min-width': 80 },
-          { prop: 'createTime', label: '提交时间', 'min-width': 100 },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', on: this.onView },
-              { label: '通过', on: this.onResolve },
-              { label: '驳回', on: this.onReject }
-            ]
-          }
+          { prop: 'resolutionRatio', label: '分辨率' },
+          { prop: 'createBy', label: '申请人' },
+          { prop: 'createTime', label: '提交时间' },
+          { type: 'invoke', width: 160, render: [
+            { label: '查看', on: this.onView },
+            { label: '通过', on: this.onResolve },
+            { label: '驳回', on: this.onReject }
+          ] }
         ]
       }
     }

+ 8 - 10
src/views/review/components/ReviewProgramRecur.vue

@@ -31,16 +31,14 @@ export default {
         list: getSchedules,
         cols: [
           { prop: 'name', label: '轮播名称', 'min-width': 100 },
-          { prop: 'resolutionRatio', label: '分辨率', 'min-width': 80 },
-          { prop: 'createBy', label: '申请人', 'min-width': 80 },
-          { prop: 'createTime', label: '提交时间', 'min-width': 100 },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', on: this.onView },
-              { label: '通过', on: this.onResolve },
-              { label: '驳回', on: this.onReject }
-            ]
-          }
+          { prop: 'resolutionRatio', label: '分辨率' },
+          { prop: 'createBy', label: '申请人' },
+          { prop: 'createTime', label: '提交时间' },
+          { type: 'invoke', width: 160, render: [
+            { label: '查看', on: this.onView },
+            { label: '通过', on: this.onResolve },
+            { label: '驳回', on: this.onReject }
+          ] }
         ]
       }
     }

+ 8 - 10
src/views/review/components/ReviewPublish.vue

@@ -44,16 +44,14 @@ export default {
           },
           { prop: 'type', label: '类型', width: 100 },
           { prop: 'name', label: '名称', 'min-width': 100 },
-          { prop: 'resolutionRatio', label: '分辨率', 'min-width': 80 },
-          { prop: 'createBy', label: '申请人', 'min-width': 80 },
-          { prop: 'createTime', label: '提交时间', 'min-width': 100 },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', on: this.onView },
-              { label: '通过', on: this.onResolve },
-              { label: '驳回', on: this.onReject }
-            ]
-          }
+          { prop: 'resolutionRatio', label: '分辨率' },
+          { prop: 'createBy', label: '申请人' },
+          { prop: 'createTime', label: '提交时间' },
+          { type: 'invoke', width: 160, render: [
+            { label: '查看', on: this.onView },
+            { label: '通过', on: this.onResolve },
+            { label: '驳回', on: this.onReject }
+          ] }
         ]
       }
     }

+ 8 - 10
src/views/review/components/ReviewSchedule.vue

@@ -31,16 +31,14 @@ export default {
         list: getSchedules,
         cols: [
           { prop: 'name', label: '排期名称', 'min-width': 100 },
-          { prop: 'resolutionRatio', label: '分辨率', 'min-width': 80 },
-          { prop: 'createBy', label: '申请人', 'min-width': 80 },
-          { prop: 'createTime', label: '提交时间', 'min-width': 100 },
-          {
-            type: 'invoke', width: 180, render: [
-              { label: '查看', on: this.onView },
-              { label: '通过', on: this.onResolve },
-              { label: '驳回', on: this.onReject }
-            ]
-          }
+          { prop: 'resolutionRatio', label: '分辨率' },
+          { prop: 'createBy', label: '申请人' },
+          { prop: 'createTime', label: '提交时间' },
+          { type: 'invoke', width: 160, render: [
+            { label: '查看', on: this.onView },
+            { label: '通过', on: this.onResolve },
+            { label: '驳回', on: this.onReject }
+          ] }
         ]
       }
     }

+ 2 - 4
src/views/schedule/deploy/index.vue

@@ -35,7 +35,6 @@
         v-show="active === 0"
         ref="tree"
         class="l-flex__fill has-padding"
-        show-ratio
         @change="onChange"
       />
       <div
@@ -346,7 +345,7 @@ export default {
         params: { id: this.programId }
       }).href, '_blank')
     },
-    _getPublishTarget () {
+    getPublishTarget () {
       switch (this.eventOptions.type) {
         case PublishType.CALENDAR:
           return {
@@ -366,7 +365,6 @@ export default {
       }
     },
     publish () {
-      console.log('publish')
       const devices = this.selectedDevices
       this.$confirm(
         `对设备 ${devices.map(device => device.name)}`,
@@ -375,7 +373,7 @@ export default {
       ).then(() => {
         return publish(
           devices.map((device) => device.id),
-          this._getPublishTarget(),
+          this.getPublishTarget(),
           {
             programCalendarName: this.eventTarget.name,
             resolutionRatio: this.resolutionRatio

+ 13 - 18
src/views/schedule/history/index.vue

@@ -33,26 +33,21 @@ export default {
         list: getPublishHistory,
         transform: this.transform,
         cols: [
-          {
-            type: 'expand', render (data, h) {
-              return h('div', {
-                staticClass: 'o-info'
-              }, [
-                h('div', null, data.desc),
-                h('div', null, `设备:${data.device}`)
-              ])
-            }
-          },
+          { type: 'expand', render (data, h) {
+            return h('div', {
+              staticClass: 'o-info'
+            }, [
+              h('div', null, data.desc),
+              h('div', null, `设备:${data.device}`)
+            ])
+          } },
           { prop: 'type', label: '类型', width: 100 },
           { prop: 'name', label: '名称', 'min-width': 100 },
-          { prop: 'resolutionRatio', label: '分辨率', 'min-width': 80 },
-          { prop: 'createBy', label: '申请人', 'min-width': 80 },
-          { prop: 'createTime', label: '提交时间', 'min-width': 100 },
-          {
-            type: 'invoke', width: 120, render: [
-              { label: '查看', on: this.onView }
-            ]
-          }
+          { prop: 'createBy', label: '申请人' },
+          { prop: 'createTime', label: '发布时间' },
+          { type: 'invoke', render: [
+            { label: '查看', on: this.onView }
+          ] }
         ]
       }
     }

+ 8 - 10
src/views/schedule/mixin.js

@@ -32,17 +32,15 @@ export default {
         ],
         cols: [
           { prop: 'name', label: '名称', 'min-width': 120 },
-          { prop: 'resolutionRatio', label: '分辨率', 'min-width': 80 },
-          {
-            label: '审核状态', 'min-width': 80, type: 'tag', render ({ status }) {
-              return {
-                type: [void 0, 'warning', 'success'][status],
-                label: ['待提交', '未审核', '已审核'][status]
-              }
+          { prop: 'resolutionRatio', label: '分辨率' },
+          { label: '审核状态', type: 'tag', render ({ status }) {
+            return {
+              type: [void 0, 'warning', 'success'][status],
+              label: ['待提交', '未审核', '已审核'][status]
             }
-          },
-          { prop: 'createTime', label: '创建时间', 'min-width': 100 },
-          { type: 'invoke', width: 180, render: this.invokes }
+          } },
+          { prop: 'createTime', label: '创建时间', 'min-width': 90 },
+          { type: 'invoke', width: 160, render: this.invokes }
         ]
       }
     }