From 6531523c57b497edefb3674f6a4dfe4fb401eaba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=9F=91=E8=9E=82?= Date: Fri, 22 May 2026 21:11:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B7=A5=E4=BD=9C=E5=8F=B0=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=BA=97=E9=93=BA=E5=92=8C=E5=95=86=E5=93=81=E9=A1=B5?= =?UTF-8?q?=E5=B8=A6=E4=B8=8A=E6=97=A5=E6=9C=9F=E8=8C=83=E5=9B=B4=E5=8F=82?= =?UTF-8?q?=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web-antd/src/utils/overview-date-range.ts | 11 ++++++++++ .../views/dashboard/store-overview/index.vue | 6 ++---- .../src/views/dashboard/workbench/index.vue | 18 +++++++++++++++-- .../components/CategoryComparisonTable.vue | 20 ++++++++++++++++++- .../finance/components/OverviewTables.vue | 5 +++-- .../workbench/tabs/finance/index.vue | 2 ++ 6 files changed, 53 insertions(+), 9 deletions(-) diff --git a/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts b/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts index df58459a..71839db4 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts +++ b/ecom-dmb-frontend/apps/web-antd/src/utils/overview-date-range.ts @@ -46,6 +46,17 @@ export function normalizeOverviewRangePickerChange( const START_Q = 'startDate'; const END_Q = 'endDate'; +/** 概览页跳转(店铺/商品)时附带的 query,与全店概览一致 */ +export function buildOverviewRouteQuery(dateRange: [Dayjs, Dayjs]): { + startDate: string; + endDate: string; +} { + return { + startDate: dateRange[0].format('YYYY-MM-DD'), + endDate: dateRange[1].format('YYYY-MM-DD'), + }; +} + /** 从当前地址栏读取概览日期 query(含 replaceState 写入、未反映到 Vue Router 的情况) */ export function getOverviewDateQueryFromLocation(): { startDate: string; diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/index.vue index 998d2d57..d2a8233d 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/store-overview/index.vue @@ -23,6 +23,7 @@ import { getCompanyOverviewApi } from '#/api/ecommerce/store-overview/apis'; import { exportByPost } from '#/utils/export'; import { applyOverviewDateRangeFromUrl, + buildOverviewRouteQuery, normalizeOverviewRangePickerChange, syncOverviewDateRangeToUrl, } from '#/utils/overview-date-range'; @@ -410,10 +411,7 @@ const handlePlatformExport = async () => { const navigateToShopOverview = (shopId: number) => { router.push({ path: `/ecom/shop/overview/${shopId}`, - query: { - startDate: dateRange.value[0].format('YYYY-MM-DD'), - endDate: dateRange.value[1].format('YYYY-MM-DD'), - }, + query: buildOverviewRouteQuery(dateRange.value), }); }; diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue index eea75341..d1bad7c1 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/index.vue @@ -15,7 +15,10 @@ import type { ShopVO } from '#/api/ecommerce/shop/types'; import { getWorkbenchSummaryApi } from '#/api/ecommerce/workbench/apis'; import type { WorkbenchDTO, WorkbenchVO } from '#/api/ecommerce/workbench/types'; import { $t } from '#/locales'; -import { normalizeOverviewRangePickerChange } from '#/utils/overview-date-range'; +import { + buildOverviewRouteQuery, + normalizeOverviewRangePickerChange, +} from '#/utils/overview-date-range'; import WorkbenchFinanceTab from './tabs/finance/index.vue'; import WorkbenchMultiTab from './tabs/multi/index.vue'; @@ -253,7 +256,17 @@ async function loadShopAndPlatformMeta() { const activeTab = ref('finance'); function handleShopNavigate(shopId: number) { - router.push(`/ecom/shop/overview/${shopId}`); + router.push({ + path: `/ecom/shop/overview/${shopId}`, + query: buildOverviewRouteQuery(dateRange.value), + }); +} + +function handleProductNavigate(productId: number) { + router.push({ + path: `/ecom/product/overview/${productId}`, + query: buildOverviewRouteQuery(dateRange.value), + }); } const financeTabRef = ref | null>( @@ -533,6 +546,7 @@ onUnmounted(() => { :multi-analysis="multiPanel" :summary-tables="summaryTablesPanel" @navigate="handleShopNavigate" + @navigate-product="handleProductNavigate" /> diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/tabs/finance/components/CategoryComparisonTable.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/tabs/finance/components/CategoryComparisonTable.vue index bf8c4f70..302919d4 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/tabs/finance/components/CategoryComparisonTable.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/workbench/tabs/finance/components/CategoryComparisonTable.vue @@ -1,6 +1,7 @@