From dfb790e713de55178515b7ff02890e7970f0d203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E9=A6=99=E7=90=AA?= <624506849@qq.com> Date: Sun, 13 Sep 2026 17:06:41 +0800 Subject: [PATCH] =?UTF-8?q?refactor(distribution):=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E5=BF=85=E8=A6=81=E7=9A=84=E6=97=B6=E9=97=B4=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=9E=84=E5=BB=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 删除 buildQueryParams 方法及相关的 startTime 和 endTime 参数,简化数据查询逻辑 - 更新 loadOverviewData 和 loadBehavior 方法,直接调用 getDistributionOverviewV2,无需构建额外的查询参数 - 优化代码结构,提高可读性和维护性 --- manager/src/views/statistics/distribution.vue | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/manager/src/views/statistics/distribution.vue b/manager/src/views/statistics/distribution.vue index b0f50807..4c1880c8 100644 --- a/manager/src/views/statistics/distribution.vue +++ b/manager/src/views/statistics/distribution.vue @@ -243,8 +243,6 @@ export default { year: item.year || "", month: item.month || "", storeId: item.storeId || "", - startTime: item.startTime || "", - endTime: item.endTime || "", }; }, onTabChange(name) { @@ -254,12 +252,6 @@ export default { this.loadGoods(); } }, - buildQueryParams() { - return { - startTime: this.params.startTime || "", - endTime: this.params.endTime || "", - }; - }, formatNumber(val) { if (val == null || val === "") return 0; const num = Number(val); @@ -271,12 +263,11 @@ export default { }, async loadOverviewData() { const query = { ...this.params }; - const v2Query = this.buildQueryParams(); const [overviewRes, distributorRes, goodsRes, overviewV2Res] = await Promise.all([ API_Statistics.getDistributionOverview(query), API_Statistics.getDistributionRankDistributor(query), API_Statistics.getDistributionRankGoods(query), - getDistributionOverviewV2(v2Query), + getDistributionOverviewV2(), ]); if (overviewRes && overviewRes.success) { this.overview = overviewRes.result || {}; @@ -294,7 +285,6 @@ export default { loadBehavior() { this.behaviorLoading = true; getDistributionBehaviorV2({ - ...this.buildQueryParams(), pageNumber: this.behaviorPage.pageNumber, pageSize: this.behaviorPage.pageSize, }).then((res) => { @@ -312,7 +302,6 @@ export default { loadGoods() { this.goodsLoading = true; getDistributionGoodsV2({ - ...this.buildQueryParams(), pageNumber: this.goodsPage.pageNumber, pageSize: this.goodsPage.pageSize, }).then((res) => {