Browse Source

refactor: adjust some styles

Casper Dai 3 years ago
parent
commit
fbe180764f

+ 1 - 1
src/api/base.js

@@ -28,7 +28,7 @@ const Status = {
   [State.REJECTED]: [3, 4, 5],
   [State.REVIEW]: [1],
   [State.AVAILABLE]: [0, 1, 2],
-  [State.EDITABLE]: [0, 1, 3, 4, 5]
+  [State.AVAILABLE_ASSET]: [0, 1]
 }
 export function addStatusScope ({ status, ...data }) {
   switch (status) {

+ 1 - 1
src/components/table/Table/index.vue

@@ -125,7 +125,7 @@ export default {
       return !!this.$listeners['row-dblclick']
     },
     cols () {
-      return this.schema.cols.filter(val => val)
+      return this.schema.cols.filter(Boolean)
     }
   }
 }

+ 0 - 3
src/components/table/mixins/table.js

@@ -131,9 +131,6 @@ export default {
         list: []
       }
     },
-    filterInvokes (data) {
-      return this.schema.invokes.filter(({ render }) => !render || render(data))
-    },
     onPagination () {
       const options = this.options
       if (!options.loading) {

+ 1 - 1
src/constant.js

@@ -29,7 +29,7 @@ export const State = {
   // 占位值
   REVIEW: 99,
   AVAILABLE: 100,
-  EDITABLE: 101
+  AVAILABLE_ASSET: 101
 }
 
 export const ScheduleType = {

+ 1 - 1
src/mixins/dv.js

@@ -14,7 +14,7 @@ export default {
     return h(canEdit ? 'Designer' : 'Viewer', {
       props: {
         ...this.$attrs,
-        status: canEdit ? State.READY : State.RESOLVED
+        status: canEdit ? void 0 : State.RESOLVED
       }
     })
   }

+ 1 - 1
src/views/bigscreen/ProgramDesigner.vue

@@ -17,7 +17,7 @@
               class="o-tab__icon el-icon-circle-plus-outline"
               @click.stop="onAdd"
             />
-            待提交
+            编辑
           </div>
         </template>
       </el-tab-pane>

+ 1 - 1
src/views/bigscreen/ast/core/config-json/base.js

@@ -209,7 +209,7 @@ export const animationConfig = {
           { value: 'fade', label: '渐隐渐现' },
           __STAGING__ ? { value: 'flip', label: '翻转' } : null,
           __STAGING__ ? { value: 'section-flip', label: '百叶窗' } : null
-        ].filter(val => val)
+        ].filter(Boolean)
       }
     }
   ]

+ 1 - 1
src/views/bigscreen/ast/core/utils.js

@@ -22,7 +22,7 @@ export const widgets = Object.freeze([
   __STAGING__ ? widgetWeather : null,
   widgetWeb,
   widgetLive
-].filter(val => val))
+].filter(Boolean))
 
 let scale = null
 export function create (node) {

+ 1 - 1
src/views/device/index.vue

@@ -90,7 +90,7 @@ export default {
           { 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) }
+          ].filter(Boolean) }
         ]
       }
     }

+ 3 - 7
src/views/platform/media/MediaDesigner.vue

@@ -47,17 +47,13 @@
         class="c-tabs has-bottom-padding"
       >
         <el-tab-pane
-          label="待提交"
-          name="0"
+          label="待审核"
+          name="101"
         />
         <el-tab-pane
           label="已审核"
           name="2"
         />
-        <el-tab-pane
-          label="待审核"
-          name="1"
-        />
         <el-tab-pane
           label="驳回"
           name="3"
