|
|
|
|
@ -198,14 +198,13 @@ export default { |
|
|
|
|
editBtn: this.vaildData(this.permission.notice_edit, false) |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
ids() { |
|
|
|
|
let ids = []; |
|
|
|
|
this.selectionList.forEach(ele => { |
|
|
|
|
ids.push(ele.id); |
|
|
|
|
}); |
|
|
|
|
return ids.join(","); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.loadDict(); |
|
|
|
|
@ -273,8 +272,7 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 弹窗表格多选 |
|
|
|
|
handleSelectionChange(val) { |
|
|
|
|
this.multipleSelection = val.map(item => item.id); |
|
|
|
|
console.log(this.multipleSelection) |
|
|
|
|
this.multipleSelection = val; |
|
|
|
|
}, |
|
|
|
|
// 弹窗确认按钮 |
|
|
|
|
submitForm() { |
|
|
|
|
@ -287,11 +285,15 @@ export default { |
|
|
|
|
}) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
let ids = this.multipleSelection.join(","); |
|
|
|
|
console.log(ids) |
|
|
|
|
let ids = [], deviceId = []; |
|
|
|
|
this.multipleSelection.forEach(ele => { |
|
|
|
|
let tags = JSON.parse(ele.tags) |
|
|
|
|
ids.push(ele.id); |
|
|
|
|
deviceId.push(tags.sectorNo); |
|
|
|
|
}); |
|
|
|
|
this.submitLoading = true; |
|
|
|
|
if (this.addForm.id > 0) { |
|
|
|
|
cornJobUpdate({ ...this.addForm, deviceId: ids }).then((res) => { |
|
|
|
|
cornJobUpdate({ ...this.addForm, deviceId: deviceId.join(","), ids: ids.join(",") }).then((res) => { |
|
|
|
|
this.submitLoading = false; |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
@ -303,7 +305,7 @@ export default { |
|
|
|
|
this.submitLoading = false; |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
cornJobSave({ ...this.addForm, deviceId: ids }).then(res => { |
|
|
|
|
cornJobSave({ ...this.addForm, deviceId: deviceId.join(","), ids: ids.join(",") }).then(res => { |
|
|
|
|
this.submitLoading = false; |
|
|
|
|
this.dialogVisible = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
@ -444,11 +446,11 @@ export default { |
|
|
|
|
}) |
|
|
|
|
this.tableData = data.records; |
|
|
|
|
this.$refs.multipleTable.clearSelection(); |
|
|
|
|
this.multipleSelection = this.addForm.deviceId ? this.addForm.deviceId.split(",") : []; |
|
|
|
|
if (this.multipleSelection.length > 0) { // 判断是否存在勾选过的数据 |
|
|
|
|
let multipleSelection = this.addForm.ids ? this.addForm.ids.split(",") : []; |
|
|
|
|
if (multipleSelection.length > 0) { // 判断是否存在勾选过的数据 |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.tableData.forEach(row => { // 获取数据列表接口请求到的数据 |
|
|
|
|
this.multipleSelection.forEach(item => { // 勾选到的数据 |
|
|
|
|
multipleSelection.forEach(item => { // 勾选到的数据 |
|
|
|
|
if (row.id === parseInt(item)) { |
|
|
|
|
this.$refs.multipleTable.toggleRowSelection(row, true); // 若有重合,则回显该条数据 |
|
|
|
|
} |
|
|
|
|
@ -476,11 +478,11 @@ export default { |
|
|
|
|
}) |
|
|
|
|
this.tableData = data.rows; |
|
|
|
|
this.$refs.multipleTable.clearSelection(); |
|
|
|
|
this.multipleSelection = this.addForm.deviceId ? this.addForm.deviceId.split(",") : []; |
|
|
|
|
if (this.multipleSelection.length > 0) { // 判断是否存在勾选过的数据 |
|
|
|
|
let multipleSelection = this.addForm.ids ? this.addForm.ids.split(",") : []; |
|
|
|
|
if (multipleSelection.length > 0) { // 判断是否存在勾选过的数据 |
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
this.tableData.forEach(row => { // 获取数据列表接口请求到的数据 |
|
|
|
|
this.multipleSelection.forEach(item => { // 勾选到的数据 |
|
|
|
|
multipleSelection.forEach(item => { // 勾选到的数据 |
|
|
|
|
if (row.id === parseInt(item)) { |
|
|
|
|
this.$refs.multipleTable.toggleRowSelection(row, true); // 若有重合,则回显该条数据 |
|
|
|
|
} |
|
|
|
|
|