fix: 季度视图跳过逻辑 + 筛选区字号 + 首页去筛选

- 季度视图与月度视图统一:无当期数据项目跳过不渲染
- 首页去除时间段筛选下拉框
- 业务/平台费用/首页筛选区文字加大一号(text-xs→text-sm)
- 业务视图不记忆上次选择,默认总视图
- seed数据重构,5工作台各>1亿
- 版本号v1.0.0.4
This commit is contained in:
mac
2026-07-07 18:01:04 +08:00
parent ec140bf105
commit a6acfb2012
6 changed files with 277 additions and 121 deletions

View File

@@ -105,15 +105,14 @@ function renderHome() {
}
document.querySelector("#home").innerHTML = `
<div class="grid gap-5">
<div class="flex items-center gap-2">
<span class="text-xs text-slate-500">筛选:</span>
<select id="homeFilter" class="text-xs font-medium py-1.5 px-3 rounded border border-slate-200 bg-white cursor-pointer" onchange="renderHomeCards()" style="appearance:none;-webkit-appearance:none;padding-right:28px;background:url(&apos;data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2212%22 height=%2212%22 viewBox=%220 0 24 24%22 fill=%22none%22 stroke=%22%236b7280%22 stroke-width=%222%22 stroke-linecap=%22round%22 stroke-linejoin=%22round%22%3E%3Cpolyline points=%226 9 12 15 18 9%22%3E%3C/polyline%3E%3C/svg%3E&apos;) no-repeat right 8px center">
<option value="all">全部时间</option>
<option value="year">本年度</option>
<option value="quarter">本季度</option>
<option value="month">本月</option>
</select>
</div>
${state.tenant === "总工作台" ? "" : `<div class="grid grid-cols-4 gap-3">
${[
["项目管理", m.total_projects, "finance"],
["重点工作与台账", m.total_proposals, "projects"],
["业务方案", m.total_products, "proposals"],
["产品迭代", m.upcoming_products, "products"],
].map(([label, value, tab]) => `<button class="metric-card" onclick="switchTab('${tab}')"><span class="flex items-center gap-2 text-xs text-slate-500"><i data-lucide="gauge"></i>${label}</span><strong class="mt-2 block text-2xl">${value}</strong></button>`).join("")}
</div>`}
${card(`<h3 class="text-sm font-bold text-slate-700 mb-3">部门经营情况</h3><div class="overflow-x-auto"><table class="w-full text-sm"><thead><tr class="border-b border-slate-200"><th class="py-2 text-left text-slate-500">指标</th><th class="py-2 text-right font-semibold text-slate-700">年度累计</th><th class="py-2 text-right font-semibold text-slate-700">上季度累计</th><th class="py-2 text-right font-semibold text-slate-700">上月累计</th><th class="py-2 text-right font-semibold text-slate-700">本季度累计</th><th class="py-2 text-right font-semibold text-slate-400">季环比</th><th class="py-2 text-right font-semibold text-slate-700">本月累计</th><th class="py-2 text-right font-semibold text-slate-400">月环比</th></tr></thead><tbody>
${(() => {
var d = [