@stalfh233/omc-cli 0.6.99 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,6 +49,24 @@ function normalizeOptions(dataRuleType, options, propertyCode) {
49
49
  }
50
50
  return normalized;
51
51
  }
52
+ /**
53
+ * T24(2.1.5):`validateHiddenProperties` 的「未声明 = 保留」比较语义。
54
+ *
55
+ * lane 的 `datarule.update` 会把当前行里、调用方没显式给的
56
+ * `validateHiddenProperties` 自动捎带(`withPreservedHiddenValidation`)。因此
57
+ * intent 没声明该键时,读回里多出来的值属于**保留**,不是漂移——严格比较会让
58
+ * 每次 plan 都发 update、apply 后又永远 mismatch。声明了该键才参与比较。
59
+ */
60
+ function optionsForComparison(declared, live) {
61
+ if (declared === null || typeof declared !== "object" || Array.isArray(declared))
62
+ return live;
63
+ if (Object.prototype.hasOwnProperty.call(declared, "validateHiddenProperties"))
64
+ return live;
65
+ if (live === null || typeof live !== "object" || Array.isArray(live))
66
+ return live;
67
+ const { validateHiddenProperties: _preserved, ...rest } = live;
68
+ return rest;
69
+ }
52
70
  /** Stored target field codes (propertyCodes array preferred, legacy singular fallback). */
53
71
  function rowCodes(row) {
54
72
  if (Array.isArray(row.propertyCodes) && row.propertyCodes.length > 0)
@@ -156,7 +174,7 @@ export const dataruleCapability = {
156
174
  }
157
175
  if (!current)
158
176
  emit.change("datarule.create", { schemaCode: intent.code, ...rule }, resource, "datarule-absent");
159
- else if (!sameValue(current.options, rule.options) || !optionalSame(current.checkType, rule.checkType) || !optionalSame(current.childRule, rule.childRule) || !optionalSame(current.name, rule.name) || !optionalSame(current.sortKey, rule.sortKey))
177
+ else if (!sameValue(optionsForComparison(rule.options, current.options), rule.options) || !optionalSame(current.checkType, rule.checkType) || !optionalSame(current.childRule, rule.childRule) || !optionalSame(current.name, rule.name) || !optionalSame(current.sortKey, rule.sortKey))
160
178
  emit.change("datarule.update", { id: current.id, schemaCode: intent.code, ...rule }, resource, "datarule-drift");
161
179
  else
162
180
  emit.skip(resource, "datarule-present");
@@ -179,7 +197,7 @@ export const dataruleCapability = {
179
197
  }
180
198
  if (!row)
181
199
  emit.difference("datarule-missing", resource, `字段 ${intent.code}.${rule.propertyCode} 的数据规则不存在`);
182
- else if (!sameValue(row.options, rule.options) || !optionalSame(row.checkType, rule.checkType) || !optionalSame(row.childRule, rule.childRule) || !optionalSame(row.name, rule.name) || !optionalSame(row.sortKey, rule.sortKey))
200
+ else if (!sameValue(optionsForComparison(rule.options, row.options), rule.options) || !optionalSame(row.checkType, rule.checkType) || !optionalSame(row.childRule, rule.childRule) || !optionalSame(row.name, rule.name) || !optionalSame(row.sortKey, rule.sortKey))
183
201
  emit.difference("datarule-mismatch", resource, `字段 ${intent.code}.${rule.propertyCode} 的数据规则不等价`);
184
202
  }
185
203
  },
@@ -39,7 +39,7 @@ const dataRuleOptionsArg = z
39
39
  * a distinct options key. `checkType` is ONLY meaningful with dataRuleType 1.
40
40
  *
41
41
  * - 1 REGEX_CHECK 正则校验 options {regexp:"/…/", regexpText:{zh,en}} (regexp is slash-wrapped; RegexCheckValidator strips the outer chars)
42
- * - 2 SUBMIT_CHECK 提交校验 options {conditions:"<cond>[ &&| || <cond>]", verifyType:"submitDenied"? , prompt:"<plain text — the portal shows options.prompt verbatim, so do NOT URL-encode it>"} ← cross-field rules use a currentModel value object on the right (e.g. {end} 小于 {"valueType":"currentModel","value":"start"})
42
+ * - 2 SUBMIT_CHECK 提交校验 options {conditions:"<cond>[ &&| || <cond>]", verifyType:"submitDenied"? , prompt:"<plain text — the portal shows options.prompt verbatim, so do NOT URL-encode it>", validateHiddenProperties?:[<fieldCodes>]} ← cross-field rules use a currentModel value object on the right (e.g. {end} 小于 {"valueType":"currentModel","value":"start"})
43
43
  * - 3 EMPTY_ROW_CHECK 空行校验 options {isEmptyRow:true, isEmptyRowTips?}
44
44
  * - 4 MAX_LENGTH_CHECK 最大长度 options {maxLength:<int>}
45
45
  * - 5 REPEAT_CHECK 重复校验 options {properties:[<fieldCodes>], isSubTableValidationAllData?, prompt:[{code,isDataItem}]}
