Procházet zdrojové kódy

fix(audit): program audit

Casper Dai před 2 roky
rodič
revize
6c61aac420

+ 9 - 15
src/components/dialog/DatasetConfigDialog/index.vue

@@ -73,11 +73,11 @@ export default {
           { label: '解绑', on: this.onUnbind }
         ],
         cols: [
-          { prop: 'tagInfo', label: '类型', align: 'center', width: 80 },
-          { prop: 'typeInfo', label: '资源', align: 'center', width: 72 },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
-          { prop: 'duration', label: '上播时长', width: 100, 'align': 'center' },
+          { prop: 'duration', label: '上播时长', width: 100, align: 'center' },
           { type: 'invoke', render: [
             { label: '查看', on: this.onViewAsset }
           ] }
@@ -98,11 +98,11 @@ export default {
         list: this.getAssets,
         transform: this.transformDatasetAsset,
         cols: [
-          { prop: 'tagInfo', label: '类型', align: 'center', width: 80 },
-          { prop: 'typeInfo', label: '资源', align: 'center', width: 72 },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
-          { prop: 'duration', label: '上播时长', 'align': 'center', width: 100 },
+          { prop: 'duration', label: '上播时长', width: 100, align: 'center' },
           { type: 'invoke', render: [
             { label: '查看', on: this.onViewAsset }
           ] }
@@ -142,15 +142,11 @@ export default {
     },
     getAssetsByDataset () {
       if (this.dataset) {
-        return Promise.resolve({
-          data: this.dataset.mediaList
-        })
+        return Promise.resolve({ data: this.dataset.mediaList })
       }
       return getDatasetByDevice(this.$deviceId).then(({ data }) => {
         this.setDataset(data)
-        return {
-          data: data.mediaList
-        }
+        return { data: data.mediaList }
       })
     },
     transformDatasetAsset (asset) {
@@ -204,9 +200,7 @@ export default {
       }
       return getFillDataset(this.$datasetId).then(({ data: { mediaList } }) => {
         this.$datasetAssets = mediaList
-        return {
-          data: mediaList
-        }
+        return { data: mediaList }
       })
     }
   }

+ 2 - 2
src/components/dialog/MaterialDialog/index.vue

@@ -60,8 +60,8 @@ export default {
         singlePage: true,
         list: this.getContentAssets,
         cols: [
-          { prop: 'tagInfo', label: '类型', width: 100, align: 'center' },
-          { prop: 'typeInfo', label: '资源', width: 72 },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
           { prop: 'adDuration', label: '上播时长', align: 'center' },

+ 3 - 5
src/components/service/EventTargetPicker/index.vue

@@ -161,8 +161,8 @@ export default {
         singlePage: true,
         list: this.getAssets,
         cols: [
-          { prop: 'tagInfo', label: '类型', align: 'center', width: 80 },
-          { prop: 'typeInfo', label: '资源', align: 'center', width: 72 },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
           { prop: 'duration', label: '上播时长', 'align': 'center', width: 100 },
@@ -329,9 +329,7 @@ export default {
       }
       return getCommonDataset(this.$datasetId).then(({ data: { mediaList } }) => {
         this.$datasetAssets = mediaList.map(transformDatasetAssetToAsset)
-        return {
-          data: this.$datasetAssets
-        }
+        return { data: this.$datasetAssets }
       })
     },
     onChoosenDataset ({ value, done }) {

+ 3 - 3
src/utils/upload.js

@@ -520,7 +520,7 @@ async function startCheck (obj) {
     setState(obj, State.CHECK)
     const { result, message } = await isExists(obj)
     if (result) {
-      finish(obj)
+      finish(obj, message)
       return
     }
     message.forEach(chunkNumber => {
@@ -570,11 +570,11 @@ function idleTask () {
   shuntTask()
 }
 
-function finish (obj) {
+function finish (obj, message) {
   Notification({
     type: 'success',
     title: '文件上传',
-    message: `${obj.name}上传成功`
+    message: message || `${obj.name}上传成功`
   })
   setState(obj, State.SUCCESS)
   emit('uploaded', obj)

+ 2 - 2
src/views/ad/automation/dataset/index.vue

@@ -134,8 +134,8 @@ export default {
         ],
         cols: [
           { type: 'selection' },
-          { prop: 'tagInfo', label: '类型', align: 'center', width: 80 },
-          { prop: 'typeInfo', label: '资源', align: 'center', width: 72 },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
           { label: '上播时长(s)', render: (data, h) => data.minioData && data.type === AssetType.IMAGE

+ 13 - 8
src/views/ad/automation/scheduling/index.vue

@@ -127,11 +127,11 @@ export default {
       minDate: '',
       dateRange: [],
       contentSchema: {
-        nonPagination: true,
+        singlePage: true,
         list: this.getContentAssets,
         cols: [
-          { prop: 'tagInfo', label: '资源', width: 100, align: 'center' },
-          { prop: 'typeInfo', label: '', width: 72 },
+          { prop: 'tagInfo', label: '类型', width: 100, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
           { prop: 'adDuration', label: '上播时长', width: 100, align: 'center' },
@@ -150,7 +150,7 @@ export default {
         condition: { id: this.schedulingId },
         cols: [
           { prop: 'fromInfo', type: 'refresh', width: 80, align: 'center' },
-          { prop: 'dataTag', label: '类型', width: 80, align: 'center' },
+          { prop: 'dataTag', label: '类型', width: 100, align: 'center' },
           { prop: 'dataType', label: '', width: 80, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'originalName', label: '' },
@@ -246,7 +246,7 @@ export default {
           return AssetTagInfo[AssetTag.AD]
         case TaskFromType.FILL:
         case TaskFromType.ASSET:
-          return relationBOS?.[0] ? AssetTagInfo[relationBOS[0].tag] : '-'
+          return relationBOS?.[0]?.detailId ? AssetTagInfo[relationBOS[0].tag] : '-'
         default:
           return '-'
       }
@@ -255,7 +255,7 @@ export default {
       switch (from) {
         case TaskFromType.FILL:
         case TaskFromType.ASSET:
-          return relationBOS?.[0] ? AssetTypeInfo[relationBOS[0].type] : '-'
+          return relationBOS?.[0]?.detailId ? AssetTypeInfo[relationBOS[0].type] : '-'
         default:
           return '素材包'
       }
@@ -264,7 +264,7 @@ export default {
       switch (from) {
         case TaskFromType.FILL:
         case TaskFromType.ASSET:
-          return relationBOS?.[0] && {
+          return relationBOS?.[0]?.detailId && {
             type: relationBOS[0].type,
             url: relationBOS[0].keyName
           }
@@ -326,7 +326,12 @@ export default {
     getContentAssets () {
       return Promise.resolve({ data: this.$assets })
     },
-    transformContractAsset ({ tag, type, keyName, originalName, duration }) {
+    transformContractAsset ({ detailId, tag, type, keyName, originalName, duration }) {
+      if (!detailId) {
+        return {
+          tagInfo: '资源已删除'
+        }
+      }
       return {
         tagInfo: AssetTagInfo[tag],
         typeInfo: AssetTypeInfo[type],

+ 4 - 7
src/views/ad/automation/task/AssetTask.vue

@@ -239,10 +239,11 @@ export default {
         ]
       },
       contentSchema: {
+        singlePage: true,
         list: this.getContentAssets,
         cols: [
-          { prop: 'tagInfo', label: '资源', width: 100, align: 'center' },
-          { prop: 'typeInfo', label: '', width: 72 },
+          { prop: 'tagInfo', label: '类型', width: 100, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
           { prop: 'adDuration', label: '上播时长', align: 'center' },
@@ -401,11 +402,7 @@ export default {
       this.$refs.contentDialog.show()
     },
     getContentAssets () {
-      const assets = this.$assets
-      return Promise.resolve({
-        data: assets,
-        totalCount: assets.length
-      })
+      return Promise.resolve({ data: this.$assets })
     },
     onViewAsset ({ file }) {
       this.$refs.previewDialog.show(file)

+ 2 - 2
src/views/ad/automation/task/ScreenTask.vue

@@ -216,11 +216,11 @@ export default {
         ]
       },
       contentSchema: {
-        nonPagination: true,
+        singlePage: true,
         list: this.getContentAssets,
         cols: [
           { prop: 'tagInfo', label: '类型', width: 100, align: 'center' },
-          { prop: 'typeInfo', label: '资源', width: 72 },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
           { prop: 'adDuration', label: '上播时长', align: 'center' },

+ 5 - 4
src/views/screen/review/workflow/audit/components/ReviewAssets.vue

@@ -26,12 +26,12 @@ export default {
         nonPaination: true,
         list: this.getList,
         cols: [
-          { prop: 'tagInfo', width: 80 },
-          { prop: 'typeInfo', label: '资源', align: 'center', width: 72 },
-          { prop: 'file', type: 'asset', on: this.onView },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
+          { prop: 'file', label: '', type: 'asset', on: this.onView },
           { prop: 'originalName', label: '' },
           { prop: 'ai', label: 'AI审核', type: 'tag' },
-          { prop: 'size', label: '文件大小' },
+          { prop: 'size', label: '文件大小', align: 'right' },
           { prop: 'diff', label: '其他', align: 'center' },
           { type: 'invoke', render: [
             { label: '查看', on: this.onView }
@@ -54,6 +54,7 @@ export default {
           thumb: getAssetThumb(asset),
           files: asset.childrenData
         },
+        originalName: asset.originalName,
         ai: getAIState(asset),
         size: parseByte(asset.size),
         diff: getAssetDiff(asset)

+ 12 - 17
src/views/screen/review/workflow/audit/components/ReviewPublish.vue

@@ -18,7 +18,7 @@
       </div>
       <template v-if="targetContent">
         <div class="c-sibling-item--v u-font-size--sm u-color--black u-bold">上播内容</div>
-        <template v-if="isAssets">
+        <template v-if="isProgram || isAssets">
           <schema-table
             class="c-sibling-item--v near"
             :schema="contentSchema"
@@ -108,8 +108,8 @@ export default {
         nonPagination: true,
         list: this.getContentAssets,
         cols: [
-          { prop: 'tagInfo', label: '类型', width: 100, align: 'center' },
-          { prop: 'typeInfo', label: '资源', width: 80 },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
           { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'name', label: '' },
           { prop: 'adDuration', label: '上播时长', 'min-width': 60, align: 'center' },
@@ -118,16 +118,16 @@ export default {
           ] }
         ]
       },
-      programAssetschema: {
+      programAssetSchema: {
         nonPaination: true,
         list: this.getContentAssets,
         cols: [
-          { prop: 'tagInfo', width: 80 },
-          { prop: 'typeInfo', label: '资源', align: 'center', width: 72 },
-          { prop: 'file', type: 'asset', on: this.onViewAsset },
+          { prop: 'tagInfo', label: '类型', width: 80, align: 'center' },
+          { prop: 'typeInfo', label: '资源', width: 72, align: 'center' },
+          { prop: 'file', label: '', type: 'asset', on: this.onViewAsset },
           { prop: 'originalName', label: '' },
           { prop: 'ai', label: 'AI审核', type: 'tag' },
-          { prop: 'size', label: '文件大小' },
+          { prop: 'size', label: '文件大小', align: 'right' },
           { prop: 'diff', label: '其他', align: 'center' },
           { type: 'invoke', render: [
             { label: '查看', on: this.onViewAsset }
@@ -161,11 +161,11 @@ export default {
           }, on: this.onView },
           !this.isAssets && { prop: 'targetName', label: '' },
           { prop: 'desc', label: '上播时间', 'min-width': 160 },
-          { type: 'invoke', width: this.targetContent ? 120 : 160, render: [
+          { type: 'invoke', render: [
             this.isProgram && { label: '查看', on: this.onView },
             { label: '通过', on: this.onResolve },
             { label: '驳回', on: this.onReject }
-          ].filter(Boolean) }
+          ].filter(Boolean), width: this.isProgram ? 160 : 120 }
         ]
       }
     },
@@ -213,9 +213,6 @@ export default {
     publishTarget () {
       return this.list?.[0].target
     },
-    isSchedule () {
-      return this.publishTarget?.type === PublishTargetType.CALENDAR
-    },
     isEvent () {
       return this.publishTarget?.type === PublishTargetType.EVENT
     },
@@ -228,9 +225,6 @@ export default {
       }
       return null
     },
-    isRecur () {
-      return this.isEvent && this.publishTarget.detail.target.type === EventTarget.RECUR
-    },
     isAssets () {
       return this.isEvent && this.publishTarget.detail.target.type === EventTarget.ASSETS
     },
@@ -280,6 +274,7 @@ export default {
             return { type, url: keyName }
           })
         },
+        originalName: asset.originalName,
         ai: getAIState(asset),
         size: parseByte(asset.size),
         diff: getAssetDiff(asset)
@@ -299,7 +294,7 @@ export default {
           type,
           url: keyName
         },
-        name: name || '',
+        name,
         adDuration: parseDuration(duration)
       }
     },

+ 40 - 0
src/views/screen/review/workflow/components/WorkflowHistoryDialog.vue

@@ -0,0 +1,40 @@
+<template>
+  <table-dialog
+    ref="tableDialog"
+    title="流程历史"
+    :schema="historySchema"
+  />
+</template>
+
+<script>
+import { WorkflowStateInfo } from '@/constant'
+import { getWorkflowHistory } from '../api'
+
+export default {
+  name: 'WorkflowHistoryDialog',
+  data () {
+    return {
+      historySchema: {
+        nonPagination: true,
+        list: this.getWorkflowHistory,
+        transform: this.transformHistory,
+        cols: [
+          { label: '节点', render: ({ status }) => WorkflowStateInfo[status], width: 100, align: 'center' },
+          { prop: 'handledBy', label: '处理人', width: 160, align: 'center' },
+          { prop: 'createTime', label: '处理时间', align: 'center' },
+          { prop: 'reason', label: '备注', align: 'right' }
+        ]
+      }
+    }
+  },
+  methods: {
+    show (workflowId) {
+      this.$workflowId = workflowId
+      this.$refs.tableDialog.show()
+    },
+    getWorkflowHistory () {
+      return getWorkflowHistory(this.$workflowId)
+    }
+  }
+}
+</script>

+ 12 - 1
src/views/screen/review/workflow/history/index.vue

@@ -11,6 +11,7 @@
       @row-click="onToggle"
     />
     <material-dialog ref="materialDialog" />
+    <workflow-history-dialog ref="workflowHistoryDialog" />
   </wrapper>
 </template>
 
@@ -21,9 +22,13 @@ import {
   cancelPublish
 } from '../api'
 import { transformCalendarRelease } from '../utils'
+import WorkflowHistoryDialog from '../components/WorkflowHistoryDialog.vue'
 
 export default {
   name: 'ScheduleDeployHistory',
+  components: {
+    WorkflowHistoryDialog
+  },
   data () {
     return {
       schema: {
@@ -72,11 +77,13 @@ export default {
           { type: 'invoke', render: this.$store.getters.isGroupAdmin
             ? [
               { label: '下架', allow: ({ status }) => status === State.RESOLVED, on: this.onCancel },
+              { label: '历史', allow: ({ workflowId }) => !!workflowId, on: this.onViewHistory },
               { label: '查看', on: this.onView }
             ]
             : [
+              { label: '历史', allow: ({ workflowId }) => !!workflowId, on: this.onViewHistory },
               { label: '查看', on: this.onView }
-            ] }
+            ], width: this.$store.getters.isGroupAdmin ? 160 : 120 }
         ]
       }
     }
@@ -84,6 +91,7 @@ export default {
   methods: {
     transform (item) {
       return {
+        workflowId: item.workflowId,
         status: item.status,
         ...transformCalendarRelease(item)
       }
@@ -98,6 +106,9 @@ export default {
       cancelPublish(publishItem.id, publishItem.name).then(() => {
         publishItem.status = State.CANCEL
       })
+    },
+    onViewHistory ({ workflowId }) {
+      this.$refs.workflowHistoryDialog.show(workflowId)
     }
   }
 }

+ 8 - 28
src/views/screen/review/workflow/mine/index.vue

@@ -31,43 +31,27 @@
     />
     <preview-dialog ref="previewDialog" />
     <material-dialog ref="materialDialog" />
-    <table-dialog
-      ref="tableDialog"
-      title="流程历史"
-      :schema="historySchema"
-    />
+    <workflow-history-dialog ref="workflowHistoryDialog" />
   </wrapper>
 </template>
 
 <script>
-import {
-  State,
-  WorkflowStateInfo
-} from '@/constant'
+import { State } from '@/constant'
 import { transformCalendarRelease } from '../utils'
 import {
   getWorkflowsByUser,
-  getWorkflowHistory,
   deleteWorkflow
 } from '../api'
+import WorkflowHistoryDialog from '../components/WorkflowHistoryDialog.vue'
 
 export default {
   name: 'MyWorkflows',
+  components: {
+    WorkflowHistoryDialog
+  },
   data () {
     return {
-      active: `${State.SUBMITTED}`,
-      workflowId: '',
-      historySchema: {
-        nonPagination: true,
-        list: this.getWorkflowHistory,
-        transform: this.transformHistory,
-        cols: [
-          { label: '节点', render: ({ status }) => WorkflowStateInfo[status], width: 100, align: 'center' },
-          { prop: 'handledBy', label: '处理人', width: 160, align: 'center' },
-          { prop: 'createTime', label: '时间', align: 'center' },
-          { prop: 'reason', label: '备注', align: 'right' }
-        ]
-      }
+      active: `${State.SUBMITTED}`
     }
   },
   computed: {
@@ -122,8 +106,7 @@ export default {
       ])
     },
     onViewHistory ({ workflowId }) {
-      this.$workflowId = workflowId
-      this.$refs.tableDialog.show()
+      this.$refs.workflowHistoryDialog.show(workflowId)
     },
     onTabClick ({ name: active }) {
       if (this.active !== active) {
@@ -137,9 +120,6 @@ export default {
         ...workflow
       }
     },
-    getWorkflowHistory () {
-      return getWorkflowHistory(this.$workflowId)
-    },
     onToggle (row) {
       this.$refs.table.getInst().toggleRowExpansion(row)
     },