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) - +
商品详情
销售额 单量