@@ -94,7 +90,7 @@ export default {
   },
   methods: {
     onUploaded ({ type }) {
-      if (this.type === type && Number(this.active) === State.READY) {
+      if (this.type === type && Number(this.active) === State.AVAILABLE_ASSET) {
         this.$refs.table.pageTo(1)
       }
     }

+ 19 - 22
src/views/platform/media/mixin.js

@@ -18,7 +18,7 @@ export default {
   props: {
     status: {
       type: Number,
-      default: State.READY
+      default: State.AVAILABLE_ASSET
     }
   },
   data () {
@@ -26,20 +26,17 @@ export default {
       type: AssetType.IMAGE,
       active: `${this.status}`,
       [AssetType.IMAGE]: {
-        [State.READY]: createListOptions({ type: AssetType.IMAGE, status: State.READY }),
-        [State.SUBMITTED]: createListOptions({ type: AssetType.IMAGE, status: State.SUBMITTED }),
+        [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.IMAGE, status: State.AVAILABLE_ASSET }),
         [State.RESOLVED]: createListOptions({ type: AssetType.IMAGE, status: State.RESOLVED, originalName: '' }),
         [State.REJECTED]: createListOptions({ type: AssetType.IMAGE, status: State.REJECTED })
       },
       [AssetType.VIDEO]: {
-        [State.READY]: createListOptions({ type: AssetType.VIDEO, status: State.READY }),
-        [State.SUBMITTED]: createListOptions({ type: AssetType.VIDEO, status: State.SUBMITTED }),
+        [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.VIDEO, status: State.AVAILABLE_ASSET }),
         [State.RESOLVED]: createListOptions({ type: AssetType.VIDEO, status: State.RESOLVED, originalName: '' }),
         [State.REJECTED]: createListOptions({ type: AssetType.VIDEO, status: State.REJECTED })
       },
       [AssetType.AUDIO]: {
-        [State.READY]: createListOptions({ type: AssetType.AUDIO, status: State.READY }),
-        [State.SUBMITTED]: createListOptions({ type: AssetType.AUDIO, status: State.SUBMITTED }),
+        [State.AVAILABLE_ASSET]: createListOptions({ type: AssetType.AUDIO, status: State.AVAILABLE_ASSET }),
         [State.RESOLVED]: createListOptions({ type: AssetType.AUDIO, status: State.RESOLVED, originalName: '' }),
         [State.REJECTED]: createListOptions({ type: AssetType.AUDIO, status: State.REJECTED })
       }
@@ -47,8 +44,6 @@ export default {
   },
   computed: {
     schema () {
-      const canEdit = this.active === `${State.READY}`
-
       return {
         list: getAssetsWithDel,
         transform: this.transform,
@@ -59,29 +54,31 @@ export default {
           : [],
         cols: [
           { prop: 'file', type: 'asset', on: this.onViewAsset },
-          { prop: 'name', 'min-width': 100, render: canEdit
-            ? (data, h) => h('edit-input', {
-              model: {
-                value: data.name,
-                callback (val) {
-                  data.name = typeof val === 'string' ? val.trim() : val
+          { prop: 'name', 'min-width': 100, render: this.active === `${State.AVAILABLE_ASSET}`
+            ? (data, h) => data.del
+              ? h('edit-input', {
+                model: {
+                  value: data.name,
+                  callback (val) {
+                    data.name = typeof val === 'string' ? val.trim() : val
+                  }
+                },
+                on: {
+                  edit: () => this.onEdit(data)
                 }
-              },
-              on: {
-                edit: () => this.onEdit(data)
-              }
-            })
+              })
+              : data.name
             : null },
+          this.active === `${State.REJECTED}` ? { prop: 'remark', label: '驳回原因' } : null,
           this.isImage ? null : { prop: 'duration', label: '时长' },
           { prop: 'size', label: '文件大小' },
           { prop: 'createTime', label: '上传时间' },
-          this.active === `${State.REJECTED}` ? { prop: 'remark', label: '驳回原因' } : null,
           { prop: 'ai', label: 'AI审核', type: 'tag', width: 100 },
           { 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(Boolean) }
+          ] }
         ]
       }
     },

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

@@ -40,7 +40,7 @@
           clearable
         />
         <template v-if="isTenant">
-          <span class="c-grid-form__label">AI机审:</span>
+          <span class="c-grid-form__label">媒资AI机审:</span>
           <div class="l-flex--row c-grid-form__option">
             <el-switch
               v-model="group.aiAudit"
@@ -120,7 +120,7 @@ export default {
         cols: [
           { prop: 'name', label: '标识' },
           { prop: 'remark', label: '名称' },
-          { label: 'AI机审', type: 'tag', render ({ parentGroup, aiAudit }) {
+          { label: '媒资AI机审', type: 'tag', render ({ parentGroup, aiAudit }) {
             return parentGroup
               ? null
               : {

+ 1 - 1
src/views/schedule/ScheduleDesigner.vue

@@ -17,7 +17,7 @@
               class="o-tab__icon el-icon-circle-plus-outline"
               @click.stop="onAdd"
             />
-            待提交
+            编辑
           </div>
         </template>
       </el-tab-pane>