Bläddra i källkod

feat: add tag info to asset-table

Casper Dai 2 år sedan
förälder
incheckning
7e5ebaa95d

+ 5 - 2
src/api/asset.js

@@ -1,5 +1,8 @@
 import request, { tenantRequest } from '@/utils/request'
-import { State } from '@/constant'
+import {
+  State,
+  Dataset
+} from '@/constant'
 import {
   getAssetThumb,
   getAssetDiff
@@ -233,7 +236,7 @@ export function getFillDataset (id) {
   return request({
     url: `/media/dataset/${id}`,
     params: {
-      type: 0,
+      type: Dataset.FILL,
       flag: 1
     }
   })

+ 1 - 1
src/utils/index.js

@@ -167,7 +167,7 @@ export function getAssetDiff ({ duration }) {
   return parseDuration(duration)
 }
 
-export function getAssetDuration ({ type, duration }, defaultDuration = 5) {
+export function getAssetDuration ({ type, duration }, defaultDuration = 10) {
   switch (type) {
     case AssetType.STREAMING_MEDIA:
       return Number(duration) || 60

+ 2 - 0
src/views/ad/automation/mixins/asset-table.js

@@ -31,6 +31,7 @@ export const assetTableMixin = {
           { key: 'originalName', type: 'search', placeholder: '资源名称' }
         ],
         cols: [
+          { label: '分类', render: ({ tag }) => AssetTagInfo[tag], width: 72, align: 'center' },
           { prop: 'file', label: '资源', type: 'asset', on: this.onViewAsset },
           { prop: 'originalName', label: '' },
           { prop: 'diff', label: '其他', width: 80, align: 'center' }
@@ -52,6 +53,7 @@ export const assetTableMixin = {
           { key: 'originalName', type: 'search', placeholder: '资源名称' }
         ],
         cols: [
+          { label: '分类', render: ({ tag }) => AssetTagInfo[tag], width: 72, align: 'center' },
           { prop: 'file', label: '资源', type: 'asset', on: this.onViewAsset },
           { prop: 'originalName', label: '' }
         ]

+ 8 - 5
src/views/ad/automation/task/ScreenTask.vue

@@ -217,8 +217,8 @@ export default {
           { prop: 'tag', type: 'tag', size: 'sm', on: canAudit && this.onAudit, width: 92 },
           { type: 'invoke', render: [
             { label: '查看', allow: ({ canView }) => canView, on: this.onViewTask },
-            { label: '删除', allow: !canAudit && (({ from, enable }) => from !== TaskFromType.ORDER && !enable), on: this.onDel }
-          ], width: 92 }
+            canEdit && { label: '删除', allow: ({ allowed, from }) => allowed && from !== TaskFromType.ORDER, on: this.onDel }
+          ].filter(Boolean), width: 92 }
         ]
       },
       contentSchema: {
@@ -308,17 +308,20 @@ export default {
             : enable
               ? {
                 type: 'success',
-                label: '公共数据'
+                label: '公共数据',
+                ignore: true
               }
               : {
                 type: 'warning',
                 label: '公共数据',
-                msg: '请于资源上播管理进行审核'
+                msg: '请于资源上播管理进行审核',
+                ignore: true
               }
           : {
             type: 'danger',
             label: '异常',
-            msg: '源数据丢失'
+            msg: '源数据丢失',
+            ignore: true
           },
         allowed: allowed && devices.length === 1,
         canView: allowed