|
@@ -288,7 +288,6 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
return {
|
|
|
- multipleTable: null,
|
|
|
// 遮罩层
|
|
|
loading: false,
|
|
|
// 表单
|
|
@@ -373,6 +372,7 @@ export default {
|
|
|
status: 1,
|
|
|
platformId: null,
|
|
|
},
|
|
|
+
|
|
|
// 总数据
|
|
|
total: 0,
|
|
|
// 弹窗列表
|
|
@@ -381,6 +381,8 @@ export default {
|
|
|
disabled: false,
|
|
|
// 是否已选
|
|
|
disabledChecked: false,
|
|
|
+ ///是否加载完
|
|
|
+ isLoad: false,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -414,62 +416,11 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleSelectionChange(val) {
|
|
|
- this.form.programList = JSON.parse(JSON.stringify(val));
|
|
|
- this.$message.success("操作成功!");
|
|
|
- /// 获取去掉的item
|
|
|
- // var deleteList = [];
|
|
|
- // for (var i = 0; i < this.tableData.length; i++) {
|
|
|
- // var isHas = false;
|
|
|
- // for (var j = 0; j < val.length; j++) {
|
|
|
- // if (this.tableData[i].id === val[j].id) {
|
|
|
- // isHas = true;
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (!isHas) {
|
|
|
- // deleteList.push(this.tableData[i]);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // /// 删掉去掉的
|
|
|
- // if (deleteList.length > 0) {
|
|
|
- // for (var i = 0; i < this.form.programList.length; i++) {
|
|
|
- // for (var j = 0; j < deleteList.length; j++) {
|
|
|
- // if (this.form.programList[i].id === deleteList[j].id) {
|
|
|
- // this.form.programList.splice(i, 1);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // console.log("gadadfqewrqerqerqr==22=" + this.form.programList.length);
|
|
|
-
|
|
|
- // ///添加没有的
|
|
|
- // for (var i = 0; i < val.length; i++) {
|
|
|
- // var item = {
|
|
|
- // id: val[i].id,
|
|
|
- // name: val[i].name,
|
|
|
- // singerName: val[i].singerName,
|
|
|
- // playTime: val[i].playTime,
|
|
|
- // status: val[i].status,
|
|
|
- // progaramUrl: val[i].progaramUrl,
|
|
|
- // };
|
|
|
- // var has = this.disabledList(item);
|
|
|
- // ///如果没有,添加
|
|
|
- // if (!has) {
|
|
|
- // this.form.programList.push(item);
|
|
|
- // }
|
|
|
- // }
|
|
|
-
|
|
|
- // this.form.programList.push({
|
|
|
- // id: row.id,
|
|
|
- // name: row.name,
|
|
|
- // singerName: row.singerName,
|
|
|
- // playTime: row.playTime,
|
|
|
- // status: row.status,
|
|
|
- // progaramUrl: row.progaramUrl,
|
|
|
- // });
|
|
|
- // this.$message.success("添加成功!");
|
|
|
+ if (this.isLoad) {
|
|
|
+ this.form.programList = JSON.parse(JSON.stringify(val));
|
|
|
+ this.form.programList = this.form.programList.filter((i) => i);
|
|
|
+ this.$message.success("操作成功!");
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 详情
|
|
@@ -505,30 +456,26 @@ export default {
|
|
|
this.total = res.data.total;
|
|
|
this.loading = false;
|
|
|
|
|
|
- // const tableInstance = this.multipleTable;
|
|
|
- // if (tableInstance) {
|
|
|
- // // 通过设置内部 selection 属性来选中行(这是内部实现细节,可能会随版本变化)
|
|
|
- // tableInstance.store.states.selection = this.form.programList.map(
|
|
|
- // (index) => tableData[index]
|
|
|
- // );
|
|
|
- // // 强制表格重新渲染,以显示选中的行
|
|
|
- // this.tableKey += 1;
|
|
|
- // }
|
|
|
-
|
|
|
- // this.$refs.tableData.clearSelection();
|
|
|
-
|
|
|
- // if (this.form.programList.length > 0) {
|
|
|
- // for (var i = 0; i < this.form.programList.length; i++) {
|
|
|
- // for (var j = 0; j < this.tableData.length; j++) {
|
|
|
- // if (this.form.programList[i] === this.tableData[j]) {
|
|
|
- // console.log("gadfadsfqewrqewrqerqerqer===" + j);
|
|
|
- // this.tableData.toggleRowSelection(this.tableData[j], true);
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
+ this.isLoad = false;
|
|
|
+ if (this.form.programList.length > 0) {
|
|
|
+ var temp = [];
|
|
|
+ for (var i = 0; i < this.tableData.length; i++) {
|
|
|
+ for (var j = 0; j < this.form.programList.length; j++) {
|
|
|
+ if (this.form.programList[j].id === this.tableData[i].id) {
|
|
|
+ temp.push(this.tableData[i]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if (temp.length > 0) {
|
|
|
+ temp.forEach((item) => {
|
|
|
+ this.$refs.multipleTable.toggleRowSelection(item, true);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ this.isLoad = true;
|
|
|
});
|
|
|
},
|
|
|
|