浏览代码

定制频道 修复已选设备不可重复选择的bug

DESKTOP-O04BTUJ\muzen 2 年之前
父节点
当前提交
3d7df7a395
共有 2 个文件被更改,包括 9 次插入7 次删除
  1. 2 2
      src/views/operation/channel/detail.vue
  2. 7 5
      src/views/operation/channel/index.vue

+ 2 - 2
src/views/operation/channel/detail.vue

@@ -57,7 +57,7 @@
       <el-form inline size="mini" @submit.native.prevent>
         <el-form-item label="音频类型:">
           <el-select v-model="dialogForm.audioType">
-            <el-option v-for="item in channelOptions[this.form.channelType]" :key="item.value"
+            <el-option v-for="item in channelOptions[form.channelType]" :key="item.value"
               :value="item.value" :label="item.label" />
           </el-select>
         </el-form-item>
@@ -198,7 +198,7 @@ export default {
     // 打开弹窗
     getDialog() {
       this.dialogVisible = true
-      this.dialogForm.platformId = this.dialogForm.platformId = this.form.channelType === 16 ? 3 : this.form.channelType === 17 ? 2 : this.platformOptions[0].value
+      this.dialogForm.platformId = this.form.channelType === 16 ? 3 : this.form.channelType === 17 ? 2 : this.platformOptions[0].value
       this.getList()
     },
 

+ 7 - 5
src/views/operation/channel/index.vue

@@ -36,7 +36,7 @@
           </el-select>
         </el-form-item>
         <el-form-item v-if="title === '编辑'" label="内容列表:">
-          <el-table :data="list" v-loading="dialog_loading" lazy :default-sort="{prop: 'sort'}">
+          <el-table class="dialog-table" :data="list" v-loading="dialog_loading" lazy :default-sort="{prop: 'sort'}">
             <el-table-column label="序号" prop="sort" align="center" width="100px" />
             <el-table-column label="频道名称" prop="aliasName" align="center" show-overflow-tooltip />
             <el-table-column label="频道封面" align="center" width="100px">
@@ -165,10 +165,12 @@ export default {
       this.index = index + 1
       this.obj = row
       // 新增 / 编辑时的设备
-      let type = row ? 1 : 0
-      devList(type).then(res => {
+      devList(0).then(res => {
         if (res.code === 0) {
           this.devOptions = res.data
+          if (this.title === '编辑') {
+            this.devOptions.unshift.apply(this.devOptions, row.deviceList)
+          }
         }
       })
 
@@ -252,8 +254,8 @@ export default {
 </script>
 
 <style lang="scss" scoped>
-.el-form {
-  height: 605px;
+.dialog-table {
+  height: 500px;
   overflow-y: auto;
 }
 </style>