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'] = [