From e1fbb89c6e3225c0e28a1580fd8b95249d2d6994 Mon Sep 17 00:00:00 2001 From: "mula.liu" Date: Thu, 29 Oct 2026 14:21:54 +0800 Subject: [PATCH] =?UTF-8?q?cleanup(web):=20=E5=88=A0=E9=99=A4=E9=9B=B6?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E6=AD=BB=E4=BB=A3=E7=A0=81=EF=BC=9A3=20?= =?UTF-8?q?=E4=B8=AA=E5=87=BD=E6=95=B0=E3=80=813=20=E4=B8=AA=20state=20?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E3=80=816=20=E7=BB=84=E6=AD=BB=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E4=B8=8E=E8=BF=87=E6=97=B6=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - app.js: regionOptions / stackBar / barList(grep 全库零调用) - state: idle / projects / customStage(定义后再无读写,也不在 UI_FIELDS) - styles.css: .board-grid/.pcard*/.svg-chart/.legend/.risk-item 整块删除; b-name .star 选择器收敛(bar-row 系列仍被人员归属卡使用,保留) - 注释纠偏:定制 tab 数量(3 个)、分类筛选器入口现址;README 同步 - node --check 通过 --- README.md | 2 +- web/app.js | 46 +++------------------------------------------- web/styles.css | 24 +----------------------- 3 files changed, 5 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index 4801c23..4546056 100644 --- a/README.md +++ b/README.md @@ -410,7 +410,7 @@ python scripts/legacy/add_entry_date.py --force # 全部重算 - **表格防竖排**:`table.tbl th` / `.pill` / `.tag-mini` 统一 `white-space:nowrap`,容易挤窄的列(区域、负责人)在 `` 上加 `class="nowrap"`;实在挤不下交给 `.tbl-wrap { overflow:auto }` 横向滚动。 - **抽屉不被内容撑破**:`.form-row > div { min-width: 0 }`(grid 子项默认 `min-width:auto`,会被交付环节步骤条撑出整表横向滚动),步骤条本身 `flex:1 1 132px`(132px = 日期输入框含日历图标的最小可用宽度)。 -> 备注:`styles.css` 里的 `.pcard`、`.board-grid` 当前没有任何 JS 引用(历史遗留样式),此处只做记录,未删除。 +> 备注:历史遗留的 `.pcard`、`.board-grid`、`.svg-chart`、`.legend`、`.risk-item` 等零引用样式已随死代码清理删除(2026-10-29)。 ## 数据导出 diff --git a/web/app.js b/web/app.js index c41c207..ec64f47 100644 --- a/web/app.js +++ b/web/app.js @@ -12,23 +12,20 @@ monthIdx: null, categoryId: null, keyword: "", - idle: "key", showArchived: false, meta: null, periods: null, categories: [], - projects: [], drawerProject: null, // 详情抽屉:周期反馈的显示粒度 / 范围 / 往前翻页偏移 dw: { group: "week", range: 2, back: 0 }, // 定制项目 customMeta: null, finance: null, // /custom/finance 汇总:统计条与年度任务的唯一数据源 - // 定制:项目明细 / 本周进展 两个 tab(原交付流水线 / 阶段看板 / 财务跟踪已下线) + // 定制:项目总览 / 本周进展 / 年度任务 三个 tab customTab: "list", customAnnualEdit: false, // 年度任务:默认查看模式,点「编辑」才可改 customRegion: "", - customStage: "", customStatus: "", customRisk: "", customOrigin: "", @@ -592,22 +589,6 @@ return `${esc(cat.name)}`; } - /** 规范省级行政区下拉(按大区分组)。selected 不在标准列表时补一个选项,避免丢值。 */ - function regionOptions(selected, withEmpty) { - const groups = (state.customMeta && state.customMeta.region_groups) || []; - const all = groups.reduce((acc, g) => acc.concat(g.regions), []); - let html = withEmpty === false ? "" : ``; - for (const g of groups) { - html += `` + - g.regions.map((r) => ``).join("") + - ``; - } - if (selected && all.indexOf(selected) < 0) { - html += ``; - } - return html; - } - /** 触发浏览器下载(导出 Excel) */ function download(url) { const a = document.createElement("a"); @@ -821,27 +802,6 @@ return note ? `${Ico.svg("alert")}${esc(note)}` : ""; } - /* ---------------------------------------------------------------- charts */ - function stackBar(items) { - const total = items.reduce((a, b) => a + b.count, 0) || 1; - let x = 0, segs = ""; - items.filter((i) => i.count > 0).forEach((d) => { - const w = (d.count / total) * 100; - segs += `${esc(d.name)}: ${d.count}`; - x += w; - }); - return `${segs}`; - } - - function barList(rows) { - return rows.map((r) => ` -
-
${r.is_key ? starMark(true) + " " : ""}${esc(r.name)}
-
-
${r.progress}${r.estimated ? "*" : ""}
-
`).join(""); - } - /* ---------------------------------------------------------------- periods */ /** 新建周期:只填「9月第1周」,年份自动接在最新周期之后(也支持写全年份) */ function createNewPeriod() { @@ -1687,7 +1647,7 @@ `; const chips = ``; - // 原来挂在左侧菜单栏的分类筛选器,收进卡头,能力不变 + // 分类筛选器在卡头 const catFilter = `