diff --git a/CHANGELOG.md b/CHANGELOG.md index 676a5698..5a34d90a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # 1.1.3 +**REFACTOR** + +- 重构: 判断vxe-table的复选框是否选中 + **Bug Fixes** - 节点树在编辑 & 空数组(不勾选)情况 勾选节点会造成watch延迟触发 导致会带上父节点id造成id重复 diff --git a/apps/web-antd/package.json b/apps/web-antd/package.json index 4490d136..d303cf5e 100644 --- a/apps/web-antd/package.json +++ b/apps/web-antd/package.json @@ -1,6 +1,6 @@ { "name": "@vben/web-antd", - "version": "1.1.2", + "version": "1.1.3", "homepage": "https://vben.pro", "bugs": "https://github.com/vbenjs/vue-vben-admin/issues", "repository": { diff --git a/apps/web-antd/src/adapter/vxe-table.ts b/apps/web-antd/src/adapter/vxe-table.ts index b4cc88c0..e8735c90 100644 --- a/apps/web-antd/src/adapter/vxe-table.ts +++ b/apps/web-antd/src/adapter/vxe-table.ts @@ -107,6 +107,7 @@ export type * from '@vben/plugins/vxe-table'; /** * 通用的表格复选框是否选中事件 + * @deprecated 使用vxeCheckboxChecked代替 * @param checked 是否选中 * @returns function */ @@ -118,3 +119,14 @@ export function tableCheckboxEvent(checked: Ref) { }; return event; } + +/** + * 判断vxe-table的复选框是否选中 + * @param tableApi api + * @returns boolean + */ +export function vxeCheckboxChecked( + tableApi: ReturnType[1], +) { + return tableApi?.grid?.getCheckboxRecords?.()?.length > 0; +} diff --git a/apps/web-antd/src/layouts/basic.vue b/apps/web-antd/src/layouts/basic.vue index b574fff0..fe2d2122 100644 --- a/apps/web-antd/src/layouts/basic.vue +++ b/apps/web-antd/src/layouts/basic.vue @@ -1,5 +1,5 @@