@steedos-labs/plugin-workflow 3.0.51 → 3.0.52
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/designer/dist/assets/{index-CeMQUt8Y.js → index-BkLrUP0o.js} +5 -3
- package/designer/dist/assets/{index-Bs9qBPga.css → index-xR8ApdWL.css} +1 -1
- package/designer/dist/index.html +2 -2
- package/main/default/routes/am.router.js +2 -0
- package/main/default/routes/api_workflow_ai_form_design.router.js +16 -1
- package/main/default/routes/api_workflow_ai_form_design_stream.router.js +7 -3
- package/main/default/routes/api_workflow_next_step.router.js +1 -1
- package/main/default/routes/flow_form_design.ejs +2 -2
- package/main/default/test/FORMULA_SCAN_GUIDE.md +3 -0
- package/main/default/test/reports/formula-scan/SCAN_HISTORY.md +57 -0
- package/main/default/test/reports/formula-scan/scan-result-v10-20260327.json +31543 -0
- package/main/default/test/reports/formula-scan/scan-result-v9-20260327.json +31723 -0
- package/main/default/test/scan_production_formulas.js +25 -5
- package/main/default/triggers/amis_form_design.trigger.js +18 -17
- package/package.json +1 -1
|
@@ -197,3 +197,60 @@ v8 与 v7 对比完全一致(0 ERROR),说明:
|
|
|
197
197
|
| KNOWN_ISSUE | 4 | 4 |
|
|
198
198
|
| WARN | 206 | 206 |
|
|
199
199
|
| PASS | 1949 | 1949 |
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## v9 → v10:Bug 9 — 设计器 section 子字段未传递 tableFieldMap
|
|
204
|
+
|
|
205
|
+
- **扫描日期**: 2026-03-27
|
|
206
|
+
- **修正前报告**: `scan-result-v9-20260327.json`(6 ERROR, 4 KNOWN_ISSUE, 206 WARN)
|
|
207
|
+
- **修正后报告**: `scan-result-v10-20260327.json`(0 ERROR, 4 KNOWN_ISSUE, 206 WARN)
|
|
208
|
+
- **关联 Issue**: [#538](https://github.com/steedos/steedos-plugins/issues/538)
|
|
209
|
+
- **修改文件**: `flow_form_design.ejs`
|
|
210
|
+
|
|
211
|
+
### Bug 9 根因
|
|
212
|
+
|
|
213
|
+
`flow_form_design.ejs` 的 `getFieldEditTpl` 函数中:
|
|
214
|
+
- **section case(第 644 行)**:调用 `getFieldEditTpl(field.fields[i], true)` — 传递布尔值 `true` 而非 `tableFieldMap`
|
|
215
|
+
- **table case(第 631 行)**:调用 `getFieldEditTpl(sField, true)` — 同样传递 `true`
|
|
216
|
+
|
|
217
|
+
在 `_mapFormula` 内部,`tableFieldMap` 为 `true` 时,`true[fieldCode]` 永远返回 `undefined`,导致子表字段识别失败,走了非子表路径(`getSafeCode` 而非 `ARRAYMAP`)。
|
|
218
|
+
|
|
219
|
+
> **为什么之前的扫描器没发现**:扫描器自己通过 `getTableFieldMap(fields)` 构建正确的 `tableFieldMap` 传给 `mapFormula`,测试的是公式引擎本身。但设计器的调用链在 section 递归时传参错误,属于**调用者 bug**而非引擎 bug。
|
|
220
|
+
|
|
221
|
+
### 修复内容
|
|
222
|
+
|
|
223
|
+
- section case:`getFieldEditTpl(field.fields[i], true)` → `getFieldEditTpl(field.fields[i], tableFieldMap)`
|
|
224
|
+
- table case:`getFieldEditTpl(sField, true)` → `getFieldEditTpl(sField, null)`(子表内字段不需要 tableFieldMap)
|
|
225
|
+
|
|
226
|
+
### 检测方法(E6 规则,一次性诊断)
|
|
227
|
+
|
|
228
|
+
为发现此类问题,临时添加 E6 规则到扫描器:
|
|
229
|
+
- 追踪字段是否在 section 内(`inSection` 标志)
|
|
230
|
+
- 对 section 内的公式字段,模拟设计器行为调用 `mapFormula(formula, true)`
|
|
231
|
+
- 比较与正确结果是否一致,不一致则报 ERROR
|
|
232
|
+
|
|
233
|
+
E6 是一次性诊断规则 — 发现问题后修复设计器,然后移除 E6(因为它测试的是调用者行为而非引擎行为)。但 `inSection` 追踪保留在 `collectFormulaFields` 中,供未来诊断使用。
|
|
234
|
+
|
|
235
|
+
### 修复了 6 个 E6 ERROR
|
|
236
|
+
|
|
237
|
+
| # | 表单名称 | formId | 字段 | 原始公式 | 版本 |
|
|
238
|
+
|---|---------|--------|------|---------|------|
|
|
239
|
+
| 1 | 【公司本部】抚顺石化公司车辆维修审批单 | `9a40a1a2049014ff074a4961` | 配件金额 | `{数量}*{单价}` | history |
|
|
240
|
+
| 2 | 【乙烯部】抚顺石化公司车辆维修审批单 | `2a36450a56ecd64af98506ba` | 配件金额 | `{数量}*{单价}` | history |
|
|
241
|
+
| 3 | 【公司办公室】抚顺石化公司车辆维修费用结算审批单 | `2c3a2c7cbbf618d95a40376b` | 配件金额 | `{数量}*{单价}` | history |
|
|
242
|
+
| 4 | 抚顺石化公司物资采购概预算调整审批单 | `cRJknoGMcLa2raizW` | 拟调整概预算金额合计 | `sum({拟调整概预算金额})` | **current** |
|
|
243
|
+
| 5 | 抚顺石化公司物资采购概预算调整审批单 | `cRJknoGMcLa2raizW` | 拟调整概预算总金额 | `sum({拟调整概预算金额})` | history |
|
|
244
|
+
| 6 | 抚顺石化公司化工三剂采购概预算调整审批单 | `17d3b669d8880cd32b89ebfb` | 拟调整概预算金额合计 | `sum({拟调整概预算金额(元)})` | **current** |
|
|
245
|
+
|
|
246
|
+
> **影响面**: 4 个 history + 2 个 **current**(#4 和 #6 影响在用表单的设计器预览)
|
|
247
|
+
|
|
248
|
+
### 扫描统计变化
|
|
249
|
+
|
|
250
|
+
| 指标 | v8 | v9(修正前) | v10(修正后) |
|
|
251
|
+
|------|-----|------------|-------------|
|
|
252
|
+
| ERROR | 0 | 6 | 0 |
|
|
253
|
+
| KNOWN_ISSUE | 4 | 4 | 4 |
|
|
254
|
+
| WARN | 206 | 206 | 206 |
|
|
255
|
+
| PASS | 1949 | 1943 | 1949 |
|
|
256
|
+
| current ERROR | 0 | 2 | 0 |
|