From b03ad8608c689170188ce04486cd5cdf655b3d54 Mon Sep 17 00:00:00 2001 From: ah--desktop Date: Thu, 26 Mar 2026 21:25:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B0=83=E6=95=B4=E6=A6=82=E8=A7=88?= =?UTF-8?q?=E9=A1=B5=E8=A1=A8=E5=A4=B4=E5=AD=97=E4=BD=93=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/company-overview/index.vue | 31 ++++++++++++----- .../views/ecommerce/shop/overview/index.vue | 33 +++++++++++++------ 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue index cdf08963..a3c70cf8 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/dashboard/company-overview/index.vue @@ -15,9 +15,9 @@ import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; import { Button, DatePicker, message, Spin } from 'ant-design-vue'; import dayjs from 'dayjs'; -import { exportByPost } from '#/utils/export'; import { getCompanyOverviewApi } from '#/api/ecommerce/company-overview'; import { getShopPageApi } from '#/api/ecommerce/shop'; +import { exportByPost } from '#/utils/export'; defineOptions({ name: 'CompanyOverview' }); @@ -102,11 +102,17 @@ const handleCustomDateRangeChange = ( } }; -const setTimeRangeTypeByDates = (startDate: dayjs.Dayjs, endDate: dayjs.Dayjs) => { +const setTimeRangeTypeByDates = ( + startDate: dayjs.Dayjs, + endDate: dayjs.Dayjs, +) => { const today = dayjs(); const daysDiff = endDate.diff(startDate, 'day'); const isEndDateToday = endDate.isSame(today, 'day'); - const isStartDate7DaysAgo = startDate.isSame(dayjs().subtract(7, 'day'), 'day'); + const isStartDate7DaysAgo = startDate.isSame( + dayjs().subtract(7, 'day'), + 'day', + ); const isStartDate30DaysAgo = startDate.isSame( dayjs().subtract(30, 'day'), 'day', @@ -449,9 +455,16 @@ const handleExportCompanyOverview = async () => { exportLoading.value = true; const [startDate, endDate] = dateRange.value; const filename = `公司概览_${startDate.format('YYYYMMDD')}_${endDate.format('YYYYMMDD')}.xlsx`; - await exportByPost('/ec/company-overview/export', { - dateRange: [startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD')], - }, filename); + await exportByPost( + '/ec/company-overview/export', + { + dateRange: [ + startDate.format('YYYY-MM-DD'), + endDate.format('YYYY-MM-DD'), + ], + }, + filename, + ); } finally { exportLoading.value = false; } @@ -734,12 +747,12 @@ const handleExportCompanyOverview = async () => { @@ -768,7 +781,7 @@ const handleExportCompanyOverview = async () => { 盈利分析维度 - + diff --git a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue index 8ac6ea8c..bbc0e007 100644 --- a/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue +++ b/ecom-dmb-frontend/apps/web-antd/src/views/ecommerce/shop/overview/index.vue @@ -12,8 +12,8 @@ import { EchartsUI, useEcharts } from '@vben/plugins/echarts'; import { Button, DatePicker, message, Spin } from 'ant-design-vue'; import dayjs from 'dayjs'; -import { exportByPost } from '#/utils/export'; import { getShopOverviewStatisticsApi } from '#/api/ecommerce/shop'; +import { exportByPost } from '#/utils/export'; defineOptions({ name: 'ShopOverview' }); @@ -101,11 +101,17 @@ const handleCustomDateRangeChange = ( } }; -const setTimeRangeTypeByDates = (startDate: dayjs.Dayjs, endDate: dayjs.Dayjs) => { +const setTimeRangeTypeByDates = ( + startDate: dayjs.Dayjs, + endDate: dayjs.Dayjs, +) => { const today = dayjs(); const daysDiff = endDate.diff(startDate, 'day'); const isEndDateToday = endDate.isSame(today, 'day'); - const isStartDate7DaysAgo = startDate.isSame(dayjs().subtract(7, 'day'), 'day'); + const isStartDate7DaysAgo = startDate.isSame( + dayjs().subtract(7, 'day'), + 'day', + ); const isStartDate30DaysAgo = startDate.isSame( dayjs().subtract(30, 'day'), 'day', @@ -232,10 +238,17 @@ const handleExportShopOverview = async () => { const shopName = overviewData.value?.shopName || `店铺${shopId.value}`; const [startDate, endDate] = dateRange.value; const filename = `${shopName}_概览_${startDate.format('YYYYMMDD')}_${endDate.format('YYYYMMDD')}.xlsx`; - await exportByPost('/ec/shop/export-overview', { - shopId: shopId.value, - dateRange: [startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD')], - }, filename); + await exportByPost( + '/ec/shop/export-overview', + { + shopId: shopId.value, + dateRange: [ + startDate.format('YYYY-MM-DD'), + endDate.format('YYYY-MM-DD'), + ], + }, + filename, + ); } finally { exportLoading.value = false; } @@ -746,12 +759,12 @@ onActivated(async () => {
店铺名称
目标单量 单量达成率
@@ -774,7 +787,7 @@ onActivated(async () => { 单品损益 (Profitability) - +
商品详情
销售额 单量