mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 02:29:19 +08:00
feat: 调整概览页表头字体大小
This commit is contained in:
@@ -15,9 +15,9 @@ import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
|||||||
import { Button, DatePicker, message, Spin } from 'ant-design-vue';
|
import { Button, DatePicker, message, Spin } from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { exportByPost } from '#/utils/export';
|
|
||||||
import { getCompanyOverviewApi } from '#/api/ecommerce/company-overview';
|
import { getCompanyOverviewApi } from '#/api/ecommerce/company-overview';
|
||||||
import { getShopPageApi } from '#/api/ecommerce/shop';
|
import { getShopPageApi } from '#/api/ecommerce/shop';
|
||||||
|
import { exportByPost } from '#/utils/export';
|
||||||
|
|
||||||
defineOptions({ name: 'CompanyOverview' });
|
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 today = dayjs();
|
||||||
const daysDiff = endDate.diff(startDate, 'day');
|
const daysDiff = endDate.diff(startDate, 'day');
|
||||||
const isEndDateToday = endDate.isSame(today, '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(
|
const isStartDate30DaysAgo = startDate.isSame(
|
||||||
dayjs().subtract(30, 'day'),
|
dayjs().subtract(30, 'day'),
|
||||||
'day',
|
'day',
|
||||||
@@ -449,9 +455,16 @@ const handleExportCompanyOverview = async () => {
|
|||||||
exportLoading.value = true;
|
exportLoading.value = true;
|
||||||
const [startDate, endDate] = dateRange.value;
|
const [startDate, endDate] = dateRange.value;
|
||||||
const filename = `公司概览_${startDate.format('YYYYMMDD')}_${endDate.format('YYYYMMDD')}.xlsx`;
|
const filename = `公司概览_${startDate.format('YYYYMMDD')}_${endDate.format('YYYYMMDD')}.xlsx`;
|
||||||
await exportByPost('/ec/company-overview/export', {
|
await exportByPost(
|
||||||
dateRange: [startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD')],
|
'/ec/company-overview/export',
|
||||||
}, filename);
|
{
|
||||||
|
dateRange: [
|
||||||
|
startDate.format('YYYY-MM-DD'),
|
||||||
|
endDate.format('YYYY-MM-DD'),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
filename,
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
exportLoading.value = false;
|
exportLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -734,12 +747,12 @@ const handleExportCompanyOverview = async () => {
|
|||||||
<table class="w-full whitespace-nowrap text-left text-sm">
|
<table class="w-full whitespace-nowrap text-left text-sm">
|
||||||
<!-- 表头分组 -->
|
<!-- 表头分组 -->
|
||||||
<thead
|
<thead
|
||||||
class="bg-slate-50 text-[11px] font-black uppercase text-slate-500"
|
class="bg-slate-50 text-xs font-black uppercase text-slate-500"
|
||||||
>
|
>
|
||||||
<tr>
|
<tr>
|
||||||
<th
|
<th
|
||||||
rowspan="2"
|
rowspan="2"
|
||||||
class="sticky-col border-b p-6 text-sm font-black text-slate-900 shadow-sm"
|
class="sticky-col border-b p-6 text-base font-black text-slate-900 shadow-sm"
|
||||||
>
|
>
|
||||||
店铺名称
|
店铺名称
|
||||||
</th>
|
</th>
|
||||||
@@ -768,7 +781,7 @@ const handleExportCompanyOverview = async () => {
|
|||||||
盈利分析维度
|
盈利分析维度
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="bg-slate-50/80">
|
<tr class="bg-slate-50/80 text-sm">
|
||||||
<!-- 目标 -->
|
<!-- 目标 -->
|
||||||
<th class="border-b border-l px-6 py-4">目标单量</th>
|
<th class="border-b border-l px-6 py-4">目标单量</th>
|
||||||
<th class="border-b px-6 py-4 text-blue-600">单量达成率</th>
|
<th class="border-b px-6 py-4 text-blue-600">单量达成率</th>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ import { EchartsUI, useEcharts } from '@vben/plugins/echarts';
|
|||||||
import { Button, DatePicker, message, Spin } from 'ant-design-vue';
|
import { Button, DatePicker, message, Spin } from 'ant-design-vue';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
import { exportByPost } from '#/utils/export';
|
|
||||||
import { getShopOverviewStatisticsApi } from '#/api/ecommerce/shop';
|
import { getShopOverviewStatisticsApi } from '#/api/ecommerce/shop';
|
||||||
|
import { exportByPost } from '#/utils/export';
|
||||||
|
|
||||||
defineOptions({ name: 'ShopOverview' });
|
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 today = dayjs();
|
||||||
const daysDiff = endDate.diff(startDate, 'day');
|
const daysDiff = endDate.diff(startDate, 'day');
|
||||||
const isEndDateToday = endDate.isSame(today, '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(
|
const isStartDate30DaysAgo = startDate.isSame(
|
||||||
dayjs().subtract(30, 'day'),
|
dayjs().subtract(30, 'day'),
|
||||||
'day',
|
'day',
|
||||||
@@ -232,10 +238,17 @@ const handleExportShopOverview = async () => {
|
|||||||
const shopName = overviewData.value?.shopName || `店铺${shopId.value}`;
|
const shopName = overviewData.value?.shopName || `店铺${shopId.value}`;
|
||||||
const [startDate, endDate] = dateRange.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', {
|
await exportByPost(
|
||||||
shopId: shopId.value,
|
'/ec/shop/export-overview',
|
||||||
dateRange: [startDate.format('YYYY-MM-DD'), endDate.format('YYYY-MM-DD')],
|
{
|
||||||
}, filename);
|
shopId: shopId.value,
|
||||||
|
dateRange: [
|
||||||
|
startDate.format('YYYY-MM-DD'),
|
||||||
|
endDate.format('YYYY-MM-DD'),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
filename,
|
||||||
|
);
|
||||||
} finally {
|
} finally {
|
||||||
exportLoading.value = false;
|
exportLoading.value = false;
|
||||||
}
|
}
|
||||||
@@ -746,12 +759,12 @@ onActivated(async () => {
|
|||||||
<table class="w-full whitespace-nowrap text-left text-sm">
|
<table class="w-full whitespace-nowrap text-left text-sm">
|
||||||
<!-- 分类复合表头 -->
|
<!-- 分类复合表头 -->
|
||||||
<thead
|
<thead
|
||||||
class="bg-slate-50 text-[10px] font-black uppercase tracking-tighter text-slate-500"
|
class="bg-slate-50 text-xs font-black uppercase tracking-tight text-slate-500"
|
||||||
>
|
>
|
||||||
<tr>
|
<tr>
|
||||||
<th
|
<th
|
||||||
rowspan="2"
|
rowspan="2"
|
||||||
class="sticky-col border-b px-6 py-6 text-sm text-slate-900"
|
class="sticky-col border-b px-6 py-6 text-base font-black text-slate-900"
|
||||||
>
|
>
|
||||||
商品详情
|
商品详情
|
||||||
</th>
|
</th>
|
||||||
@@ -774,7 +787,7 @@ onActivated(async () => {
|
|||||||
单品损益 (Profitability)
|
单品损益 (Profitability)
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="bg-slate-50/80">
|
<tr class="bg-slate-50/80 text-sm">
|
||||||
<!-- 规模 -->
|
<!-- 规模 -->
|
||||||
<th class="border-b border-l px-6 py-4">销售额</th>
|
<th class="border-b border-l px-6 py-4">销售额</th>
|
||||||
<th class="border-b px-6 py-4">单量</th>
|
<th class="border-b px-6 py-4">单量</th>
|
||||||
|
|||||||
Reference in New Issue
Block a user