@@ -54,7 +54,11 @@ export const DATARULE_CHECK_TYPES = Object.freeze({
54
54
  /** Options the 8.6.26 engine actually reads for each data-rule discriminator. */
55
55
  export const DATARULE_CHECK_OPTION_KEYS = Object.freeze({
56
56
  1: Object.freeze(["regexp", "regexpText"]),
57
- 2: Object.freeze(["conditions", "verifyType", "prompt"]),
57
+ // 2.1.5 `DataRuleOptions.validateHiddenProperties`(`launcher-2.1.5/cloudpivot-contracts-AI-Platform-v2.1.5/.../
58
+ // bizmodel/DataRuleOptions.java:18`)由服务端 `ConditionFilterUtil`(同批 :29)按它过滤隐藏字段;
59
+ // 条件是条件串,所以只有 checkType 2(唯一读 conditions 的类别)接受它。8.6.26 无此键——白名单是并集,
60
+ // 8.6 环境带着它写入无害(服务端忽略),但读取面会把它算作 effective 而非 ignored。
61
+ 2: Object.freeze(["conditions", "verifyType", "prompt", "validateHiddenProperties"]),
58
62
  3: Object.freeze(["isEmptyRow", "isEmptyRowTips"]),
59
63
  4: Object.freeze(["maxLength"]),
60
64
  5: Object.freeze(["noRepeat", "properties", "isSubTableValidationAllData", "prompt"]),
@@ -573,6 +577,31 @@ async function assertChildFormulaRefs(session, args, knownChildFields) {
573
577
  `(裸 {字段}=主记录字段,带点 {子表code.字段}=子表字段)。`,
574
578
  });
575
579
  }
580
+ /**
581
+ * T24(2.1.5):`validateHiddenProperties` 的自动保留。
582
+ *
583
+ * `datarule.update` 把 options **整份重发**(平台 update 是全行覆盖,见
584
+ * `fullDataRuleBody`),所以调用方只改 `prompt` 时,没带 `validateHiddenProperties`
585
+ * 就会把设计器配好的隐藏字段校验名单**静默清空**(服务端 `ConditionFilterUtil`
586
+ * 正是按这份名单过滤隐藏字段的必填/唯一校验:`launcher-2.1.5/.../ConditionFilterUtil.java:29`)。
587
+ * 规则:调用方显式给了该键(含 `null`/`[]`)就尊重;没给则从当前行 options 原样捎带。
588
+ *
589
+ * 只在目标类型/checkType 的白名单接受该键时合并(checkType 2),否则改 checkType
590
+ * 的更新会因残留键撞 `datarule-unknown-option-keys`。合并必须发生在
591
+ * `withStitchEditorText`/`withOptionsPropertyCodes` 之前,避免被后两者重建的 options 覆盖。
592
+ */
593
+ export function withPreservedHiddenValidation(options, currentOptions, dataRuleType, checkType) {
594
+ if (options.validateHiddenProperties !== undefined)
595
+ return options;
596
+ if (!effectiveOptionKeys(dataRuleType, checkType).includes("validateHiddenProperties"))
597
+ return options;
598
+ if (currentOptions === null || typeof currentOptions !== "object" || Array.isArray(currentOptions))
599
+ return options;
600
+ const stored = currentOptions.validateHiddenProperties;
601
+ if (stored === undefined)
602
+ return options;
603
+ return { ...options, validateHiddenProperties: stored };
604
+ }
576
605
  /** Ensure the wire `options` carries `propertyCodes` (comma-joined), as the designer writes it. */
577
606
  function withOptionsPropertyCodes(options, codes) {
578
607
  if (codes.length === 0)
@@ -1022,10 +1051,12 @@ export function registerDataRuleLane(tools) {
1022
1051
  if (duplicate)
1023
1052
  throw new ToolRefusalError({ status: "refused", blocker: "datarule-duplicate-property-type", nextCommand: `omc call datarule.update --args '${JSON.stringify({ id: String(duplicate.id ?? "<existingId>"), schemaCode: args.schemaCode, propertyCode: codes.length === 1 ? codes[0] : undefined, propertyCodes: codes.length > 1 ? codes : undefined, dataRuleType: args.dataRuleType, checkType: args.checkType, options: args.options })}'`, message: `字段 ${args.schemaCode}.${codes.join(",")} 已存在同类型数据规则${args.dataRuleType === 1 ? `(checkType ${args.checkType})` : ""};拒绝 update POST;如需修改请使用该规则 id 更新` });
1024
1053
  const beforeDecoded = decodeDataRule(current);
1054
+ // T24:先合并再走 withStitchEditorText/withOptionsPropertyCodes(两者会重建 options 对象)。
1055
+ const outgoingOptions = withPreservedHiddenValidation(args.options, parseOptions(current.options), args.dataRuleType, args.checkType);
1025
1056
  const performed = await wireCall(session, {
1026
1057
  path: ENDPOINTS.dataRuleUpdate,
1027
1058
  method: "POST",
1028
- body: fullDataRuleBody(current, boundArgs, JSON.stringify(withOptionsPropertyCodes(withStitchEditorText(args.options), codes))),
1059
+ body: fullDataRuleBody(current, boundArgs, JSON.stringify(withOptionsPropertyCodes(withStitchEditorText(outgoingOptions), codes))),
1029
1060
  });
1030
1061
  const record = (await listDataRules(session, args.schemaCode, args.dataRuleType)).find((row) => row.id === id);
1031
1062
  if (!record)
@@ -9,7 +9,8 @@ import { decodeJsonColumn, decodeJsonObjectColumn, JSON_COLUMN_NULL_COALESCE, JS
9
9
  import { syncFormConditionDataRules } from "./datarule.js";
10
10
  import { FORM_CONDITION_OPTION_KEYS } from "./datarule-protocol.js";
11
11
  import { defineTool, ToolRefusalError } from "../tool-types.js";
12
- import { wireCall, wireRows, WireError } from "../wire.js";
12
+ import { wireCall, wireRows, WireError, optionPublishMessages } from "../wire.js";
13
+ import { assertTreeSelectionOptions } from "../field-tree-options.js";
13
14
  import { executeFormDraftWrite, executeFormPublishWrite, readFormOrNull } from "../form-support.js";
14
15
  import { FIELD_LANE_CONTRACT } from "./field-contract.js";
15
16
  import { flattenTreeRows, mapBounded } from "../support.js";
@@ -1691,8 +1692,12 @@ export async function executeFieldPublish(session, args) {
1691
1692
  // pre-publish DRAFT shape (name + type). The draft face must be
1692
1693
  // snapshotted BEFORE the publish because a model-scoped publish can leave
1693
1694
  // it empty; the draft row is the caller-visible expectation.
1694
- const draftSnapshot = new Map(wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "false" } })).data)
1695
- .map((row) => [codeOf(row), { name: String(row.name ?? ""), propertyType: Number(row.type ?? row.propertyType) }]));
1695
+ // T19:发布门预检与已发布短路比对复用同一草稿读。快照本身只放 name/type
1696
+ //(detail 校验的 expected 会原样回给调用方);原始 options 单独一张表,
1697
+ // 避免把整列 options 带进 mismatches.expected。
1698
+ const draftRows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "false" } })).data);
1699
+ const draftSnapshot = new Map(draftRows.map((row) => [codeOf(row), { name: String(row.name ?? ""), propertyType: Number(row.type ?? row.propertyType) }]));
1700
+ const draftOptionsRawByCode = new Map(draftRows.map((row) => [codeOf(row), row.options]));
1696
1701
  const verifyFieldDetails = async (targets) => {
1697
1702
  const bounded = targets.slice(0, 25);
1698
1703
  const checked = await mapBounded(bounded, 5, async (code) => {
@@ -1731,9 +1736,9 @@ export async function executeFieldPublish(session, args) {
1731
1736
  // r29e F10/F11:旧短路只看「code 在发布面存在」,改了 options 仍报
1732
1737
  // already-published + verification.ok(假绿)。再比草稿/发布 options 指纹;
1733
1738
  // 不一致就真发布。name/type 仍由 verifyFieldDetails 核对。
1734
- const draftOptionsByCode = new Map(wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "false" } })).data)
1735
- .map((row) => [codeOf(row), optionsFingerprint(row.options)])
1736
- .filter(([code]) => code.length > 0));
1739
+ const draftOptionsByCode = new Map([...draftOptionsRawByCode]
1740
+ .filter(([code]) => code.length > 0)
1741
+ .map(([code, options]) => [code, optionsFingerprint(options)]));
1737
1742
  const publishedOptionsByCode = new Map(prePublishedRows
1738
1743
  .map((row) => [codeOf(row), optionsFingerprint(row.options)])
1739
1744
  .filter(([code]) => code.length > 0));
