diff --git a/apps/web-antd/src/components/table-action/table-action.vue b/apps/web-antd/src/components/table-action/table-action.vue index 96d2f5403..3c29d7d93 100644 --- a/apps/web-antd/src/components/table-action/table-action.vue +++ b/apps/web-antd/src/components/table-action/table-action.vue @@ -4,7 +4,7 @@ import type { PropType } from 'vue'; import type { ActionItem, PopConfirm } from './typing'; -import { computed, unref } from 'vue'; +import { computed, unref, watch } from 'vue'; import { useAccess } from '@vben/access'; import { IconifyIcon } from '@vben/icons'; @@ -60,21 +60,20 @@ function isIfShow(action: ActionItem): boolean { /** 处理按钮 actions */ const getActions = computed(() => { - return (props.actions || []).filter((action: ActionItem) => isIfShow(action)); + const actions = props.actions || []; + return actions.filter((action: ActionItem) => isIfShow(action)); }); /** 处理下拉菜单 actions */ const getDropdownList = computed(() => { - return (props.dropDownActions || []).filter((action: ActionItem) => - isIfShow(action), - ); + const dropDownActions = props.dropDownActions || []; + return dropDownActions.filter((action: ActionItem) => isIfShow(action)); }); /** Space 组件的 size */ const spaceSize = computed(() => { - return unref(getActions)?.some((item: ActionItem) => item.type === 'link') - ? 0 - : 8; + const actions = unref(getActions); + return actions?.some((item: ActionItem) => item.type === 'link') ? 0 : 8; }); /** 获取 PopConfirm 属性 */ @@ -137,6 +136,15 @@ function handleButtonClick(action: ActionItem) { action.onClick(); } } + +// 监听props变化,强制重新计算 +watch( + () => [props.actions, props.dropDownActions], + () => { + // 这里不需要额外处理,computed会自动重新计算 + }, + { deep: true }, +); diff --git a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue index f3eb6735a..7b002a206 100644 --- a/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue +++ b/packages/effects/plugins/src/vxe-table/use-vxe-grid.vue @@ -300,7 +300,7 @@ async function init() { const enableProxyConfig = options.value.proxyConfig?.enabled; if (enableProxyConfig && autoLoad) { props.api.grid.commitProxy?.( - '_init', + 'query', formOptions.value ? ((await formApi.getValues()) ?? {}) : {}, ); // props.api.reload(formApi.form?.values ?? {}); diff --git a/playground/src/views/examples/vxe-table/remote.vue b/playground/src/views/examples/vxe-table/remote.vue index 907c1e2cd..7042019fb 100644 --- a/playground/src/views/examples/vxe-table/remote.vue +++ b/playground/src/views/examples/vxe-table/remote.vue @@ -55,7 +55,7 @@ const gridOptions: VxeGridProps = { custom: true, export: true, // import: true, - refresh: { code: 'query' }, + refresh: true, zoom: true, }, }; diff --git a/playground/src/views/system/dept/list.vue b/playground/src/views/system/dept/list.vue index 1b4154d45..13d45a6ee 100644 --- a/playground/src/views/system/dept/list.vue +++ b/playground/src/views/system/dept/list.vue @@ -110,7 +110,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ toolbarConfig: { custom: true, export: false, - refresh: { code: 'query' }, + refresh: true, zoom: true, }, treeConfig: { diff --git a/playground/src/views/system/menu/list.vue b/playground/src/views/system/menu/list.vue index 9ab456448..759dccf6b 100644 --- a/playground/src/views/system/menu/list.vue +++ b/playground/src/views/system/menu/list.vue @@ -44,7 +44,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ toolbarConfig: { custom: true, export: false, - refresh: { code: 'query' }, + refresh: true, zoom: true, }, treeConfig: { diff --git a/playground/src/views/system/role/list.vue b/playground/src/views/system/role/list.vue index b5e383a62..f89228f67 100644 --- a/playground/src/views/system/role/list.vue +++ b/playground/src/views/system/role/list.vue @@ -52,7 +52,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ toolbarConfig: { custom: true, export: false, - refresh: { code: 'query' }, + refresh: true, search: true, zoom: true, }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 149677743..80ef93d30 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -565,11 +565,11 @@ catalogs: specifier: ^0.2.4 version: 0.2.4 vxe-pc-ui: - specifier: ^4.6.42 - version: 4.6.49 + specifier: ^4.7.12 + version: 4.7.15 vxe-table: - specifier: ^4.13.51 - version: 4.13.52 + specifier: ^4.14.4 + version: 4.14.4 watermark-js-plus: specifier: ^1.6.2 version: 1.6.2 @@ -1862,10 +1862,10 @@ importers: version: 3.5.17(typescript@5.8.3) vxe-pc-ui: specifier: 'catalog:' - version: 4.6.49(vue@3.5.17(typescript@5.8.3)) + version: 4.7.15(vue@3.5.17(typescript@5.8.3)) vxe-table: specifier: 'catalog:' - version: 4.13.52(vue@3.5.17(typescript@5.8.3)) + version: 4.14.4(vue@3.5.17(typescript@5.8.3)) devDependencies: '@types/markdown-it': specifier: 'catalog:' @@ -5317,8 +5317,8 @@ packages: '@vueuse/shared@9.13.0': resolution: {integrity: sha512-UrnhU+Cnufu4S6JLCPZnkWh0WwZGUp72ktOF2DFptMlOs3TOdVv8xJN53zhHGARmVOsz5KqOls09+J1NR6sBKw==} - '@vxe-ui/core@4.2.1': - resolution: {integrity: sha512-tfImwvh9vRPEER+VRqPKEqU6lgB8y9u1O7iMC5V+mhJq/iWaJUE3EufSkfg5GQK8vBaceVtea1ydICl0Pr4j7w==} + '@vxe-ui/core@4.2.5': + resolution: {integrity: sha512-K/0ae1VoCaVHZTnV3rUFsQdkwCU6dKjbFVtf0bvVRCYG5v+KrKbvFBSkqdnGT7sDoeotPVjL/WjBbl64RpHs3w==} peerDependencies: vue: ^3.5.17 @@ -11430,11 +11430,11 @@ packages: peerDependencies: vue: ^3.5.17 - vxe-pc-ui@4.6.49: - resolution: {integrity: sha512-VqRmNHTWVUINevIn2vok3cdMFVU3ciGRCBfRFXqXcZHVSfl+z/zl+CxjjU6Orv6xs6XxJlpACY2S1I0PmyknNg==} + vxe-pc-ui@4.7.15: + resolution: {integrity: sha512-kaCiBl9BdKGihVXsL69WMEILtEQVut3ogVEzExYUJaCS5NGWsVkRQo2wQB/sgJxbNjlK7zq5kmgdmxbxNUyVcg==} - vxe-table@4.13.52: - resolution: {integrity: sha512-cP+H2zJNrXiu3PooOWJSh7XisT8Q0/KpjByMKbWlwt4txJrZ0xFdgxr+u+xIcSiO3pbdPAUjg7fJnZgOgFrKYw==} + vxe-table@4.14.4: + resolution: {integrity: sha512-h4KDw8DHZz037kNULSJD2lEiNifAtHNw5XvXSH0Ropk60WK5My1zj9Kb2rX+uU1oGfh75dmv71JzR6V2iWoSUw==} wangeditor@4.7.15: resolution: {integrity: sha512-aPTdREd8BxXVyJ5MI+LU83FQ7u1EPd341iXIorRNYSOvoimNoZ4nPg+yn3FGbB93/owEa6buLw8wdhYnMCJQLg==} @@ -11615,6 +11615,9 @@ packages: xe-utils@3.7.6: resolution: {integrity: sha512-QxASuZUcjEaQ+QQj4DGBupOBvym1F5U0akd3+2gnKrSfk0w9OlLnHslmI4MO4N4jP+8zHcTV5KdKpIBf66hvcg==} + xe-utils@3.7.8: + resolution: {integrity: sha512-V/k6B/ASYir6yLYhp62DnM17po9u1N9mou/rn4if5WoFCsAO49JpCiVpkDpwCv4zxGfWmhWgzmz4FytWF+pDVw==} + xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} @@ -15493,11 +15496,11 @@ snapshots: - '@vue/composition-api' - vue - '@vxe-ui/core@4.2.1(vue@3.5.17(typescript@5.8.3))': + '@vxe-ui/core@4.2.5(vue@3.5.17(typescript@5.8.3))': dependencies: dom-zindex: 1.0.6 vue: 3.5.17(typescript@5.8.3) - xe-utils: 3.7.6 + xe-utils: 3.7.8 '@whatwg-node/disposablestack@0.0.6': dependencies: @@ -22300,15 +22303,15 @@ snapshots: vooks: 0.2.12(vue@3.5.17(typescript@5.8.3)) vue: 3.5.17(typescript@5.8.3) - vxe-pc-ui@4.6.49(vue@3.5.17(typescript@5.8.3)): + vxe-pc-ui@4.7.15(vue@3.5.17(typescript@5.8.3)): dependencies: - '@vxe-ui/core': 4.2.1(vue@3.5.17(typescript@5.8.3)) + '@vxe-ui/core': 4.2.5(vue@3.5.17(typescript@5.8.3)) transitivePeerDependencies: - vue - vxe-table@4.13.52(vue@3.5.17(typescript@5.8.3)): + vxe-table@4.14.4(vue@3.5.17(typescript@5.8.3)): dependencies: - vxe-pc-ui: 4.6.49(vue@3.5.17(typescript@5.8.3)) + vxe-pc-ui: 4.7.15(vue@3.5.17(typescript@5.8.3)) transitivePeerDependencies: - vue @@ -22590,6 +22593,8 @@ snapshots: xe-utils@3.7.6: {} + xe-utils@3.7.8: {} + xml-name-validator@4.0.0: {} y18n@4.0.3: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 8466b7615..59d652674 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -204,8 +204,8 @@ catalog: vue-router: ^4.5.1 vue-tippy: ^6.7.1 vue-tsc: 2.2.10 - vxe-pc-ui: ^4.6.42 - vxe-table: ^4.13.51 + vxe-pc-ui: ^4.7.12 + vxe-table: ^4.14.4 watermark-js-plus: ^1.6.2 zod: ^3.25.67 zod-defaults: ^0.1.3