fix: 年份动态计算 + 首页布局优化
- 后端所有硬编码2026替换为date.today().year动态计算 - 首页移除4个快捷跳转卡片 - 首页新增时间段筛选下拉框 - 版本号更新至v1.0.0.3
This commit is contained in:
@@ -105,14 +105,15 @@ function renderHome() {
|
||||
}
|
||||
document.querySelector("#home").innerHTML = `
|
||||
<div class="grid gap-5">
|
||||
${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>`}
|
||||
<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('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') no-repeat right 8px center">
|
||||
<option value="all">全部时间</option>
|
||||
<option value="year">本年度</option>
|
||||
<option value="quarter">本季度</option>
|
||||
<option value="month">本月</option>
|
||||
</select>
|
||||
</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 = [
|
||||
|
||||
Reference in New Issue
Block a user