@@ -1762,6 +1767,12 @@ export async function executeFieldPublish(session, args) {
1762
1767
  },
1763
1768
  };
1764
1769
  }
1770
+ // T19(2026-11-24):2.1.5+ 的树形自定义下拉发布门。平台在模型级发布时
1771
+ // 递归校验 custom 树的 code/value 非空 + code 全树唯一,非法即整单失败
1772
+ // (外层 300004「数据模型不存在!」+ 逐项 301013,真正原因在 data 里)。
1773
+ // 这个预检必须在 POST 之前:already-published 短路只在 options 指纹一致时
1774
+ // 成立;改了 options 会走到这里真发布,正好被门拦。
1775
+ await assertTreeSelectionOptions(session, args.schemaCode, draftRows);
1765
1776
  // Ticket 79 live-fidelity (docker log evidence, 2026-09-13 21:43-21:45,
1766
1777
  // cloud8_launcher log_error.log + nginx access timings): under DB
1767
1778
  // connection-pool contention a model publish can fail with a transient
@@ -1788,6 +1799,29 @@ export async function executeFieldPublish(session, args) {
1788
1799
  // 「数据模型不存在!」。子表不是顶层 biz schema,发布是父模型级。旧回执只
1789
1800
  // 把裸 wire 错误冒泡 + 指向 omc help omc-refusals,用户只能自己猜父模型。
1790
1801
  if (error instanceof WireError && error.kind === "business" && error.errcode === 300004) {
1802
+ // T20(2026-11-24):2.1.5 把「树形自定义选项非法」的整单发布失败包成
1803
+ // 外层 300004 + 609016,真正原因在 data 的逐项 301013「…数据项的选项
1804
+ // 设置有误」(BizSchemaCheckServiceImpl :60-66 抛
1805
+ // BIZ_SCHEMA_MODEL_NOT_EXIST,明细在 data)。先认 payload,别让用户去
1806
+ // 查「模型不存在/子表」。
1807
+ const platformMessages = optionPublishMessages(error.payload);
1808
+ if (platformMessages.length > 0) {
1809
+ throw new ToolRefusalError({
1810
+ status: "refused",
1811
+ blocker: "field-options-publish-invalid",
1812
+ errcode: 300004,
1813
+ schemaCode: args.schemaCode,
1814
+ platformMessages,
1815
+ nextCommand: `omc call field.list --args '${JSON.stringify({ schemaCode: args.schemaCode, published: false })}'`,
1816
+ message: `平台在发布时拒绝了本模型的字段选项(外层 300004「数据模型不存在!」只是外壳,明细是 301013):${platformMessages.join(";")}。` +
1817
+ "这不是模型不存在、也不是子表 schemaCode 问题。2.1.5+ 在**模型级发布**时递归校验树形自定义下拉(optionsSet.optionsType=\"custom\" + " +
1818
+ "optionStructure=\"tree\"):每个节点的 code(平台内部叫**选项编码**,口语叫 key)与 value(显示值)必须非空,且 code 全树唯一" +
1819
+ "(RadioOptionsModel.validateCustomTreeOptions,launcher-2.1.5 .../bizmodel/RadioOptionsModel.java:130-142)。" +
1820
+ "8.6/8.7 不查;平铺自定义/字典/业务模型下拉也不查。修法:用 field.update 给报错字段的节点补非空 code/value。" +
1821
+ "若不需要层级,把 optionsSet.optionStructure 改成 \"flat\" 再发布。",
1822
+ nextAction: "先 omc call field.list --args '{\"schemaCode\":\"<model>\",\"published\":false}' 核对草稿字段的 optionsSet.custom 树;修好后重跑 field.publish",
1823
+ });
1824
+ }
1791
1825
  const parent = await findChildTableParent(session, args.schemaCode).catch(() => undefined);
1792
1826
  throw new ToolRefusalError({
1793
1827
  status: "refused",
@@ -19,7 +19,7 @@ const FORM_TOOLS = FORM_LANE_CONTRACT.tools;
19
19
  * `src/endpoints.ts` 由 discovery 片持有,本轮不新增 ENDPOINTS 键(w2 设计 §3.5
20
20
  * 的所有权划分)——单一真相仍是 contract 的 wire 事实。
21
21
  */
22
- const FORM_SHEET_LIST_PATH = "/api/api/app/bizsheet/list";
22
+ const FORM_SHEET_LIST_PATH = ENDPOINTS.sheetList;
23
23
  /** BizFormType.getIndex()(BizFormType.java:13-15,45-48);未知索引原样透传、不猜。 */
24
24
  const FORM_TYPE_NAMES = Object.freeze({ 0: "DEFAULT_SHEET", 1: "CUSTOMIZE_SHEET", 2: "PRINT_TEMPLATE" });
25
25
  const FORM_LIST_MAX_SHEETS = 12;
@@ -410,6 +410,22 @@ export function buttonsRenderCompat(buttons) {
410
410
  }
411
411
  return violations.length ? { ok: false, violations } : { ok: true };
412
412
  }
413
+ /**
414
+ * T22:2.1.5 树视图(`displayType="INLINE_LIST"`)条件行的三个树过滤组键
415
+ * (`BizQueryConditionModel.java:90,92,94`)。8.6 的条件行没有它们;读面只在
416
+ * 有值时才投影、写面只在基线含它们时设防,8.6 因此零影响。
417
+ */
418
+ export const LISTVIEW_TREE_CONDITION_KEYS = ["treeLimitScopeType", "treeLimitConditionGroup", "treeDefaultConditionGroup"];
419
+ /**
420
+ * 一行条件上「有值」的树过滤组键(undefined/null/空串视为没配)。读面投影与
421
+ * 写前保护共用这一个判定,避免「读得见但判成没值」的双面不一致。
422
+ */
423
+ export function treeConditionKeysPresent(row) {
424
+ return LISTVIEW_TREE_CONDITION_KEYS.filter((key) => {
425
+ const value = row[key];
426
+ return value !== undefined && value !== null && !(typeof value === "string" && value.trim() === "");
427
+ });
428
+ }
413
429
  /**
414
430
  * The keys a list-view condition (a filter CONTROL definition) accepts. Mirrors
415
431
  * `com.authine.cloudpivot.metadata.bizquery.BizQueryConditionModel` (8.6.26) at
@@ -437,6 +453,11 @@ const LISTVIEW_CONDITION_KEYS = new Set([
437
453
  "buildTreeBy",
438
454
  "visible",
439
455
  "filterType",
456
+ // T22:2.1.5 `BizQueryConditionModel.java:90,92,94` 的树视图过滤组三键
457
+ // (treeLimitScopeType / treeLimitConditionGroup / treeDefaultConditionGroup)。
458
+ // 8.6 的条件行没有它们;调用方显式传入时必须放行(否则
459
+ // listview-condition-unknown-key 会把「原样带回」的路堵死),值原样透传。
460
+ ...LISTVIEW_TREE_CONDITION_KEYS,
440
461
  ]);
441
462
  /**
442
463
  * Out-the-door dry lint for `sorts`/`conditions`/`actions`/`presentation`/
@@ -732,6 +753,30 @@ export function assertListViewConfigureShape(args) {
732
753
  if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
733
754
  throw new ToolRefusalError({ status: "refused", blocker: "listview-query-layer-invalid", message: "queryLayer entries must be objects" });
734
755
  }
756
+ // T21 零副作用拒收(写前、无 wire):2.1.5 的「内联树」
757
+ // (`BizQueryLayer.displayType="INLINE_LIST"`)不是纯配置——平台只在
758
+ // `/query/publish` 里初始化层级:`BizQueryController.java:979-986` 调
759
+ // `initializeHierarchyPath`,由 `HierarchyPathInitializationServiceImpl.java:59-140`
760
+ // 建 `_hierarchy_path_<hash>` LONG_TEXT 列 + 停写锁 + 全表回填 + 状态。OMC 走的是
761
+ // `/query/update`(`endpoints.ts` listQueryUpdate),写完视图立即 publish=TRUE 但
762
+ // 层级从未初始化 → 树加载抛 `HIERARCHY_PATH_MAINTENANCE_PENDING`
763
+ // (`QueryRuntimeController.java:457-470`),数据写入还可能撞未建列。8.6/8.7 的
764
+ // `BizQueryLayer` 没有 displayType/treeLoadMode,因此这条路径只能拒收、指路设计器。
765
+ // 只检查**本次显式传入**的 args.queryLayer:基线里已有的 INLINE_LIST 由
766
+ // `{...model}` echo 回写,其层级早已由当初的设计器发布初始化过,不在此列。
767
+ if (entry.displayType === "INLINE_LIST") {
768
+ throw new ToolRefusalError({
769
+ status: "refused",
770
+ blocker: "listview-inline-tree-needs-publish",
771
+ nextAction: "用平台设计器发布该视图(双端 PC/APP)让平台建层级路径列并回填,或先把该层改回普通层级(displayType 不用 INLINE_LIST)再配置",
772
+ message: "内联树(displayType=INLINE_LIST)不能经 OMC 的 /query/update 配置:" +
773
+ "平台只在 /query/publish 里初始化层级(BizQueryController.java:979-986 → " +
774
+ "HierarchyPathInitializationServiceImpl.java:59-140:建 _hierarchy_path_* LONG_TEXT 列 + 停写锁 + 全表回填 + 状态)," +
775
+ "而 /query/update 只落配置、随即 publish=TRUE;层级没初始化时树加载会抛 " +
776
+ "HIERARCHY_PATH_MAINTENANCE_PENDING(QueryRuntimeController.java:457-470),数据写入也可能撞未建列。" +
777
+ "8.6/8.7 的 BizQueryLayer 也没有 displayType/treeLoadMode。本次零写入拒绝;请改用平台设计器发布该视图,或先配置普通层级。",
778
+ });
779
+ }
735
780
  }
736
781
  }
737
782
  const multiTableHeaderConfig = args.multiTableHeaderConfig;
@@ -864,6 +909,12 @@ export function normalizeConditions(conditions, fieldRows, schemaCode) {
864
909
  row.includeSubData = condition.includeSubData;
865
910
  if (condition.buildTreeBy !== undefined)
866
911
  row.buildTreeBy = condition.buildTreeBy;
912
+ // T22:树过滤组三键(BizQueryConditionModel.java:90,92,94)。读面原样带出、
913
+ // 调用方显式带回时必须原样落到写报文,否则「允许带齐」只是放行却仍静默丢。
914
+ for (const key of LISTVIEW_TREE_CONDITION_KEYS) {
915
+ if (condition[key] !== undefined)
916
+ row[key] = condition[key];
917
+ }
867
918
  // A query condition IS a filter the list shows; the platform defaults an
868
919
  // omitted `visible` to false, which hides every filter the caller asked
869
920
  // for. Offer it shown unless the caller explicitly opts out.
@@ -1099,7 +1150,7 @@ export function decodeSortRow(row) {
1099
1150
  };
1100
1151
  }
1101
1152
  export function decodeConditionRow(row) {
1102
- return {
1153
+ const out = {
1103
1154
  propertyCode: row.propertyCode ?? null,
1104
1155
  propertyType: row.propertyType ?? null,
1105
1156
  displayType: decodeWireEnum(DISPLAY_TYPE, row.displayType),
@@ -1119,11 +1170,37 @@ export function decodeConditionRow(row) {
1119
1170
  buildTreeBy: row.buildTreeBy ?? null,
1120
1171
  visible: row.visible ?? null,
1121
1172
  };
1173
+ // T22:2.1.5 树视图过滤组三键(BizQueryConditionModel.java:90,92,94)。8.6 的
1174
+ // 条件行没有它们 → 一个字节都不新增;有值才带,避免给普通条件加三个 null 噪声。
1175
+ const presentTreeKeys = treeConditionKeysPresent(row);
1176
+ for (const key of LISTVIEW_TREE_CONDITION_KEYS) {
1177
+ if (presentTreeKeys.includes(key))
1178
+ out[key] = row[key];
1179
+ }
1180
+ return out;
1122
1181
  }
1123
1182
  export function readArray(model, key) {
1124
1183
  const value = model[key];
1125
1184
  return Array.isArray(value) ? value : [];
1126
1185
  }
1186
+ /**
1187
+ * T22:`listview.get` 精简面的 queryLayer 摘要。2.1.5 的 `BizQueryLayer` 新增
1188
+ * `displayType`/`treeLoadMode`(`docs/platform-contracts/2.1-delta.md:62`,8.6
1189
+ * 的 `apps.d.ts:145-205` 没有),但完整对象是设计器面的大载荷,精简面只回
1190
+ * 「这层是什么」:code/layerType/displayType/treeLoadMode,缺失键省略——8.6 的
1191
+ * 层对象不会凭空多出 displayType/treeLoadMode。
1192
+ */
1193
+ export function queryLayerSummary(queryLayer) {
1194
+ return queryLayer.map((layer) => {
1195
+ const summary = {};
1196
+ for (const key of ["code", "layerType", "displayType", "treeLoadMode"]) {
1197
+ const value = layer[key];
1198
+ if (value !== undefined && value !== null)
1199
+ summary[key] = value;
1200
+ }
1201
+ return summary;
1202
+ });
1203
+ }
1127
1204
  export function decodeActionRow(row) {
1128
1205
  const type = row.queryActionType;
1129
1206
  const association = row.associationType ?? row.queryActionRelativeType;
@@ -11,7 +11,7 @@ import { QUERY_ACTION_TYPE } from "omc-core/list-view-wire";
11
11
  import { resolveModelTreeNode } from "./model.js";
12
12
  import { NUMERICAL_FORMAT_DECIMALS, SYSTEM_FIELD_CODES, canonicalNumericalFormat } from "../field-families.js";
13
13
  import { LIST_VIEW_LANE_CONTRACT } from "./list-view-contract.js";
14
- import { assertListViewConfigureShape, decodeActionRow, decodeButtonRow, decodeConditionRow, decodeGantt, decodePresentation, decodeSortRow, listViewActionArg, listViewButtonArg, listViewConditionArg, listViewGanttArg, listViewMultiTableHeaderArg, listViewOptionsArg, listViewPresentationArg, listViewQueryLayerArg, listViewSortArg, mergeActions, PLATFORM_DEFAULT_LIST_ACTIONS, normalizeActions, normalizeButtons, normalizeConditions, normalizeGantt, normalizePresentation, normalizeSorts, parseConditionOptions, presentationTypeArg, readArray, resolveFieldRef, buttonsRenderCompat, columnsRenderCompat, } from "./list-view-shapes.js";
14
+ import { assertListViewConfigureShape, decodeActionRow, decodeButtonRow, decodeConditionRow, decodeGantt, decodePresentation, decodeSortRow, listViewActionArg, listViewButtonArg, listViewConditionArg, listViewGanttArg, listViewMultiTableHeaderArg, listViewOptionsArg, listViewPresentationArg, listViewQueryLayerArg, listViewSortArg, mergeActions, PLATFORM_DEFAULT_LIST_ACTIONS, normalizeActions, normalizeButtons, normalizeConditions, normalizeGantt, normalizePresentation, normalizeSorts, parseConditionOptions, presentationTypeArg, queryLayerSummary, readArray, resolveFieldRef, treeConditionKeysPresent, buttonsRenderCompat, columnsRenderCompat, } from "./list-view-shapes.js";
15
15
  // Ticket 53: every shape (enum/zod/encode/decode/lint) lives once in
16
16
  // ./list-view-shapes.ts and is re-exported for existing import paths.
17
17
  export { assertListViewConfigureShape } from "./list-view-shapes.js";
@@ -37,6 +37,59 @@ function sumTypeByCodeFromPresentation(model) {
37
37
  }
38
38
  return out;
39
39
  }
40
+ /**
41
+ * T14 最小安全网:CloudPivot 2.1.5 的 BizQueryModel 新增顶层
42
+ * `queryDataRangeRestriction`(`{clientType:"PC"|…, conditionGroup:[[{propertyCode,…}]]}`,
43
+ * 即「数据范围限制」)。平台 `saveBizQueryDetail` 是 **delete-on-omit**:
44
+ * 先按 clientType 删掉旧条、再加 incoming(launcher-2.1.5 ModelManagementFacadeImpl.java:2159-2161,242-243)
45
+ * ——请求里没带这个键 = 静默删除,且照样回 200。
46
+ *
47
+ * 因此读面/写后校验都需要一个**只含计数与客户端**的摘要(不回传全量条件:
48
+ * 体积大且条件里可能有业务敏感值)。raw 既可能是对象,也可能是 JSON 字符串
49
+ * (PowerShell ConvertFrom-Json 等中转会把对象摊平/还原成字符串,同
50
+ * flowWorkflowCodeFromActionConfig 的处理惯例)。
51
+ */
52
+ export function dataRangeRestrictionSummary(raw) {
53
+ let value = null;
54
+ if (typeof raw === "string") {
55
+ const text = raw.trim();
56
+ // 空串 = 平台侧没配(String 列的空值),等同缺席。
57
+ if (text === "")
58
+ return { present: false };
59
+ try {
60
+ const parsed = JSON.parse(text);
61
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed))
62
+ value = parsed;
63
+ }
64
+ catch {
65
+ return { present: false };
66
+ }
67
+ }
68
+ else if (raw !== null && typeof raw === "object" && !Array.isArray(raw)) {
69
+ value = raw;
70
+ }
71
+ if (value === null)
72
+ return { present: false };
73
+ // conditionGroup 是 List<List<…>>:外层是「条件组」,每组是一个条件数组。
74
+ // 单元素数组被中转摊平成对象的情形按 1 条计(只影响计数,不影响判定)。
75
+ let groupCount = 0;
76
+ let conditionCount = 0;
77
+ if (Array.isArray(value.conditionGroup)) {
78
+ groupCount = value.conditionGroup.length;
79
+ for (const group of value.conditionGroup) {
80
+ if (Array.isArray(group))
81
+ conditionCount += group.length;
82
+ else if (group !== null && typeof group === "object")
83
+ conditionCount += 1;
84
+ }
85
+ }
86
+ return {
87
+ present: true,
88
+ ...(typeof value.clientType === "string" && value.clientType.length > 0 ? { clientType: value.clientType } : {}),
89
+ groupCount,
90
+ conditionCount,
91
+ };
92
+ }
40
93
  function fieldOptions(options) {
41
94
  if (typeof options === "string") {
42
95
  try {
@@ -402,6 +455,20 @@ export function registerListViewLane(tools) {
402
455
  const conditions = readArray(model, "queryConditions")
403
456
  .map(decodeConditionRow)
404
457
  .sort((a, b) => String(a.propertyCode ?? "").localeCompare(String(b.propertyCode ?? "")));
458
+ // T14:2.1.5 的 queryDataRangeRestriction 不在精简面的任何既有投影里,
459
+ // 调用方无法验收它「还在」。键存在(非 undefined/null)才回摘要;8.6 没有
460
+ // 这个键 → 一个字节都不新增(键缺席 = 该版本族无此配置面)。full:true
461
+ // 已在上面原样回报文,保持不动。
462
+ const dataRangeRestriction = model.queryDataRangeRestriction !== undefined && model.queryDataRangeRestriction !== null
463
+ ? dataRangeRestrictionSummary(model.queryDataRangeRestriction)
464
+ : undefined;
465
+ // T22:2.1.5 的 queryLayer(含 displayType/treeLoadMode)不在这条精简面的任何
466
+ // 既有投影里,调用方无法验收「层级/树加载方式还是我配的那样」。只回摘要
467
+ // (code/layerType/displayType/treeLoadMode),不回全量层对象;空数组或 8.6
468
+ // 无该键时不新增任何字节。full:true 已原样回报文,保持不动。
469
+ const queryLayer = Array.isArray(model.queryLayer) && model.queryLayer.length > 0
470
+ ? queryLayerSummary(model.queryLayer)
471
+ : undefined;
405
472
  return {
406
473
  schemaCode: args.schemaCode,
407
474
  code,
@@ -468,6 +535,8 @@ export function registerListViewLane(tools) {
468
535
  return { buttons: decoded };
469
536
  })(),
470
537
  options: model.options !== undefined && model.options !== null ? parseConditionOptions(model.options) : null,
538
+ ...(dataRangeRestriction !== undefined ? { dataRangeRestriction } : {}),
539
+ ...(queryLayer !== undefined ? { queryLayer } : {}),
471
540
  // Round 16 (bench65 feedback): the query row's `published=false` is NOT
472
541
  // an "inactive view" signal — a list view has no draft/publish
473
542
  // lifecycle; this column is a design-time placeholder. The view is
@@ -688,8 +757,48 @@ export function registerListViewLane(tools) {
688
757
  const model = (got.data ?? {});
689
758
  if (!model.id)
690
759
  throw new WireError("business", `list view ${code} not found on ${args.schemaCode}`, 302025);
760
+ // T14:写前基线(2.1.5 才有的键;8.6 读到 undefined → present:false,后续
761
+ // 守卫与写后校验全部不触发,回执不多一个字节)。
762
+ const dataRangeBefore = dataRangeRestrictionSummary(model.queryDataRangeRestriction);
691
763
  const columns = Array.isArray(model.queryColumns) ? ([...model.queryColumns]) : [];
692
764
  const fieldRows = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.schemaCode, isPublish: "true" } })).data);
765
+ // T22 写前保护(零副作用):conditions 是**整体替换**(下面的
766
+ // `body.queryConditions = normalizedConditions`),而 normalizeConditions 只投影
767
+ // 8.6 的固定键面。2.1.5 的树视图条件组三键(`BizQueryConditionModel.java:90,92,94`:
768
+ // treeLimitScopeType / treeLimitConditionGroup / treeDefaultConditionGroup)在基线里
769
+ // 存在、提交行却没带 → 平台照常 200 保存,但树过滤组被静默清掉。基线有、提交缺就拒;
770
+ // 调用方显式带齐则放行。没有任何 tree 键时(8.6 同样没有)零影响。
771
+ if (args.conditions !== undefined) {
772
+ const submittedByCode = new Map();
773
+ for (const row of args.conditions) {
774
+ const ref = String(row.propertyCode ?? "");
775
+ const resolved = (ref.length > 0 ? resolveFieldRef(fieldRows, ref)?.code : undefined) ?? ref;
776
+ if (!submittedByCode.has(resolved))
777
+ submittedByCode.set(resolved, row);
778
+ }
779
+ const lost = readArray(model, "queryConditions").flatMap((row) => {
780
+ const required = treeConditionKeysPresent(row);
781
+ if (required.length === 0)
782
+ return [];
783
+ const propertyCode = String(row.propertyCode ?? "");
784
+ const supplied = treeConditionKeysPresent(submittedByCode.get(propertyCode) ?? {});
785
+ const missing = required.filter((key) => !supplied.includes(key));
786
+ return missing.length > 0 ? [{ propertyCode, keys: missing }] : [];
787
+ });
788
+ if (lost.length > 0)
789
+ throw new ToolRefusalError({
790
+ status: "refused",
791
+ blocker: "listview-tree-conditions-would-be-lost",
792
+ schemaCode: args.schemaCode,
793
+ code,
794
+ lost,
795
+ nextAction: "把 treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup 原样带进对应 propertyCode 的条件行(值照抄基线)后重试;本次不想改 conditions 就省略该参数;或用 omc call 的逃生口自行承担替换语义",
796
+ message: "conditions 是整体替换:本视图基线条件里的树过滤组会被静默清掉。" +
797
+ `受影响条件:${lost.map((entry) => `${entry.propertyCode}(${entry.keys.join("/")})`).join("、")}。` +
798
+ "2.1.5 的 BizQueryConditionModel.java:90,92,94 有 treeLimitScopeType/treeLimitConditionGroup/treeDefaultConditionGroup 三键," +
799
+ "提交行未原样带回即随整表替换丢失(平台仍回 200,树过滤组消失)。把这三键原样带进对应条件行,或本次不要改 conditions。",
800
+ });
801
+ }
693
802
  let sortKey = columns.reduce((max, c) => Math.max(max, Number(c.sortKey) || 0), 0);
694
803
  const added = [];
695
804
  const updated = [];
@@ -901,6 +1010,25 @@ export function registerListViewLane(tools) {
901
1010
  if (args.multiTableHeaderConfig !== undefined) {
902
1011
  body.multiTableHeaderConfig = encodeJsonColumn(args.multiTableHeaderConfig);
903
1012
  }
1013
+ // T14 写前守卫(零副作用):body 现在是 `{...model, queryColumns}`,正常路径
1014
+ // 天然带回该键。但平台是 delete-on-omit(launcher-2.1.5
1015
+ // ModelManagementFacadeImpl.java:2159-2161,242-243:先按 clientType 删旧条再
1016
+ // 加 incoming),任何将来「从 spec 构造 body / 用 header 起稿」的重构都会
1017
+ // 静默清空既有数据范围限制并回 200。基线有值而 body 缺键时直接拒。
1018
+ // 只对**非空**基线设防:平台对未配置/空组返回 {} 或空 conditionGroup 时,
1019
+ // 「丢了」本来也没有内容可丢,不应误报。
1020
+ if (dataRangeBefore.present && (dataRangeBefore.conditionCount ?? 0) > 0 && !Object.prototype.hasOwnProperty.call(body, "queryDataRangeRestriction"))
1021
+ throw new ToolRefusalError({
1022
+ status: "refused",
1023
+ blocker: "listview-datarange-echo-missing",
1024
+ schemaCode: args.schemaCode,
1025
+ code,
1026
+ dataRangeRestriction: dataRangeBefore,
1027
+ nextCommand: `omc call listview.get --args '${JSON.stringify({ schemaCode: args.schemaCode, code, full: true })}'`,
1028
+ message: "平台 saveBizQueryDetail 是 delete-on-omit(ModelManagementFacadeImpl.java:2159-2161,242-243):按 clientType 先删旧条再加 incoming," +
1029
+ "请求未带 queryDataRangeRestriction 会把既有数据范围限制静默删除且返回成功。" +
1030
+ "本视图当前已配置数据范围限制,写入 body 必须原样回传该键;先 listview.get --full 取证,再重试。",
1031
+ });
904
1032
  const performed = await wireCall(session, { path: ENDPOINTS.listQueryUpdate, method: "POST", body });
905
1033
  // BUG-11 (live, docker+source verified): the controller's /query/update
906
1034
  // forces publish=TRUE and the engine's updateBizQuery SKIPS the entity
@@ -1034,6 +1162,24 @@ export function registerListViewLane(tools) {
1034
1162
  if (afterModel.multiTableHeaderConfig !== undefined && afterModel.multiTableHeaderConfig !== null && afterModel.multiTableHeaderConfig !== "") {
1035
1163
  readback.multiTableHeaderConfig = parseConditionOptions(afterModel.multiTableHeaderConfig);
1036
1164
  }
1165
+ // T14 写后校验:写已发生,所以不用 ok/失败表达丢失,而是回一个状态字段。
1166
+ // 仅当基线本来就有数据范围限制时才校验(8.6 无此面 → 不加任何键)。
1167
+ if (dataRangeBefore.present && (dataRangeBefore.conditionCount ?? 0) > 0) {
1168
+ const dataRangeAfter = dataRangeRestrictionSummary(afterModel.queryDataRangeRestriction);
1169
+ const preserved = dataRangeAfter.present &&
1170
+ dataRangeAfter.clientType === dataRangeBefore.clientType &&
1171
+ dataRangeAfter.groupCount === dataRangeBefore.groupCount &&
1172
+ dataRangeAfter.conditionCount === dataRangeBefore.conditionCount;
1173
+ readback.dataRangeRestriction = preserved
1174
+ ? { status: "preserved", ...dataRangeAfter }
1175
+ : {
1176
+ // present 但计数/客户端变了 = 平台改写(coerced);整键不见了 = lost。
1177
+ status: dataRangeAfter.present ? "coerced" : "lost",
1178
+ before: dataRangeBefore,
1179
+ after: dataRangeAfter,
1180
+ message: "平台 delete-on-omit:请求未带 queryDataRangeRestriction(或平台改写)会把既有数据范围限制删掉/改形且返回成功(ModelManagementFacadeImpl.java:2159-2161,242-243)。写已发生,本字段是状态而非失败;用 listview.get --full 复核并到设计器重建数据范围限制。",
1181
+ };
1182
+ }
1037
1183
  return { performed: { errcode: performed.errcode }, readback };
1038
1184
  },
1039
1185
  preflight: assertListViewConfigureShape,
@@ -16,6 +16,7 @@ import { writeTool } from "../write.js";
16
16
  import { registerPackageTool } from "../package-tool.js";
17
17
  import { defineTool, ToolInputError, ToolRefusalError } from "../tool-types.js";
18
18
  import { wireCall, wireRows, WireError } from "../wire.js";
19
+ import { assertTreeSelectionOptions } from "../field-tree-options.js";
19
20
  import { readModelRecord } from "../model-record.js";
20
21
  import { MODEL_CREATE_BODY_DEFAULTS, MODEL_LANE_CONTRACT } from "./model-contract.js";
21
22
  import { flattenFolders } from "./folder.js";
@@ -1574,10 +1575,21 @@ export function registerModelLane(tools) {
1574
1575
  return failed;
1575
1576
  }
1576
1577
  const existingFields = new Map();
1578
+ // T19:发布门校验的是**草稿面** options。existingFields 会被 isPublish=true
1579
+ // 的行覆盖(后写胜),不能拿它做预检——否则「草稿树非法、已发布面仍是旧合法值」
1580
+ // 会漏检,直到平台整单 300004。草稿面单独留一份。
1581
+ const draftFields = new Map();
1577
1582
  const mergedFieldCodes = [];
1583
+ // T19:本次新建字段的线上 options(create 后已落库,发布门预检也需要
1584
+ // 覆盖它们——existingFields 只含调用开始时读到的行)。
1585
+ const createdOptions = new Map();
1578
1586
  for (const isPublish of ["false", "true"]) {
1579
- for (const row of wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.code, isPublish } })).data))
1580
- existingFields.set(String(row.code ?? row.propertyCode ?? ""), row);
1587
+ for (const row of wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.code, isPublish } })).data)) {
1588
+ const code = String(row.code ?? row.propertyCode ?? "");
1589
+ existingFields.set(code, row);
1590
+ if (isPublish === "false")
1591
+ draftFields.set(code, row);
1592
+ }
1581
1593
  }
