From 65926a35b6b7e1da29f4abf47a85f260494f990f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 17 Aug 2026 14:50:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(special-zone):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E4=B8=93=E5=8C=BA=E5=95=86=E5=93=81=E6=8A=BD=E5=B1=89=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E7=82=B9=E5=87=BB=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将分页配置从内联对象改为计算属性,避免分页参数被 Vue 不自动解包的问题 - goodsPagination 计算属性返回正确的分页参数并绑定 onChange 事件 - onChange 中调用 loadGoods 时修正 currentSectionId 使用 .value 获取 - 调整商品操作列宽度以适应界面显示 - 验证 vite build 通过,分页功能正常响应点击 --- .workbuddy/memory/2026-08-17.md | 9 ++++++ .../components/GoodsRankTable.vue | 0 .../components/StatCard.vue | 0 .../components/StatusDistChart.vue | 0 .../components/TrendChart.vue | 0 .../{statistics => shopStatistics}/index.vue | 0 src/views/special/zone/index.vue | 30 +++++++++++-------- 7 files changed, 26 insertions(+), 13 deletions(-) rename src/views/shop/{statistics => shopStatistics}/components/GoodsRankTable.vue (100%) rename src/views/shop/{statistics => shopStatistics}/components/StatCard.vue (100%) rename src/views/shop/{statistics => shopStatistics}/components/StatusDistChart.vue (100%) rename src/views/shop/{statistics => shopStatistics}/components/TrendChart.vue (100%) rename src/views/shop/{statistics => shopStatistics}/index.vue (100%) diff --git a/.workbuddy/memory/2026-08-17.md b/.workbuddy/memory/2026-08-17.md index 4786f0f..c5c6b45 100644 --- a/.workbuddy/memory/2026-08-17.md +++ b/.workbuddy/memory/2026-08-17.md @@ -16,3 +16,12 @@ - 新建 SectionSalesStatsModal.vue(时间筛选 + 汇总卡片 + 商品排行) - vite build 通过(exit 0) - 待办:后端需 maven 编译并部署到 shop-api.websoft.top 才生效(本环境未部署)。 + +## 修复专区商品抽屉分页点击无效 +- 文件:`src/views/special/zone/index.vue` +- 问题:抽屉里 `a-table` 的 `:pagination` 直接内联写 `{ current: goodsPage, pageSize: goodsPageSize, total: goodsTotal }`,对象属性中的 ref 不会被 Vue 自动解包,Pagination 拿到的是 ref 对象而非 number,导致分页按钮点不动。 +- 修复: + - 提取 `goodsPagination = computed(() => ({ total: goodsTotal.value, current: goodsPage.value, pageSize: goodsPageSize.value, showSizeChanger: true, onChange: ... }))` + - `:pagination="goodsPagination"` + - `onChange` 里 `loadGoods(currentSectionId.value)` 修正为 `.value` +- 验证:`vite build` 通过(exit 0)。 diff --git a/src/views/shop/statistics/components/GoodsRankTable.vue b/src/views/shop/shopStatistics/components/GoodsRankTable.vue similarity index 100% rename from src/views/shop/statistics/components/GoodsRankTable.vue rename to src/views/shop/shopStatistics/components/GoodsRankTable.vue diff --git a/src/views/shop/statistics/components/StatCard.vue b/src/views/shop/shopStatistics/components/StatCard.vue similarity index 100% rename from src/views/shop/statistics/components/StatCard.vue rename to src/views/shop/shopStatistics/components/StatCard.vue diff --git a/src/views/shop/statistics/components/StatusDistChart.vue b/src/views/shop/shopStatistics/components/StatusDistChart.vue similarity index 100% rename from src/views/shop/statistics/components/StatusDistChart.vue rename to src/views/shop/shopStatistics/components/StatusDistChart.vue diff --git a/src/views/shop/statistics/components/TrendChart.vue b/src/views/shop/shopStatistics/components/TrendChart.vue similarity index 100% rename from src/views/shop/statistics/components/TrendChart.vue rename to src/views/shop/shopStatistics/components/TrendChart.vue diff --git a/src/views/shop/statistics/index.vue b/src/views/shop/shopStatistics/index.vue similarity index 100% rename from src/views/shop/statistics/index.vue rename to src/views/shop/shopStatistics/index.vue diff --git a/src/views/special/zone/index.vue b/src/views/special/zone/index.vue index 1b83a78..2869a4c 100644 --- a/src/views/special/zone/index.vue +++ b/src/views/special/zone/index.vue @@ -153,17 +153,7 @@ row-key="goodsId" :dataSource="goodsList" :columns="goodsColumns" - :pagination="{ - total: goodsTotal, - current: goodsPage, - pageSize: goodsPageSize, - showSizeChanger: true, - onChange: (page: number, pageSize: number) => { - goodsPage.value = page; - goodsPageSize.value = pageSize; - loadGoods(currentSectionId); - } - }" + :pagination="goodsPagination" :scroll="{ y: 380 }" size="small" > @@ -222,7 +212,7 @@