|
@@ -68,8 +68,8 @@
|
|
</el-form>
|
|
</el-form>
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
<el-table :data="dialogData" height="476" ref="table" :row-key="getRowKey"
|
|
<el-table :data="dialogData" height="476" ref="table" :row-key="getRowKey"
|
|
- @selection-change="getChange">
|
|
|
|
- <el-table-column type="selection" />
|
|
|
|
|
|
+ @selection-change="getChange" lazy>
|
|
|
|
+ <el-table-column type="selection" align="center" reserve-selection />
|
|
<el-table-column label="内容ID" prop="id" align="center" />
|
|
<el-table-column label="内容ID" prop="id" align="center" />
|
|
<el-table-column label="音频名称" prop="audioName" align="center" />
|
|
<el-table-column label="音频名称" prop="audioName" align="center" />
|
|
<el-table-column label="音频封面" align="center">
|
|
<el-table-column label="音频封面" align="center">
|
|
@@ -164,14 +164,15 @@ export default {
|
|
if (res.code == 0) {
|
|
if (res.code == 0) {
|
|
this.dialogData = res.data[0].pageData.records
|
|
this.dialogData = res.data[0].pageData.records
|
|
this.total = res.data[0].pageData.total
|
|
this.total = res.data[0].pageData.total
|
|
- this.$nextTick(() => {
|
|
|
|
|
|
+ this.$refs.table.clearSelection()
|
|
|
|
+ if (this.tableData.length > 0) {
|
|
this.tableData.map(i => {
|
|
this.tableData.map(i => {
|
|
let row = res.data[0].pageData.records.find(j => j.id === i.audioId)
|
|
let row = res.data[0].pageData.records.find(j => j.id === i.audioId)
|
|
if (row) {
|
|
if (row) {
|
|
this.$refs.table.toggleRowSelection(row)
|
|
this.$refs.table.toggleRowSelection(row)
|
|
}
|
|
}
|
|
})
|
|
})
|
|
- })
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
@@ -226,8 +227,13 @@ export default {
|
|
},
|
|
},
|
|
// 表格多选
|
|
// 表格多选
|
|
getChange(row) {
|
|
getChange(row) {
|
|
- this.ids = []
|
|
|
|
- row.map(i => this.ids.push(i.id))
|
|
|
|
|
|
+ if (row.length > 0) {
|
|
|
|
+ row.map(i => {
|
|
|
|
+ if (this.ids.findIndex(j => j === i.id) === -1) {
|
|
|
|
+ this.ids.push(i.id)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
},
|
|
},
|
|
|
|
|
|
// 添加频道内容
|
|
// 添加频道内容
|