bpmax-cli 0.2.1-beta.49 → 0.2.1-beta.50
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/bin.js +1600 -493
- package/dist/bin.js.map +1 -1
- package/package.json +4 -3
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +12 -1
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +4 -0
- package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +85 -0
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +9 -3
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +2 -0
- package/skills/bpmax-form-template-editor/SKILL.md +3 -0
- package/skills/bpmax-form-template-editor/references/full-detail-guide.md +6 -0
- package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmax-cli",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.50",
|
|
4
4
|
"description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -27,12 +27,13 @@
|
|
|
27
27
|
"node": ">=18"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"acorn": "^8.16.0",
|
|
31
30
|
"@clack/prompts": "1.0.1",
|
|
31
|
+
"acorn": "^8.16.0",
|
|
32
32
|
"axios": "^1.9.0",
|
|
33
33
|
"commander": "^14.0.0",
|
|
34
34
|
"jszip": "^3.10.1",
|
|
35
|
-
"open": "^10.1.2"
|
|
35
|
+
"open": "^10.1.2",
|
|
36
|
+
"playwright-core": "1.61.1"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
39
|
"@types/node": "^22.15.17",
|
|
@@ -34,6 +34,10 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
34
34
|
|
|
35
35
|
## 重复操作加速模式
|
|
36
36
|
- E2E 加速分两层:`bpmax-cli e2e` 提供稳定、可复用、可审计的执行能力;本 skill 负责把这些能力编排成标准打法。
|
|
37
|
+
- 稳定页面步骤统一使用确定性 Browser Action Runner V2:`case_steps.csv` 声明 `runner=browser_action`,同场景 `automation.json` 保存语义定位、原子动作、页面指纹和执行后断言。正常路径由 CLI 一次执行;LLM 只参与首次录制、`cache_stale`、未支持控件和异常诊断。
|
|
38
|
+
- 只能缓存动作代码、语义选择器、页面指纹和稳定断言。严禁缓存或复用 `project_id`、`step_id`、flow id、流水号、trace id、本轮截图、Network 结果或旧 pass 结论。
|
|
39
|
+
- `bpmax-cli e2e browser-run` 会在任何提交动作前检查页面指纹;页面、必填字段、按钮或环节发生漂移时必须返回 `cache_stale`、`remote_submitted=false` 并停止,禁止自动刷新后立即提交。
|
|
40
|
+
- `button.click` 必须明确是否为远端 mutation;提交/确认动作必须声明 `mutation=true,retry=never`。远端结果不确定时不得盲目重试。
|
|
37
41
|
- 首次运行一条流程或一个复杂 step 时,就必须沉淀 `scenario plan`、`data profile` 或 reusable step template;不要等重复多次后才整理。
|
|
38
42
|
- `bpmax-cli test-suite lint` 会检查非 deprecated E2E 用例是否已有首次运行沉淀方式。缺少 `bpmax-cli e2e create-page-submit`、`bpmax-cli e2e step-run`、`bpmax-cli e2e record-from-evidence`、`data profile`、`scenario plan` 或 reusable step template 时,不要直接判业务失败,读取 `e2e_acceleration.bootstrap_required=true` 和 `missing_cases`。
|
|
39
43
|
- 发现 `bootstrap_required=true` 时,先跑一次真实页面或安全 step-run,把截图、DOM/URL、console/network、submit/readback 证据保存到稳定目录,再运行 `bpmax-cli e2e record-from-evidence` 生成 reusable step template。
|
|
@@ -41,18 +45,23 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
41
45
|
- 如果 `expected_checks` 缺失、失败,或没有拿到预期范围内结果,判为 `cache_stale`,停止后续提交;优先用 `--auto-refresh-cache` 重建当前步骤缓存,但刷新后的模板不等于通过结论。
|
|
42
46
|
- 如果新模板显示新增必填字段、处理人不可处理、动作消失或 step 已结束,先补数据、换样本或修配置,再复跑;不得把刷新后的缓存当作通过结论。
|
|
43
47
|
- 页面提交类操作必须走真实浏览器:`bpmax-cli e2e create-page-submit` / `e2e browser-template create-form` 不是 raw API 创建,必须保留截图、URL、DOM 摘要、console/network 错误和 `project_id`;不得把接口提交伪装成页面回归。
|
|
44
|
-
-
|
|
48
|
+
- 批量真实执行使用 `bpmax-cli e2e scenario execute --automation ... --execution-manifest ...`;旧 `scenario run` 仅生成 dry-run 状态矩阵,禁止再用 `--resume` 冒充真实续跑。
|
|
49
|
+
- `--resume` 只能继续同一个尚未完成的 execution manifest。用户要求重新运行或 manifest 已完成时,必须重新执行 `test-suite run start` 创建新 run;已跑过的 case 也必须产生新的业务 ID、截图、DOM/Console/Network 和逐步证据,绝不能因为历史 pass 而跳过。
|
|
45
50
|
- 常用命令详见 `references/full-detail-guide.md`:
|
|
46
51
|
- `bpmax-cli e2e step-run`
|
|
47
52
|
- `bpmax-cli e2e create-page-submit`
|
|
48
53
|
- `bpmax-cli e2e record-from-evidence`
|
|
49
54
|
- `bpmax-cli e2e scenario run`
|
|
55
|
+
- `bpmax-cli e2e browser-run`
|
|
56
|
+
- `bpmax-cli e2e scenario execute`
|
|
50
57
|
- `bpmax-cli e2e cache inspect`
|
|
51
58
|
- `bpmax-cli e2e cache refresh`
|
|
52
59
|
|
|
53
60
|
## `.ai_test` 资产门禁
|
|
54
61
|
- 可复用测试用例统一放在 `.ai_test/`;运行状态放在 `.codex/tmp/e2e_states/`;不要混用。
|
|
55
62
|
- 每个场景必须同时有 `cases.csv` 和 `case_steps.csv`:前者只保存用例级元数据,后者必须让每个测试步骤独占一行。禁止继续把打开、填写、提交、审批和验证聚合到一个 `steps` 单元格。
|
|
63
|
+
- 使用 `runner=browser_action` 的场景必须提供 `automation.json`,且每个步骤都有同名 `<case_id>/<step_id>` 动作映射、`page_fingerprint`、非空 `actions` 和 `expected_checks`。坐标、绝对 XPath、硬编码运行态 ID 和可盲重试提交均为 hard error。
|
|
64
|
+
- 首次尚未自动化的真实页面步骤可暂时使用 `runner=browser` 进入 bootstrap;一旦录制成功应改为 `browser_action`。确实只能人工执行时必须在 `input_data` 写 `manual_reason=<具体原因>`,不能用空泛的“页面复杂”。
|
|
56
65
|
- `case_steps.csv` 每行只能有一个用户动作,并写清 actor、runner、action、target、input_data、即时 expected_result 和 evidence_required;不能用“然后/接着/再”把多步塞进一行。上传附件属于合法单一步骤,应单独写成“上传 <具体附件>”并记录页面证据。
|
|
57
66
|
- 生成、检查、更新用例资产前,必须先 latest sync,并把证明写入 `.codex/tmp/ai_test_suite/latest-<env>-proof.json`。缺少 `--latest-proof` 时,CLI 必须拒绝 lint/index/draft-update/promote。
|
|
58
67
|
- `.ai_test` suite 的 lint、review init/repair/explain、draft-update、promote 都使用 `bpmax-cli test-suite` 的 TypeScript 实现;不要新增或调用旧 Python suite 脚本作为主路径。
|
|
@@ -118,6 +127,7 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
118
127
|
- 要用浏览器证明页面行为或 DevTools 失效兜底:读 `references/browser-only-checkpoints.md`。
|
|
119
128
|
- 要发现筛选字段、列表字段或字段映射依据:读 `references/filter-field-discovery.md`。
|
|
120
129
|
- 要跑负卖样板或接口诊断骨架:读 `references/profile-schema.md`、`references/negative-sale-api-matrix.md` 和对应 profile。
|
|
130
|
+
- 要录制、编写或排查确定性浏览器动作:读 `references/browser-action-dsl.md`。
|
|
121
131
|
|
|
122
132
|
## 配置与页面一致性 lint
|
|
123
133
|
- 测试前必须审计流程节点页模板和操作方式:填写当前环节表单的节点应绑定“项目详情 + 当前环节表单填写模块”,审批/审核/确认/验收类节点应绑定“项目详情”,打回修改或发起人补充节点应绑定“只填写项目表单”。
|
|
@@ -155,3 +165,4 @@ description: "用于在 BPMAX 中做全链路流程测试、场景回归、前
|
|
|
155
165
|
- 筛选字段发现规则:`references/filter-field-discovery.md`
|
|
156
166
|
- 负卖配置接口矩阵:`references/negative-sale-api-matrix.md`
|
|
157
167
|
- 经验教训覆盖矩阵:`references/skill-experience-coverage-matrix.md`
|
|
168
|
+
- 确定性浏览器动作 DSL:`references/browser-action-dsl.md`
|
|
@@ -131,6 +131,10 @@ bpmax-cli test-suite run next --manifest .ai_test/report/<run_id>/execution-mani
|
|
|
131
131
|
bpmax-cli test-suite run record --manifest .ai_test/report/<run_id>/execution-manifest.json --case-id <case_id> --case-step-id <step_id> --result pass --evidence <path> --format json
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
+
稳定浏览器步骤使用 `runner=browser_action`,并在场景目录维护 `automation.json`。正式执行由 `bpmax-cli e2e browser-run` 读取 manifest 当前步骤并自动写入本轮证据;已完成 manifest 不允许 resume,重新运行必须 `run start` 新建 run。
|
|
135
|
+
|
|
136
|
+
完整 DSL、页面指纹、mutation 和缓存边界见 [browser-action-dsl.md](browser-action-dsl.md)。
|
|
137
|
+
|
|
134
138
|
源码 CLI 联调时显式增加:
|
|
135
139
|
|
|
136
140
|
```bash
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Browser Action Runner V2
|
|
2
|
+
|
|
3
|
+
## 目标
|
|
4
|
+
|
|
5
|
+
Browser Action Runner V2 把稳定、重复的真实页面步骤变成可审计代码。`case_steps.csv` 仍描述业务动作,`automation.json` 描述完成该业务动作所需的技术原子动作。
|
|
6
|
+
|
|
7
|
+
正常复跑不再由 Agent 临场逐字段点击。Agent 只在首次 bootstrap、页面指纹变化、未支持控件或执行失败时介入。
|
|
8
|
+
|
|
9
|
+
## 场景文件
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"version": 1,
|
|
14
|
+
"scenario": "procurement-main",
|
|
15
|
+
"steps": {
|
|
16
|
+
"C001/S001": {
|
|
17
|
+
"runner": "browser_action",
|
|
18
|
+
"page_fingerprint": {
|
|
19
|
+
"route": "/project/create",
|
|
20
|
+
"fields": ["subject", "amount"],
|
|
21
|
+
"buttons": ["提交"]
|
|
22
|
+
},
|
|
23
|
+
"actions": [
|
|
24
|
+
{
|
|
25
|
+
"type": "navigation.open",
|
|
26
|
+
"route": "/w:new_oa/project/create?flow_type={{data.flow_type}}"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"type": "form.set_value",
|
|
30
|
+
"target": { "field": "subject" },
|
|
31
|
+
"value": "{{data.subject}}"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "button.click",
|
|
35
|
+
"target": { "role": "button", "name": "提交" },
|
|
36
|
+
"mutation": true,
|
|
37
|
+
"retry": "never"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"expected_checks": [
|
|
41
|
+
{ "type": "wait.route", "route": "/projectContinue" },
|
|
42
|
+
{ "type": "page.assert_step", "expected": "部门审批" }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## 支持动作
|
|
50
|
+
|
|
51
|
+
- 页面与等待:`navigation.open`、`wait.visible`、`wait.network`、`wait.route`。
|
|
52
|
+
- 主表单:`form.set_value`、`form.select_option`、`form.assert_value`。
|
|
53
|
+
- 明细表:`detail.add_row`、`detail.set_value`、`detail.assert_rows`。
|
|
54
|
+
- 命令动作:`button.click`、`dialog.confirm`。
|
|
55
|
+
- 上下文与断言:`context.extract`、`page.assert_step`、`list.assert_record`、`evidence.capture`。
|
|
56
|
+
|
|
57
|
+
一个 `case_steps.csv` 行只能描述一个业务动作,但该动作可以包含多个技术原子动作。
|
|
58
|
+
|
|
59
|
+
## 定位规则
|
|
60
|
+
|
|
61
|
+
优先使用 `field`、`label`、`role + name`、`text`、`test_id`。CSS 只允许稳定 id、`name`、`aria-label` 或 `data-*` 属性。
|
|
62
|
+
|
|
63
|
+
禁止坐标、绝对 XPath、依赖 DOM 层级的长 CSS,以及写死本轮 `project_id`、`step_id`、流水号或 trace id。
|
|
64
|
+
|
|
65
|
+
## mutation 与重试
|
|
66
|
+
|
|
67
|
+
所有 `button.click` 必须声明 `mutation=true|false`。会远端提交的点击和确认动作必须使用:
|
|
68
|
+
|
|
69
|
+
```json
|
|
70
|
+
{ "mutation": true, "retry": "never" }
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
CLI 在 mutation 前验证页面指纹。mutation 发出后即使页面等待超时,也按“可能已经提交”处理,停止盲目重试并保留证据。
|
|
74
|
+
|
|
75
|
+
## 运行与重跑
|
|
76
|
+
|
|
77
|
+
正式运行先创建新的 test-suite run,再执行 `browser-run` 或 `scenario execute`。`--resume` 只继续同一个未完成 run;已完成 run 必须新建,历史 pass 不得让本轮 case 被跳过。
|
|
78
|
+
|
|
79
|
+
每轮重新解析动态 ID,并生成新的截图、DOM、Console/Network、动作 trace 和 manifest 记录。缓存只包含动作和页面语义。
|
|
80
|
+
|
|
81
|
+
## 首次录制
|
|
82
|
+
|
|
83
|
+
首次页面操作后保存 `browser-action-trace.json`,内容包含 `page_fingerprint`、`actions`、`expected_checks`。使用 `record-from-evidence --automation-out ...` 合并到场景 `automation.json`,人工 review 后再把对应步骤改为 `runner=browser_action`。
|
|
84
|
+
|
|
85
|
+
`cache_stale`、不支持控件或 lint 失败时,不得直接改成宽泛 CSS 绕过;应重新录制语义定位并 review。
|
|
@@ -69,6 +69,9 @@
|
|
|
69
69
|
- 首次运行一条流程或一个复杂 step 时,就必须按可复用方式沉淀 `scenario plan`、`data profile` 或 reusable step template;不要等重复多次后才整理。
|
|
70
70
|
- 哪怕本轮只跑一次,也要把 handoff、step-run、浏览器截图、DOM/URL、console/network、submit/readback 证据落到稳定目录,便于下一次直接复用或从失败点恢复。
|
|
71
71
|
- `bpmax-cli test-suite lint` 会强制检查每条非 deprecated E2E 用例是否已有首次运行沉淀方式;缺少 `bpmax-cli e2e create-page-submit`、`bpmax-cli e2e step-run`、`bpmax-cli e2e record-from-evidence`、`data profile`、`scenario plan` 或 reusable step template 时,不要直接判业务失败,而是读取输出中的 `e2e_acceleration.bootstrap_required=true` 和 `missing_cases`。
|
|
72
|
+
- 稳定浏览器步骤应升级为 `runner=browser_action`,场景目录提供 `automation.json`。lint 会逐步校验动作映射、页面指纹、语义选择器、断言、动态 ID 和 mutation 重试策略,并输出 `automation_coverage`。
|
|
73
|
+
- 正常复跑使用 `bpmax-cli e2e browser-run` 或 `bpmax-cli e2e scenario execute`。LLM 不得对已有稳定动作重复临场点击;只有首次录制、`cache_stale`、未支持控件和异常诊断才介入。
|
|
74
|
+
- `--resume` 仅继续当前未完成 run。用户要求重新运行、全量重跑或当前 manifest 已完成时,必须新建 run;历史 pass、status matrix 或缓存不能跳过本轮 case。
|
|
72
75
|
- 发现 `bootstrap_required=true` 时,执行编排必须先跑一次真实页面或安全 step-run,把截图、DOM/URL、console/network、submit/readback 证据保存到稳定目录,然后运行 `bpmax-cli e2e record-from-evidence` 生成 reusable step template;完成沉淀后再进入批量复跑或结论判断。
|
|
73
76
|
- 缓存执行不是无条件信任旧模板。每个 reusable step template 必须包含 `expected_checks`,复用时 `bpmax-cli e2e step-run --data-profile @...` 会先检查当前运行态模式是否仍符合预期,例如处理人可处理、step 未结束、必填字段集合、缺失字段范围、动作仍存在。
|
|
74
77
|
- 处理人判定必须优先使用当前有效 owner/assignee;`step.user_id` 只能作为辅助字段。若它与 owner 冲突,或只有 `user_id` 没有权威 owner 证明,step-run 必须阻断,不能生成可提交计划。
|
|
@@ -122,14 +125,17 @@ bpmax-cli e2e create-page-submit \
|
|
|
122
125
|
- 批量场景优先声明 `.codex/e2e-plans/<scenario>.json`,再运行:
|
|
123
126
|
|
|
124
127
|
```bash
|
|
125
|
-
bpmax-cli e2e scenario
|
|
128
|
+
bpmax-cli e2e scenario execute \
|
|
126
129
|
--plan .codex/e2e-plans/<scenario>.json \
|
|
130
|
+
--automation .ai_test/suite/<scenario>/automation.json \
|
|
131
|
+
--execution-manifest .ai_test/report/<run>/execution-manifest.json \
|
|
127
132
|
--resume \
|
|
128
|
-
--
|
|
133
|
+
--until-blocked \
|
|
129
134
|
--format json
|
|
130
135
|
```
|
|
131
136
|
|
|
132
|
-
-
|
|
137
|
+
- 旧 `scenario run` 只保留 dry-run/status matrix 兼容用途,不能执行页面,也禁止使用 `--resume` 表示真实复跑。
|
|
138
|
+
- 确定性 runner 仍必须逐步骤产生本轮真实截图和运行态证据;没有这些证据时不得把执行计划当成完整链路通过。
|
|
133
139
|
- 对表单 schema、字段 options、step requirements 反复探测时,先使用 runtime cache:
|
|
134
140
|
|
|
135
141
|
```bash
|
|
@@ -103,6 +103,8 @@ description: "用于通过 bpmax-cli typed config 创建、编辑、校验或美
|
|
|
103
103
|
- 标题、说明和分割线控件不得生成左侧字段名:`h_label` / `description` / `i_hr` / `divider` 的 `rule.title`、`value.title` 必须为空或省略;`h_label` / `description` 的展示内容只写 `props.text`。普通输入控件仍必须保留业务字段标题,不能按文案中含“标题”二字误判。
|
|
104
104
|
- `radio` 不能只写 `type=radio` 和 options;`_fc_drag_tag=radio`、`name=radio` 是运行态控件身份,缺失时必须硬阻断。新建模板还必须使用 `defaultValueType=option` 和 `{ type: "radio", value?: <option> }`;历史 edit 模板的 `defaultValueType=string` 或标量默认值只提示迁移 warning,不得阻断无关字段修改,也不得由 build 静默改写。
|
|
105
105
|
- `sub_form` 不是父表单中的占位对象;必须有父字段配置、已发布子表单模板 ID、运行态保存/展示验证。父表单绑定的 `form_template.id` 必须是已发布模板 ID,不要绑定草稿 ID。
|
|
106
|
+
- 表格模式 `sub_form` 的桌面预览必须至少保留一个自适应数据列。当前平台只有在 `props.applyColWidthOnPreview=false`(或省略)且 `fixed_left_fields` / `fixed_right_fields` 都为空时,才会省略数据列 `width` 并自动填充剩余空间。
|
|
107
|
+
- 不得把 `props.applyColWidthOnPreview=true`、任意固定列、空 `col_width` 项、`auto` 或百分比当作“固定列 + 单列自适应”方案;当前运行时一旦强制应用列宽或存在固定列,就会给全部数据列固定宽度。若业务必须同时固定部分列并保留自适应列,应记录平台能力 blocker,不能伪造配置通过验收。
|
|
106
108
|
- `es_project_selector` 必须以当前环境源码或真实接口验证为准;若存在非空 `lambda`,`quickValue` 必须显式为 `true`。
|
|
107
109
|
- `sn_number` 需要验证发起项目和审批提交链路中的后端生成结果,模板保存成功不等于单号已生成。
|
|
108
110
|
- `raw` 可用于只读展示或内部传值,但若参与脚本或数据集必须有稳定 `key`;发布后必须回读 `raw.hidden`、`display`、`visibilityCondition`、`quickValue` 和 `key` 是否被改写。
|
|
@@ -124,6 +126,7 @@ description: "用于通过 bpmax-cli typed config 创建、编辑、校验或美
|
|
|
124
126
|
- 不得新增、删除字段;不得把隐藏/只读/自动带出字段因为排版调整变成可编辑。若布局调整必须连带修改字段属性,必须先归类为 `required-collateral` 并等待确认。
|
|
125
127
|
- 美化任务必须在 structured work 中启用 TypeScript 美观性 lint,并保留 `meta.lintHints`、`meta.visualReview`、`meta.confirmedNonBehavioralProps` 等证据字段。
|
|
126
128
|
- `bpmax-cli config form-template lint --work <work-file>` 已将美观性问题作为 hard error:空行、单行字段过多、长标签挤在多列、`sub_form` / `i_textarea` / `raw` 等宽控件和其他字段挤在同一行都会阻断。
|
|
129
|
+
- `sub_form` 列宽属于常规结构 lint,不只在美化模式启用:表格模式若 `applyColWidthOnPreview=true` 或配置任一固定列,lint/build/typed submit 都必须以 `[form.sub_form.adaptive_column_required]` 阻断,防止桌面预览所有列宽被写死而无法填满容器。
|
|
127
130
|
- 美化类提交前必须先列出修改前后 diff,并按 `requested / required-collateral / out-of-scope` 分类;必须先让用户确认 work diff,再构建 submit 文件。
|
|
128
131
|
- 美化类验收默认是模板编辑器验收,必须刷新表单编辑器页面确认布局生效;只有用户要求发起页/运行页生效时,才继续做运行态验收。
|
|
129
132
|
|
|
@@ -638,6 +638,12 @@ bpmax-cli config form-template lint --work .codex/tmp/form-template-editor/work/
|
|
|
638
638
|
- `props.mode = "table"`
|
|
639
639
|
- `props.form_template.id = <publishedChildTemplateId>`
|
|
640
640
|
- `props.form_template.name = <childTemplateName>`
|
|
641
|
+
- 表格模式必须让桌面预览至少存在一个自适应数据列:
|
|
642
|
+
- `props.applyColWidthOnPreview` 保持 `false` 或省略
|
|
643
|
+
- `props.fixed_left_fields`、`props.fixed_right_fields` 保持为空
|
|
644
|
+
- `props.col_width` 可用于编辑态、移动端和固定宽度回退,但不能证明桌面预览存在自适应列
|
|
645
|
+
- 平台 `TableForm` 当前会在 `applyColWidthOnPreview=true` 时为每个数据列使用 `col_width` 或默认 `145px`;只要存在任一固定列,`hasFixedRules` 也会让全部数据列获得固定 `width`。因此不能通过在 `col_width` 中留空、写 `auto` 或写百分比实现“部分固定 + 至少一列自适应”。
|
|
646
|
+
- `bpmax-cli config form-template lint/build/submit` 会以 `[form.sub_form.adaptive_column_required]` 阻断上述全固定配置。若业务确实要求固定首列/末列且其余列自动填充,应停止并记录平台能力 blocker,不能绕过 typed lint。
|
|
641
647
|
- 如果是“普通子表单模式”,才使用 `props.mode = "form"`;不要默认写成 `form`。
|
|
642
648
|
- 子表单模板本身仍然是普通 `form_template`,提交流程和父表单一样:
|
|
643
649
|
1. `POST /api/form_template` 或 `PUT /api/form_template/:id`
|
|
@@ -10,6 +10,12 @@
|
|
|
10
10
|
- 子表单单独建模板
|
|
11
11
|
- 一条子表单记录表示一条明细
|
|
12
12
|
|
|
13
|
+
## 表格列宽
|
|
14
|
+
- `props.mode = "table"` 时,桌面预览至少保留一个自适应数据列,避免所有列宽写死后在宽屏留白或窄屏拥挤。
|
|
15
|
+
- 当前可验证的自适应配置是:`props.applyColWidthOnPreview=false`(或省略),并且不设置 `fixed_left_fields` / `fixed_right_fields`。此时桌面预览的数据列不传 `width`,由表格自动分配剩余空间。
|
|
16
|
+
- `col_width` 可以保留整数像素列表供编辑态、移动端或回退宽度使用,但不要在其中写空项、`auto` 或百分比冒充自适应列。
|
|
17
|
+
- 当前平台不支持“固定部分列,同时让至少一列自适应”:配置任一固定列后,运行时会给全部数据列固定宽度。遇到这类需求应标记平台能力 blocker,而不是绕过 `[form.sub_form.adaptive_column_required]` lint。
|
|
18
|
+
|
|
13
19
|
## 销售出库流程的落地经验(2026-04-11)
|
|
14
20
|
|
|
15
21
|
### 目标
|