1582
1594
  const configureTargetVersion = session.detectedVersion();
1583
1595
  for (const entry of entries) {
@@ -1599,6 +1611,7 @@ export function registerModelLane(tools) {
1599
1611
  }
1600
1612
  const prepared = prepareFieldChange(input);
1601
1613
  const performed = await wireCall(session, { path: ENDPOINTS.fieldCreate, method: "POST", body: fieldChangeWireBody(input, prepared) });
1614
+ createdOptions.set(entry.code, prepared.options);
1602
1615
  const after = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.code, isPublish: "false" } })).data);
1603
1616
  if (!after.some((row) => String(row.code ?? row.propertyCode) === entry.code))
1604
1617
  throw new ToolRefusalError({ status: "refused", blocker: "field-create-readback-failed", message: `field.create 后权威草稿字段未读到 ${entry.code}` });
@@ -1609,6 +1622,14 @@ export function registerModelLane(tools) {
1609
1622
  return failed;
1610
1623
  }
1611
1624
  failed = await run(results.length, "field.publish", async () => {
1625
+ // T19(2026-11-24):2.1.5+ 树形自定义下拉发布门(custom + tree 节点的
1626
+ // code/value 非空、code 全树唯一)。平台在模型级发布时整单拒(外层
1627
+ // 300004 + 逐项 301013),所以在 POST 前先用草稿行做同样预检。复用启动
1628
+ // 时读到的 existingFields,并补上本次新建字段的 options。
1629
+ await assertTreeSelectionOptions(session, args.code, [
1630
+ ...draftFields.values(),
1631
+ ...[...createdOptions].map(([code, options]) => ({ code, options })),
1632
+ ]);
1612
1633
  const performed = await wireCall(session, { path: ENDPOINTS.fieldPublish, method: "POST", body: { bizSchemaCode: args.code, sendMessage: false } });
1613
1634
  const after = wireRows((await wireCall(session, { path: ENDPOINTS.fieldList, query: { schemaCode: args.code, isPublish: "true" } })).data);
1614
1635
  const publishedCodes = new Set(after.map((row) => String(row.code ?? row.propertyCode)));
@@ -123,13 +123,29 @@ export function registerOnlineJsLane(tools) {
123
123
  return { schemaCode: args.schemaCode, sheetCode, present: false, hint: "表单不存在——先 form.draft/表单创建" };
124
124
  const draft = readCustomScriptSource(typeof sheet.draftHtmlJson === "string" ? sheet.draftHtmlJson : null);
125
125
  const published = readCustomScriptSource(typeof sheet.publishedHtmlJson === "string" ? sheet.publishedHtmlJson : null);
126
+ // 平台设计器保存时会把 IIFE 之外的代码拆到 beforeCustomScript/afterCustomScript
127
+ // (8.6 的 javaScriptSplit 就有,2.1.5 只是抽成 helper)。只回 customScript 会让
128
+ // 调用方以为 helper 代码丢了。这里如实列出非空的两段(空段不占字节)。
129
+ const segmentsOf = (raw) => {
130
+ const elements = parseLayoutElements(raw);
131
+ const pick = (id) => {
132
+ const element = elements.find((candidate) => candidate.id === id);
133
+ const text = typeof element?.innerHTML === "string" ? element.innerHTML : "";
134
+ return text.trim() === "" ? undefined : { bytes: Buffer.byteLength(text, "utf8"), sha256: createHash("sha256").update(text, "utf8").digest("hex"), script: text };
135
+ };
136
+ const before = pick("beforeCustomScript");
137
+ const after = pick("afterCustomScript");
138
+ return before === undefined && after === undefined ? undefined : { ...(before !== undefined ? { before } : {}), ...(after !== undefined ? { after } : {}) };
139
+ };
140
+ const draftSegments = segmentsOf(typeof sheet.draftHtmlJson === "string" ? sheet.draftHtmlJson : null);
141
+ const publishedSegments = segmentsOf(typeof sheet.publishedHtmlJson === "string" ? sheet.publishedHtmlJson : null);
126
142
  return {
127
143
  schemaCode: args.schemaCode,
128
144
  sheetCode,
129
145
  present: draft.present || published.present,
130
146
  sheetPublished: sheet.published === true,
131
- draft: { ...draft, scriptSha256: draft.sha256 || undefined, ...(draft.script === null ? { note: "草稿无 customScript 脚本(尚未 compose 或被清空)" } : {}) },
132
- published: { ...published, scriptSha256: published.sha256 || undefined, ...(published.script === null ? { note: "发布面无 customScript 脚本" } : {}) },
147
+ draft: { ...draft, scriptSha256: draft.sha256 || undefined, ...(draft.script === null ? { note: "草稿无 customScript 脚本(尚未 compose 或被清空)" } : {}), ...(draftSegments !== undefined ? { segments: draftSegments } : {}) },
148
+ published: { ...published, scriptSha256: published.sha256 || undefined, ...(published.script === null ? { note: "发布面无 customScript 脚本" } : {}), ...(publishedSegments !== undefined ? { segments: publishedSegments } : {}) },
133
149
  ...(draft.sha256 !== "" && published.sha256 !== ""
134
150
  ? { draftPublishedInSync: draft.sha256 === published.sha256 }
135
151
  : {}),
@@ -47,7 +47,7 @@ function permissionGroupRows(data) {
47
47
  // 8.7(AI-Platform v1.1.23-dsj.8)的 DataPermissionType 新增 MY_BRANCH_OFFICE=7「同机构」;
48
48
  // 未知值原样回传(不降级成 1/6),否则读回后回写会把新权限改坏。
49
49
  const permissionType = (v) => ({ 1: "全部可见", 2: "本部门", 3: "仅自己", 4: "自定义", 5: "角色管理范围", 6: "均不可见", 7: "同机构" }[String(v)] ?? (v == null ? null : v));
50
- const PERMISSION_UPDATE_FUNCTION = "/api/api/system/permission/update_function";
50
+ const PERMISSION_UPDATE_FUNCTION = ENDPOINTS.permissionUpdateFunction;
51
51
  /**
52
52
  * r96(2026-11-24,真机会话 40 次 `perm.auth` 摩擦):动作码此前只活在源码里,
53
53
  * `describe perm.auth` 只显示 `grants: array<object>`,非法码只回「未知视图动作码:xxx」