mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-23 23:59: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 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 () => {
|
||||
<table class="w-full whitespace-nowrap text-left text-sm">
|
||||
<!-- 表头分组 -->
|
||||
<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>
|
||||
<th
|
||||
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>
|
||||
@@ -768,7 +781,7 @@ const handleExportCompanyOverview = async () => {
|
||||
盈利分析维度
|
||||
</th>
|
||||
</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 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 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 () => {
|
||||
<table class="w-full whitespace-nowrap text-left text-sm">
|
||||
<!-- 分类复合表头 -->
|
||||
<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>
|
||||
<th
|
||||
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>
|
||||
@@ -774,7 +787,7 @@ onActivated(async () => {
|
||||
单品损益 (Profitability)
|
||||
</th>
|
||||
</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 px-6 py-4">单量</th>
|
||||
|
||||
Reference in New Issue
Block a user