diff --git a/framework/sdk-parent/frontend/src/components/table/MsTable.vue b/framework/sdk-parent/frontend/src/components/table/MsTable.vue index ab711582ac..3813ca0152 100644 --- a/framework/sdk-parent/frontend/src/components/table/MsTable.vue +++ b/framework/sdk-parent/frontend/src/components/table/MsTable.vue @@ -341,6 +341,9 @@ export default { }); } }, + pageSize() { + this.clear(); + }, selectDataCounts(value) { this.$emit("selectCountChange", value); }, @@ -417,7 +420,7 @@ export default { this.selectRows, this.condition ); - setUnSelectIds(this.data, this.condition, this.selectRows); + setUnSelectIds(selection, this.condition, this.selectRows); this.selectDataCounts = getSelectDataCounts( this.condition, this.total, @@ -447,8 +450,6 @@ export default { }, isSelectDataAll(data) { this.condition.selectAll = data; - //设置勾选 - toggleAllSelection(this.$refs.table, this.data, this.selectRows); //显示隐藏菜单 _handleSelectAll(this, this.data, this.data, this.selectRows); //设置未选择ID(更新) diff --git a/framework/sdk-parent/frontend/src/utils/tableUtils.js b/framework/sdk-parent/frontend/src/utils/tableUtils.js index 1d882997f0..0a9cd15324 100644 --- a/framework/sdk-parent/frontend/src/utils/tableUtils.js +++ b/framework/sdk-parent/frontend/src/utils/tableUtils.js @@ -10,18 +10,20 @@ import {CUSTOM_FIELD_TYPE_OPTION, SYSTEM_FIELD_NAME_MAP} from "./table-constants import {generateColumnKey} from "../components/search/custom-component"; export function _handleSelectAll(component, selection, tableData, selectRows, condition) { + selectRows.clear(); if (selection.length > 0) { + selection.forEach((item) => { + selectRows.add(item); + }); if (selection.length === 1) { selection.hashTree = []; tableData.forEach((item) => { component.$set(item, "showMore", true); - selectRows.add(item); }); } else { tableData.forEach((item) => { item.hashTree = []; component.$set(item, "showMore", true); - selectRows.add(item); }); } } else { @@ -83,8 +85,8 @@ export function getSelectDataCounts(condition, total, selectRows) { // 全选操作 export function toggleAllSelection(table, tableData, selectRows) { //如果已经全选,不需要再操作了 - if (selectRows.size != tableData.length) { - table.toggleAllSelection(true); + if (selectRows.size !== tableData.length) { + table.toggleAllSelection(); } }