From 386e1ad624d19b689f0e81dc2aa4493ea393409a Mon Sep 17 00:00:00 2001 From: lianjianwei2024 <168657369+lianjianwei2024@users.noreply.github.com> Date: Fri, 30 Oct 2026 12:39:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=86=B3=E7=AD=96240/241=E2=80=94?= =?UTF-8?q?=E2=80=94=E5=AD=90=E7=BA=A7=E5=B7=A5=E6=96=99=E6=9C=BA=E4=BA=8C?= =?UTF-8?q?=E6=AC=A1=E5=90=88=E5=B9=B6=E8=A7=86=E9=87=8E=E4=B8=8E=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E8=B4=AF=E9=80=9A=E3=80=81AdminCost=20=E5=B0=81?= =?UTF-8?q?=E5=AD=98=E5=8F=8A=E5=8F=B0=E8=B4=A6=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AdminCost/app.py | 22 +- AdminCost/index.html | 297 +- AdminCost/state.json | 1 + .../规范与COS4/DBJT15-145-2025_第6章_结构.json | 14497 ++++++++++++++++ .../规范与COS4/scripts/build_doc_2025.py | 200 + .../参考资料/规范与COS4/scripts/ocr_all.py | 33 + .../参考资料/规范与COS4/scripts/ocr_page.py | 80 + .../规范与COS4/scripts/parse_ch6_2025.py | 231 + CostReview/app/server/api_server.py | 106 +- CostReview/app/tests/test_lme_merge_sub.py | 239 + CostReview/app/ui/workbench.html | 26 +- yhy-mager | 1 + yhy-mager-本地导览.html | 137 + 决策台账.md | 42 + 决策台账索引.md | 2 + 15 files changed, 15885 insertions(+), 29 deletions(-) create mode 100644 AdminCost/state.json create mode 100644 AdminCost/参考资料/规范与COS4/DBJT15-145-2025_第6章_结构.json create mode 100644 AdminCost/参考资料/规范与COS4/scripts/build_doc_2025.py create mode 100644 AdminCost/参考资料/规范与COS4/scripts/ocr_all.py create mode 100644 AdminCost/参考资料/规范与COS4/scripts/ocr_page.py create mode 100644 AdminCost/参考资料/规范与COS4/scripts/parse_ch6_2025.py create mode 100644 CostReview/app/tests/test_lme_merge_sub.py create mode 160000 yhy-mager create mode 100644 yhy-mager-本地导览.html diff --git a/AdminCost/app.py b/AdminCost/app.py index a793835..456b00c 100644 --- a/AdminCost/app.py +++ b/AdminCost/app.py @@ -737,14 +737,17 @@ def rows_of(conn, tab_id): def sheet_payload(conn, tab_id): - if conn.execute("SELECT id FROM tabs WHERE id = ?", (tab_id,)).fetchone() is None: + tab_row = conn.execute( + "SELECT id, element FROM tabs WHERE id = ?", (tab_id,) + ).fetchone() + if tab_row is None: raise AppError(404, "标签不存在") # 打开工作区时再对一次:行的多少 / 顺序 / 后缀名永远跟后缀设置一致 if sync_rows_to_suffixes(conn): conn.commit() columns = [] for r in conn.execute( - "SELECT id, name, kind, width FROM columns WHERE tab_id = ?" + "SELECT id, name, kind, width, std_name FROM columns WHERE tab_id = ?" " ORDER BY sort_order ASC, id ASC", (tab_id,), ): @@ -754,7 +757,8 @@ def sheet_payload(conn, tab_id): "name": r["name"], "kind": r["kind"], "width": r["width"], - "locked": r["kind"] in ("index", "suffix", "anchor", "action", "anchorline"), + "stdName": r["std_name"] or "", + "locked": r["kind"] in ("index", "suffix", "action", "anchorline"), "hasValues": has_value(conn, r["id"]) if r["kind"] in ("custom", "anchor") else False, @@ -786,7 +790,14 @@ def sheet_payload(conn, tab_id): ): if r["value"]: cells["%d:%d" % (r["col_id"], r["row_id"])] = r["value"] - return {"tabId": tab_id, "columns": columns, "groups": groups, "rows": rows, "cells": cells} + return { + "tabId": tab_id, + "element": tab_row["element"] or "", + "columns": columns, + "groups": groups, + "rows": rows, + "cells": cells, + } # ---------------------------------------------------------------- 业务逻辑 @@ -834,9 +845,10 @@ def build_state(): "parentId": r["parent_id"], "nodeKind": r["node_kind"], "collapsed": bool(r["collapsed"]), + "element": r["element"] or "", } for r in conn.execute( - "SELECT id, name, is_fixed, parent_id, node_kind, collapsed FROM tabs" + "SELECT id, name, is_fixed, parent_id, node_kind, collapsed, element FROM tabs" " ORDER BY is_fixed DESC, sort_order ASC, id ASC" ) ] diff --git a/AdminCost/index.html b/AdminCost/index.html index f596243..e427de9 100644 --- a/AdminCost/index.html +++ b/AdminCost/index.html @@ -307,6 +307,20 @@ .wrap.sheet-view{gap:0;} .sheet-bar{display:flex;align-items:center;gap:12px;margin:0 0 6px;min-height:30px;} .sheet-bar .spacer{margin-left:auto;} + .sheet-bar .view-sw{display:inline-flex;} + .sheet-bar .btn.on{border-color:#2b6cb8;color:#1d4e89;background:#eaf2fd;} + /* 字段对照矩阵 */ + table.sheet.mx td.mx-std{color:#6b7280;font-size:12px;white-space:nowrap;} + td.mx-cell{cursor:text;min-width:110px;height:28px;} + td.mx-cell[contenteditable="true"]{outline:2px solid #2b6cb8;background:#fff;} + td.mx-cell .mx-empty{color:#c9cfd8;} + /* 值设置弹框 */ + .val-pick{margin:8px 0 4px;font-size:13px;} + .val-pick select{font:inherit;padding:2px 6px;} + .val-grid{max-height:52vh;overflow:auto;border:1px solid #e3e7ee;margin-top:6px;} + .val-grid table{border-collapse:collapse;width:100%;} + .val-grid th,.val-grid td{border-bottom:1px solid #eef1f5;padding:5px 8px;font-size:13px;text-align:left;white-space:nowrap;} + .val-grid input{width:110px;font:inherit;padding:2px 6px;border:1px solid #d5dae2;} .sheet-rule{height:2px;border-radius:1px;background:var(--accent);margin:0 0 5px;} .save-flag{font-size:12px;color:#15803d;opacity:0;transition:opacity .25s;} .save-flag.show{opacity:1;} @@ -618,6 +632,19 @@ + +