@stalfh233/omc-cli 0.8.35 → 0.8.36
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.
- package/dist/approval-flow.js +1 -1
- package/dist/cli.js +12 -0
- package/dist/form-support.js +692 -13
- package/dist/lanes/app.js +47 -6
- package/dist/lanes/businessrule.js +24 -8
- package/dist/lanes/form-contract.js +3 -3
- package/dist/lanes/form.js +47 -14
- package/dist/lanes/runtime-data/record-write.js +18 -2
- package/dist/lanes/runtime-data/shapes.js +23 -0
- package/dist/lanes/runtime-data/submission.js +20 -0
- package/dist/lanes/runtime-data/write-support.js +112 -0
- package/dist/model-purge.js +62 -26
- package/dist/plan.js +63 -5
- package/dist/read-projection.js +42 -0
- package/dist/read-shapes.js +4 -3
- package/dist/read.js +3 -1
- package/dist/recipes/field.js +7 -3
- package/dist/recipes/form.js +51 -1
- package/dist/recipes/runtime-data.js +2 -1
- package/dist/search-index.js +4 -0
- package/dist/write-outcome.js +14 -0
- package/package.json +3 -3
- package/skills/omc-business-configuration.md +7 -6
- package/skills/omc-capabilities.md +1 -0
package/dist/model-purge.js
CHANGED
|
@@ -562,24 +562,37 @@ export async function executePurge(plan, session, call) {
|
|
|
562
562
|
// referrers 拼 deletionOrder/nextCommand:自引用(子表列 parentCode 解析回自身)
|
|
563
563
|
// 时得到 ["m","m"],nextCommand 只是重跑同一条命令——照做必再撞同一拒绝。
|
|
564
564
|
let deleteRefusal;
|
|
565
|
+
// F12(探针 AA,0.8.36):删除确认只认**记录面 absent**(或计划时模型本就不
|
|
566
|
+
// 存在);平台 deleteTask FAIL 直接判失败——absent=true 遇到 FAIL 也不能算成功
|
|
567
|
+
// (model.ts 同口径:记录面 absent 只说明还没删)。
|
|
568
|
+
let deleteConfirmed = !plan.modelExists;
|
|
569
|
+
let deleteTask;
|
|
565
570
|
if (!failed) {
|
|
566
571
|
const outcome = await call("model.delete", { schemaCode });
|
|
567
572
|
const readback = outcome.result.readback;
|
|
568
573
|
const absent = readback?.absent === true || outcome.result.performed?.skipped === "already-absent";
|
|
574
|
+
deleteTask = readback?.deleteTask !== null && typeof readback?.deleteTask === "object" ? readback.deleteTask : undefined;
|
|
575
|
+
const taskFailed = deleteTask?.taskStatus === "FAIL";
|
|
569
576
|
referrers = Array.isArray(outcome.result.referencingModels)
|
|
570
577
|
? outcome.result.referencingModels.map((row) => String(row.schemaCode ?? "")).filter((code) => code.length > 0)
|
|
571
578
|
: [];
|
|
572
579
|
const refusalMessage = typeof outcome.result.message === "string" && outcome.result.message.length > 0 ? outcome.result.message : refusalText(outcome.result);
|
|
573
|
-
record(`model.delete:${schemaCode}`, outcome.ok || absent, outcome.ok || absent
|
|
580
|
+
record(`model.delete:${schemaCode}`, (outcome.ok || absent) && !taskFailed, (outcome.ok || absent) && !taskFailed
|
|
574
581
|
? (readback ? { cascades: true, absent: readback.absent ?? null } : undefined)
|
|
575
|
-
: {
|
|
576
|
-
|
|
582
|
+
: {
|
|
583
|
+
message: taskFailed ? `平台删除任务失败:${String(deleteTask?.message ?? refusalMessage)}` : refusalMessage,
|
|
584
|
+
...(referrers.length > 0 ? { referencedBy: referrers } : {}),
|
|
585
|
+
});
|
|
586
|
+
if ((!outcome.ok && !absent) || taskFailed) {
|
|
577
587
|
failed = true;
|
|
578
588
|
const inboundReferences = Array.isArray(outcome.result.inboundReferences) ? outcome.result.inboundReferences : [];
|
|
579
589
|
const deletionSteps = Array.isArray(outcome.result.deletionSteps) ? outcome.result.deletionSteps : [];
|
|
580
590
|
if (inboundReferences.length > 0)
|
|
581
591
|
deleteRefusal = { inboundReferences, deletionSteps, message: refusalMessage };
|
|
582
592
|
}
|
|
593
|
+
else {
|
|
594
|
+
deleteConfirmed = !plan.modelExists || absent;
|
|
595
|
+
}
|
|
583
596
|
}
|
|
584
597
|
const status = failed ? "partial" : "ok";
|
|
585
598
|
const mixedReferencesAtRefusal = plan.unbindReferences !== true && selfLabels.size > 0 && (plan.crossModelUnbindSteps?.length ?? 0) > 0;
|
|
@@ -618,18 +631,29 @@ export async function executePurge(plan, session, call) {
|
|
|
618
631
|
`拆完引用后由 model.delete 级联;② 自己按 deletionSteps 逐条执行。` +
|
|
619
632
|
(refusalHasCrossModel ? "不要在未拆引用时重试 --apply(不带 --unbind-references 仍会零写入拒绝)。" : ""),
|
|
620
633
|
}
|
|
621
|
-
:
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
: "
|
|
628
|
-
|
|
634
|
+
: deleteTask?.taskStatus === "FAIL"
|
|
635
|
+
? {
|
|
636
|
+
nextAction: "fix-and-rerun",
|
|
637
|
+
deleteTask,
|
|
638
|
+
modelDeleteTaskFailed: true,
|
|
639
|
+
...(referrers.length > 0 ? { blockedBy: referrers } : {}),
|
|
640
|
+
message: `${schemaCode} 未删除:平台删除任务失败(deleteTask.taskStatus=FAIL,真因见 deleteTask.message:${String(deleteTask?.message ?? "平台未返回 message")})。` +
|
|
641
|
+
`记录面 absent 只说明还没删,不代表成功。按平台原文拆引用/清理残留后重试 --apply(幂等);先只读复核再动手。`,
|
|
642
|
+
}
|
|
643
|
+
: {
|
|
644
|
+
nextAction: "fix-and-rerun",
|
|
645
|
+
...(referrers.length > 0 ? { blockedBy: referrers } : {}),
|
|
646
|
+
message: referrers.length > 0
|
|
647
|
+
? `${schemaCode} 仍被 ${referrers.join("、")} 的关联字段引用,模型不能删。先跑 omc model-purge --code ${schemaCode}(dry-run)拿 inboundReferences / deletionSteps;` +
|
|
648
|
+
`再加 --unbind-references --apply 让一条命令自动拆引用(破坏性:会删除引用列),或逐条拆后再 --apply。`
|
|
649
|
+
: "在失败的这一步停下(幂等,可修好后重跑同一条命令)。已成功的步骤不会重复破坏。",
|
|
650
|
+
};
|
|
629
651
|
const result = {
|
|
630
652
|
status,
|
|
631
653
|
schemaCode,
|
|
632
|
-
|
|
654
|
+
// F12(探针 AA,0.8.36):verdict 只认记录面——已删净(absent)就 clean,
|
|
655
|
+
// 未确认(模型记录仍在)才是 cascading;失败一律 partial。
|
|
656
|
+
verdict: failed ? "partial" : deleteConfirmed ? "clean" : "cascading",
|
|
633
657
|
...(plan.workflowCode !== undefined ? { workflowCode: plan.workflowCode } : {}),
|
|
634
658
|
...(plan.unbindReferences === true
|
|
635
659
|
? { unbindReferences: true }
|
|
@@ -652,20 +676,32 @@ export async function executePurge(plan, session, call) {
|
|
|
652
676
|
steps,
|
|
653
677
|
...(failed
|
|
654
678
|
? failureFields
|
|
655
|
-
:
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
"
|
|
668
|
-
|
|
679
|
+
: {
|
|
680
|
+
// F12(探针 AA,0.8.36):已删净(记录面 absent=true)不再教「重跑本
|
|
681
|
+
// 命令」(那会被读成「还没删完」并触发重复删除);只给只读复核。
|
|
682
|
+
...(deleteConfirmed
|
|
683
|
+
? {
|
|
684
|
+
note: "已删净(记录面 absent=true):流程实例逐个删除 → " +
|
|
685
|
+
(unbindOutcome !== undefined ? "拆入站引用(field.delete 引用列 → field.publish 所属模型)→ " : "") +
|
|
686
|
+
"model.delete 级联带走流程模板/列表视图/字段/表单/业务规则;平台记录面已确认 absent。" +
|
|
687
|
+
"**这就是 r12–r14 三次脏沙盒的根治**:实例先走,就不会留下指向空模板的待办。",
|
|
688
|
+
recheckCommand: `omc residue ${schemaCode}`,
|
|
689
|
+
}
|
|
690
|
+
: {
|
|
691
|
+
note: "尚未确认删净(记录面仍能读到模型):model.delete 是平台异步任务(建删除历史后立即返回,级联时长不定),absent=false 只表示级联仍在进行,不是失败。" +
|
|
692
|
+
"先只读复核(recheckCommand / data.list),仍在再幂等重跑本命令;不要凭「命令已返回」当作已删除。",
|
|
693
|
+
recheckCommand: `omc residue ${schemaCode}`,
|
|
694
|
+
...(deleteTask !== undefined ? { deleteTask } : {}),
|
|
695
|
+
}),
|
|
696
|
+
...(unremovableInstances.length > 0
|
|
697
|
+
? {
|
|
698
|
+
cleanupWarning: `${unremovableInstances.length} 条停滞实例无法通过平台 REST 删除(delete_instance 50000:业务对象已不存在,平台 NPE)。` +
|
|
699
|
+
"它们没有在办待办,所以不会污染全局待办搜索;模型已按其能力级联清理。" +
|
|
700
|
+
"残留的 `biz_workflow_instance` 行需要维护者清库(平台不提供强制删除面);再次用同 code 建流程前先清,否则新实例会继承这些行。",
|
|
701
|
+
maintainerAction: `DELETE FROM biz_workflow_instance WHERE id IN (${unremovableInstances.map((item) => `'${item.id}'`).join(", ")});`,
|
|
702
|
+
}
|
|
703
|
+
: {}),
|
|
704
|
+
}),
|
|
669
705
|
};
|
|
670
706
|
return { failed, result };
|
|
671
707
|
}
|
package/dist/plan.js
CHANGED
|
@@ -52,13 +52,71 @@ function smallStringPreview(value) {
|
|
|
52
52
|
/**
|
|
53
53
|
* F5(探针 Y,0.8.34):`formData` 的子表值是数组,`smallStringPreview` 只收标量,
|
|
54
54
|
* 于是 dry-run 静默省略子表行——调用方在提交前看不到「子表到底带了几行」。
|
|
55
|
-
*
|
|
56
|
-
*
|
|
55
|
+
*
|
|
56
|
+
* F9(探针 AA,0.8.36):旧实现只给**首行**,多行子表在提交前无法核对第 2..n 行。
|
|
57
|
+
* 现在在 400B 预算内尽量多给**整行**:`rows:[...]`(每行只含标量叶子),
|
|
58
|
+
* `omittedRows = count - rows.length`;`firstRow` 保留为兼容别名(= rows[0])。
|
|
59
|
+
*
|
|
60
|
+
* F9 复审(2026-12-02):预算必须按**回执真实 JSON 字节**算。旧实现只累加每行
|
|
61
|
+
* value 的字节,key/引号/冒号/逗号/数组括号全不计,于是「value 总长 380B」的
|
|
62
|
+
* 一行实际序列化 600B 仍被当预算内塞进回执。现在每加一行都拿候选
|
|
63
|
+
* `JSON.stringify([...rows, row])` 的实际字节与 400 比;放不下整行就停,不塞
|
|
64
|
+
* 半行(半行比不给更容易被误读成「这行缺字段」)。仅当**首行本身**就超预算时,
|
|
65
|
+
* 退回按同一 JSON 字节预算裁剪出的标量叶子集合,保证 `firstRow` 仍在。
|
|
57
66
|
*/
|
|
67
|
+
const CHILD_PREVIEW_BUDGET_BYTES = 400;
|
|
68
|
+
/** `[...]` 两字节固定开销,裁剪单行时先扣掉,保证数组整体仍 ≤400B。 */
|
|
69
|
+
const CHILD_PREVIEW_ROW_BUDGET_BYTES = CHILD_PREVIEW_BUDGET_BYTES - 2;
|
|
70
|
+
function jsonBytes(value) {
|
|
71
|
+
return Buffer.byteLength(JSON.stringify(value), "utf8");
|
|
72
|
+
}
|
|
73
|
+
/** 一行里的全部标量叶子(不做预算裁决,预算在 childRowsPreview 按 JSON 字节做)。 */
|
|
74
|
+
function scalarLeaves(value) {
|
|
75
|
+
if (value === null || typeof value !== "object" || Array.isArray(value))
|
|
76
|
+
return undefined;
|
|
77
|
+
const out = {};
|
|
78
|
+
for (const [key, entry] of Object.entries(value)) {
|
|
79
|
+
if (typeof entry === "string" || typeof entry === "number" || typeof entry === "boolean")
|
|
80
|
+
out[key] = entry;
|
|
81
|
+
}
|
|
82
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
83
|
+
}
|
|
84
|
+
/** 首行超预算时的逃生:按序列化后的实际字节保留尽量多的标量叶子。 */
|
|
85
|
+
function trimScalarPreview(leaves, maxBytes) {
|
|
86
|
+
const out = {};
|
|
87
|
+
for (const [key, entry] of Object.entries(leaves)) {
|
|
88
|
+
const candidate = { ...out, [key]: entry };
|
|
89
|
+
if (jsonBytes(candidate) > maxBytes)
|
|
90
|
+
continue;
|
|
91
|
+
out[key] = entry;
|
|
92
|
+
}
|
|
93
|
+
return Object.keys(out).length > 0 ? out : undefined;
|
|
94
|
+
}
|
|
58
95
|
function childRowsPreview(rows) {
|
|
59
|
-
const
|
|
60
|
-
const
|
|
61
|
-
|
|
96
|
+
const previewRows = [];
|
|
97
|
+
for (const [index, row] of rows.entries()) {
|
|
98
|
+
const leaves = scalarLeaves(row);
|
|
99
|
+
if (leaves === undefined)
|
|
100
|
+
continue;
|
|
101
|
+
if (jsonBytes([...previewRows, leaves]) > CHILD_PREVIEW_BUDGET_BYTES) {
|
|
102
|
+
// 首行就超预算:给预算内裁剪后的标量前缀(firstRow 兼容别名仍在),
|
|
103
|
+
// 其余行整行不再塞。
|
|
104
|
+
if (index === 0 && previewRows.length === 0) {
|
|
105
|
+
const trimmed = trimScalarPreview(leaves, CHILD_PREVIEW_ROW_BUDGET_BYTES);
|
|
106
|
+
if (trimmed !== undefined)
|
|
107
|
+
previewRows.push(trimmed);
|
|
108
|
+
}
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
previewRows.push(leaves);
|
|
112
|
+
}
|
|
113
|
+
const firstRow = previewRows[0];
|
|
114
|
+
return {
|
|
115
|
+
count: rows.length,
|
|
116
|
+
...(previewRows.length > 0 ? { rows: previewRows } : {}),
|
|
117
|
+
...(firstRow !== undefined ? { firstRow } : {}),
|
|
118
|
+
omittedRows: Math.max(0, rows.length - previewRows.length),
|
|
119
|
+
};
|
|
62
120
|
}
|
|
63
121
|
function summarizedArgs(tool, args) {
|
|
64
122
|
if (typeof args.summary === "string" && typeof args.fingerprint === "string")
|
package/dist/read-projection.js
CHANGED
|
@@ -19,6 +19,7 @@ import { jsonBytes, summarizeValue } from "./support.js";
|
|
|
19
19
|
* - `inlineKeys` ← 旧 `ALWAYS_INLINE_KEYS`(教学/证据键 + 字节上限)
|
|
20
20
|
* - `shapePreservingKeys` ← 旧 `CODE_NAME_LIST_KEYS`(保形为 `code|name` 码表)
|
|
21
21
|
* - `codeListKeys` ← 旧 `CODE_LIST_KEYS`(配置清单保形为裸码表)
|
|
22
|
+
* - `identifierListKeys` ← W47(`schemaCodes`/`absentModels`… 外置时仍为数组)
|
|
22
23
|
* - `bulkyKeys` ← 旧 `BULKY_READ_KEYS`(压成 `*Count`,外置时补空占位)
|
|
23
24
|
* - `nonContainerKeys` ← 旧 `NON_CONTAINER_KEYS`(回执派生数组不算结果容器)
|
|
24
25
|
* - `containerKeys` ← 旧 `CONTAINER_NAME_KEYS` 的判定顺序
|
|
@@ -47,6 +48,15 @@ export const READ_SMALL_ROW_SET_LIMIT = 10;
|
|
|
47
48
|
export const READ_TRIGGER_ROW_SET_LIMIT = 60;
|
|
48
49
|
/** `code|name` 码表的内联对数上限(~1–2KB);更大的清单回退 count + artifact。 */
|
|
49
50
|
export const READ_CODE_NAME_PAIR_LIMIT = 40;
|
|
51
|
+
/**
|
|
52
|
+
* 标识符清单(`schemaCodes`/`absentModels`/…)的内联条数上限。
|
|
53
|
+
*
|
|
54
|
+
* 2026-12 W47:这几个键的值**就是答案**(「本次问了哪些模型/规则」),不是正文
|
|
55
|
+
* bulk——3 个模型被折成 `{count:3,sha256,omitted}` 后,agent 无从知道读了哪些、
|
|
56
|
+
* 哪些缺席,只能去 artifact 再取一次。工具入参本身有批上限(≤20),这里的上限
|
|
57
|
+
* 只是防御:超过仍保形为数组(头 + count + truncated),不再退化成哈希。
|
|
58
|
+
*/
|
|
59
|
+
export const READ_IDENTIFIER_LIST_LIMIT = 40;
|
|
50
60
|
/** `rules` 瘦身行的内联上限(r62b-F3:9 条连名字都看不到曾逼二次取回)。 */
|
|
51
61
|
export const READ_RULE_SLIM_LIMIT = 12;
|
|
52
62
|
/** 教学串(`*Hint`)的内联上限;超过才摘要(0.6.91 真机:209B hint 被摘要)。 */
|
|
@@ -67,6 +77,11 @@ const ALWAYS_INLINE_KEYS = new Map([
|
|
|
67
77
|
["coverage", 1200],
|
|
68
78
|
["applicationResolution", 600],
|
|
69
79
|
["summaryHint", 600],
|
|
80
|
+
// W47(0.8.36d 真机):部分失败清单是**诊断回执**,不是结果 bulk——被折成
|
|
81
|
+
// `{count,sha256,omitted}` 后 `partial:true` 就没有任何可行动信息(哪条失败、
|
|
82
|
+
// 为什么)。≤2KB 原样内联;更大的失败清单仍在 artifact 里。
|
|
83
|
+
["failed", 2000],
|
|
84
|
+
["failures", 2000],
|
|
70
85
|
]);
|
|
71
86
|
/** Config-inventory keys that compact to a code list (not a bare count). */
|
|
72
87
|
const CODE_LIST_KEYS = new Set(["fields", "columns", "conditions", "sorts", "datarules", "buttons", "views", "sheets"]);
|
|
@@ -78,6 +93,11 @@ const CODE_LIST_KEYS = new Set(["fields", "columns", "conditions", "sorts", "dat
|
|
|
78
93
|
const CODE_NAME_LIST_KEYS = new Set(["roles", "groups", "models", "departments", "workflows", "services", "methods"]);
|
|
79
94
|
/** 节点类清单:参与者是扫描目标(r46 用户实测)——内联 `code:name@participant`。 */
|
|
80
95
|
const ACTIVITY_LIST_KEYS = new Set(["activities"]);
|
|
96
|
+
/**
|
|
97
|
+
* 标识符清单:值是「这次覆盖了哪些 code」的事实(不是 bulk 正文)。外置时仍为
|
|
98
|
+
* 字符串数组,见 `READ_IDENTIFIER_LIST_LIMIT` 的说明。
|
|
99
|
+
*/
|
|
100
|
+
const IDENTIFIER_LIST_KEYS = new Set(["schemaCodes", "absentModels", "ruleCodes", "modelCodes", "missingCodes"]);
|
|
81
101
|
/**
|
|
82
102
|
* Keys whose values are the bulk a compact projection replaces with a count.
|
|
83
103
|
* Everything else is a small facet identity/decision fields (workflowCode,
|
|
@@ -211,11 +231,32 @@ function projectGenericEntry(policy, key, value) {
|
|
|
211
231
|
[`${key}Count`]: value.length,
|
|
212
232
|
};
|
|
213
233
|
}
|
|
234
|
+
if (policy.identifierListKeys.has(key) && Array.isArray(value)) {
|
|
235
|
+
// W47(0.8.36d 真机回归):`rule.list --schemaCodes` 的 `schemaCodes`/
|
|
236
|
+
// `absentModels` 是「本次覆盖了哪些模型」的答案,通用摘要把它折成
|
|
237
|
+
// `{count,sha256,omitted}`——外置与内联不同形,调用方读不到自己问过的清单。
|
|
238
|
+
// 条数在工具入参批上限内(≤20)时原样内联;异常大的清单保留数组头 + count。
|
|
239
|
+
const entries = value;
|
|
240
|
+
const identifiers = entries.every((entry) => typeof entry === "string" || typeof entry === "number");
|
|
241
|
+
if (identifiers) {
|
|
242
|
+
if (entries.length <= READ_IDENTIFIER_LIST_LIMIT)
|
|
243
|
+
return { [key]: entries };
|
|
244
|
+
return { [key]: entries.slice(0, READ_IDENTIFIER_LIST_LIMIT), [`${key}Count`]: entries.length, [`${key}Truncated`]: true };
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
// 空数组没有 bulk 可藏:折成 `{count:0,sha256,omitted}` 只会把「确实没有」
|
|
248
|
+
// (例如 `failed: []` 的零失败)变成需要二次取回的噪声。空对象同理。
|
|
249
|
+
// 注意顺序:放在 bulky 分支**之后**,否则 `data: {}` 之类会丢掉 `<key>Count`
|
|
250
|
+
// 而改变 bulky 面的既有形状。
|
|
214
251
|
if (policy.bulkyKeys.has(key)) {
|
|
215
252
|
return {
|
|
216
253
|
[`${key}Count`]: Array.isArray(value) ? value.length : value && typeof value === "object" ? Object.keys(value).length : 0,
|
|
217
254
|
};
|
|
218
255
|
}
|
|
256
|
+
if (Array.isArray(value) && value.length === 0)
|
|
257
|
+
return { [key]: [] };
|
|
258
|
+
if (value !== null && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0)
|
|
259
|
+
return { [key]: {} };
|
|
219
260
|
// r28a 真机(2026-11-05)/ 2026-11-22(0.6.93 真机):见旧 read.ts 的一整段
|
|
220
261
|
// 说明——小对象、教学串、`*Hint` 都不该被摘要成 `{count/keys,sha256,omitted}`。
|
|
221
262
|
if (policy.inlineKeys.has(key) && jsonBytes(value) <= policy.inlineKeys.get(key)) {
|
|
@@ -248,6 +289,7 @@ export function defaultReadProjectionPolicy() {
|
|
|
248
289
|
inlineKeys: ALWAYS_INLINE_KEYS,
|
|
249
290
|
shapePreservingKeys: CODE_NAME_LIST_KEYS,
|
|
250
291
|
codeListKeys: CODE_LIST_KEYS,
|
|
292
|
+
identifierListKeys: IDENTIFIER_LIST_KEYS,
|
|
251
293
|
bulkyKeys: BULKY_READ_KEYS,
|
|
252
294
|
nonContainerKeys: NON_CONTAINER_KEYS,
|
|
253
295
|
};
|
package/dist/read-shapes.js
CHANGED
|
@@ -107,8 +107,8 @@ const READ_SHAPES = {
|
|
|
107
107
|
notes: ["计数用 total(totalElements);分组=值域×count,key 是存储值/code,null 单列 nullBucket;分桶 count 并发窗口 4;数值指标(sum/avg/min/max+field)本地折叠(cap 1000,null 不进聚合、avg 分母排除 null);coverage.mode=server-total/paged-local-scan/local-scan/server-aggregate,/sum 不可用或形状不符回退本地(strategyFallback);complete:false 只覆盖已扫行,勿外推", "child=子表目标:count 走 list_child totalElements,数值列只拉目标列分页折叠"],
|
|
108
108
|
},
|
|
109
109
|
"app.list": {
|
|
110
|
-
keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted"],
|
|
111
|
-
notes: ["applicationsCount + omitted 与 discover 同构;omitted:false 表示内联即全集"],
|
|
110
|
+
keys: ["applications:array<{code,name,groupId?,modelCount}>", "applicationsCount", "omitted", "omittedCount?", "nextCommand?", "tablesHint?"],
|
|
111
|
+
notes: ["applicationsCount + omitted 与 discover 同构;omitted:false 表示内联即全集", "外置档默认只内联 20 条:all:true 取到 500 条,limit/offset 做客户端翻页(平台 apppackage/list 无分页参数,一次返回全量);omitted:true 时按 nextCommand 续取,或 --jq applications[].code 直接从 artifact 取"],
|
|
112
112
|
},
|
|
113
113
|
"model.list": {
|
|
114
114
|
// Compact diet may rewrite models to "code|name" pairs and add modelsCount.
|
|
@@ -221,9 +221,10 @@ const READ_SHAPES = {
|
|
|
221
221
|
// A2 locator:控件清单键 ↔ config.diff 的逐控件差异路径(BizFormModel.java:26-32
|
|
222
222
|
// 六列分面存储,diff 按控件 key 对齐,前缀 view/attributes/html/actions)。
|
|
223
223
|
locator: { controlCodes: "publishedControlCodes|draftControlCodes", diffPath: "changes[].path" },
|
|
224
|
-
keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "childColumnLocator?:{path,children[]}", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
|
|
224
|
+
keys: ["present", "published", "publishedControlCodes", "draftControlCodes", "decorations[{key,type,row}]", "childColumnLocator?:{path,children[]}", "formButtonCodes?", "formButtons?", "customButtonJson?(full)", "customButtonJsonShapeWarning?"],
|
|
225
225
|
notes: [
|
|
226
226
|
"控件清单键是 publishedControlCodes/draftControlCodes,不是 controls;两面差异的逐控件路径在 config.diff changes[].path(前缀 view/attributes/html/actions,按控件 key 对齐)",
|
|
227
|
+
"非字段控件(200/202/203)在 decorations(html=options.name)",
|
|
227
228
|
"表单按钮读 formButtonCodes/formButtons;full:true 另带 customButtonJson 数组原样(库里是字符串脏形时给 customButtonJsonShapeWarning——线上 #38 前端按钮不渲染,重写 buttons 自愈)",
|
|
228
229
|
],
|
|
229
230
|
},
|
package/dist/read.js
CHANGED
|
@@ -157,7 +157,9 @@ export async function governedRead(ctx, tool, args, execute, options = {}) {
|
|
|
157
157
|
const plan = projectReadResult(result, {
|
|
158
158
|
toolName: tool.name,
|
|
159
159
|
full: options.full === true,
|
|
160
|
-
|
|
160
|
+
// issue #65:投影需要本次参数(app.list 的 all/limit/offset 决定内联多少条),
|
|
161
|
+
// 但前面的完整性短路/缓存键仍只看结果。传 args 是纯增量,旧的两参 compact 照旧可用。
|
|
162
|
+
...(options.compact !== undefined ? { customProjection: (raw) => options.compact(raw, session, args) } : {}),
|
|
161
163
|
});
|
|
162
164
|
const rawBytes = plan.decision.bytes;
|
|
163
165
|
if (options.full === true) {
|
package/dist/recipes/field.js
CHANGED
|
@@ -56,11 +56,15 @@ const formConditionalRequired = Object.freeze({
|
|
|
56
56
|
name: "请假事由",
|
|
57
57
|
options: { requiredFormula: '{leave_amount} 大于 {"valueType":"custom","value":5000}' },
|
|
58
58
|
},
|
|
59
|
-
preconditions: [
|
|
60
|
-
|
|
59
|
+
preconditions: [
|
|
60
|
+
"目标字段与作为条件的字段都已发布",
|
|
61
|
+
"这是门户表单交互层(真实门户打开表单、改条件字段值来验证控件是否变必填);**不要用 datarule.create**——实测 type4 不会让门户控件变必填,且符号式经 historyOpt 会让表单渲染崩溃",
|
|
62
|
+
"**权威面 = 字段级 `options.requiredFormula`**(本 recipe)。控件级同名键(`form.draft` 的 `draftAttributesJson.<控件>.options.requiredFormula`)是派生面:设计器保存会按字段元数据/规则行重建控件,手写控件级会被清空(**已在 8.1.108 真机连续 3 次验证**;**其他版本需真机采样**)。不要手写控件级;回执 `requiredFormulaDrift` 点名时改字段级。",
|
|
63
|
+
],
|
|
64
|
+
conditionalRequirements: ["条件串:`{字段} 操作符 [值]`(操作符两侧留空格),字段级写入自动配对 bizdatarule type4。操作符用**中文**(真实设计器产出):等于/不等于/大于/小于/大于等于/小于等于/包含/不包含/包含全部/包含任意一个/等于任意一个/为空/不为空;也接受符号 == != > >= <= Contains IsEmpty。为空/不为空**不带值**(`{reason} 不为空`),其余带 JSON 值 {\"valueType\":...,\"value\":...}。多条件用 ` && `、多组用 ` || `。**不是** eq/gt/isnull——会让门户渲染 SyntaxError"],
|
|
61
65
|
priorToolReferences: [{ tool: "field.list", args: { environment, schemaCode: model, published: true }, purpose: "确认条件字段与目标字段都已发布" }],
|
|
62
66
|
dryRun: { supported: true, command: `omc call field.update --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 校验字段 options 形状,不写入" },
|
|
63
|
-
expectedReadback: { readback: { field: { code: "leaveReason", options: { requiredFormula: "<protocol>" } } }, next: ["(一调)field.update cascadeRepublish:true", "(分步)field.publish → form.draft(rebuild) → form.publish", "(只刷新表单)form.publish rebuild:true"] },
|
|
67
|
+
expectedReadback: { readback: { field: { code: "leaveReason", options: { requiredFormula: "<protocol>" } } }, verification: "字段级回读 field.get full:true → options.requiredFormula;控件级用 form.get controls:true 读 draftAttributesJson(派生面,应一致);设计器保存后应仍在门户生效(点验:改条件字段值看控件必填)。requiredFormulaDrift 为空即对齐。", next: ["(一调)field.update cascadeRepublish:true", "(分步)field.publish → form.draft(rebuild) → form.publish", "(只刷新表单)form.publish rebuild:true"] },
|
|
64
68
|
refusalRecovery: [
|
|
65
69
|
{ code: "capability-out-of-coverage", action: "条件串用中文或符号操作符(等于/大于/不为空 或 == />/IsEmpty);恒必填用字面量 \"true\"" },
|
|
66
70
|
...commonRecovery,
|
package/dist/recipes/form.js
CHANGED
|
@@ -95,8 +95,58 @@ const formDraftTwoColumn = Object.freeze({
|
|
|
95
95
|
],
|
|
96
96
|
requiresEnvironmentDerivedIds: false,
|
|
97
97
|
});
|
|
98
|
+
/**
|
|
99
|
+
* GitLab issue #57(CloudPivot 8.1.108):设计器「描述说明」控件(type 202)的正文
|
|
100
|
+
* 是 `options.name` 里的整段 HTML(前端 template.ts:185 + 移动端
|
|
101
|
+
* `innerHTML` 渲染分支)。此前只能由用户在设计器手加,rebuild 还会清空。
|
|
102
|
+
* 配方给一个可直接抄的红字提示形状;`decorations` 是增量面,不必回传整包 attrs。
|
|
103
|
+
*/
|
|
104
|
+
const formDraftDescription = Object.freeze({
|
|
105
|
+
id: "form-description-block",
|
|
106
|
+
title: "表单加描述块/红色说明文字(类型 202 布局控件,HTML 写 options.name)",
|
|
107
|
+
aliases: ["描述块", "描述控件", "描述说明", "富文本说明", "红字提示", "说明文字"],
|
|
108
|
+
status: "offline-valid",
|
|
109
|
+
tool: "form.draft",
|
|
110
|
+
args: {
|
|
111
|
+
environment,
|
|
112
|
+
schemaCode: model,
|
|
113
|
+
decorations: [
|
|
114
|
+
{
|
|
115
|
+
type: 202,
|
|
116
|
+
html: '<div style="color:#e02020">如涉及二级图纸归档,需明确产品是否做小批试制</div>',
|
|
117
|
+
span: 24,
|
|
118
|
+
},
|
|
119
|
+
],
|
|
120
|
+
},
|
|
121
|
+
preconditions: [
|
|
122
|
+
"表单已有控件面(先 configure_form 或 form.draft 把字段绑进表单);decorations 是增量面,不负责从零建表",
|
|
123
|
+
"202 的正文是 html(写进 options.name,设计器同形,按 innerHTML 渲染);200 分组标题 / 203 表单标题用 name 纯文本",
|
|
124
|
+
"**存储/发布/读回已在 2.1.5 验证;门户设计器渲染未验证**(需 8.1.108 或真页采样)——写完务必门户打开表单点验,不要只凭 form.get 回执宣称渲染正常",
|
|
125
|
+
"key 省略自动生成 Description<序号>;带 key 命中既有布局控件=改它(其余 options 原样保留)",
|
|
126
|
+
"row 是 1-based 插入行(省略=末尾追加一行);span ∈ 6/8/12/16/18/24,插入已占满的行会拒 form-decoration-row-full",
|
|
127
|
+
"decorations 与 draftViewJson/draftAttributesJson/layout/rebuild/fieldCodes/childColumns 互斥",
|
|
128
|
+
],
|
|
129
|
+
conditionalRequirements: [
|
|
130
|
+
"写完必须 form.publish 才在门户生效;验收用 form.get 的 `decorations`(html 原文 + row)核对,不要整包 diff",
|
|
131
|
+
"rebuild:true 会原样保留 202 描述块(含 displayFormula);额外的分组标题/表单标题会被 fail-closed 拒绝并在 losing 列出",
|
|
132
|
+
],
|
|
133
|
+
priorToolReferences: [
|
|
134
|
+
{ tool: "form.get", args: { environment, schemaCode: model }, purpose: "确认表单已有控件面,并看 decorations 里已有的描述块 key/row" },
|
|
135
|
+
],
|
|
136
|
+
dryRun: { supported: true, command: `omc call form.draft --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 跑同一个 composeFormDecorationsDraft:回执 decorations.added/rows 就是真写会写下的控件,零 wire 写入" },
|
|
137
|
+
expectedReadback: {
|
|
138
|
+
readback: { decorations: { added: [{ type: 202 }] }, next: ["form.publish", "form.get 核对 decorations"] },
|
|
139
|
+
},
|
|
140
|
+
refusalRecovery: [
|
|
141
|
+
{ code: "form-decorations-no-baseline", action: "先用 configure_form 或 form.draft 把已发布字段绑进表单,再加描述块" },
|
|
142
|
+
{ code: "form-decoration-param-conflict", action: "decorations 是增量面:只传 decorations,不要同时传整包 draftViewJson/draftAttributesJson 或 rebuild" },
|
|
143
|
+
{ code: "form-decoration-row-full", action: "省略 row 让描述块单独占一末行;或换到尚有 24 栅格余量的行;或显式传合法的 span" },
|
|
144
|
+
...commonRecovery,
|
|
145
|
+
],
|
|
146
|
+
requiresEnvironmentDerivedIds: false,
|
|
147
|
+
});
|
|
98
148
|
export const FORM_METADATA = Object.freeze({
|
|
99
149
|
"configure_form": Object.freeze({ recipes: [configureFormRecipe], relatedTools: ["field.list", "field.update", "listview.create", "listview.get"] }),
|
|
100
|
-
"form.draft": Object.freeze({ recipes: [formDraftTwoColumn], relatedTools: ["field.list", "field.publish", "form.get", "form.publish"] }),
|
|
150
|
+
"form.draft": Object.freeze({ recipes: [formDraftTwoColumn, formDraftDescription], relatedTools: ["field.list", "field.publish", "form.get", "form.publish"] }),
|
|
101
151
|
});
|
|
102
152
|
//# sourceMappingURL=form.js.map
|
|
@@ -91,13 +91,14 @@ const workflowSubmit = Object.freeze({
|
|
|
91
91
|
"workItemId 或 workflowInstanceId 出现时必须传 bizObjectId;身份只能复制 data.save 的 authoritative readback",
|
|
92
92
|
"**审批提交(workItemId/workflowInstanceId)只传主表字段**:formData 里不要带子表数组——平台按「追加行」再插一份(真机 2→6 行),CLI 默认拒 `submit-approval-child-rows`。子表数组只在保存/首次提交时带;确要在审批中追加子行才显式传 allowChildRowAppend:true",
|
|
93
93
|
"子表读回顺序按 sortKey ASC(平台固定排序):**新建**保存/提交时 CLI 会给缺 sortKey 的子行按数组下标补 1..n(显式值保留);更新既有记录请显式带 sortKey,否则 null 排序不保证",
|
|
94
|
+
"节点字段权限(editable/visible)只是门户读面膜:REST 提交/普通更新都不校验(回执 nodeFieldPermissionNote)",
|
|
94
95
|
],
|
|
95
96
|
priorToolReferences: [
|
|
96
97
|
{ tool: "data.save", args: { environment, schemaCode: model, workflowCode: "<workflow.code>", formData: { name: "recipe draft" } }, purpose: "提供三个环境生成的提交身份" },
|
|
97
98
|
{ tool: "workitem.list", args: { environment }, purpose: "当 data.save 未直接返回 workItemId 时按 workflowInstanceId 解析待办" },
|
|
98
99
|
],
|
|
99
100
|
dryRun: { supported: true, command: `omc call data.submit --env ${environment} --dry-run --args '<recipe.args>'`, notes: "dry-run 验证两段式参数关系,不推进 workflow" },
|
|
100
|
-
expectedReadback: { performed: { formType: "1" }, readback: { sequenceStatus: "COMPLETED", workflowInstanceId: "<same-as-data.save>", workItemId: "<same-as-data.save>" } },
|
|
101
|
+
expectedReadback: { performed: { formType: "1" }, readback: { sequenceStatus: "COMPLETED", workflowInstanceId: "<same-as-data.save>", workItemId: "<same-as-data.save>", nodeFieldPermissionNote: "<带 formData 的审批提交回:节点权限只作用门户读面膜>" } },
|
|
101
102
|
refusalRecovery: [
|
|
102
103
|
{ code: "submit-biz-object-id-required", action: "把 data.save 的 bizObjectId 原样传给 data.submit" },
|
|
103
104
|
{ code: "submit-existing-workflow-unsupported", action: "不要用旧行 + workflowCode 启动;先 data.save 新建 DRAFT,再用返回 workItemId 提交" },
|
package/dist/search-index.js
CHANGED
|
@@ -75,6 +75,10 @@ const KEY_RULES = Object.freeze({
|
|
|
75
75
|
nodeGraph: { cls: "user", source: "规则图(节点/动作/条件)是需求本体", user: "utterance" },
|
|
76
76
|
draftViewJson: { cls: "user", source: "表单布局行分组是需求本体", user: "utterance" },
|
|
77
77
|
draftAttributesJson: { cls: "user", source: "控件属性(span/options)是需求本体", user: "utterance" },
|
|
78
|
+
// issue #57(0.8.36):form.draft 的 decorations(非字段布局控件 200/202/203)——
|
|
79
|
+
// 正文(202 的 html 写 options.name)与行位/span 是需求本体;key/row 省略时由工具
|
|
80
|
+
// 自动生成(参数内部默认,不是独立槽位)。来源 recipe:form-description-block。
|
|
81
|
+
decorations: { cls: "user", source: "描述块/分组标题的正文与行位是需求本体", user: "utterance" },
|
|
78
82
|
handler: { cls: "user", source: "绑定哪个流程事件(start/cancel/activate/end)由需求决定", user: "utterance" },
|
|
79
83
|
methodName: { cls: "user", source: "方法名属于接口契约", user: "utterance" },
|
|
80
84
|
methodConfig: { cls: "user", source: "HTTP 契约来自外部接口文档", user: "utterance" },
|
package/dist/write-outcome.js
CHANGED
|
@@ -80,6 +80,20 @@ export function deliveryStateFor(readback) {
|
|
|
80
80
|
deliveryState: "WRITE_UNVERIFIED",
|
|
81
81
|
readbackWarning: "目标是删除级联中:平台 async 任务未完成(readback.allAbsent=false,见 perCode 逐项),勿当成功——稍后重跑本工具(幂等)复核",
|
|
82
82
|
};
|
|
83
|
+
// issue #65:权威读回里有「请求值与落库值不一致」的字段级证据 → 请求送达但
|
|
84
|
+
// 写入未被证明。平台会静默忽略自动生成/规则/权限字段(真机:8 条 data.update
|
|
85
|
+
// 的 name 全被数据标题覆盖,回执仍是 DELIVERED)。envelope 保持 ok(不误升
|
|
86
|
+
// uncertain),只收回 DELIVERED。
|
|
87
|
+
const fieldWriteMismatch = Array.isArray(record?.fieldWriteMismatch) ? record.fieldWriteMismatch : [];
|
|
88
|
+
if (fieldWriteMismatch.length > 0) {
|
|
89
|
+
const fields = fieldWriteMismatch
|
|
90
|
+
.map((entry) => (entry !== null && typeof entry === "object" ? String(entry.field ?? "") : ""))
|
|
91
|
+
.filter((field) => field.length > 0);
|
|
92
|
+
return {
|
|
93
|
+
deliveryState: "WRITE_UNVERIFIED",
|
|
94
|
+
readbackWarning: `读回与本次提交不一致${fields.length > 0 ? `:${fields.join("、")}` : ""}(见 fieldWriteMismatch)——平台可能忽略该字段(自动生成/数据标题/规则重算/权限)。请求已送达,但本次写入未被证明:先 data.load 复核;需要真正落地请改自建业务字段或去掉自动生成规则,勿当作已完成`,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
83
97
|
return { deliveryState: "DELIVERED" };
|
|
84
98
|
}
|
|
85
99
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stalfh233/omc-cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.36",
|
|
4
4
|
"description": "CloudPivot 8.6 configuration capability CLI — governed, fail-closed, coverage-manifest bounded.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
60
|
"commander": "14.0.3",
|
|
61
|
-
"omc-core": "0.8.
|
|
61
|
+
"omc-core": "0.8.36",
|
|
62
62
|
"proper-lockfile": "4.1.2",
|
|
63
63
|
"write-file-atomic": "6.0.0",
|
|
64
64
|
"zod": "^3.23.8",
|
|
@@ -76,6 +76,6 @@
|
|
|
76
76
|
"directory": "packages/omc-cli"
|
|
77
77
|
},
|
|
78
78
|
"optionalDependencies": {
|
|
79
|
-
"@stalfh233/omc-fake-platform": "0.8.
|
|
79
|
+
"@stalfh233/omc-fake-platform": "0.8.36"
|
|
80
80
|
}
|
|
81
81
|
}
|
|
@@ -128,7 +128,7 @@ rules:
|
|
|
128
128
|
- **每个 filter 项必须有且只有一个条件来源**:`from`(动态 EQ)或一个比较键(`equals`/`notEquals`/`gt`/`gte`/`lt`/`lte` + 标量)。缺来源 `intent-rule-leaf-source-missing` 拒绝;**绝不**静默成 `EQ null`。
|
|
129
129
|
- 动作节点的条件分「定位数据」与「执行门」两类,**别混**(详见下「规则图的触发条件」)。
|
|
130
130
|
- **跨模型 UPDATE 目标查找键=`filterCondition.mainConditions`**(`[[{targetSchemaDataItem, ruleConditionType, ruleValueType, value|currentSchemaDataItem}]]`,非触发条件的 conditionGroups——错键静默反序列化为空,引擎恒报「查找范围不存在数据」形似跨模型不可用,r42 曾误判;校验 `rule-graph-filter-condition-wrong-key` 已拦)。连坑:叶取值键 `value` 非 fixedValue;`rule.node.update` 只写 DRAFT,改完须 `rule.enable`/`--publish` 重发布才生效。
|
|
131
|
-
- **跨模型写(`targetObjectCode
|
|
131
|
+
- **跨模型写(`targetObjectCode`≠规则模型)平台支持、可运行时生效**(真机)。两个前提:① 规则必须真的触发——`Create` 在提交时触发;`Update` 只在 `data.update` 触发,**submit 不执行它**(放进 `Update` 是典型静默空转,lint 警告 `rule-graph-cross-model-update-trigger-inert`;可改绑流程事件如 `end`)。② 目标行必须已提交——目标查询不匹配 DRAFT 行,`data.save` 未 submit 的行不回写。
|
|
132
132
|
- 关联字段:`type: WORK_SHEET` + `relativeCode: <目标模型>` + `options.displayField`,与 `field.create` 行形状一致。(键名是 `relativeCode`,wire 键 `relativeSchemaCode`,别混。)
|
|
133
133
|
- 节点显示名用 activity 级的 `name`(`participant.name` 只作参与者说明,平台不认作节点名;`{type: Originator, name: 部门负责人}` 会被工具提升为节点名)。
|
|
134
134
|
- **字段级数据规则**(`models[].datarules[]`,`dataRuleType` 1校验/2计算/3拼接/4必填/5只读)——注意是 `dataRuleType`(不是 `type`):
|
|
@@ -136,7 +136,7 @@ rules:
|
|
|
136
136
|
datarules:
|
|
137
137
|
- { propertyCode: order_note, dataRuleType: 4, options: { requiredFormula: '{amount} 大于 {"valueType":"custom","value":5000}' }, name: 金额超5000说明必填 }
|
|
138
138
|
```
|
|
139
|
-
⚠️ **type 3/4/5
|
|
139
|
+
⚠️ **type 3/4/5 不驱动门户表单控件**:平台存成 bizdatarule,只镜像进控件 `historyOpt`,运行时门户读的是控件 `options`。门户条件必须写在 `fields[].options`(`requiredFormula`/`readonlyCondition`/`shortTextStitch`);写进 `datarules[]` 设计器可见但门户不拦(`datarule-not-portal-facing` 警告)。datarule 只用于服务端引擎。未声明 `sortKey` = 顺序归平台、不参与比较;显式声明才严格比较。
|
|
140
140
|
|
|
141
141
|
- 规则排在字段发布之后(编译器按能力排序:先建全部模型/字段,再跑规则)。
|
|
142
142
|
- `rule.save` 只写草稿;`enabled` 由 `rule.enable` 保证(publish+启用)——readback 用 `enabled` 和**语义图摘要**(忽略画布几何)判等价。
|
|
@@ -144,13 +144,14 @@ rules:
|
|
|
144
144
|
## 表单与视图
|
|
145
145
|
|
|
146
146
|
- 新字段加入已有表单:`form.publish --args '{...,"rebuild":true}'` 一步(重建脚手架+强制提拔);或分步 `form.draft --rebuild` → `form.publish`。
|
|
147
|
-
- rebuild
|
|
148
|
-
-
|
|
147
|
+
- rebuild 保留关系映射、显示/布局 options 与 202 描述块,Sheet201 columns 按最新子表字段刷新;额外 200/203 实例 fail-closed 列于 `losing`。
|
|
148
|
+
- **描述块/描述控件(红色说明、富文本说明)**(设计器「描述说明」= 布局控件 type 202,非字段):正文是 `options.name` 里的 HTML;`form.draft {decorations:[{type:202,html:"<div style=\"color:#e02020\">…</div>"}]}` 增量加,`form.get` 的 `decorations` 核对;200/203 同面。
|
|
149
|
+
- **配置列表视图用 `listview.configure`(省略 `code` 即平台默认视图 code=schemaCode),不要先 `listview.create`——那会多出一个视图**;确实要第二个视图才 create。
|
|
149
150
|
- 数值控件:`scale` 是小数位数(0=整数,1=1位,2=2位…);「金额两位小数」用 `scale:2`。列表列 displayFormat 由 scale 推导。
|
|
150
|
-
- **`percentile`
|
|
151
|
+
- **`percentile` 不是百分比**(高频误读):`format` 里 `integer`/`tenths`/`percentile` 都是小数位;**百分比要带 `ratio` 词**(`ratio`/`ratio.tenths`/`ratio.percentile`),货币 `RMB.*`/`dollar.*`。字段 `options.format` 缺 `scale` 时按 `integer` 生成,金额务必显式 `scale:2`。
|
|
151
152
|
- **列表列只放业务字段**:平台 `listview.create` 会预置系统列(`name/creater/createdTime/sequenceNo`)和一条 `createdTime` 默认筛选;intent 的 `fieldCodes` 是权威集合,编译器用 `replaceColumns:true + hideDefaultSystemFields:true + conditions:[]` 清掉预置项。要展示某系统列/筛选就显式点名。
|
|
152
153
|
- 筛选条件默认显示:`conditions[].visible` 不传也应为 true。
|
|
153
|
-
-
|
|
154
|
+
- 配置默认视图后 `data.list` 才有业务列;单行核对用 `data.load`。
|
|
154
155
|
- 读回视图用 `listview.get`(默认回列/排序/条件/动作紧凑清单)与 `listview.list`。
|
|
155
156
|
- **model.create 不自动发布表单页**(r65 真机):模型建好 ≠ 门户有页面——直接打开会回「form is unpublished」。要 `form.publish` + `listview.configure`(默认视图)后门户才有页面可看。
|
|
156
157
|
- **门户页面 URL 模式**(r65 真机取证,验收/取证用):
|
|
@@ -116,6 +116,7 @@ only the section for the capability you need —
|
|
|
116
116
|
- **每个模型交付前其默认表单必须已发布**:只建草稿=用户无法录入/查看。用 `configure_form` 或 `form.draft(rebuild:true)`+`form.publish` 发布。
|
|
117
117
|
- **`form.get` 的 `published`/`existDraft` 是内容面结论**(`platformFlags` 才是平台 `bizsheet/get` 的原始标记位);`form.list` 的 `published` 仍是平台旗标,两者语义不同——判发布面内容用 `form.get`,不要用 `form.list` 旗标或 `publishedControlCodes` 是否非空。交付前列出每个模型的 `form.get.published` 核对。
|
|
118
118
|
- **写业务数据的前提是先发布模型+表单**:正确顺序 = 建模型 → 发布字段(`field.publish`)→ 建并**发布**默认表单(`form.publish`)→ 才 `data.save`/`data.submit`。不要在建/未发布状态下写业务数据。
|
|
119
|
+
- **条件必填/只读/显示的权威面是字段级 `options`**(`field.update` 写 `requiredFormula`/`readonlyCondition`/`displayFormula`,自动配对 bizdatarule)。控件级同名键(`form.draft` 的 `draftAttributesJson.<控件>.options.*`)是**派生面**:平台设计器保存会按字段元数据/规则行重建控件,手工写控件级会被清空(**已在 8.1.108 真机验证;其他版本需真机采样**)。不要手写控件级;`form.draft`/`form.publish` 回执的 `requiredFormulaDrift` 点名不一致时改字段级。recipe:`omc describe field.update --example form-conditional-required`。
|
|
119
120
|
- **表单按钮**:`form.publish {buttons:[…]}` 写 `options.customButtonJson` 并生成 `h_biz_button(triggerType=FORM)`;表单页显示还取决于流程节点 `buttonPermission.customBtns[].enabled`(设计器「表单操作」勾选)。执行用 `form.runButton`(带整条记录,区别于列表按钮的 `rule.run`)。
|
|
120
121
|
|
|
121
122
|
## 列表视图 `listview`
|