Browse Source

Merge remote-tracking branch 'origin/dev_review' into staging

fenghao 3 years ago
parent
commit
6cf763d74b

+ 3 - 3
src/views/review/workflow/detail/components/ReviewDialog.vue

@@ -121,12 +121,12 @@ export default {
     return {
       lines: [
         { label: '文件名称', key: 'originalName' },
-        { label: '分辨率', key: 'a' },
+        // { label: '分辨率', key: 'a' },
         { label: '大小', key: 'size' },
-        { label: '上传人', key: 'createBy' },
+        // { label: '上传人', key: 'createBy' },
         { label: '时长', key: 'duration' },
         { label: '上传时间', key: 'createTime' },
-        { label: 'AI审核通过', key: 'q' },
+        { label: 'AI审核', key: 'aiLabel' },
         {
           label: '审核状态',
           key: 'status',

+ 30 - 30
src/views/review/workflow/detail/index.vue

@@ -12,7 +12,7 @@
       @click="getPublishWorkflowDetail"
     />
     <div v-if="dataMap.length">
-      <div class="l-flex--row o-title has-bottom-padding u-color--black u-bold">{{ title }}</div>
+      <div class="l-flex--row o-title has-bottom-padding u-color--black u-bold">{{ title }} <span class="applicant">{{ sourceMap.createBy?`申请人:${sourceMap.createBy}`:'' }}</span></div>
       <div class="l-flex--row has-padding">
         <el-steps
           :active="active"
@@ -54,7 +54,7 @@
         <el-button
           v-if="showTempReject && tempRejectInfo.length"
           class="o-button"
-          @click="reject"
+          @click="reject()"
         >{{ tempRejectMap[backDataType]["text"] }}</el-button>
       </div>
       <schema-table
@@ -138,7 +138,8 @@ import {
   EventPriority,
   EventFreq,
   EventTarget,
-  PublishType
+  PublishType,
+  AssetType
 } from '@/constant'
 // 前端命名 和后端数据命名
 const front2back = {
@@ -173,7 +174,7 @@ const data2label = {
   calendarReleaseScheduling: '发布'
 }
 function showOpt (status) {
-  return ![2, 3].includes(status)
+  return ![State.RESOLVED, State.REJECTED].includes(status)
 }
 const allDataMap = [
   'minios',
@@ -248,7 +249,7 @@ export default {
               { prop: 'originalName', label: '' },
               { prop: 'duration', label: '时长' },
               { prop: 'size', label: '文件大小' },
-              { prop: 'createBy', label: '申请人' },
+              // { prop: 'createBy', label: '申请人' },
               { prop: 'ai', label: 'AI审核', type: 'tag', width: 100 },
               {
                 label: '审核状态',
@@ -276,7 +277,7 @@ export default {
             cols: [
               { prop: 'name', label: '节目名称', 'min-width': 100 },
               { prop: 'resolutionRatio', label: '分辨率' },
-              { prop: 'createBy', label: '申请人' },
+              // { prop: 'createBy', label: '申请人' },
               {
                 label: '审核状态',
                 type: 'tag',
@@ -322,7 +323,7 @@ export default {
             cols: [
               { prop: 'name', label: '排期名称', 'min-width': 100 },
               { prop: 'resolutionRatio', label: '分辨率' },
-              { prop: 'createBy', label: '申请人' },
+              // { prop: 'createBy', label: '申请人' },
               {
                 label: '审核状态',
                 type: 'tag',
@@ -382,7 +383,7 @@ export default {
               { prop: 'type', label: '类型', width: 100 },
               { prop: 'name', label: '名称', 'min-width': 100 },
               { prop: 'resolutionRatio', label: '分辨率' },
-              { prop: 'createBy', label: '申请人' },
+              // { prop: 'createBy', label: '申请人' },
               {
                 type: 'invoke',
                 width: 160,
@@ -422,7 +423,7 @@ export default {
           text: `${data2label[item]}驳回`,
           show:
             !this.tempRejectMap.length
-            && this.sourceMap[item].filter(i => ![2, 3].includes(i.status))
+            && this.sourceMap[item].filter(i => ![State.RESOLVED, State.REJECTED].includes(i.status))
               .length
         }
       }
@@ -459,7 +460,7 @@ export default {
             this.tempRejectMap[item] = {
               text: `${data2label[item]}驳回`,
               length: this.sourceMap[item].filter(
-                i => ![2, 3].includes(i.status)
+                i => ![State.RESOLVED, State.REJECTED].includes(i.status)
               ).length
             }
           }
@@ -469,7 +470,7 @@ export default {
       // 确定节点
       let active = 0
       for (const item of this.dataMap) {
-        if (this.sourceMap[item].every(i => i.status === 2)) {
+        if (this.sourceMap[item].every(i => i.status === State.RESOLVED)) {
           active++
           continue
         }
@@ -489,11 +490,11 @@ export default {
       const index = list.findIndex(i => i.id === item.id)
       list[index].status = status
       this.$refs.table.onPagination()
-      if (status === 2 && this.tableData.every(i => i.status === 2)) {
+      if (status === State.RESOLVED && this.tableData.every(i => i.status === State.RESOLVED)) {
         this.closePreviewDialog()
         this.nextStep()
       }
-      if (status === 3) {
+      if (status === State.REJECTED) {
         list[index].review = review
       }
     },
@@ -519,6 +520,11 @@ export default {
       const { type } = row
       switch (kind) {
         case front2back['assets']:
+          if (row.type === AssetType.IMAGE) {
+            row.thumbnail = row.keyName
+          } else if (row.type === AssetType.VIDEO && row.screenshot !== 'analyzing') {
+            row.thumbnail = row.screenshot
+          }
           row.typeName = [null, '图片', '视频', '音频'][type]
           row.file = {
             type: row.type,
@@ -529,6 +535,7 @@ export default {
           row.size = parseByte(row.size)
           row.createBy = row.userName || row.createBy
           row.ai = mediaMixin.methods.getAIState(row)
+          row.aiLabel = row.ai.label
           row.id = row.keyName
           return row
         case front2back['program']:
@@ -626,13 +633,7 @@ export default {
       this.$refs.scheduleDialog.show(id)
     },
     viewProgram (id) {
-      window.open(
-        this.$router.resolve({
-          name: 'program',
-          params: { id }
-        }).href,
-        '_blank'
-      )
+      this.$viewProgram(id)
     },
     // 查看
     onView (row) {
@@ -644,13 +645,7 @@ export default {
           )
           break
         case front2back['program']:
-          window.open(
-            this.$router.resolve({
-              name: 'program',
-              params: { id }
-            }).href,
-            '_blank'
-          )
+          this.$viewProgram(id)
           break
         case front2back['schedule']:
         case front2back['programRecur']:
@@ -674,7 +669,7 @@ export default {
     // 通过
     onResolve (item) {
       this.resolve(item).then(() => {
-        this.refreshStatus(item, 2)
+        this.refreshStatus(item, State.RESOLVED)
       })
     },
     resolve (item) {
@@ -730,7 +725,7 @@ export default {
           // 缓存驳回数据
           done()
           this.tempRejectInfo.push(rejectInfo)
-          this.refreshStatus(this.$item, 3, {
+          this.refreshStatus(this.$item, State.REJECTED, {
             type: this.review.type,
             reason: this.review.reason
           })
@@ -755,7 +750,7 @@ export default {
         name
       )
         .then(() => {
-          this.$router.push({ name: 'review-list' })
+          this.$router.push({ name: 'workflow-list' })
         })
         .catch(err => {
           console.log(err)
@@ -806,4 +801,9 @@ export default {
 .fl-end {
   justify-content: flex-end;
 }
+.applicant{
+  font-size: 14px;
+  margin-left: 30px;
+  font-weight: 400;
+}
 </style>

+ 5 - 9
src/views/review/workflow/index.vue

@@ -17,7 +17,9 @@
 import { getPublishWorkflows } from '@/api/workflow'
 import {
   PublishType,
-  EventPriority
+  EventPriority,
+  State,
+  EventTarget
 } from '@/constant'
 import { getEventDescription } from '@/utils/event'
 
@@ -26,7 +28,7 @@ export default {
   data () {
     return {
       schema: {
-        condition: { status: 1 },
+        condition: { status: State.SUBMITTED },
         list: getPublishWorkflows,
         transform: this.transform,
         cols: [
@@ -147,13 +149,7 @@ export default {
       this.$refs.scheduleDialog.show(id)
     },
     viewProgram (id) {
-      window.open(
-        this.$router.resolve({
-          name: 'program',
-          params: { id }
-        }).href,
-        '_blank'
-      )
+      this.$viewProgram(id)
     },
     review (item) {
       this.$router.push({

+ 41 - 7
src/views/review/workflow/mine/index.vue

@@ -10,7 +10,6 @@
       class="c-tabs has-bottom-padding"
       @tab-click="onTabClick"
     >
-
       <el-tab-pane
         label="待审核"
         name="1"
@@ -39,8 +38,7 @@ import {
   calendarPublishRestart
 } from '@/api/workflow'
 import {
-  PublishType,
-  EventPriority
+  PublishType, EventPriority, State, EventTarget
 } from '@/constant'
 import { getEventDescription } from '@/utils/event'
 
@@ -86,12 +84,23 @@ export default {
           },
           {
             type: 'invoke',
-            width: 120,
+            width: 160,
             render: [
               { label: '查看', on: this.onView },
-              { label: '提交', render ({ status }) {
-                return status === 3
-              }, on: this.restart }
+              {
+                label: '编辑',
+                render ({ status }) {
+                  return status === State.REJECTED
+                },
+                on: this.onEdit
+              },
+              {
+                label: '提交',
+                render ({ status }) {
+                  return status === State.REJECTED
+                },
+                on: this.restart
+              }
             ]
           }
         ]
@@ -177,12 +186,37 @@ export default {
           break
       }
     },
+    onEdit ({ target: { type, detail } }) {
+      switch (type) {
+        case PublishType.CALENDAR:
+          this.editSchedule(detail, 'schedule-design')
+          break
+        case PublishType.EVENT:
+          if (detail.target.type === EventTarget.RECUR) {
+            this.editSchedule(detail.target.id, 'recur-design')
+          } else {
+            this.editProgram(detail.target.id)
+          }
+          break
+        default:
+          break
+      }
+    },
     viewSchedule (id) {
       this.$refs.scheduleDialog.show(id)
     },
+    editSchedule (id, redirect) {
+      this.$router.push({
+        name: redirect,
+        params: { id: `${id}` }
+      })
+    },
     viewProgram (id) {
       this.$viewProgram(id)
     },
+    editProgram (id) {
+      this.$viewProgram(id, 'design')
+    },
     restart (item) {
       calendarPublishRestart(item.workflowId, item.name).then(() => {
         this.$refs.table.onPagination()