修复构建冲突:移除本地重复 Panel 定义,清理 .next 缓存,新增终端子组件模块

This commit is contained in:
2569718930@qq.com
2026-05-25 03:23:10 +08:00
parent 54b03321cb
commit 89497bdf69
6 changed files with 921 additions and 589 deletions
@@ -0,0 +1,29 @@
import type { ScanOpportunityRow } from "@/lib/dashboard-types";
export function rowName(row?: ScanOpportunityRow | null) {
return row?.city_display_name || row?.display_name || row?.city || "--";
}
export function pct(value: unknown, digits = 1) {
const n = Number(value);
if (!Number.isFinite(n)) return "--";
return `${(Math.abs(n) <= 1 ? n * 100 : n).toFixed(digits)}%`;
}
export function money(value: unknown) {
const n = Number(value);
if (!Number.isFinite(n)) return "--";
return `$${Math.round(n).toLocaleString()}`;
}
export function temp(value: unknown, unit?: string | null) {
const n = Number(value);
if (!Number.isFinite(n)) return "--";
return `${n.toFixed(1)}${unit || "°"}`;
}
export function edgeClass(value: unknown) {
const n = Number(value);
if (!Number.isFinite(n) || n === 0) return "text-slate-500";
return n > 0 ? "text-emerald-600" : "text-rose-600";
}