From 8c06f57b04c5a03629bc3afa20dfd556002f6da6 Mon Sep 17 00:00:00 2001 From: guoyuqi Date: Tue, 10 Jan 2023 18:58:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=B1=E4=BF=9D=E5=AD=98=E5=89=8D=E4=B8=80?= =?UTF-8?q?=E9=A1=B5=E8=80=8C=E5=BC=95=E8=B5=B7=E7=9A=84=E5=85=A8=E9=80=89?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021777 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021777 --bug=1021772 --user=郭雨琦 https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001021772 --- .../frontend/src/components/table/MsTable.vue | 7 ++++--- framework/sdk-parent/frontend/src/utils/tableUtils.js | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) 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(); } }