feat: 样式统一 + 月份下拉框扩展

- 品牌色统一为天机阁标准 #4A6CF7,tailwind.config 扩展完整色阶
- styles.css 新增 :root CSS 变量层(brand 色阶、语义色、圆角/阴影 token)
- 全项目 hex/Tailwind 类统一替换为 brand-* CSS 变量(115 处引用)
- border-radius/box-shadow 统一使用 token 变量
- 预留 :root[data-theme="dark"] 暗色主题变量占位
- 所有月份下拉框范围从 3 年/15 月扩展至 2020-2027(8 年 96 月)
This commit is contained in:
mac
2026-07-13 16:34:53 +08:00
parent 89810942cd
commit f619ed34a7
15 changed files with 209 additions and 149 deletions

View File

@@ -86,7 +86,7 @@ function renderHome() {
const sign = pct >= 0 ? '+' : '';
return '<span class="' + cls + '">' + sign + pct + '%</span>';
};
const COLORS = ['text-slate-700','text-blue-600','text-green-600','text-rose-600','text-indigo-600','text-amber-600','text-purple-600','text-cyan-600'];
const COLORS = ['text-slate-700','text-brand-600','text-green-600','text-rose-600','text-indigo-600','text-amber-600','text-purple-600','text-cyan-600'];
const LABELS = ['合同金额','确收金额','确收毛利','成本','项目利润','回款金额','已付','现金流'];
const Q_FIELDS = [m.signed_q2||0, m.revenue_q2, m.gross_q2, m.cost_q2||0, m.profit_q2||0, m.payment_q2||0, m.paid_q2||0, m.cashflow_q2||0];
const Q_PREV = [m.signed_prev_q||0, m.revenue_prev_q||0, m.gross_prev_q||0, m.cost_prev_q||0, m.profit_prev_q||0, m.payment_prev_q||0, m.paid_prev_q||0, m.cashflow_prev_q||0];
@@ -212,7 +212,7 @@ function renderCharts(data) {
state.chart2 = new Chart(c2, {
type: "line",
data: { labels, datasets: [
{ label: "确收", data: data.map((x) => x.revenue || 0), borderColor: "#2563eb", backgroundColor: "rgba(37,99,235,0.06)", fill: true, tension: 0.3 },
{ label: "确收", data: data.map((x) => x.revenue || 0), borderColor: "var(--brand-600)", backgroundColor: "rgba(37,99,235,0.06)", fill: true, tension: 0.3 },
{ label: "毛利", data: data.map((x) => x.gross || 0), borderColor: "#059669", backgroundColor: "rgba(5,150,105,0.06)", fill: true, tension: 0.3 },
]},
options: baseOpts,