Prechádzať zdrojové kódy

修复遗漏的传参

DESKTOP-O04BTUJ\muzen 3 rokov pred
rodič
commit
cfadb7588b
1 zmenil súbory, kde vykonal 13 pridanie a 7 odobranie
  1. 13 7
      src/views/operation/recommend/index.vue

+ 13 - 7
src/views/operation/recommend/index.vue

@@ -88,7 +88,8 @@
 
             <el-form-item label="列表:" v-if="isList()">
               <el-button type="primary" @click="getDialog(index)" v-hasPermi="['operation:recommend:add']">
-                添加内容</el-button>
+                添加内容
+              </el-button>
               <el-table :data="item.childList" height="332">
                 <el-table-column label="电台名称:" prop="contentName" align="center" show-overflow-tooltip />
                 <el-table-column label="当前状态" prop="status" align="center" :formatter="statusFormatter" />
@@ -141,7 +142,7 @@
         @selection-change="handleSelectionChange">
         <el-table-column type="selection" align="center" reserve-selection
           v-if="tabIndex === 2 && active === 1" />
-        <el-table-column label="音频ID" prop="audioId" align="center" />
+        <el-table-column label="音频ID" prop="audioId" align="center" show-overflow-tooltip />
         <el-table-column label="音频名称" prop="audioName" align="center" show-overflow-tooltip />
         <el-table-column label="音频封面" align="center" width="100px">
           <template slot-scope="scope">
@@ -181,14 +182,15 @@ import {
   upOrDown
 } from '@/api/operation/recommend'
 import Upload from '@/components/Upload/index'
+import { isFreeMixin } from '@/mixin/index'
 
 export default {
   dicts: [
     'platform_type',
-    'free_yes_no',
     'is_custom',
     'content_model'
   ],
+  mixins: [isFreeMixin],
   components: {
     Upload
   },
@@ -476,14 +478,14 @@ export default {
           this.tableData = res.data.records
           this.total = res.data.total
           this.$refs.tableData.clearSelection()
-          this.$nextTick(() => {
+          if (this.tableData.length > 0) {
             this.list[this.index].childList.map(i => {
               let row = res.data.records.find(j => j.audioId === i.contentId)
               if (row) {
                 this.$refs.tableData.toggleRowSelection(row)
               }
             })
-          })
+          }
         }
       })
     },
@@ -493,8 +495,10 @@ export default {
       let e = this.list[this.index]
       e.contentId = row.audioId
       e.contentName = row.audioName
+      e.pic = row.audioPic
       e.platformId = row.platformId
       e.contentType = row.audioType
+      e.description = row.description
       this.dialogVisible = false
       this.$message.success('选择成功!')
     },
@@ -512,7 +516,9 @@ export default {
               contentId: i.audioId,
               contentName: i.audioName,
               platformId: i.platformId,
-              contentType: i.audioType
+              contentType: i.audioType,
+              pic: i.audioPic,
+              description: i.description
             })
           }
         })
@@ -561,7 +567,7 @@ export default {
       return this.selectDictLabel(this.audioTypeOptions, row.audioType)
     },
     freeFormatter(row) {
-      return this.selectDictLabel(this.dict.type.free_yes_no, row.isFree)
+      return this.selectDictLabel(this.freeOptions, row.isFree)
     },
     statusFormatter(row) {
       return row.status === 0 ? '上架' : '下架'