refactor(ecom-dmb): 导出服务重构,ExportServiceImpl拆分为独立服务类,抽取ExportFilenameUtils统一文件名构建

This commit is contained in:
小蟑螂
2026-04-28 14:02:29 +08:00
parent 455f10beed
commit 57fe400dee
21 changed files with 979 additions and 831 deletions
@@ -232,7 +232,7 @@ const handleExportShopOverview = async () => {
exportLoading.value = true;
const shopName = overviewData.value?.shopName || `店铺${shopId.value}`;
const [startDate, endDate] = dateRange.value;
const filename = `${shopName}_概览_${startDate.format('YYYYMMDD')}_${endDate.format('YYYYMMDD')}.xlsx`;
const filename = `${shopName}_概览_${startDate.format('YYYYMMDD')}-${endDate.format('YYYYMMDD')}.xlsx`;
await exportByPost(
'/ec/shop/export-overview',
{
@@ -270,7 +270,12 @@ const handleCategoryExport = async () => {
if (selectedExportCategoryIds.value.length > 0) {
params.categoryIds = selectedExportCategoryIds.value;
}
await exportByPost('/ec/shop/export-category', params, '门店品类汇总.xlsx');
const [catStart, catEnd] = dateRange.value;
await exportByPost(
'/ec/shop/export-category',
params,
`门店品类汇总_${catStart.format('YYYYMMDD')}-${catEnd.format('YYYYMMDD')}.xlsx`,
);
} finally {
categoryExportLoading.value = false;
}