Przeglądaj źródła

列表展示资源平台

DESKTOP-SVI9JE1\muzen 1 rok temu
rodzic
commit
4c1214420d
1 zmienionych plików z 7 dodań i 1 usunięć
  1. 7 1
      src/views/music/radioclass/index.vue

+ 7 - 1
src/views/music/radioclass/index.vue

@@ -6,6 +6,7 @@
     <el-table :data="tableData" v-loading="loading">
       <el-table-column type="index" label="序号" align="center" />
       <el-table-column label="分类名称" prop="title" align="center" />
+      <el-table-column label="资源平台" prop="platformId" align="center" :formatter="platformIdFormatter" />
       <el-table-column label="更新时间" align="center">
         <template slot-scope="scope">
           {{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}
@@ -79,6 +80,7 @@ export default {
     }
   },
   mounted() {
+    this.getPlatform({})
     this.getList()
   },
   methods: {
@@ -86,7 +88,6 @@ export default {
     getDialog(title, id) {
       this.dialogVisible = true
       this.title = title
-      this.getPlatform({})
       if (id) {
         detail(id).then(res => {
           if (res.code === 0) {
@@ -145,6 +146,11 @@ export default {
           }
         })
       }).catch(() => { })
+    },
+
+    // 字典翻译
+    platformIdFormatter(row) {
+      return JSON.parse(row.platformId).map(i => this.selectDictLabel(this.platformOptions, i)).join(',')
     }
   }
 }