From a58e85e5e3de8705b833ef3b29dd689a0e9728b9 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Mon, 29 Jun 2026 17:58:14 -0700 Subject: [PATCH] fix: issues #IJXOKO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复 ShortcutDateRangePicker 初始化 change 早于 VXE Grid mount 时, 商品排行卡片调用 gridApi.query() 导致 commitProxy 不存在的问题。 影响范围: - apps/web-antd - apps/web-antdv-next - apps/web-ele 验证: - pnpm exec eslint apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue - pnpm -F @vben/web-antd typecheck - pnpm -F @vben/web-antdv-next typecheck - pnpm -F @vben/web-ele typecheck --- .../src/views/mall/statistics/product/modules/rank-card.vue | 5 ++++- .../src/views/mall/statistics/product/modules/rank-card.vue | 5 ++++- .../src/views/mall/statistics/product/modules/rank-card.vue | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue b/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue index ea58c3986..e90d201dd 100644 --- a/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue +++ b/apps/web-antd/src/views/mall/statistics/product/modules/rank-card.vue @@ -28,7 +28,10 @@ const handleDateRangeChange = (times?: [Dayjs, Dayjs]) => { formatDateTime(times[0]) as string, formatDateTime(times[1]) as string, ]; - gridApi.query(); + // ShortcutDateRangePicker 初始化会先触发 change,此时 Grid 可能还没 mount:https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/IJXOKO + if (typeof gridApi.grid?.commitProxy === 'function') { + gridApi.query(); + } }; const columns: VxeTableGridOptions['columns'] = [ diff --git a/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue b/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue index 321ec5b2e..990b01376 100644 --- a/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue +++ b/apps/web-antdv-next/src/views/mall/statistics/product/modules/rank-card.vue @@ -28,7 +28,10 @@ const handleDateRangeChange = (times?: [Dayjs, Dayjs]) => { formatDateTime(times[0]) as string, formatDateTime(times[1]) as string, ]; - gridApi.query(); + // ShortcutDateRangePicker 初始化会先触发 change,此时 Grid 可能还没 mount:https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/IJXOKO + if (typeof gridApi.grid?.commitProxy === 'function') { + gridApi.query(); + } }; const columns: VxeTableGridOptions['columns'] = [ diff --git a/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue b/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue index 0a7e34e74..127dc7173 100644 --- a/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue +++ b/apps/web-ele/src/views/mall/statistics/product/modules/rank-card.vue @@ -28,7 +28,10 @@ const handleDateRangeChange = (times?: [Dayjs, Dayjs]) => { formatDateTime(times[0]) as string, formatDateTime(times[1]) as string, ]; - gridApi.query(); + // ShortcutDateRangePicker 初始化会先触发 change,此时 Grid 可能还没 mount:https://gitee.com/yudaocode/yudao-ui-admin-vben/issues/IJXOKO + if (typeof gridApi.grid?.commitProxy === 'function') { + gridApi.query(); + } }; const columns: VxeTableGridOptions['columns'] = [