Commit 5ccf12d5 authored by “yiyousong”'s avatar “yiyousong”

perf: 优化办事指南事项管理

parent ede15671
...@@ -158,6 +158,7 @@ const sourceType = { ...@@ -158,6 +158,7 @@ const sourceType = {
0: "一体化添加", 0: "一体化添加",
1: "手动添加", 1: "手动添加",
}; };
import { uniqueObjArray } from "@/utils";
export default { export default {
components: { components: {
...@@ -272,6 +273,8 @@ export default { ...@@ -272,6 +273,8 @@ export default {
// 搜索 // 搜索
onSearch() { onSearch() {
this.searchForm.page = 1; this.searchForm.page = 1;
this.selectedRowKeys = [];
this.selectedRows = [];
this.getMatterSiteData(); this.getMatterSiteData();
}, },
...@@ -308,13 +311,10 @@ export default { ...@@ -308,13 +311,10 @@ export default {
// 勾选 // 勾选
onSelectChange(keys, rows) { onSelectChange(keys, rows) {
this.selectedRowKeys = keys; this.selectedRowKeys = keys;
this.selectedRows = [...this.selectedRows, ...rows]; this.selectedRows = uniqueObjArray([
let res = new Map(); ...this.selectedRows,
this.selectedRows = this.selectedRows ...rows,
.filter((v) => { ]).filter((v) => {
return !res.has(v.id) && res.set(v.id, 1);
})
.filter((v) => {
return this.selectedRowKeys.includes(v.id); return this.selectedRowKeys.includes(v.id);
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment