瀏覽代碼

fix: audit with marketing

Casper Dai 1 年之前
父節點
當前提交
b351b7ac42

+ 11 - 15
src/layout/components/Navbar/UploadDashboard/index.vue

@@ -28,7 +28,7 @@
               <span class="c-sibling-item u-color--info">
                 目录
               </span>
-              <div class="c-sibling-item el-input--small u-width">
+              <div class="l-flex--row c-sibling-item el-input--small u-width--md">
                 <div class="el-input__inner u-ellipsis">
                   {{ directory }}
                 </div>
@@ -60,11 +60,13 @@
               <span class="c-sibling-item u-color--info">
                 参与营销
               </span>
-              <schema-select
+              <el-switch
                 v-model="marketing"
-                class="c-sibling-item u-width--2xs"
-                size="small"
-                :schema="marketingSelectSchema"
+                class="c-sibling-item"
+                :active-value="1"
+                active-color="#13ce66"
+                :inactive-value="0"
+                inactive-color="#ff4949"
               />
             </div>
             <div class="l-flex--row c-sibling-item far">
@@ -139,15 +141,16 @@ export default {
     return {
       uploading: false,
       hasFile: false,
+      directoryOption: null,
+      directoryInfo: null,
       tag: AssetTag.AD,
-      subTag: '',
-      videoTranscode: true,
       tagSelectSchema: { options: [
         { value: AssetTag.AD, label: AssetTagInfo[AssetTag.AD] },
         { value: AssetTag.PUBLICITY, label: AssetTagInfo[AssetTag.PUBLICITY] },
         { value: AssetTag.LOCAL_PUBLICITY, label: AssetTagInfo[AssetTag.LOCAL_PUBLICITY] },
         { value: AssetTag.SHIM, label: AssetTagInfo[AssetTag.SHIM] }
       ] },
+      subTag: '',
       subTagSelectSchema: {
         remote: getAssetSubTags,
         placeholder: '暂不配置',
@@ -155,14 +158,7 @@ export default {
         label: 'name'
       },
       marketing: 0,
-      marketingSelectSchema: {
-        options: [
-          { value: 0, label: '否' },
-          { value: 1, label: '是' }
-        ]
-      },
-      directoryOption: null,
-      directoryInfo: null
+      videoTranscode: true
     }
   },
   computed: {

+ 1 - 1
src/views/realm/settings/index.vue

@@ -173,7 +173,7 @@ export default {
   methods: {
     getQrCodeType () {
       getTenantAttribute(QRCODE_STATUS, false).then(({ data }) => {
-        this.qrCodeType = data ? data.attributeValue : '0'
+        this.qrCodeType = data?.attributeValue || '0'
       })
     },
     toggleMarketingQr () {

+ 1 - 1
src/views/screen/deploy/workflow/audit/index.vue

@@ -281,7 +281,7 @@ export default {
           { prop: 'user', label: '申请人', width: 160, align: 'center' },
           { type: 'invoke', render: [
             this.needView && { label: '查看', on: this.onView },
-            { label: '通过', allow: () => this.qrCodeStatus === 0, on: this.onResolve },
+            { label: '通过', allow: () => !this.needMarketing || this.qrCodeStatus === 0, on: this.onResolve },
             { label: '驳回', on: this.onReject }
           ].filter(Boolean), width: 160 }
         ]

+ 14 - 19
src/views/screen/material/media/index.vue

@@ -132,11 +132,6 @@ import {
 } from '@/api/asset.js'
 import LineChart from './components/LineChart.vue'
 
-const marketingOptions = [
-  { label: '否', value: 0 },
-  { label: '是', value: 1 }
-]
-
 export default {
   components: {
     LineChart
@@ -200,22 +195,22 @@ export default {
           { type: 'selection', fixed: true },
           { prop: 'tagInfo', label: '分类', width: 72, 'align': 'center', fixed: true },
           { prop: 'typeInfo', label: '资源', width: 72, 'align': 'center', fixed: true },
-          { prop: 'marketing', label: '参与营销', render: (data, h) => h('el-select', {
+          { prop: 'marketing', label: '参与营销', render: (data, h) => h('el-switch', {
             props: {
-              value: data.marketing === 1 ? '是' : '否',
-              size: 'mini'
+              value: data.marketing,
+              size: 'mini',
+              'active-value': 1,
+              'active-color': '#13ce66',
+              'inactive-value': 0,
+              'inactive-color': '#ff4949'
+            },
+            nativeOn: {
+              click: e => e.stopPropagation()
             },
             on: {
-              input: val => { this.onEditSelect(data, val, data.marketing) }
+              input: val => { this.onToggleMarketing(data, val, data.marketing) }
             }
-          }, [
-            marketingOptions.map(item => h('el-option', {
-              props: {
-                value: item.value,
-                label: item.label
-              }
-            }))
-          ]), width: 86, fixed: true },
+          }), width: 72, align: 'center', fixed: true },
           { prop: 'file', label: '', type: 'asset', on: this.onView, fixed: true },
           { render: (data, h) => h('edit-input', {
             props: {
@@ -438,11 +433,11 @@ export default {
         asset.originalName = oldVal
       })
     },
-    onEditSelect (asset, newVal, oldVal) {
+    onToggleMarketing (asset, newVal, oldVal) {
       if (newVal === oldVal) {
         return
       }
-      asset.marketing = newVal
+      this.$set(asset, 'marketing', newVal)
       updateAsset({
         keyName: asset.keyName,
         marketing: newVal