From 9bb23ac13bf365338fe7cdaff639819032ec3671 Mon Sep 17 00:00:00 2001 From: lianjianwei2024 <168657369+lianjianwei2024@users.noreply.github.com> Date: Sun, 11 Oct 2026 10:52:01 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8C=89=E8=8B=B1=E6=96=87?= =?UTF-8?q?=E5=91=BD=E5=90=8D=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=88=90=E7=9B=B8?= =?UTF-8?q?=E5=AF=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 6 + .gitignore | 6 +- .../app/core/export_xlsx.py | 0 .../app/core/import_job.py | 17 +- {造价审核 => CostReview}/app/core/match.py | 0 .../app/core/price_html.py | 0 .../app/core/price_xlsx.py | 0 .../app/core/search_demo.py | 0 .../app/core/session_job.py | 47 +- .../app/run_server_headless.py | 0 .../app/server/api_server.py | 516 +++++------------- .../app/server/license_client/__init__.py | 0 .../app/server/license_client/client.py | 6 +- .../app/server/license_client/gate.py | 0 .../app/server/license_client/pinned_keys.json | 0 .../app/server/license_client/store.py | 0 .../app/server/license_client/verify.py | 0 {造价审核 => CostReview}/app/shell.py | 0 {造价审核 => CostReview}/app/store/README.md | 0 {造价审核 => CostReview}/app/store/schema.sql | 0 .../app/store/session.sql | 0 .../app/tests/conftest.py | 0 .../app/tests/lic_helpers.py | 0 .../app/tests/test_license_client.py | 0 .../app/tests/test_license_hardening.py | 0 .../app/tests/test_license_verify.py | 0 CostReview/app/tests/test_wipe.py | 84 +++ .../app/tests/testdata/license_test_vectors.json | 0 .../app/tools/backfill_lme_lib.py | 0 .../app/tools/check_parity.py | 0 .../app/tools/deadcode_scan.py | 0 .../app/tools/gen_price_mock.py | 0 .../app/tools/gen_project_mock.py | 0 .../app/tools/health_check.py | 0 .../app/tools/purge_batches.py | 0 .../app/tools/rebuild_batch_db.py | 0 .../app/tools/safe_write.py | 0 .../app/tools/test_parse_std.py | 0 .../app/ui/_deprecated/workbench_map.html | 0 {造价审核 => CostReview}/app/ui/admin.html | 10 +- {造价审核 => CostReview}/app/ui/common.css | 0 {造价审核 => CostReview}/app/ui/common.js | 163 +++++- {造价审核 => CostReview}/app/ui/period.js | 0 {造价审核 => CostReview}/app/ui/sessions.html | 0 .../app/ui/workbench.html | 386 +++++-------- build_portable.py | 12 +- launch.py | 4 +- release/testdata/check_db_once.py | 61 +++ release/testdata/gen_testdata.py | 52 +- release/testdata/probe_db.py | 25 + release/testdata/regen_cfg.json | 4 +- release/testdata/run_cfg.json | 24 +- release_entry.py | 4 +- 使用手册.md | 4 +- 决策台账.md | 132 +++++ 参考页C区字段台账.md | 259 --------- 启动造价审核.bat | 33 +- 备份代码.bat | 4 +- 技能vs软件_C区对比台账.md | 140 ----- 模拟数据工具.bat | 14 +- 模拟数据控制台.bat | 14 +- 造价审核/app/tools/_patch_combo_free.py | 95 ---- 造价审核/app/tools/_patch_combo_free_x.py | 97 ---- 造价审核/app/tools/_patch_combo_x.py | 121 ---- 64 files changed, 913 insertions(+), 1427 deletions(-) create mode 100644 .gitattributes rename {造价审核 => CostReview}/app/core/export_xlsx.py (100%) rename {造价审核 => CostReview}/app/core/import_job.py (97%) rename {造价审核 => CostReview}/app/core/match.py (100%) rename {造价审核 => CostReview}/app/core/price_html.py (100%) rename {造价审核 => CostReview}/app/core/price_xlsx.py (100%) rename {造价审核 => CostReview}/app/core/search_demo.py (100%) rename {造价审核 => CostReview}/app/core/session_job.py (91%) rename {造价审核 => CostReview}/app/run_server_headless.py (100%) rename {造价审核 => CostReview}/app/server/api_server.py (90%) rename {造价审核 => CostReview}/app/server/license_client/__init__.py (100%) rename {造价审核 => CostReview}/app/server/license_client/client.py (98%) rename {造价审核 => CostReview}/app/server/license_client/gate.py (100%) rename {造价审核 => CostReview}/app/server/license_client/pinned_keys.json (100%) rename {造价审核 => CostReview}/app/server/license_client/store.py (100%) rename {造价审核 => CostReview}/app/server/license_client/verify.py (100%) rename {造价审核 => CostReview}/app/shell.py (100%) rename {造价审核 => CostReview}/app/store/README.md (100%) rename {造价审核 => CostReview}/app/store/schema.sql (100%) rename {造价审核 => CostReview}/app/store/session.sql (100%) rename {造价审核 => CostReview}/app/tests/conftest.py (100%) rename {造价审核 => CostReview}/app/tests/lic_helpers.py (100%) rename {造价审核 => CostReview}/app/tests/test_license_client.py (100%) rename {造价审核 => CostReview}/app/tests/test_license_hardening.py (100%) rename {造价审核 => CostReview}/app/tests/test_license_verify.py (100%) create mode 100644 CostReview/app/tests/test_wipe.py rename {造价审核 => CostReview}/app/tests/testdata/license_test_vectors.json (100%) rename {造价审核 => CostReview}/app/tools/backfill_lme_lib.py (100%) rename {造价审核 => CostReview}/app/tools/check_parity.py (100%) rename {造价审核 => CostReview}/app/tools/deadcode_scan.py (100%) rename {造价审核 => CostReview}/app/tools/gen_price_mock.py (100%) rename {造价审核 => CostReview}/app/tools/gen_project_mock.py (100%) rename {造价审核 => CostReview}/app/tools/health_check.py (100%) rename {造价审核 => CostReview}/app/tools/purge_batches.py (100%) rename {造价审核 => CostReview}/app/tools/rebuild_batch_db.py (100%) rename {造价审核 => CostReview}/app/tools/safe_write.py (100%) rename {造价审核 => CostReview}/app/tools/test_parse_std.py (100%) rename {造价审核 => CostReview}/app/ui/_deprecated/workbench_map.html (100%) rename {造价审核 => CostReview}/app/ui/admin.html (99%) rename {造价审核 => CostReview}/app/ui/common.css (100%) rename {造价审核 => CostReview}/app/ui/common.js (92%) rename {造价审核 => CostReview}/app/ui/period.js (100%) rename {造价审核 => CostReview}/app/ui/sessions.html (100%) rename {造价审核 => CostReview}/app/ui/workbench.html (86%) create mode 100644 release/testdata/check_db_once.py create mode 100644 release/testdata/probe_db.py delete mode 100644 参考页C区字段台账.md delete mode 100644 技能vs软件_C区对比台账.md delete mode 100644 造价审核/app/tools/_patch_combo_free.py delete mode 100644 造价审核/app/tools/_patch_combo_free_x.py delete mode 100644 造价审核/app/tools/_patch_combo_x.py diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..53e1334 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +# Windows 批处理/PowerShell 必须 CRLF:git 库里存 LF,检出时强制转 CRLF。 +# 不钉死的话,全凭各机器 core.autocrlf 抽签——曾因 LF bat 在别的机器报 +# 'p0"/cho/nel_server 不是命令' 碎片错误(cmd 对 LF 的解析是未定义行为)。 +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf diff --git a/.gitignore b/.gitignore index 4a8cb7a..0b125b7 100644 --- a/.gitignore +++ b/.gitignore @@ -18,9 +18,12 @@ node_modules/ # ===== 数据 / 样本 / 生成物:不入库 ===== /后台需要导入的项目/ /造价审核/data/* +# 2026-10-11 造价审核/ 改名 CostReview/,ignore 同步换轨(旧规则对新路径失效, +# 曾致 git add 全量暂存把 data/inquiry 几 GB 测试附件哈希进索引、卡死 22 分钟) +/CostReview/data/* # 2026-10-06:history.db / session.db 已 git rm --cached 移出版本控制 # (库内全是测试数据、无保存价值,两库合计约 130MB,不再入库)。 -# 确有必要提交一次数据库快照时:git add -f 造价审核/data/xxx.db +# 确有必要提交一次数据库快照时:git add -f CostReview/data/xxx.db /输出/ /2025造价数据标准.docx /横琴高位水池及加压泵房工程(1).html @@ -34,3 +37,4 @@ node_modules/ # 废弃代码只留本地(2026-10-09 主人定:不入新仓库) 造价审核/app/_deprecated/ +CostReview/app/_deprecated/ diff --git a/造价审核/app/core/export_xlsx.py b/CostReview/app/core/export_xlsx.py similarity index 100% rename from 造价审核/app/core/export_xlsx.py rename to CostReview/app/core/export_xlsx.py diff --git a/造价审核/app/core/import_job.py b/CostReview/app/core/import_job.py similarity index 97% rename from 造价审核/app/core/import_job.py rename to CostReview/app/core/import_job.py index f7387a6..dcb2b94 100644 --- a/造价审核/app/core/import_job.py +++ b/CostReview/app/core/import_job.py @@ -27,7 +27,9 @@ REGION = ("广东省", "珠海市", "香洲区") # 改过滤规则、改层级记账方式、修了会导致旧数据错/缺的 bug),就把号往上加一位。 # 只改界面 / 只改查询,不动入库结构 —— 不用改号,否则会白白提示全库重导。 # 格式建议 YYYY.MM.DD-N(同一天多次改口径就 +1)。 -PARSER_VER = "2026.10.08-1" # 2026.10.08-1:清单节点开始采集源文件备注 Remark(老批次需重导才有) +PARSER_VER = "2026.10.10-2" # 2026.10.10-2:清单序号 x_seq 改**每单位工程从 1 起**(跨工程连号是错口径,老批次需重导) + # 2026.10.10-1:clean_attr 剥号加小数点护栏(x_attr_norm 口径变,老批次需重导) + # 2026.10.08-1:清单节点开始采集源文件备注 Remark(老批次需重导才有) # ---------- 归一化 ---------- def norm(s): @@ -62,8 +64,10 @@ def clean_attr(s): t = norm(s) for w in STOPWORDS: t = t.replace(norm(w), "") - t = re.sub(r"(?.profession` → `global/professions` 里同名专业的 `groups`。 - 前台工作台与后台管理共用这一个方法、同一份数据(professions),不再各读一套。 - - ⚠️ 已删除两套历史兼容配置(产品开发阶段、数据可全量重导,无需兼容): - - 旧 ② `session:.similar_groups`(工程单独存一份分组) - - 旧 ③ `global/similar_groups_default`(全局默认模板) - 返回 None 表示未选专业 / 该专业无分组,调用方回退到「前 6 字 / 前 4 字」原逻辑。 - """ - prof = _setting_get("session:%d" % sid, "profession") - if not prof: - return None - for p in _load_professions(): - if p.get("name") == prof: - g = p.get("groups") - return g if (isinstance(g, list) and g) else None - return None - - -def _group_by_keywords(rows, cfg): - """按关键字分组:命中某组「正向关键字」即候选;若该组同时命中「排除(名称+项目特征)」或 - 「排除(单位)」,则跳过该组、继续往后匹配其他组(跳出该组继续匹配);都未命中任何组归入 other。 - - 2026-10-01 主人最终定口径: - ① 同名优先:名称相同的清单强制同组,不管项目特征/单位/命中哪个关键词组。 - ② 其余清单:关键词「首匹配」归组(组内 OR、不看命中数量、首个命中的组胜出即停),再查排除项。 - ③ 同组必须同单位(① 同名除外):关键词组内按单位拆开,拆出的是**平级组**而非折叠子组, - 组名形如「混凝土结构 · m3」,保证组内单价可比。 - ④ 都没命中 → other。 - - 判定面正交(互不污染): - 正向 keywords → 子串匹配「名称 + 项目特征」(**不含单位**) - 排除 exclude → 子串匹配「名称 + 项目特征」(**不含单位**) - 排除 exclude_units → 精确匹配「单位」这一列(前端已不再配置该列,保留仅为兼容旧数据) - ⚠️ 此前把单位也拼进匹配面,导致「排除单位」填 t 时会顺带把名称里含字母 t 的清单误剔除 - (T型龙骨、PVC-t 管等);且正向分组会误依赖单位命中。现按主人要求把单位从文本匹配面摘出去。 - """ - def _text(r): - # 只取「名称 + 项目特征」,单位不参与文本匹配 - return match.norm("%s %s" % (r["Name"] or "", r["Attr"] or "")) - def _unit(r): - return match.norm(r["Unit"] or "") - - # ① 同名优先聚类:名称相同的强制同组(不管项目特征、单位、也不管原本命中哪个关键词组) - by_name = {} - for r in rows: - by_name.setdefault(match.norm(r["Name"] or ""), []).append(r) - name_groups, rest_rows = [], [] - for key, rs in by_name.items(): - if key and len(rs) >= 2: - name_groups.append(rs) # 同名簇(≥2 条才有比对价值) - else: - rest_rows.extend(rs) - - # ② 其余清单:关键词首匹配 + 排除项 - buckets = [[] for _ in cfg] - other = [] - for r in rest_rows: - nm, u = _text(r), _unit(r) - placed = False - for gi, g in enumerate(cfg): - kws = [match.norm(k) for k in (g.get("keywords") or []) if k] - if not kws or not any(k in nm for k in kws): - continue # 正向未命中 → 跳过该组 - # 命中正向 → 查排除项(命中任一则跳出该组,继续往后匹配) - exu = set(match.norm(x) for x in (g.get("exclude_units") or []) if x) - if u in exu: - continue # 排除单位(精确匹配归一化后的单位) - exk = [match.norm(x) for x in (g.get("exclude") or []) if x] - if exk and any(k in nm for k in exk): - continue # 命中排除关键字 - buckets[gi].append(r) - placed = True - break - if not placed: - other.append(r) - - # ③ 关键词组内按单位拆开 —— 拆出的是**平级组**(组名形如「混凝土结构 · m3」), - # 不是可折叠的子组。保证同组内单位一致 → 单价可比(名称相同的由 ① 豁免) - groups = [] - for gi, rs in enumerate(buckets): - if not rs: - continue - gname = cfg[gi]["name"] - by_unit = {} - for r in rs: - by_unit.setdefault(_unit(r) or "—", []).append(r) - for u, urs in by_unit.items(): - groups.append(("%s · %s" % (gname, u), urs)) - - # ④ 同名簇各自成组(组名 = 该清单名称) - for rs in name_groups: - groups.append((rs[0]["Name"] or "(未命名)", rs)) - - return groups, other - - +# ⚠️ 决策 32(2026-10-10,主人定"取消全部专业")已删除:专业体系 +# (_seed_professions/_ensure_sysprof/_load_professions/api_professions/_load_similar_groups/ +# _group_by_keywords 及 SYS_PROF 内置专业)。关键词层改读 global.grp_rules(_grp_rules_load)。 +# 旧设置键 professions / default_profession 留库不读(启动时清除);找回历史看 git。 def _cmp_bills(con, T, oid): """可比清单(**两侧唯一实现**):原数据全留在库里,这里只做「视图层」筛选。 @@ -2146,11 +1964,8 @@ def api_session_groups(sid, kind): if kind == "inconsistent": return _inconsistent(rows, BILLROW) - # ---- similar:v2 七点顺序管线(决策 29,2026-10-10 主人定)---- - # 关键词层仍读本工程专业的配置(后期专业取消后 kw_cfg 恒 None,管线自动只剩名称层+特征层) - prof = _setting_get("session:%d" % sid, "profession") - kw_cfg = _load_similar_groups(sid) if (prof and prof != SYS_PROF) else None - return _group_v2_output(rows, kw_cfg) + # ---- similar:v2 顺序管线(决策 29/30)——关键词层读「分组设置」表(global.grp_rules)---- + return _group_v2_output(rows) def api_session_bill_norms(bill_id): @@ -2958,91 +2773,22 @@ def api_inconsistent(bid): # 系统内置专业:**不可删除、不可重命名**。分组方式固定为「名称前 4 字分桶 + bigram 相似度≥0.60」, # 由主人 2026-10-01 定:实测这种自动聚类比手工配关键字更贴合,故固化为系统默认分组。 -SYS_PROF = "系统默认(按名称聚类)" - - -def _group_by_prefix(rows): - """系统默认分组(两侧唯一实现):名称归一化后按**前 4 字**分桶,桶内两两比 bigram, - 相似度 ≥0.60 且名称不完全相同 → 成组。 - - ⚠️ 此前工作台用「前 6 字」、后台用「前 4 字 + bigram」,同一工程两侧分组结果不同(分叉)。 - 现统一为前 4 字 + bigram——即主人认可的那一套。 - """ - buckets = {} - for r in rows: - key = norm_txt(_col(r, "Name"))[:4] - buckets.setdefault(key, []).append(r) - groups = [] - for _key, items in buckets.items(): - if len(items) < 2: - continue - seen, grp = set(), None - for i in range(len(items)): - for j in range(i + 1, len(items)): - a, b = norm_txt(_col(items[i], "Name")), norm_txt(_col(items[j], "Name")) - if a == b: - continue - A, B = _bg(a), _bg(b) - sim = len(A & B) / max(len(A | B), 1) - if sim >= 0.60: - if grp is None or i not in seen: - grp = {"rows": [items[i]], "sim": round(sim, 2)} - groups.append(grp) - seen.add(i) - if j not in seen: - grp["rows"].append(items[j]) - seen.add(j) - groups = [g for g in groups if len(g["rows"]) > 1] - # 未成组的清单要一并交回去(决策 18:一条不漏)—— 否则「其他」分组为空 - shown = set() - for g in groups: - for r in g["rows"]: - shown.add(r["id"] if _col(r, "id") is not None else id(r)) - rest = [r for r in rows - if (r["id"] if _col(r, "id") is not None else id(r)) not in shown] - return groups, rest - - -def _extra_by_cat(rest, rowfn): - """未进任何组的合规清单 → 按类别归并(决策 18:保证一条不漏)。两侧唯一实现。""" - buckets = {} - for r in rest: - buckets.setdefault(cat_of(_col(r, "Name")) or "其他", []).append(r) - out = [] - for lab, rs in sorted(buckets.items(), key=lambda x: (-len(x[1]), x[0])): - d = _grpstat(rs) - d["cat"] = lab - d["sim"] = 1.0 - d["rows"] = [rowfn(x) for x in rs] - out.append(d) - return out - - -def _bg(s): - s = norm_txt(s) - return set(s[i:i + 2] for i in range(len(s) - 1)) or {s} - - -def norm_txt(s): - s = (s or "").strip().replace("(", "(").replace(")", ")").replace("×", "*") - s = "".join(ch for ch in s if not ch.isspace()) - return s.lower() - - -# ---------- 类似清单分组 v2(2026-10-10 决策 29 主人定:7 点顺序管线) ---------- +# ⚠️ 决策 32:旧"前4字+bigram"聚类(_group_by_prefix/_bg/norm_txt/_extra_by_cat)与 SYS_PROF +# 内置专业已删除——前后台统一走下方 v2 顺序管线(工作台/后台同一份实现)。 +# ---------- 类似清单分组 v2(决策 29 七点顺序管线;2026-10-10 决策 32 修订) ---------- # 顺序语义(主人定,顺序不可颠倒):逐级实施,**上一级分走的行不再进入下一级**。 -# 第3点 关键词层:本工程专业配置的关键词组(首匹配+排除词);**不按单位拆**——取值范围=名称+特征。 +# 第3点 关键词层:「分组设置」表格(global.grp_rules,专业体系已取消)——序号升序首匹配+排除词; +# 关键词/排除的分隔符=空格+逗号,无空格的词必须整串命中,多词任一命中即可; +# 匹配面=名称+项目特征整体文本;**不按单位拆**。 # 第4点 名称层:名称字集 交集≥min(4, 短方全长) 并查集聚类(字集等效换序无关:钢混凝土=混凝土钢; # 短名按全长处理:土=钢混凝土)。 # 第5点 特征层:剩余落单按特征"数字字母签名"(剥换行排序序号后提取字母数字的字符集合)等值成组。 -# 第6点 其他:仍没进组的全部按类别归并展示(一条不漏,决策 18)。 -# 第7点 池化合并(2026-10-10 主人定修订):1~6 步的组**完全对等**——三层组倒进同一个池, -# 组代表(组内最高频名称的中文主干字集)Jaccard≥grp_merge_thr 即合并; -# **不设条数上限、无跨块限制**(初版"按块+累计上限50"已废,主人拍板池化)。 +# 第6点 其他:仍没进组的全部进**一个「其他」组**(一条不漏,决策 18;按类别分桶已废,CATS 作废)。 +# ~~第7点 合并~~:已整体删除(主人定"不走第7步,直接到第6步停止",grp_merge_* 设置键作废, +# 启动时随 _purge_dead_settings 一并清除)。 # 保险丝(防串联巨组,实测 2099/3511 条巨组的解):任何一层产生的组超过 grp_big 条 → 组内按特征签名 -# 星形细分(阈值 grp_sig_thr)。 -# 规则参数读 global 设置(缺省用默认):grp_big=50 / grp_sig_thr=0.6 / grp_merge_on=1 / -# grp_merge_thr=0.85。专业/组名称配置仍作关键词层来源(后期取消)。 +# 星形细分(锚=先到签名,行只跟锚比;阈值 grp_sig_thr)。 +# 规则参数读 global 设置(缺省用默认):grp_big=50 / grp_sig_thr=0.6。 def _grp_rule(): def _i(k, d): @@ -3056,9 +2802,67 @@ def _grp_rule(): except Exception: return d return {"big": _i("grp_big", 50), - "sig_thr": _f("grp_sig_thr", 0.6), - "merge_on": (_setting_get("global", "grp_merge_on") or "1") not in ("0", "false", "off"), - "merge_thr": _f("grp_merge_thr", 0.85)} + "sig_thr": _f("grp_sig_thr", 0.6)} + + +def _purge_dead_settings(): + """决策 32(主人定"旧的直接删除了"):专业体系与第7点合并退役后,清掉 settings 死键。 + 幂等:每次启动跑一遍,删 0 行零成本。""" + sc = sess.connect() + try: + n = sc.execute("""DELETE FROM s_settings WHERE scope='global' AND k IN + ('professions','default_profession', + 'grp_merge_on','grp_merge_thr','grp_merge_cap')""").rowcount + sc.commit() + if n: + print("清理退役设置键 %d 条(专业体系/第7点合并,决策 32)" % n, flush=True) + finally: + sc.close() + + +def _grp_rules_load(): + """分组设置表(决策 32):global.grp_rules = [{seq,组名,关键词串,排除串}],按 seq 升序返回 + (seq 即匹配优先级)。关键词/排除为原文串(分隔符=空格+逗号),解析在匹配层做。""" + try: + v = json.loads(_setting_get("global", "grp_rules") or "[]") + rs = [r for r in v if isinstance(r, dict)] + rs.sort(key=lambda r: r["seq"] if isinstance(r.get("seq"), (int, float)) else 9999) + return rs + except Exception: + return [] + + +def api_grp_rules_hits(sid): + """「分组设置」命中列(决策 32 主人定,本次一起做):按当前工程的合规清单模拟关键词层 + 首匹配(序号顺序、排除词生效、前面规则用掉的行后面不再计),返回每条规则的命中条数。 + 未打开工程(sid 无效)→ 各规则 hits=null。""" + if not sid: + rules = _grp_rules_load() + return {"ok": True, "hits": [{"seq": g.get("seq"), "name": g.get("name"), "hits": None} + for g in rules], "total": None} + sc = sess.connect() + try: + rows = _cmp_bills(sc, TBL["session"], sid) + finally: + sc.close() + rule = _grp_rule() + used = set() + out = [] + for g in _grp_rules_load(): + # 与 _group_v2 关键词层同口径:关键词/排除词同走 norm()(2026-10-10 修小写死词问题) + kws = [match.norm(t) for t in re.split(r"[,,\s]+", g.get("keywords") or "") if t] + exs = [match.norm(t) for t in re.split(r"[,,\s]+", g.get("exclude") or "") if t] + mem = 0 + if kws: + for r in rows: + if _col(r, "id") in used: + continue + nm = match.norm("%s %s" % (_col(r, "Name") or "", _col(r, "Attr") or "")) + if any(k in nm for k in kws) and not any(x in nm for x in exs): + mem += 1; used.add(_col(r, "id")) + out.append({"seq": g.get("seq"), "name": g.get("name"), "hits": mem}) + out.sort(key=lambda r: r["seq"] if isinstance(r.get("seq"), (int, float)) else 9999) + return {"ok": True, "hits": out, "total": len(rows)} def _grp_signature(s): @@ -3067,17 +2871,6 @@ def _grp_signature(s): return "".join(sorted(set("".join(match._TOK.findall(s))))) -def _grp_stem_set(names): - """组代表(第7点合并判据):组内最高频名称的**中文主干**字集——编号字母不掺进相似度。""" - c = Counter((match.norm_attr(n or "")) for n in names) - if not c: - return set() - best = c.most_common(1)[0][0] - s = match._TOK.sub(" ", best) - s = "".join(re.sub(r"[^一-鿿]+", " ", s).split()) - return set(match.set_norm(s)) if s else set() - - def _grp_fuse(mem_rows, thr): """巨组保险丝:组内按特征签名**星形**细分——锚=先到的签名,行只跟锚比,杜绝串联。 返回子组列表(可能含单行子组,调用方分流到下一层)。""" @@ -3095,61 +2888,43 @@ def _grp_fuse(mem_rows, thr): return [m2 for rs, m2 in reps] -def _grp_block_merge(groups, thr): - """第7点池化合并(2026-10-10 主人定:1~6 步的组看作**完全对等**的待合并组,跨块池化; - **不设条数上限**):组代表(最高频名称的中文主干字集)Jaccard≥thr 即合并。""" - reps = [_grp_stem_set([_col(x, "Name") for x in g]) for g in groups] - par2 = list(range(len(groups))) - def f2(x): - while par2[x] != x: par2[x] = par2[par2[x]]; x = par2[x] - return x - for i in range(len(groups)): - for j in range(len(groups)): - if i == j: - continue - a, b = reps[i], reps[j] - if not a or not b: - continue - ri, rj = f2(i), f2(j) - if ri == rj: - continue - u = len(a | b) - if u and len(a & b) / u >= thr: - par2[ri] = rj - mg = {} - for i in range(len(groups)): mg.setdefault(f2(i), []).extend(groups[i]) - return [v for v in mg.values() if len(v) > 1] - - -def _group_v2(rows, kw_cfg): - """决策 29 七点顺序管线。kw_cfg=本工程专业关键词配置(无/后期取消=跳过关键词层)。 - 返回 (blocks, rest):blocks=[(组名或None, 行列表)] 按块顺序(关键词→名称→特征), - rest=未进组的行(调用方交 _extra_by_cat 归并)。""" +def _group_v2(rows): + """决策 29/30 顺序管线(到第 6 点为止,无合并层)。返回 (blocks, rest): + blocks=[(标签, 行列表)],关键词块标签={cat:组名, seq:序号},名称/特征块标签=None; + rest=未进组的行(调用方归入单个「其他」组)。""" rule = _grp_rule() used = set() - # ---- 第3点 关键词层 ---- + # ---- 第3点 关键词层:分组设置表(global.grp_rules),序号升序首匹配 + 排除词 ---- kw_blocks = [] - if kw_cfg: - for g in kw_cfg: - kws = [match.norm(k) for k in (g.get("keywords") or []) if k] - if not kws: + to_other = [] # 命中规则但不足 2 条的行(决策 32:不成组不显示,直接进「其他」) + for g in _grp_rules_load(): + # 关键词/排除词与正文同走 norm()(2026-10-10 修):norm 会把文本转小写, + # 关键词不做同一变换,"C30" 就永远匹配不上 "…c30…"(预置 C10~C95 全是死词, + # 条形基础C30 进不了混凝土组即此因)。 + kws = [match.norm(t) for t in re.split(r"[,,\s]+", g.get("keywords") or "") if t] + if not kws: + continue # 没有关键词的组不收行(纯占位) + exs = [match.norm(t) for t in re.split(r"[,,\s]+", g.get("exclude") or "") if t] + mem = [] + for r in rows: + if _col(r, "id") in used: continue - mem = [] - for r in rows: - if _col(r, "id") in used: - continue - nm = match.norm("%s %s" % (_col(r, "Name") or "", _col(r, "Attr") or "")) - if any(k in nm for k in kws) and not any( - match.norm(x) in nm for x in (g.get("exclude") or []) if x): - mem.append(r) - if not mem: - continue - subs = _grp_fuse(mem, rule["sig_thr"]) if len(mem) > rule["big"] else [mem] - for m in subs: - if len(m) > 1: # 单行子组不算"已分组",落回名称层 - kw_blocks.append((g.get("name") or "关键词组", m)) - used.update(_col(x, "id") for x in m) + nm = match.norm("%s %s" % (_col(r, "Name") or "", _col(r, "Attr") or "")) + if any(k in nm for k in kws) and not any(x in nm for x in exs): + mem.append(r) + if not mem: + continue + if len(mem) < 2: + # 命中不足 2 条(不含 2):该组不在类似清单目录显示,行直接进「其他」(决策 32 主人定) + to_other.extend(mem) + used.update(_col(x, "id") for x in mem) + continue + # 关键词组不装保险丝:它是主人显式定义的集合(成员=命中规则的行),不存在名称层那种 + # 串联问题;拆了反而左树出现一堆同号小组。嫌组大就用屏蔽词收窄。 + kw_blocks.append(({"cat": g.get("name") or "关键词组", + "seq": g.get("seq")}, mem)) + used.update(_col(x, "id") for x in mem) # ---- 第4点 名称层:字集 交集≥min(4,短方全长) ---- rest0 = [r for r in rows if _col(r, "id") not in used] @@ -3197,66 +2972,51 @@ def _group_v2(rows, kw_cfg): taken.update(_col(x, "id") for x in v) rest = [r for r in rest if _col(r, "id") not in taken] - # ---- 第7点 池化合并(2026-10-10 主人定修订:1~6 步的组**完全对等**,三层组倒进同一个池, - # 组代表主干字集 J≥merge_thr 即并,**不设条数上限、不跨块限制已随池化取消**)---- - if rule["merge_on"] and len(kw_blocks) + len(name_blocks) + len(attr_blocks) > 1: - pool = kw_blocks + name_blocks + attr_blocks - merged = _grp_block_merge([b[1] for b in pool], rule["merge_thr"]) - lbl_of = {} - for lbl0, g0 in pool: - for x in g0: - lbl_of[id(x)] = lbl0 - kw_blocks, name_blocks, attr_blocks = [], [], [] - for g in merged: - cnt = Counter(lbl_of.get(id(x)) for x in g if lbl_of.get(id(x))) - lbl = max(cnt, key=lambda l: cnt[l]) if cnt else None # 沿用簇内多数的关键词组名 - kw_blocks.append((lbl, g)) + # ---- 第6点 其他:剩余全部 + 关键词层不足 2 条的行,进单个「其他」组(条数守恒)---- + rest = list(rest) + to_other return kw_blocks + name_blocks + attr_blocks, rest -def _group_v2_output(rows, kw_cfg): - """v2 管线 → 前端响应(结构与原 similar 完全同构:total/groups/extra/group_mode)。""" - blocks, rest = _group_v2(rows, kw_cfg) +def _group_v2_output(rows): + """v2 管线 → 前端响应(结构与原 similar 完全同构:total/groups/extra/group_mode)。 + 组排序:关键词组(规则序号升序)在前,名称/特征层组随后按差%降序(决策 19)。""" + blocks, rest = _group_v2(rows) out = [] for label, rs in blocks: d = _grpstat(rs) - if label: - d["cat"] = label + if isinstance(label, dict): # 关键词层组:带组名+序号(左树格式用) + d["cat"] = label["cat"] + d["seq"] = label["seq"] d["sim"] = 1.0 d["rows"] = [BILLROW(x) for x in rs] out.append(d) - out.sort(key=lambda x: -(x.get("spread") or 0)) # 决策 19:组按差% 从大到小 - return {"total": len(out), "groups": out, - "extra": _extra_by_cat(rest, BILLROW), "group_mode": True} + kw_out = sorted((d for d in out if d.get("seq") is not None), key=lambda d: d["seq"]) + sys_out = sorted((d for d in out if d.get("seq") is None), + key=lambda x: -(x.get("spread") or 0)) + out = kw_out + sys_out + extra = [] + if rest: + ex = _grpstat(rest) + ex["cat"] = "其他" + ex["sim"] = 1.0 + ex["rows"] = [BILLROW(x) for x in rest] + extra = [ex] + return {"total": len(out), "groups": out, "extra": extra, "group_mode": True} # 行适配统一用上面的 BILLROW(两侧唯一实现,原 _billrow 已删 —— 2026-10-08 收编)。 def api_similar(bid, profession=None): - """后台「类似清单」:固定走系统内置分组(`SYS_PROF` = 名称前 4 字分桶 + bigram ≥0.60)。 - - 2026-10-01 主人定:后台不再提供「专业」下拉 —— 它是历史数据检索口, - 统一自动聚类比让操作者选专业更稳;工作台(当前审核会话)才需要切换专业。 - ⚠️ 因此 profession 参数已废弃(保留仅为兼容调用方传参),不再读批次库 professions。 - """ + """后台「类似清单」:与工作台同一套 v2 顺序管线(决策 32:口径统一;关键词层读全局 + 「分组设置」表,后台不再有专业语境)。profession 参数废弃(保留仅为兼容调用方传参)。""" c = conn() try: # 与工作台完全同口径(_cmp_bills,唯一实现):过滤措施费 + 单价空/0,并带出单位工程名 rows = _cmp_bills(c, TBL["batch"], bid) finally: c.close() - # 固定走系统内置分组:前 4 字分桶 + bigram ≥0.60(_group_by_prefix,两侧唯一实现) - gs, rest = _group_by_prefix(rows) - out = [] - for g in gs: - d = _grpstat(g["rows"]); d["sim"] = g["sim"] - d["rows"] = [BILLROW(x) for x in g["rows"]] - out.append(d) - out.sort(key=lambda x: -(x.get("spread") or 0)) - # 未成组的按类别归并进「其他」,保证一条不漏(此前后台没有 extra → 看不到「其他」分组) - return {"total": len(out), "groups": out, - "extra": _extra_by_cat(rest, BILLROW), "group_mode": True} + return _group_v2_output(rows) def _bill_norms(con, T, bill_id): @@ -3592,6 +3352,8 @@ class Handler(SimpleHTTPRequestHandler): return self._json(api_session_inq(int(one.get("session_id", 0) or 0))) if p == "/api/adopt/list": # 工作台「询价附件」:当前会话收进的附件目录(会话级,决策 28) return self._json(api_adopt_list(int((q.get("sid") or ["0"])[0] or 0))) + if p == "/api/grp/rules": # 分组设置「命中」列:各规则在当前工程的命中条数(决策 32) + return self._json(api_grp_rules_hits(int((q.get("session_id") or ["0"])[0] or 0))) if p == "/api/session/rows": # 会话数据(工作台三个标签) return self._json(api_session_rows(one)) if p == "/api/session/inconsistent": # 会话内:组价不一致 @@ -3603,8 +3365,6 @@ class Handler(SimpleHTTPRequestHandler): if not scope or not k: return self._json({"error": "scope 和 k 必填"}, 400) return self._json({"v": _setting_get(scope, k)}) - if p == "/api/professions": # 工作台专业清单(会话库) - return self._json(api_professions()) if p == "/api/session/lme/res": # 会话内:台班/配合比的下一级组成 sc0 = sess.connect() try: @@ -3912,10 +3672,12 @@ def run(): _ensure_batch_schema() # 唯一建表入口:执行 schema.sql(含 attachments/dict/settings/inquiry 全部表) ensure_attach_schema() # 老库补列 + 回填(x_attach_sha / x_publisher / x_rows_price / prices.Block / x_setkey) migrate_match_keys() # 决策 27:清单哈希改编码前9位 + 字集键回填(幂等,探针跳过) + _purge_dead_settings() # 决策 32:专业体系/第7点合并退役设置键清除(幂等) ensure_dict_schema() # 数据源字典(首次用库里已有值播种) backfill_session_batch() # 老会话补 x_batch_id → 工作台才能看到该项目的询价附件 license_gate.init(DATA_DIR) # 授权门禁:读配置/状态,配了凭据则起心跳线程(内部吞异常) cleanup_sessions() # 启动时清掉超过保留天数的会话(只碰 session.db) + sess.dedupe_lme_res() # 2026-10-10:s_lme_res 存量去重自愈(wipe 曾漏这张表,台班组成重复) try: # 启动自检:有批次是用旧解析器导入的 → 控制台先报一句 s = stale_batches() if s["n"]: diff --git a/造价审核/app/server/license_client/__init__.py b/CostReview/app/server/license_client/__init__.py similarity index 100% rename from 造价审核/app/server/license_client/__init__.py rename to CostReview/app/server/license_client/__init__.py diff --git a/造价审核/app/server/license_client/client.py b/CostReview/app/server/license_client/client.py similarity index 98% rename from 造价审核/app/server/license_client/client.py rename to CostReview/app/server/license_client/client.py index b62d519..251b2b4 100644 --- a/造价审核/app/server/license_client/client.py +++ b/CostReview/app/server/license_client/client.py @@ -25,7 +25,11 @@ try: from .verify import (VerifyError, verify_certificate, verify_lease, parse_rfc3339, rfc3339) from .store import StorageError -except ImportError: # 允许把本目录直接加进 sys.path 运行 +except ImportError as _e: + # 只对"相对导入不可用"退裸导入;包内真实依赖缺失(如 cryptography)必须原样抛出, + # 否则真实病因会被掩盖成 "No module named 'verify'" 指错排查方向(2026-10-11 实证踩坑) + if "attempted relative import" not in str(_e): + raise from verify import (VerifyError, verify_certificate, verify_lease, parse_rfc3339, rfc3339) from store import StorageError diff --git a/造价审核/app/server/license_client/gate.py b/CostReview/app/server/license_client/gate.py similarity index 100% rename from 造价审核/app/server/license_client/gate.py rename to CostReview/app/server/license_client/gate.py diff --git a/造价审核/app/server/license_client/pinned_keys.json b/CostReview/app/server/license_client/pinned_keys.json similarity index 100% rename from 造价审核/app/server/license_client/pinned_keys.json rename to CostReview/app/server/license_client/pinned_keys.json diff --git a/造价审核/app/server/license_client/store.py b/CostReview/app/server/license_client/store.py similarity index 100% rename from 造价审核/app/server/license_client/store.py rename to CostReview/app/server/license_client/store.py diff --git a/造价审核/app/server/license_client/verify.py b/CostReview/app/server/license_client/verify.py similarity index 100% rename from 造价审核/app/server/license_client/verify.py rename to CostReview/app/server/license_client/verify.py diff --git a/造价审核/app/shell.py b/CostReview/app/shell.py similarity index 100% rename from 造价审核/app/shell.py rename to CostReview/app/shell.py diff --git a/造价审核/app/store/README.md b/CostReview/app/store/README.md similarity index 100% rename from 造价审核/app/store/README.md rename to CostReview/app/store/README.md diff --git a/造价审核/app/store/schema.sql b/CostReview/app/store/schema.sql similarity index 100% rename from 造价审核/app/store/schema.sql rename to CostReview/app/store/schema.sql diff --git a/造价审核/app/store/session.sql b/CostReview/app/store/session.sql similarity index 100% rename from 造价审核/app/store/session.sql rename to CostReview/app/store/session.sql diff --git a/造价审核/app/tests/conftest.py b/CostReview/app/tests/conftest.py similarity index 100% rename from 造价审核/app/tests/conftest.py rename to CostReview/app/tests/conftest.py diff --git a/造价审核/app/tests/lic_helpers.py b/CostReview/app/tests/lic_helpers.py similarity index 100% rename from 造价审核/app/tests/lic_helpers.py rename to CostReview/app/tests/lic_helpers.py diff --git a/造价审核/app/tests/test_license_client.py b/CostReview/app/tests/test_license_client.py similarity index 100% rename from 造价审核/app/tests/test_license_client.py rename to CostReview/app/tests/test_license_client.py diff --git a/造价审核/app/tests/test_license_hardening.py b/CostReview/app/tests/test_license_hardening.py similarity index 100% rename from 造价审核/app/tests/test_license_hardening.py rename to CostReview/app/tests/test_license_hardening.py diff --git a/造价审核/app/tests/test_license_verify.py b/CostReview/app/tests/test_license_verify.py similarity index 100% rename from 造价审核/app/tests/test_license_verify.py rename to CostReview/app/tests/test_license_verify.py diff --git a/CostReview/app/tests/test_wipe.py b/CostReview/app/tests/test_wipe.py new file mode 100644 index 0000000..098a8ac --- /dev/null +++ b/CostReview/app/tests/test_wipe.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +"""wipe 清场防回归(2026-10-10)。 + +背景:wipe 手工枚举清表清单两次漏表(2026-09-30 s_sections、2026-10-10 s_lme_res), +每次漏表 = 「重新解析」不断叠加脏数据(台班组成曾叠到 13 份)。 +改造后 wipe 按 sqlite_master 动态发现 s_ 表,本测试钉死两条防线: + ① 未来新建任何带 session_id 的 s_ 表(即使谁都不记得它),wipe 必然清它; + ② WIPE_KEEP 里的表(s_remarks/s_settings)任何情况下不被清。 +""" + +import sqlite3 +import sys, os + +sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "core")) +import session_job # noqa: E402 + + +def _mk_db(): + con = sqlite3.connect(":memory:") + c = con.cursor() + # 业务表形状(简化自 schema,只保留 wipe 相关列) + c.execute("CREATE TABLE s_bills (id INTEGER PRIMARY KEY, session_id INT)") + c.execute("CREATE TABLE s_norms (id INTEGER PRIMARY KEY, bill_id INT)") # 无 session_id + c.execute("CREATE TABLE s_norm_res (id INTEGER PRIMARY KEY, norm_id INT)") # 无 session_id + # ⭐ 模拟「未来新表」:带 session_id 的普通数据表,谁都不用记得登记 + c.execute("CREATE TABLE s_future_thing (id INTEGER PRIMARY KEY, session_id INT)") + # 保留清单里的表 + c.execute("CREATE TABLE s_remarks (id INTEGER PRIMARY KEY, session_id INT)") + c.execute("CREATE TABLE s_settings (id INTEGER PRIMARY KEY, session_id INT)") + # sessions 表(s_ 前缀误匹配检查:'sessions' 不应以通配方式被清/被当数据表) + c.execute("CREATE TABLE sessions (id INTEGER PRIMARY KEY)") + # 数据 + c.execute("INSERT INTO sessions VALUES (58)") + c.execute("INSERT INTO s_bills (session_id) VALUES (58)") + c.execute("INSERT INTO s_norms (bill_id) VALUES (1)") + c.execute("INSERT INTO s_norms (bill_id) VALUES (NULL)") # 孤儿定额 + c.execute("INSERT INTO s_norm_res (norm_id) VALUES (1)") + c.execute("INSERT INTO s_norm_res (norm_id) VALUES (NULL)") # 孤儿消耗量 + c.execute("INSERT INTO s_future_thing (session_id) VALUES (58)") + c.execute("INSERT INTO s_remarks (session_id) VALUES (58)") + c.execute("INSERT INTO s_settings (session_id) VALUES (58)") + con.commit() + return con + + +def test_wipe_clears_future_tables(): + """⭐ 核心防线:未来加的新表(带 session_id)即使没人同步 wipe 也必被清。""" + con = _mk_db() + session_job.wipe(con, 58) + assert con.execute("SELECT COUNT(*) FROM s_future_thing").fetchone()[0] == 0 + + +def test_wipe_clears_known_tables(): + con = _mk_db() + session_job.wipe(con, 58) + for t in ("s_bills",): + assert con.execute(f"SELECT COUNT(*) FROM {t}").fetchone()[0] == 0, t + # 定额按 bill_id 绕层清 + 孤儿全清 + assert con.execute("SELECT COUNT(*) FROM s_norms").fetchone()[0] == 0 + assert con.execute("SELECT COUNT(*) FROM s_norm_res").fetchone()[0] == 0 + + +def test_wipe_keeps_remarks_and_settings(): + """保留清单:备注与设置跨重新解析存活。""" + con = _mk_db() + session_job.wipe(con, 58) + assert con.execute("SELECT COUNT(*) FROM s_remarks").fetchone()[0] == 1 + assert con.execute("SELECT COUNT(*) FROM s_settings").fetchone()[0] == 1 + + +def test_wipe_scoped_to_session_and_keeps_sessions_row(): + con = _mk_db() + c = con.cursor() + c.execute("INSERT INTO s_bills (session_id) VALUES (99)") # 别的会话 + c.execute("INSERT INTO s_remarks (session_id) VALUES (99)") + con.commit() + session_job.wipe(con, 58) + assert c.execute("SELECT COUNT(*) FROM s_bills WHERE session_id=99").fetchone()[0] == 1 + assert c.execute("SELECT COUNT(*) FROM sessions WHERE id=58").fetchone()[0] == 1 + + +def test_wipe_keep_list_has_documented_members(): + """保留清单必须精确等于这两张表 —— 多了会漏清数据,少了会丢用户数据。""" + assert session_job.WIPE_KEEP == {"s_remarks", "s_settings"} diff --git a/造价审核/app/tests/testdata/license_test_vectors.json b/CostReview/app/tests/testdata/license_test_vectors.json similarity index 100% rename from 造价审核/app/tests/testdata/license_test_vectors.json rename to CostReview/app/tests/testdata/license_test_vectors.json diff --git a/造价审核/app/tools/backfill_lme_lib.py b/CostReview/app/tools/backfill_lme_lib.py similarity index 100% rename from 造价审核/app/tools/backfill_lme_lib.py rename to CostReview/app/tools/backfill_lme_lib.py diff --git a/造价审核/app/tools/check_parity.py b/CostReview/app/tools/check_parity.py similarity index 100% rename from 造价审核/app/tools/check_parity.py rename to CostReview/app/tools/check_parity.py diff --git a/造价审核/app/tools/deadcode_scan.py b/CostReview/app/tools/deadcode_scan.py similarity index 100% rename from 造价审核/app/tools/deadcode_scan.py rename to CostReview/app/tools/deadcode_scan.py diff --git a/造价审核/app/tools/gen_price_mock.py b/CostReview/app/tools/gen_price_mock.py similarity index 100% rename from 造价审核/app/tools/gen_price_mock.py rename to CostReview/app/tools/gen_price_mock.py diff --git a/造价审核/app/tools/gen_project_mock.py b/CostReview/app/tools/gen_project_mock.py similarity index 100% rename from 造价审核/app/tools/gen_project_mock.py rename to CostReview/app/tools/gen_project_mock.py diff --git a/造价审核/app/tools/health_check.py b/CostReview/app/tools/health_check.py similarity index 100% rename from 造价审核/app/tools/health_check.py rename to CostReview/app/tools/health_check.py diff --git a/造价审核/app/tools/purge_batches.py b/CostReview/app/tools/purge_batches.py similarity index 100% rename from 造价审核/app/tools/purge_batches.py rename to CostReview/app/tools/purge_batches.py diff --git a/造价审核/app/tools/rebuild_batch_db.py b/CostReview/app/tools/rebuild_batch_db.py similarity index 100% rename from 造价审核/app/tools/rebuild_batch_db.py rename to CostReview/app/tools/rebuild_batch_db.py diff --git a/造价审核/app/tools/safe_write.py b/CostReview/app/tools/safe_write.py similarity index 100% rename from 造价审核/app/tools/safe_write.py rename to CostReview/app/tools/safe_write.py diff --git a/造价审核/app/tools/test_parse_std.py b/CostReview/app/tools/test_parse_std.py similarity index 100% rename from 造价审核/app/tools/test_parse_std.py rename to CostReview/app/tools/test_parse_std.py diff --git a/造价审核/app/ui/_deprecated/workbench_map.html b/CostReview/app/ui/_deprecated/workbench_map.html similarity index 100% rename from 造价审核/app/ui/_deprecated/workbench_map.html rename to CostReview/app/ui/_deprecated/workbench_map.html diff --git a/造价审核/app/ui/admin.html b/CostReview/app/ui/admin.html similarity index 99% rename from 造价审核/app/ui/admin.html rename to CostReview/app/ui/admin.html index 365a688..8a7cf7c 100644 --- a/造价审核/app/ui/admin.html +++ b/CostReview/app/ui/admin.html @@ -195,7 +195,7 @@ a:hover{text-decoration:underline} 授权管理入口),本按钮改回原名「数据源」——功能一点没动。 margin-bottom:6px —— 让它比标签条矮半截,免得看起来像第四个标签。 --> + title="字典设置:地区 / 发布单位 / 建设单位 下拉选项 + 上传大小上限">⚙ 字典 @@ -483,7 +483,7 @@ a:hover{text-decoration:underline} - +