From 464159121c4c127a4d3675d586156ff6a1ceb346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E7=90=A6?= Date: Sat, 11 Jul 2026 18:08:38 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=B8=9A=E5=8A=A1=E5=91=98=E6=9F=A5?= =?UTF-8?q?=E7=9C=8B=E7=BB=B4=E5=BA=A6=E5=A2=9E=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/salesperson-dashboard/api/index.ts | 31 +- .../components/InactiveStoreWarningList.vue | 140 +++++++ .../components/RegionDistributionChart.vue | 6 +- .../components/StoreAmountRankingList.vue | 202 +++++++++ .../system/salesperson-dashboard/index.vue | 396 ++++++------------ .../utils/periodStorage.ts | 94 +++++ 6 files changed, 583 insertions(+), 286 deletions(-) create mode 100644 apps/web-antd/src/views/system/salesperson-dashboard/components/InactiveStoreWarningList.vue create mode 100644 apps/web-antd/src/views/system/salesperson-dashboard/components/StoreAmountRankingList.vue create mode 100644 apps/web-antd/src/views/system/salesperson-dashboard/utils/periodStorage.ts diff --git a/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts b/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts index 1c3e7d58..5c8a5cad 100644 --- a/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts +++ b/apps/web-antd/src/views/system/salesperson-dashboard/api/index.ts @@ -9,7 +9,8 @@ export type DashboardPeriod = | 'last30days' | 'this_year' | 'last365days' - | 'last_year'; + | 'last_year' + | 'custom'; export type SalespersonDashboardTrendItem = { label: string; @@ -36,6 +37,24 @@ export type SalespersonDashboardRankingItem = { amount?: string; }; +export type SalespersonDashboardStoreAmountItem = { + store_id: number; + name: string; + type: number; + type_label: string; + amount: string; + promoter_nick_name: string; +}; + +export type SalespersonDashboardInactiveStoreItem = { + store_id: number; + name: string; + type: number; + type_label: string; + input_at: number; + promoter_nick_name: string; +}; + export type SalespersonDashboardResult = { period: DashboardPeriod; start_at: number; @@ -58,8 +77,16 @@ export type SalespersonDashboardResult = { region_stats: SalespersonDashboardRegionItem[]; input_ranking: SalespersonDashboardRankingItem[]; amount_ranking: SalespersonDashboardRankingItem[]; + store_amount_ranking: SalespersonDashboardStoreAmountItem[]; + inactive_store_warnings: SalespersonDashboardInactiveStoreItem[]; }; -export async function getSalespersonDashboardApi(params: { period: DashboardPeriod }) { +export type SalespersonDashboardParams = { + period: DashboardPeriod; + start_at?: number; + end_at?: number; +}; + +export async function getSalespersonDashboardApi(params: SalespersonDashboardParams) { return requestClient.get(`${prefix}dashboard`, { params }); } diff --git a/apps/web-antd/src/views/system/salesperson-dashboard/components/InactiveStoreWarningList.vue b/apps/web-antd/src/views/system/salesperson-dashboard/components/InactiveStoreWarningList.vue new file mode 100644 index 00000000..fb6acc09 --- /dev/null +++ b/apps/web-antd/src/views/system/salesperson-dashboard/components/InactiveStoreWarningList.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue b/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue index d0ae9c2a..5d0faebc 100644 --- a/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue +++ b/apps/web-antd/src/views/system/salesperson-dashboard/components/RegionDistributionChart.vue @@ -60,12 +60,8 @@ async function renderChart() { watch( () => props.data, () => renderChart(), - { deep: true, flush: 'post' }, + { deep: true, immediate: true, flush: 'post' }, ); - -watch(showChart, (visible) => { - if (visible) renderChart(); -});