weaver-e10-builder 1.0.11-beta → 1.0.12-beta
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/commands/auth.d.ts.map +1 -1
- package/dist/commands/auth.js +13 -0
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/form-list-permission.d.ts.map +1 -1
- package/dist/commands/form-list-permission.js +130 -15
- package/dist/commands/form-list-permission.js.map +1 -1
- package/dist/commands/form-nlist.d.ts +22 -0
- package/dist/commands/form-nlist.d.ts.map +1 -0
- package/dist/commands/form-nlist.js +179 -0
- package/dist/commands/form-nlist.js.map +1 -0
- package/dist/commands/form-serial-mark.d.ts +0 -15
- package/dist/commands/form-serial-mark.d.ts.map +1 -1
- package/dist/commands/form-serial-mark.js +604 -137
- package/dist/commands/form-serial-mark.js.map +1 -1
- package/dist/commands/form.d.ts.map +1 -1
- package/dist/commands/form.js +91 -0
- package/dist/commands/form.js.map +1 -1
- package/dist/commands/skill.d.ts +3 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +112 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/workflow-condition.d.ts.map +1 -1
- package/dist/commands/workflow-condition.js +3 -1
- package/dist/commands/workflow-condition.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +11 -7
- package/dist/commands/workflow.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/services/condition-rules.d.ts.map +1 -1
- package/dist/services/condition-rules.js +3 -1
- package/dist/services/condition-rules.js.map +1 -1
- package/dist/services/form-create.d.ts.map +1 -1
- package/dist/services/form-create.js +4 -1
- package/dist/services/form-create.js.map +1 -1
- package/dist/services/form-nlist.d.ts +42 -0
- package/dist/services/form-nlist.d.ts.map +1 -0
- package/dist/services/form-nlist.js +332 -0
- package/dist/services/form-nlist.js.map +1 -0
- package/dist/services/skill-provision.d.ts +18 -0
- package/dist/services/skill-provision.d.ts.map +1 -0
- package/dist/services/skill-provision.js +86 -0
- package/dist/services/skill-provision.js.map +1 -0
- package/dist/services/workflow-initiator.js +3 -3
- package/dist/services/workflow-initiator.js.map +1 -1
- package/package.json +4 -2
- package/skill-docs/SKILL.md +348 -0
- package/skill-docs/actionflows/references/components/calendar/MeetingCreate.md +17 -0
- package/skill-docs/actionflows/references/components/calendar/ScheduleCreate.md +17 -0
- package/skill-docs/actionflows/references/components/document/AttachmentCopy.md +17 -0
- package/skill-docs/actionflows/references/components/document/AttachmentMove.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentCopy.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentDelete.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentEdit.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentMove.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentPermissionChange.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentRenewal.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentRevert.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentSave.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentSubscription.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentSubscriptionApprove.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentSubscriptionSendBack.md +17 -0
- package/skill-docs/actionflows/references/components/document/DocumentSubscriptionWithdraw.md +17 -0
- package/skill-docs/actionflows/references/components/document/FileFolderSave.md +17 -0
- package/skill-docs/actionflows/references/components/document/GetAttachmentInfo.md +17 -0
- package/skill-docs/actionflows/references/components/document/GetDocumentInfo.md +17 -0
- package/skill-docs/actionflows/references/components/document/ModifyDocumentStatus.md +17 -0
- package/skill-docs/actionflows/references/components/document/ReplaceAttachment.md +17 -0
- package/skill-docs/actionflows/references/components/document/UpdatePrintNum.md +17 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbAdd.md +39 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbDelete.md +21 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbRecover.md +17 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbSaveVersion.md +17 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbUpdate.md +21 -0
- package/skill-docs/actionflows/references/components/ebuilder/DateTrigger.md +17 -0
- package/skill-docs/actionflows/references/components/ebuilder/EbGetDataById.md +17 -0
- package/skill-docs/actionflows/references/components/ebuilder/EnquiryForm.md +75 -0
- package/skill-docs/actionflows/references/components/ebuilder/EventFormData.md +17 -0
- package/skill-docs/actionflows/references/components/ebuilder/TimeBatchTrigger.md +17 -0
- package/skill-docs/actionflows/references/components/logic/Condition.md +23 -0
- package/skill-docs/actionflows/references/components/logic/LogicFlowSet.md +17 -0
- package/skill-docs/actionflows/references/components/logic/MultipleExecution.md +38 -0
- package/skill-docs/actionflows/references/components/logic/Output.md +17 -0
- package/skill-docs/actionflows/references/components/message/SendMessage.md +17 -0
- package/skill-docs/actionflows/references/components/personnel/AlterPersonStatus.md +30 -0
- package/skill-docs/actionflows/references/components/personnel/HrmEmployeeUpdate.md +32 -0
- package/skill-docs/actionflows/references/components/personnel/PersonnelOnboarding.md +34 -0
- package/skill-docs/actionflows/references/components/trigger/SimpleScheduler.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveAddSign.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveAgreeRejectApply.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveCommit.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveCompletelyDelete.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveConsulTurnTodo.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveCreate.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveDelete.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveDoCirculate.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveDoForward.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveDoTurnTodo.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveEntrust.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveIntervention.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveMandatoryArchiving.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveManualCC.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveRefuseRejectApply.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveRejectApply.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveSave.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveSendBack.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveShareEntry.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveTrigger.md +49 -0
- package/skill-docs/actionflows/references/components/workflow/ApproveWithdraw.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/WorkFlowDocEmpowerment.md +17 -0
- package/skill-docs/actionflows/references/components/workflow/WorkflowToDoc.md +17 -0
- package/skill-docs/actionflows/references/condition_rules.md +97 -0
- package/skill-docs/actionflows/references/examples/enquiry-form-batch-insert-scene2.json +1046 -0
- package/skill-docs/actionflows/references/function_rules.md +13 -0
- package/skill-docs/actionflows/references/trigger_runtime_notes.md +51 -0
- package/skill-docs/assets/sample/.claude/settings.local.json +8 -0
- package/skill-docs/assets/sample/api/formApi.js +510 -0
- package/skill-docs/assets/sample/config/config.js +0 -0
- package/skill-docs/assets/sample/config/configLoad.js +0 -0
- package/skill-docs/assets/sample/config/configLoad_default.js +0 -0
- package/skill-docs/assets/sample/config/config_default.js +0 -0
- package/skill-docs/assets/sample/entry.js +22 -0
- package/skill-docs/assets/sample/eslint.config.cjs +48 -0
- package/skill-docs/assets/sample/memo.md +0 -0
- package/skill-docs/assets/sample/readme.js +8 -0
- package/skill-docs/references/auth/guide-auth.md +88 -0
- package/skill-docs/references/coding/guide-edit-backfill.md +189 -0
- package/skill-docs/references/coding/guide-form-crud.md +262 -0
- package/skill-docs/references/coding/guide-page-code.md +224 -0
- package/skill-docs/references/coding/guide-page-export.md +119 -0
- package/skill-docs/references/coding/ref-compile-rules.md +106 -0
- package/skill-docs/references/common/ref-cli-commands.md +286 -0
- package/skill-docs/references/components/@weapp-Button.md +104 -0
- package/skill-docs/references/components/base-Badge.md +100 -0
- package/skill-docs/references/components/base-Dialog.md +358 -0
- package/skill-docs/references/components/base-Empty.md +58 -0
- package/skill-docs/references/components/base-Tag.md +112 -0
- package/skill-docs/references/components/display-Alert.md +64 -0
- package/skill-docs/references/components/display-Avatar.md +150 -0
- package/skill-docs/references/components/display-Calendar.md +263 -0
- package/skill-docs/references/components/display-Carousel.md +115 -0
- package/skill-docs/references/components/display-Collapse.md +299 -0
- package/skill-docs/references/components/display-FilePreview.md +49 -0
- package/skill-docs/references/components/display-Icon.md +66 -0
- package/skill-docs/references/components/display-List.md +320 -0
- package/skill-docs/references/components/display-Pagination.md +41 -0
- package/skill-docs/references/components/display-Spin.md +34 -0
- package/skill-docs/references/components/display-Steps.md +89 -0
- package/skill-docs/references/components/display-Table.md +160 -0
- package/skill-docs/references/components/display-Title.md +117 -0
- package/skill-docs/references/components/form-Checkbox.md +161 -0
- package/skill-docs/references/components/form-DepartmentBrowser-api.md +52 -0
- package/skill-docs/references/components/form-EmployeeBrowser-api.md +51 -0
- package/skill-docs/references/components/form-EmployeeBrowser.md +51 -0
- package/skill-docs/references/components/form-Input.md +123 -0
- package/skill-docs/references/components/form-Radio.md +145 -0
- package/skill-docs/references/components/form-Select.md +191 -0
- package/skill-docs/references/components/form-Switch.md +46 -0
- package/skill-docs/references/components/form-Upload.md +53 -0
- package/skill-docs/references/components/generic-Echarts.md +102 -0
- package/skill-docs/references/form/guide-create-form.md +407 -0
- package/skill-docs/references/form/guide-ebuilder-filter.md +73 -0
- package/skill-docs/references/form/guide-ebuilder-scope.md +82 -0
- package/skill-docs/references/form/guide-form-data.md +48 -0
- package/skill-docs/references/form/guide-form-formula-functions.md +297 -0
- package/skill-docs/references/form/guide-form-linkage.md +185 -0
- package/skill-docs/references/form/guide-form-view-permission.md +38 -0
- package/skill-docs/references/form/guide-form-view.md +267 -0
- package/skill-docs/references/form/style-templates.md +44 -0
- package/skill-docs/references/hrm/guide-matrix.md +103 -0
- package/skill-docs/references/menu/system-menus.md +63 -0
- package/skill-docs/references/workflow/guide-workflow-action.md +168 -0
- package/skill-docs/references/workflow/guide-workflow-condition.md +405 -0
- package/skill-docs/references/workflow/guide-workflow.md +388 -0
- package/skill-docs/references/workflow/operator-matrix.md +74 -0
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
# 流程分支条件指南
|
|
2
|
+
|
|
3
|
+
> 流程基础(建流程、节点、连线、审批人)见 `workflow/guide-workflow.md`。本指南专讲**分支/出口条件**:金额>1万走高级审批、合同类型=采购走快速通道这类路由。
|
|
4
|
+
|
|
5
|
+
## 添加分支条件(简化语法,推荐)
|
|
6
|
+
|
|
7
|
+
**一行命令搞定**,自动校验字段类型、自动生成 API payload、自动绑定到连线:
|
|
8
|
+
|
|
9
|
+
> **AND / OR 规则写在「同一次调用」里**:要组合多条规则,一次 `add` 传多个 `--rule` + `--relation AND|OR`,例如
|
|
10
|
+
> `--rule "form:金额:大于:1000" --rule "system:流程标题:包含:合同" --relation AND`。
|
|
11
|
+
>
|
|
12
|
+
> **对同一连线重复 `add` 是「替换」,不是叠加**:第二次 `add` 会先删掉该连线旧条件再重建。这是刻意的——若允许跨调用叠加,极易产生 `(金额≥100万) AND (金额<100万)` 这类永远不成立的矛盾条件。因此**想给已有条件补一条规则,必须在新的 `add` 里把旧规则连同新规则一起写全**,不能靠再跑一次叠上去。
|
|
13
|
+
>
|
|
14
|
+
> **同源节点多分支**:一条连线只绑一个条件。要分多个分支,先给每个分支各建一条连线(`add-link`),再分别对每条连线 `add`。
|
|
15
|
+
|
|
16
|
+
### 基础示例
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# 系统字段条件
|
|
20
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "条件名称" \
|
|
21
|
+
--rule "system:流程标题:包含:关键词"
|
|
22
|
+
|
|
23
|
+
# 数值范围条件
|
|
24
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "金额过万" \
|
|
25
|
+
--rule "system:流程超时(时):范围:1:72"
|
|
26
|
+
|
|
27
|
+
# 日期范围条件
|
|
28
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "今年发起" \
|
|
29
|
+
--rule "system:发起时间:范围:2026-01-01:2026-12-31"
|
|
30
|
+
|
|
31
|
+
# 为空/不为空
|
|
32
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "无部门" \
|
|
33
|
+
--rule "system:发起人部门:为空"
|
|
34
|
+
|
|
35
|
+
# 多规则 AND/OR 组合
|
|
36
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "复合条件" \
|
|
37
|
+
--rule "system:流程标题:包含:报销" \
|
|
38
|
+
--rule "system:流程超时(时):大于:24" \
|
|
39
|
+
--relation AND
|
|
40
|
+
|
|
41
|
+
# 表单字段条件(字段ID / 名称 / dataKey 均可匹配)
|
|
42
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "表单字段" \
|
|
43
|
+
--rule "form:<字段ID>:大于:1000" # 按 fieldId
|
|
44
|
+
--rule "form:申请金额:大于:1000" # 按字段名
|
|
45
|
+
--rule "form:je_2831:大于:1000" # 按 dataKey(原生流程表单 fieldId 会变,用 dataKey 最稳)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 选项类字段(Select/CheckBox/RadioBox):用"属于"或"包含"
|
|
49
|
+
|
|
50
|
+
选项类字段归 Browser 族,用 `属于`(= `包含`,code 9)匹配任一选项:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# 合同类型=采购类(单个选项)
|
|
54
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "采购类合同" \
|
|
55
|
+
--rule "form:合同类型:属于:采购类"
|
|
56
|
+
|
|
57
|
+
# 报销类型∈{差旅费,住宿费}(多个选项,逗号分隔)
|
|
58
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "差旅住宿报销" \
|
|
59
|
+
--rule "form:报销类型:属于:差旅费,住宿费"
|
|
60
|
+
|
|
61
|
+
# 也可以直接用"包含"(等价)
|
|
62
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "招待费报销" \
|
|
63
|
+
--rule "form:报销类型:包含:招待费"
|
|
64
|
+
|
|
65
|
+
# 不包含/不属于
|
|
66
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "非采购类" \
|
|
67
|
+
--rule "form:合同类型:不属于:采购类"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> `属于` 和 `包含` 是**别名**,底层都是 code 9("包含或属于"),由平台显示语义。对 Select/CheckBox/RadioBox 选项字段,建议用 `属于`;对文本/人员字段用 `包含`。
|
|
71
|
+
|
|
72
|
+
### 人员/部门字段
|
|
73
|
+
|
|
74
|
+
人员/部门字段值走浏览器解析,用逗号分隔多值:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
# 报销人=闫宇或吴鹏(人员多选)
|
|
78
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "闫宇或吴鹏报销" \
|
|
79
|
+
--rule "form:报销人:等于:闫宇,吴鹏"
|
|
80
|
+
|
|
81
|
+
# 所属部门=财务部
|
|
82
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "财务部报销" \
|
|
83
|
+
--rule "form:所属部门:等于:财务部"
|
|
84
|
+
|
|
85
|
+
# 部门不含子部门
|
|
86
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "本部门" \
|
|
87
|
+
--rule "form:所属部门:等于:财务部:不包含子部门"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
### 字段 vs 字段比较(变量模式)
|
|
91
|
+
|
|
92
|
+
用 `field` 关键字表示值来自另一个字段,而非字面值:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# 发起时间 ≥ 报销日期(系统字段 vs 表单字段)
|
|
96
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "先报销后发起" \
|
|
97
|
+
--rule "system:发起时间:大于等于:field:报销日期"
|
|
98
|
+
|
|
99
|
+
# 发票日期 < 报销日期(表单字段 vs 表单字段)
|
|
100
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "发票早于报销日期" \
|
|
101
|
+
--rule "form:发票日期:小于:field:报销日期"
|
|
102
|
+
|
|
103
|
+
# 数值字段 vs 字段
|
|
104
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "超标" \
|
|
105
|
+
--rule "form:实际金额:大于:field:预算金额"
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
> **语法**:`来源:左字段:操作:field:右字段`。`field` 是固定关键字,表示右边是字段引用不是字面值。支持 `system` 和 `form` 两种来源,适用范围:`大于`/`小于`/`等于`/`不等于`/`大于等于`/`小于等于`。
|
|
109
|
+
|
|
110
|
+
### 明细字段条件
|
|
111
|
+
|
|
112
|
+
末尾必带量词 `:任一`(任一行满足) / `:所有`(所有行满足):
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
# 明细任一行金额>1万
|
|
116
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "明细金额过万" \
|
|
117
|
+
--rule "form:明细金额:大于:10000:任一"
|
|
118
|
+
|
|
119
|
+
# 明细所有行数量都在 1~100
|
|
120
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "明细数量范围" \
|
|
121
|
+
--rule "form:明细数量:范围:1:100:所有"
|
|
122
|
+
|
|
123
|
+
# 明细字段 vs 字段(发票日期 < 报销日期)
|
|
124
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "明细发票日期" \
|
|
125
|
+
--rule "form:发票日期:小于:field:报销日期:任一"
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### OR 分组:用 `|` 分隔子规则
|
|
129
|
+
|
|
130
|
+
同一条 `--rule` 内用 `|` 分隔表示 OR 关系:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# 报销类型∈{差旅费,住宿费} OR 发票编号以FP开头
|
|
134
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "差旅住宿或FP发票" \
|
|
135
|
+
--rule "form:报销类型:属于:差旅费,住宿费:任一|form:发票编号:包含:FP:任一"
|
|
136
|
+
|
|
137
|
+
# 报销金额>10000 OR 紧急程度=紧急
|
|
138
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "大额或紧急" \
|
|
139
|
+
--rule "form:报销金额:大于:10000" \
|
|
140
|
+
--rule "system:紧急程度:等于:紧急"
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
> 单条 `--rule` 内用 `|` 分隔的子规则是 OR 关系;多条 `--rule` 之间默认 AND 关系(`--relation OR` 可改)。
|
|
144
|
+
|
|
145
|
+
### 完整复杂条件示例
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# 报销初审→财务部专项复核:
|
|
149
|
+
# AND条件:所属部门=财务部, 报销金额5k~10k, 发起时间≥报销日期,
|
|
150
|
+
# OR条件(明细):报销类型∈{差旅费,住宿费} OR 发票编号以FP开头
|
|
151
|
+
e10-cli workflow condition add <wf> <sourceId> <nodeId> "财务部复核" \
|
|
152
|
+
--rule "form:所属部门:等于:财务部" \
|
|
153
|
+
--rule "form:报销金额:范围:5000:10000" \
|
|
154
|
+
--rule "system:发起时间:大于等于:field:报销日期" \
|
|
155
|
+
--rule "form:报销类型:属于:差旅费,住宿费:任一|form:发票编号:包含:FP:任一"
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## 添加分支条件(原始 JSON,完整控制)
|
|
159
|
+
|
|
160
|
+
需要 4 步操作:
|
|
161
|
+
```bash
|
|
162
|
+
# 1. 生成新连线 ID
|
|
163
|
+
e10-cli workflow generate-link-id <workflowId> # → newLinkId
|
|
164
|
+
|
|
165
|
+
# 2. 获取当前流程图 XML,在 XML 中添加新的 <mxCell edge="1"> 后保存
|
|
166
|
+
e10-cli workflow save-layout <workflowId> @修改后的xml文件
|
|
167
|
+
|
|
168
|
+
# 3. 保存条件规则(CLI 自动生成节点 ID,只需写条件逻辑)
|
|
169
|
+
e10-cli workflow save-condition @条件.json --app-id <appId> # → conditionKey
|
|
170
|
+
|
|
171
|
+
# 4. 绑定条件到连线
|
|
172
|
+
e10-cli workflow set-link-condition-key <wf> <linkId> <key> <nodeId>
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> `--app-id` 用于自动生成唯一 ID。省略时透传原始 JSON(需自己填好所有 ID)。
|
|
176
|
+
|
|
177
|
+
## 条件 JSON 格式
|
|
178
|
+
|
|
179
|
+
`childrens` 是**递归树结构**,叶子条件用 `selectType` 判断,分组条件用 `relation` + `childrens` 组合。**CLI 只自动生成 ID**(`expressionId`/`expressionBaseId`/`dataValueId`/`elementValue*Id`),其余字段必须按以下格式手写。
|
|
180
|
+
|
|
181
|
+
**完整结构**:
|
|
182
|
+
```json
|
|
183
|
+
{
|
|
184
|
+
"source": 2,
|
|
185
|
+
"sourceId": "连线ID",
|
|
186
|
+
"workflowId": "流程ID",
|
|
187
|
+
"conditionName": "条件名称",
|
|
188
|
+
"linkName": "连线名称",
|
|
189
|
+
"needFormfield": true,
|
|
190
|
+
"readOnly": false,
|
|
191
|
+
"mapBaseId": "表单ID",
|
|
192
|
+
"isEdit": false,
|
|
193
|
+
"isFromRuleListPage": true,
|
|
194
|
+
"relation": 1,
|
|
195
|
+
"childrens": [/* 叶子或分组 */]
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
### 两种节点类型
|
|
202
|
+
|
|
203
|
+
**叶子条件** — 有 `selectType`,无 `childrens`:
|
|
204
|
+
|
|
205
|
+
**分组条件** — 有 `relation` + `childrens`,无 `selectType`:
|
|
206
|
+
|
|
207
|
+
```json
|
|
208
|
+
{ "relation": 1, "childrens": [/* 嵌套的叶子或分组 */] }
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
> `selectType` 是数字 3 或 4。`relation`: 1=AND, 2=OR。
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
### 叶子条件:字段前缀由 fieldType 决定
|
|
216
|
+
|
|
217
|
+
> **关键**:每组字段有 `{前缀}CompareOptionLeft`、`{前缀}ValueOptionLeft`、`{前缀}TextValueLeft1` 三件套。
|
|
218
|
+
|
|
219
|
+
**Text / Textarea → `String*` 前缀**:
|
|
220
|
+
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"selectType": 4,
|
|
224
|
+
"formField": [{ "supportContainType": false, "total": false, "name": "字段名", "id": "fieldId", "fieldType": "Text", "groupKey": "Text" }],
|
|
225
|
+
"StringValueOptionLeft": 1,
|
|
226
|
+
"StringCompareOptionLeft": 5,
|
|
227
|
+
"StringTextValueLeft1": "要匹配的值",
|
|
228
|
+
"valueType": "0"
|
|
229
|
+
}
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**Number / Money / Int → `Number*` 前缀**:
|
|
233
|
+
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"selectType": 4,
|
|
237
|
+
"formField": [{ "supportContainType": false, "total": false, "name": "金额", "id": "fieldId", "fieldType": "Money", "groupKey": "Money" }],
|
|
238
|
+
"NumberValueOptionLeft": 1,
|
|
239
|
+
"NumberCompareOptionLeft": 1,
|
|
240
|
+
"NumberTextValueLeft1": "50000",
|
|
241
|
+
"valueType": "1"
|
|
242
|
+
}
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**Select / RadioBox / CheckBox → `Browser*` 前缀**:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"selectType": 4,
|
|
250
|
+
"formField": [{ "supportContainType": false, "total": false, "name": "字段名", "id": "fieldId", "fieldType": "Select", "groupKey": "Select" }],
|
|
251
|
+
"BrowserCompareOptionLeft": "9",
|
|
252
|
+
"BrowserValueOptionLeft": "1",
|
|
253
|
+
"BrowserTextValueLeft1": [{ "id": "选项valueKey", "content": "选项名" }],
|
|
254
|
+
"valueType": "0"
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
**Date / DateTime → `Date*` 前缀**:
|
|
259
|
+
|
|
260
|
+
```json
|
|
261
|
+
{
|
|
262
|
+
"selectType": 4,
|
|
263
|
+
"formField": [{ "supportContainType": false, "total": false, "name": "日期", "id": "fieldId", "fieldType": "Date", "groupKey": "Date" }],
|
|
264
|
+
"DateValueOptionLeft": 1,
|
|
265
|
+
"DateCompareOptionLeft": 1,
|
|
266
|
+
"DateTextValueLeft1": "2026-07-23",
|
|
267
|
+
"valueType": "0"
|
|
268
|
+
}
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
**系统变量-字符串**(selectType=3, systemVariable="-1" 等):
|
|
272
|
+
|
|
273
|
+
```json
|
|
274
|
+
{
|
|
275
|
+
"selectType": 3,
|
|
276
|
+
"systemVariable": "-1",
|
|
277
|
+
"StringValueOptionLeft": 1,
|
|
278
|
+
"StringCompareOptionLeft": 5,
|
|
279
|
+
"StringTextValueLeft1": "值",
|
|
280
|
+
"valueType": "0"
|
|
281
|
+
}
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
**系统变量-日期**(selectType=3, systemVariable="-3" 等):
|
|
285
|
+
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"selectType": 3,
|
|
289
|
+
"systemVariable": "-3",
|
|
290
|
+
"DateValueOptionLeft": 1,
|
|
291
|
+
"DateCompareOptionLeft": 1,
|
|
292
|
+
"DateTextValueLeft1": "2026-07-23",
|
|
293
|
+
"valueType": "0"
|
|
294
|
+
}
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
---
|
|
298
|
+
|
|
299
|
+
### formField 字段映射
|
|
300
|
+
|
|
301
|
+
`formField` 需要**完整字段元数据**(不是精简格式)。直接从 `form read --app-id <appId> --out fields.json` 输出的字段对象中取,保留所有字段。
|
|
302
|
+
|
|
303
|
+
`formField` 至少包含:`id`(fieldId)、`name`(fieldName)、`fieldType`、`detail`、`detailName`、`total`、`formId`、`sourceModule`、`layoutDetail`、`selectDataSource`、`groupKey`、`supportContainType`、`newFormDesigner`、`variable`、`valueCount`、`dataTemplateId`、`detailTableId`。
|
|
304
|
+
|
|
305
|
+
> **不要精简**:碰到 `selectType: "4"` 就把 `form read` 返回的字段对象全量塞进 `formField` 数组。紧凑格式在 mulinquan 碰巧能过但不完整,eteams 直接拒绝。
|
|
306
|
+
|
|
307
|
+
---
|
|
308
|
+
|
|
309
|
+
## 查看已有条件
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# 列出工作流下所有连线绑定的条件(连线名 + 条件名 + 表达式 + mapId)
|
|
313
|
+
e10-cli workflow condition list <workflowId> [--name <关键词>]
|
|
314
|
+
# 查看单个条件详情(含中文表达式),id 可用 conditionKey / mapId / conditionId
|
|
315
|
+
e10-cli workflow condition get <workflowId> <id>
|
|
316
|
+
# 删除条件(自动解绑连线),id 同 get
|
|
317
|
+
e10-cli workflow condition delete <workflowId> <id> [--link-id <linkId>]
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
> **getConditionList 是「按连线」查询**:请求体需回传 getConditionSet 的完整上下文
|
|
321
|
+
> (`sourceId`=连线 + `conditionName`=sourceName + `linkName` + `mapBaseId`/`conditionKey`
|
|
322
|
+
> + `exitConditionMapBrowserInfo`/`conditionMapBrowserBean`),只传简化参数会返回空列表。
|
|
323
|
+
> 删除时 `deleteConditions.mapIds` 需传 **mapId**(getConditionList 记录里的 mapId),不是 conditionKey。
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
### 前缀速查表
|
|
328
|
+
|
|
329
|
+
| 字段类型 | selectType | 前缀 | CompareOption 类型 | valueType |
|
|
330
|
+
|---------|-----------|------|--------------------|-----------|
|
|
331
|
+
| Text / Textarea | 4 | `String` | number | `"0"` |
|
|
332
|
+
| Number / Money / Int | 4 | `Number` | number | `"1"` |
|
|
333
|
+
| Select / RadioBox / CheckBox | 4 | `Browser` | **string** | `"0"` |
|
|
334
|
+
| Date / DateTime | 4 | `Date` | number | `"0"` |
|
|
335
|
+
| 系统变量-字符串 | 3 | `String` | number | `"0"` |
|
|
336
|
+
| 系统变量-日期 | 3 | `Date` | number | `"0"` |
|
|
337
|
+
| 系统变量-下拉 | 3 | `SysBrowser` | — | `"0"` |
|
|
338
|
+
|
|
339
|
+
---
|
|
340
|
+
|
|
341
|
+
### 比较符(CompareOption)
|
|
342
|
+
|
|
343
|
+
| 值 | 含义 |
|
|
344
|
+
|---|------|
|
|
345
|
+
| 1 | 大于 |
|
|
346
|
+
| 2 | 大于等于 |
|
|
347
|
+
| 3 | 小于 |
|
|
348
|
+
| 4 | 小于等于 |
|
|
349
|
+
| 5 | 等于 |
|
|
350
|
+
| 6 | 不等于 |
|
|
351
|
+
| 9 | 包含(文本/人员/部门)/ 属于(发起人/下拉) |
|
|
352
|
+
| 10 | 不包含 / 不属于 |
|
|
353
|
+
| 13 | 为空 |
|
|
354
|
+
| 14 | 不为空 |
|
|
355
|
+
|
|
356
|
+
> **易错**:`1` 是「大于」**不是**「大于等于」——`≥` 要用 `2`,`<` 用 `3`,`≤` 用 `4`。
|
|
357
|
+
> Number/Date 字段用 1/2/3/4/5/6(数值、日期比较);Text 用 5/6/9/10(等于/不等于/包含/不包含);Select/Browser 用 9/10(属于/不属于)。完整矩阵见 operator-matrix.md。
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
### 树结构示例
|
|
362
|
+
|
|
363
|
+
`合同子类型=采购类 AND 合同总金额≤50000`:
|
|
364
|
+
|
|
365
|
+
```json
|
|
366
|
+
{
|
|
367
|
+
"source": 2,
|
|
368
|
+
"sourceId": "1294902940272197632",
|
|
369
|
+
"workflowId": "1294602764921430016",
|
|
370
|
+
"conditionName": "采购类5w快速通道",
|
|
371
|
+
"linkName": "采购类5w快速通道",
|
|
372
|
+
"needFormfield": true,
|
|
373
|
+
"readOnly": false,
|
|
374
|
+
"mapBaseId": "1294601519433310236",
|
|
375
|
+
"isEdit": false,
|
|
376
|
+
"isFromRuleListPage": true,
|
|
377
|
+
"relation": 1,
|
|
378
|
+
"childrens": [
|
|
379
|
+
{
|
|
380
|
+
"selectType": 4,
|
|
381
|
+
"formField": [{"supportContainType":false,"total":false,"name":"合同子类型","id":"1294601519433310217","fieldType":"Select","groupKey":"Select"}],
|
|
382
|
+
"BrowserCompareOptionLeft": "9",
|
|
383
|
+
"BrowserValueOptionLeft": "1",
|
|
384
|
+
"BrowserTextValueLeft1": [{"id":"1294601523677945864","content":"采购类"}],
|
|
385
|
+
"valueType": "0"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"selectType": 4,
|
|
389
|
+
"formField": [{"supportContainType":false,"total":false,"name":"合同总金额","id":"1294601519433310221","fieldType":"Money","groupKey":"Money"}],
|
|
390
|
+
"NumberCompareOptionLeft": 4,
|
|
391
|
+
"NumberValueOptionLeft": 1,
|
|
392
|
+
"NumberTextValueLeft1": "50000",
|
|
393
|
+
"valueType": "1"
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
> `expressionId`/`expressionBaseId`/`dataValueId`/`elementValue*Id` 省略,CLI 自动生成。
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## 参考
|
|
404
|
+
|
|
405
|
+
- [字段类型与关系符编码矩阵](operator-matrix.md) — 数字编码、字段类型矩阵、系统字段清单
|