Преглед на файлове

feat: reason for rejection

Casper Dai преди 3 години
родител
ревизия
e9d3c17809
променени са 4 файла, в които са добавени 37 реда и са изтрити 6 реда
  1. 22 0
      src/views/bigscreen/Program.vue
  2. 2 1
      src/views/platform/media/mixin.js
  3. 2 2
      src/views/schedule/ScheduleDesigner.vue
  4. 11 3
      src/views/schedule/mixin.js

+ 22 - 0
src/views/bigscreen/Program.vue

@@ -5,6 +5,16 @@
       :style="style"
       @click="onClick"
     >
+      <el-tooltip
+        v-if="isRejected"
+        :content="program.remark"
+        placement="top-start"
+      >
+        <i
+          class="c-program__warning el-icon-warning-outline"
+          @click.stop
+        />
+      </el-tooltip>
       <span class="c-program__ratio">{{ program.resolutionRatio }}</span>
       <div class="c-program__time u-ellipsis">{{ time }}</div>
     </div>
@@ -55,6 +65,9 @@ export default {
     },
     time () {
       return this.program.updateTime?.split(' ')[0]
+    },
+    isRejected () {
+      return this.program.status > State.RESOLVED
     }
   },
   methods: {
@@ -102,6 +115,15 @@ export default {
       100% 100% no-repeat;
   }
 
+  &__warning {
+    position: absolute;
+    top: 0;
+    left: 0;
+    padding: 4px 6px;
+    color: $warning;
+    font-size: 24px;
+  }
+
   &__ratio {
     position: absolute;
     top: 0;

+ 2 - 1
src/views/platform/media/mixin.js

@@ -75,12 +75,13 @@ export default {
           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(val => val) }
+          ].filter(Boolean) }
         ]
       }
     },

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

@@ -106,7 +106,6 @@ export default {
         { label: '复制', render ({ status }) { return status === State.SUBMITTED || status === State.RESOLVED }, on: this.onCopy },
         { label: '删除', render ({ del }) { return del }, on: this.onDel }
       ],
-      active: `${this.status}`,
       resolutionRatioSelectSchema: { remote: getRatiosWithUser },
       schedule: {},
       copySchedule: {
@@ -126,8 +125,9 @@ export default {
   methods: {
     onTabClick ({ name: active }) {
       if (this.active !== active) {
+        const { resolutionRatio, name } = this.$refs.table.getCondition()
+        this.$condition = { resolutionRatio, name }
         this.active = active
-        this.$refs.table.mergeCondition({ status: Number(active) })
       }
     },
     onAdd () {

+ 11 - 3
src/views/schedule/mixin.js

@@ -16,14 +16,18 @@ export default {
       default: State.READY
     }
   },
+  data () {
+    return {
+      active: `${this.status}`
+    }
+  },
   computed: {
     schema () {
       return {
         condition: {
           type: this.type,
-          resolutionRatio: void 0,
-          status: this.status,
-          name: ''
+          status: Number(this.active),
+          ...this.getCondition()
         },
         list: getSchedules,
         filters: [
@@ -34,12 +38,16 @@ export default {
           { prop: 'name', label: '名称', 'min-width': 120 },
           { prop: 'resolutionRatio', label: '分辨率' },
           { prop: 'createTime', label: '创建时间', 'min-width': 90 },
+          this.active === `${State.REJECTED}` ? { prop: 'remark', label: '驳回原因' } : null,
           { type: 'invoke', width: 160, render: this.invokes }
         ]
       }
     }
   },
   methods: {
+    getCondition () {
+      return this.$condition || { resolutionRatio: void 0, name: '' }
+    },
     onView ({ id }) {
       this.$refs.scheduleDialog.show(id)
     },