陆运产品价无费名时默认陆运费;看板指标与工单列表共用起止日,趋势按日铺点。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
linmianxun
2026-10-12 14:57:27 +08:00
co-authored by Cursor
parent 739ba401aa
commit 428548c390
10 changed files with 219 additions and 44 deletions
@@ -56,11 +56,15 @@ const activePoint = ref<string | null>(null);
const INQUIRY_PLOT_TOP = 36;
const INQUIRY_PLOT_BOTTOM = 188;
/**
* 粗粒度 range 仅作后端无 dateFrom/dateTo 时的回退;正式请求一律带显式日期。
* 注意:不可再把「单日」映射成 today——today 是日历今天,不是所选那一天。
*/
function resolveRange(): string {
const from = new Date(dateFrom.value);
const to = new Date(dateTo.value);
const days = Math.max(0, Math.round((to.getTime() - from.getTime()) / 86400000));
if (days <= 0) return "today";
if (days <= 0) return "1d";
if (days <= 6) return "7d";
return "30d";
}
@@ -88,7 +92,12 @@ function onDateRangeChange() {
async function loadMetrics() {
loading.value = true;
try {
const res: any = await getDashboardMetrics(resolveRange());
const req = {
range: resolveRange(),
dateFrom: dateFrom.value,
dateTo: dateTo.value,
};
const res: any = await getDashboardMetrics(req);
const data = res?.result || res || {};
todayMetrics.value = (data.metrics || []) as MetricCard[];
inquiryTrend.value = ((data.trend || []) as any[]).map((p) => ({