weaver-e10-builder 1.1.6 → 1.1.7
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/actionflow.d.ts.map +1 -1
- package/dist/commands/actionflow.js +93 -10
- package/dist/commands/actionflow.js.map +1 -1
- package/dist/commands/designer-common.d.ts +12 -2
- package/dist/commands/designer-common.d.ts.map +1 -1
- package/dist/commands/designer-common.js +89 -22
- package/dist/commands/designer-common.js.map +1 -1
- package/dist/commands/designer.d.ts.map +1 -1
- package/dist/commands/designer.js +7 -2
- package/dist/commands/designer.js.map +1 -1
- package/dist/commands/form-association-manage.js +1 -1
- package/dist/commands/form-association-manage.js.map +1 -1
- package/dist/commands/form-association.d.ts.map +1 -1
- package/dist/commands/form-association.js +1 -6
- package/dist/commands/form-association.js.map +1 -1
- package/dist/commands/form-field-lang.d.ts +3 -0
- package/dist/commands/form-field-lang.d.ts.map +1 -0
- package/dist/commands/form-field-lang.js +148 -0
- package/dist/commands/form-field-lang.js.map +1 -0
- package/dist/commands/form-table-view.d.ts.map +1 -1
- package/dist/commands/form-table-view.js +28 -9
- package/dist/commands/form-table-view.js.map +1 -1
- package/dist/commands/form.d.ts.map +1 -1
- package/dist/commands/form.js +10 -4
- package/dist/commands/form.js.map +1 -1
- package/dist/commands/interface.d.ts.map +1 -1
- package/dist/commands/interface.js +7 -3
- package/dist/commands/interface.js.map +1 -1
- package/dist/commands/matrix.d.ts.map +1 -1
- package/dist/commands/matrix.js +78 -16
- package/dist/commands/matrix.js.map +1 -1
- package/dist/commands/workflow-create-workflow.d.ts.map +1 -1
- package/dist/commands/workflow-create-workflow.js +20 -5
- package/dist/commands/workflow-create-workflow.js.map +1 -1
- package/dist/commands/workflow-odoc.d.ts +3 -0
- package/dist/commands/workflow-odoc.d.ts.map +1 -0
- package/dist/commands/workflow-odoc.js +288 -0
- package/dist/commands/workflow-odoc.js.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/services/actionflow/build_workflow_draft.d.ts.map +1 -1
- package/dist/services/actionflow/build_workflow_draft.js +17 -7
- package/dist/services/actionflow/build_workflow_draft.js.map +1 -1
- package/dist/services/actionflow/command_output.d.ts +4 -0
- package/dist/services/actionflow/command_output.d.ts.map +1 -1
- package/dist/services/actionflow/command_output.js +92 -1
- package/dist/services/actionflow/command_output.js.map +1 -1
- package/dist/services/actionflow/component_registry.d.ts.map +1 -1
- package/dist/services/actionflow/component_registry.js +11 -2
- package/dist/services/actionflow/component_registry.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_add.js +1 -1
- package/dist/services/actionflow/components/action_eb_add.js.map +1 -1
- package/dist/services/actionflow/components/action_eb_update.js +1 -1
- package/dist/services/actionflow/components/action_eb_update.js.map +1 -1
- package/dist/services/actionflow/components/dml_execute.d.ts +11 -0
- package/dist/services/actionflow/components/dml_execute.d.ts.map +1 -0
- package/dist/services/actionflow/components/dml_execute.js +172 -0
- package/dist/services/actionflow/components/dml_execute.js.map +1 -0
- package/dist/services/actionflow/components/enquiry_form.d.ts +7 -0
- package/dist/services/actionflow/components/enquiry_form.d.ts.map +1 -1
- package/dist/services/actionflow/components/enquiry_form.js +57 -7
- package/dist/services/actionflow/components/enquiry_form.js.map +1 -1
- package/dist/services/actionflow/components/http.d.ts +12 -0
- package/dist/services/actionflow/components/http.d.ts.map +1 -0
- package/dist/services/actionflow/components/http.js +216 -0
- package/dist/services/actionflow/components/http.js.map +1 -0
- package/dist/services/actionflow/components/index.d.ts.map +1 -1
- package/dist/services/actionflow/components/index.js +7 -0
- package/dist/services/actionflow/components/index.js.map +1 -1
- package/dist/services/actionflow/components/send_message.d.ts.map +1 -1
- package/dist/services/actionflow/components/send_message.js +9 -1
- package/dist/services/actionflow/components/send_message.js.map +1 -1
- package/dist/services/actionflow/context_preflight.d.ts +2 -0
- package/dist/services/actionflow/context_preflight.d.ts.map +1 -1
- package/dist/services/actionflow/context_preflight.js +127 -16
- package/dist/services/actionflow/context_preflight.js.map +1 -1
- package/dist/services/actionflow/datasource_source.d.ts +18 -0
- package/dist/services/actionflow/datasource_source.d.ts.map +1 -0
- package/dist/services/actionflow/datasource_source.js +19 -0
- package/dist/services/actionflow/datasource_source.js.map +1 -0
- package/dist/services/actionflow/design_client.d.ts +0 -2
- package/dist/services/actionflow/design_client.d.ts.map +1 -1
- package/dist/services/actionflow/design_client.js +0 -19
- package/dist/services/actionflow/design_client.js.map +1 -1
- package/dist/services/actionflow/dynamic_resources.d.ts +69 -0
- package/dist/services/actionflow/dynamic_resources.d.ts.map +1 -0
- package/dist/services/actionflow/dynamic_resources.js +259 -0
- package/dist/services/actionflow/dynamic_resources.js.map +1 -0
- package/dist/services/actionflow/form_source.d.ts +6 -0
- package/dist/services/actionflow/form_source.d.ts.map +1 -1
- package/dist/services/actionflow/form_source.js +16 -0
- package/dist/services/actionflow/form_source.js.map +1 -1
- package/dist/services/actionflow/formula_service.d.ts +2 -0
- package/dist/services/actionflow/formula_service.d.ts.map +1 -1
- package/dist/services/actionflow/formula_service.js +126 -6
- package/dist/services/actionflow/formula_service.js.map +1 -1
- package/dist/services/actionflow/generation_service.d.ts +17 -1
- package/dist/services/actionflow/generation_service.d.ts.map +1 -1
- package/dist/services/actionflow/generation_service.js +105 -8
- package/dist/services/actionflow/generation_service.js.map +1 -1
- package/dist/services/actionflow/http_input_params.d.ts +17 -0
- package/dist/services/actionflow/http_input_params.d.ts.map +1 -0
- package/dist/services/actionflow/http_input_params.js +98 -0
- package/dist/services/actionflow/http_input_params.js.map +1 -0
- package/dist/services/actionflow/http_source.d.ts +41 -0
- package/dist/services/actionflow/http_source.d.ts.map +1 -0
- package/dist/services/actionflow/http_source.js +261 -0
- package/dist/services/actionflow/http_source.js.map +1 -0
- package/dist/services/actionflow/plan_constraints.d.ts.map +1 -1
- package/dist/services/actionflow/plan_constraints.js +4 -2
- package/dist/services/actionflow/plan_constraints.js.map +1 -1
- package/dist/services/actionflow/preflight_service.d.ts +8 -0
- package/dist/services/actionflow/preflight_service.d.ts.map +1 -1
- package/dist/services/actionflow/preflight_service.js +105 -27
- package/dist/services/actionflow/preflight_service.js.map +1 -1
- package/dist/services/actionflow/readback_verifier.d.ts.map +1 -1
- package/dist/services/actionflow/readback_verifier.js +34 -1
- package/dist/services/actionflow/readback_verifier.js.map +1 -1
- package/dist/services/actionflow/save_workflow_draft.d.ts +1 -0
- package/dist/services/actionflow/save_workflow_draft.d.ts.map +1 -1
- package/dist/services/actionflow/save_workflow_draft.js +61 -16
- package/dist/services/actionflow/save_workflow_draft.js.map +1 -1
- package/dist/services/actionflow/step_branches.d.ts +18 -0
- package/dist/services/actionflow/step_branches.d.ts.map +1 -0
- package/dist/services/actionflow/step_branches.js +26 -0
- package/dist/services/actionflow/step_branches.js.map +1 -0
- package/dist/services/actionflow/update_service.d.ts.map +1 -1
- package/dist/services/actionflow/update_service.js +24 -53
- package/dist/services/actionflow/update_service.js.map +1 -1
- package/dist/services/actionflow/workflow_compiler.d.ts +1 -1
- package/dist/services/actionflow/workflow_compiler.d.ts.map +1 -1
- package/dist/services/actionflow/workflow_compiler.js +47 -11
- package/dist/services/actionflow/workflow_compiler.js.map +1 -1
- package/dist/services/esb-interface/document-parser.d.ts.map +1 -1
- package/dist/services/esb-interface/document-parser.js +17 -1
- package/dist/services/esb-interface/document-parser.js.map +1 -1
- package/dist/services/esb-interface/importer.d.ts +4 -1
- package/dist/services/esb-interface/importer.d.ts.map +1 -1
- package/dist/services/esb-interface/importer.js +10 -4
- package/dist/services/esb-interface/importer.js.map +1 -1
- package/dist/services/esb-interface/postman-collection.d.ts +6 -0
- package/dist/services/esb-interface/postman-collection.d.ts.map +1 -1
- package/dist/services/esb-interface/postman-collection.js +12 -1
- package/dist/services/esb-interface/postman-collection.js.map +1 -1
- package/dist/services/esb-interface/types.d.ts +1 -0
- package/dist/services/esb-interface/types.d.ts.map +1 -1
- package/dist/services/form-association.d.ts +1 -0
- package/dist/services/form-association.d.ts.map +1 -1
- package/dist/services/form-association.js +28 -4
- package/dist/services/form-association.js.map +1 -1
- package/dist/services/form-table-view.d.ts +24 -4
- package/dist/services/form-table-view.d.ts.map +1 -1
- package/dist/services/form-table-view.js +144 -133
- package/dist/services/form-table-view.js.map +1 -1
- package/dist/services/rich-types.d.ts.map +1 -1
- package/dist/services/rich-types.js +149 -9
- package/dist/services/rich-types.js.map +1 -1
- package/package.json +3 -2
- package/skill-docs/SKILL.md +261 -252
- package/skill-docs/actionflows/references/components/database/DMLExecute.md +38 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbAdd.md +2 -0
- package/skill-docs/actionflows/references/components/ebuilder/ActionEbUpdate.md +2 -0
- package/skill-docs/actionflows/references/components/ebuilder/EnquiryForm.md +2 -2
- package/skill-docs/actionflows/references/components/http/Http.md +77 -0
- package/skill-docs/actionflows/references/components/message/SendMessage.md +14 -1
- package/skill-docs/actionflows/references/condition_rules.md +1 -0
- package/skill-docs/actionflows/references/dynamic_resources.md +41 -0
- package/skill-docs/actionflows/references/function_rules.md +15 -13
- package/skill-docs/references/common/guide-plan-template.md +21 -7
- package/skill-docs/references/common/ref-cli-commands.md +13 -6
- package/skill-docs/references/esb-interface/guide-import.md +31 -0
- package/skill-docs/references/form/guide-create-form.md +126 -376
- package/skill-docs/references/form/guide-form-association.md +6 -3
- package/skill-docs/references/form/guide-form-layout-planning.md +68 -0
- package/skill-docs/references/form/guide-form-serial-mark.md +47 -0
- package/skill-docs/references/form/guide-form-view.md +22 -3
- package/skill-docs/references/form/ref-form-fields.md +147 -0
- package/skill-docs/references/hrm/guide-matrix.md +54 -3
- package/skill-docs/references/workflow/guide-workflow-action.md +2 -0
- package/skill-docs/references/workflow/guide-workflow-condition.md +48 -6
- package/skill-docs/references/workflow/guide-workflow-odoc.md +76 -0
- package/skill-docs/references/workflow/guide-workflow.md +467 -461
- package/skill-docs/references/workflow/operator-matrix.md +2 -0
|
@@ -1,464 +1,214 @@
|
|
|
1
|
-
# 新建
|
|
1
|
+
# 新建 EBuilder 表单
|
|
2
2
|
|
|
3
|
-
通过 `e10-cli form create`
|
|
3
|
+
通过 `e10-cli form create` 在 EBuilder 应用中创建表单。本指南说明从需求整理、`fields.json` 编写到建后配置的完整顺序;字段参数和布局样表的详细规则按需读取专题参考。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 标准创建流程
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
不传 `--fields` 时使用默认字段:名称(Text)、数量(Number)、日期(Date)、状态(Select)。
|
|
17
|
-
|
|
18
|
-
### 布局类型(流式/表格式)
|
|
7
|
+
1. 确认目标应用 `appId`。
|
|
8
|
+
2. 确认布局类型:流式 `FLOW` 或表格式 `EXCEL`。布局类型在建表时确定。
|
|
9
|
+
3. 从需求中整理字段、明细表、字段顺序和布局要求;遇到完整布局样表时,将空间结构写入 plan 的“表单布局蓝图”。
|
|
10
|
+
4. 将建表时可以完成的配置写入 `fields.json`。
|
|
11
|
+
5. 执行 `form create`,记录返回的 `objId` 和 `formId`。
|
|
12
|
+
6. 使用 `form list-view` 查询并记录默认台账 `listId`。
|
|
13
|
+
7. 按需求完成多语言、联动、校验、权限、视图和按钮等建后配置。
|
|
14
|
+
8. 使用读取命令轻量核对字段、布局和默认台账。
|
|
19
15
|
|
|
20
16
|
```bash
|
|
21
|
-
e10-cli form create
|
|
22
|
-
e10-cli form
|
|
17
|
+
e10-cli form create <appId> "<表单名>" --fields @fields.json --layout FLOW|EXCEL
|
|
18
|
+
e10-cli form list-view <objId> <appId>
|
|
19
|
+
e10-cli form read <objId> --app-id <appId> --out fields-created.json
|
|
23
20
|
```
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
|------|------|
|
|
27
|
-
| **布局类型建表时定死** | 平台建表后不可切换(流式↔表格式),只能创建时选。`--layout` 写在建表请求里(`layoutType` + `isAdvance:false`) |
|
|
28
|
-
| **流式模板** | FLOW 用特殊模板 `820000000000000001`(非通用版本 id,跨环境一致);CLI 自动配 |
|
|
29
|
-
| 缺省 | 不传 `--layout` 时缺省 `EXCEL`(表格,行为不变) |
|
|
30
|
-
|
|
31
|
-
> **⚠ 建表前必须和用户确认布局类型**:表单要**流式(FLOW)** 还是**表格式(EXCEL)**——平台建表后不可切换,只能创建时定死。需求文档/截图没明确表态时,不要默认 EXCEL 直接建,先向用户问清。流程表单同理(`workflow create-workflow --layout FLOW|EXCEL`)。
|
|
32
|
-
|
|
33
|
-
### 从需求文档识别完整布局样表
|
|
34
|
-
|
|
35
|
-
识别发生在读取需求文档之后、编写 `plan.md` 之前。先完成字段定义识别,再扫描布局章节;不要等到创建表单时才回头猜布局。
|
|
36
|
-
|
|
37
|
-
出现下列任一特征时,将表格作为“布局样表”候选,而不是普通字段清单:
|
|
38
|
-
|
|
39
|
-
- 上下文出现“表格式布局”“Excel样式”“按照如下布局构建”等说明;
|
|
40
|
-
- 单元格包含 `[字段名]`,或呈现“标签|字段|标签|字段”的交替结构;
|
|
41
|
-
- 存在独占行的表单标题、分组标题、有意义的空白单元格或同一行多个字段;
|
|
42
|
-
- 表格描述字段摆放位置,而不是“字段名称/字段类型/字段说明”的重复记录。
|
|
43
|
-
|
|
44
|
-
逐行识别单元格角色:表单标题、分组标题、字段标签、字段控件、空白占位。字段控件后的必填、只读、金额大写等归字段显示属性;条件式必填/隐藏归显隐联动;字段比较归校验;公式归字段公式。空白单元格和同排关系属于布局信息,不能丢弃。
|
|
22
|
+
需要同时生成台账菜单入口时,在创建命令中增加 `--menu`;建成后也可使用 `menu add-table <appId> <objId>` 添加。默认台账视图与应用菜单入口是两个资源。
|
|
45
23
|
|
|
46
|
-
|
|
24
|
+
## 各阶段配置范围
|
|
47
25
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
26
|
+
| 阶段 | 配置内容 |
|
|
27
|
+
|---|---|
|
|
28
|
+
| 需求与 plan | 表单名称、字段类型、顺序、明细结构、FLOW/EXCEL、布局蓝图及外围配置 |
|
|
29
|
+
| `fields.json` | 字段、选项、默认值、精度、日期格式、关联、公式、明细、分组和显示属性 |
|
|
30
|
+
| `form create` | 表单主体、字段、明细、布局、基础查看权限、默认台账及可选菜单 |
|
|
31
|
+
| 建成后 | 字段多语言、联动、查重、进一步权限、视图名称与列、筛选、按钮及关联页签 |
|
|
32
|
+
| 完成核对 | `objId`、`formId`、`listId`、字段结构和布局结果 |
|
|
54
33
|
|
|
55
|
-
|
|
34
|
+
## 建表前整理需求
|
|
56
35
|
|
|
57
|
-
|
|
36
|
+
### 布局类型
|
|
58
37
|
|
|
59
38
|
```bash
|
|
60
|
-
e10-cli form create
|
|
39
|
+
e10-cli form create <appId> "<表单名>" --fields @fields.json --layout FLOW
|
|
40
|
+
e10-cli form create <appId> "<表单名>" --fields @fields.json --layout EXCEL
|
|
61
41
|
```
|
|
62
42
|
|
|
63
|
-
|
|
43
|
+
- `FLOW`:流式布局。
|
|
44
|
+
- `EXCEL`:表格式布局,也是 CLI 缺省值。
|
|
45
|
+
- 需求未明确且布局选择会影响结果时,建表前向用户确认。
|
|
46
|
+
- 需求提供完整表格、合并单元格、分组标题、标签与字段交替排布时,按布局样表处理,详见 [表单布局规划](guide-form-layout-planning.md)。
|
|
47
|
+
|
|
48
|
+
### 字段定义
|
|
49
|
+
|
|
50
|
+
字段按照需求顺序写入 `fields.json`。主表字段在前,`DetailTable` 明细表放在数组末尾。
|
|
64
51
|
|
|
65
52
|
```json
|
|
66
53
|
[
|
|
67
|
-
{"componentKey":
|
|
68
|
-
{"componentKey":
|
|
69
|
-
{"componentKey":
|
|
70
|
-
{"componentKey":
|
|
71
|
-
{"componentKey":
|
|
72
|
-
{"componentKey":
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
54
|
+
{"componentKey":"Text","fieldName":"合同名称","required":true,"singleRow":true},
|
|
55
|
+
{"componentKey":"DateRange","fieldName":"合同有效期","format":"yyyy-MM-dd"},
|
|
56
|
+
{"componentKey":"Money","fieldName":"合同金额","precision":2},
|
|
57
|
+
{"componentKey":"Select","fieldName":"合同状态","fieldOptions":[{"name":"草稿"},{"name":"履行中"}]},
|
|
58
|
+
{"componentKey":"Employee","fieldName":"负责人"},
|
|
59
|
+
{"componentKey":"DetailTable","fieldName":"付款明细","formFields":[
|
|
60
|
+
{"componentKey":"Date","fieldName":"付款日期"},
|
|
61
|
+
{"componentKey":"Number","fieldName":"付款金额","precision":2}
|
|
62
|
+
]}
|
|
76
63
|
]
|
|
77
64
|
```
|
|
78
65
|
|
|
79
|
-
|
|
80
|
-
> ```json
|
|
81
|
-
> [
|
|
82
|
-
> {"componentKey":"Text","fieldName":"合同名称"},
|
|
83
|
-
> {"componentKey":"Money","fieldName":"合同金额"},
|
|
84
|
-
> {"componentKey":"DetailTable","fieldName":"付款明细","formFields":[
|
|
85
|
-
> {"componentKey":"Text","fieldName":"付款条件"},
|
|
86
|
-
> {"componentKey":"Number","fieldName":"付款金额","precision":2}
|
|
87
|
-
> ]}
|
|
88
|
-
> ]
|
|
89
|
-
> ```
|
|
66
|
+
常用类型包括 `Text`、`TextArea`、`Number`、`Money`、`Date`、`DateTime`、`DateRange`、`Select`、`Employee`、`Department`、`FileComponent`、`EBuilder`、`Browser`、`Flow` 和 `DetailTable`。完整类型、关联码表及各类型属性见 [表单字段定义参考](ref-form-fields.md)。
|
|
90
67
|
|
|
91
|
-
|
|
68
|
+
## 常用字段属性
|
|
92
69
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
70
|
+
| 属性 | 作用 |
|
|
71
|
+
|---|---|
|
|
72
|
+
| `required:true` | 字段必填 |
|
|
73
|
+
| `readOnly:true` | 禁止手工编辑 |
|
|
74
|
+
| `hidden:true` | 布局中隐藏,字段仍可参与计算 |
|
|
75
|
+
| `singleRow:true` | 独占一行 |
|
|
76
|
+
| `group:"基本信息"` | 放入指定字段分组 |
|
|
77
|
+
| `multiple:true` | 支持多选的字段设置为多选 |
|
|
78
|
+
| `maxLen:500` | 文本最大长度 |
|
|
79
|
+
| `precision:2` | 数字或金额小数位 |
|
|
80
|
+
| `defaultValue` | 字段默认值 |
|
|
98
81
|
|
|
99
|
-
|
|
100
|
-
- 与 `fieldOptions` 互斥:同字段两个都写时 `optionTemplate` 被忽略(模板引用只在无内联选项时绑定)
|
|
101
|
-
- 数据记录存模板选项的 valueKey(`fieldOptionId`),与内联选项一致;`form data add` 直接填选项名或 valueKey
|
|
102
|
-
- 模板管理:`list`(`--system` 看内置)/ `read` / `copy` / `delete`;已有字段补绑用 `form add-field` 加不了——对已有 Select 改绑模板需在字段管理页面操作
|
|
82
|
+
### 字段分组
|
|
103
83
|
|
|
104
|
-
|
|
105
|
-
```json
|
|
106
|
-
{"componentKey":"Number","fieldName":"请假时长(小时)","readOnly":true,"hidden":true},
|
|
107
|
-
{"componentKey":"FileComponent","fieldName":"证明材料","required":true}
|
|
108
|
-
```
|
|
109
|
-
> `hidden:true` → 布局属性"显示"取消(show:false);`readOnly` → 布局"禁止手工编辑";`required` → 布局"必填"。这些是**布局属性**(优先级:字段在布局中的设置 > 字段管理中字段设置 > 模块默认),建表时一次配好,勿依赖平台默认值。
|
|
84
|
+
以需求为准:只有需求明确要求字段分组时,才在 `fields.json` 中设置 `group`;需求未要求时保持不分组。
|
|
110
85
|
|
|
111
|
-
**独占一行**:字段写 `"singleRow":true` → 该字段整行显示(对齐平台布局 singleRow 属性),其余字段仍两列:
|
|
112
|
-
```json
|
|
113
|
-
{"componentKey":"Text","fieldName":"项目名称","singleRow":true},
|
|
114
|
-
{"componentKey":"TextArea","fieldName":"项目描述","singleRow":true},
|
|
115
|
-
{"componentKey":"Text","fieldName":"负责人"}
|
|
116
|
-
```
|
|
117
|
-
> 不加 `singleRow` 的普通字段两列排布。明细表 / 落单字段(奇数最后一个)本来就独占一行。add-field 加字段可用 `--single-row`。
|
|
118
|
-
>
|
|
119
|
-
> **规划阶段就该判断,勿默认全两列**:长文本/备注/项目描述/地址/富文本/长说明 → 默认 `singleRow:true`(两列挤一起难看);标题类(项目名称、合同名称)也常独占。AI 常漏标 singleRow,建表前过一遍字段语义。
|
|
120
|
-
|
|
121
|
-
**字段分组**(按表单结构判断,**勿默认全平铺**):6+ 字段、或字段有明显逻辑分段(基本信息/合同信息/系统设置/付款信息…)→ 按 `group` 名分组,建表时自动生成折叠容器,字段收进对应分组。用户没明确要求时,按字段语义自然分组(别每张表都加,也别 3 字段小表加)。建表时 fields.json 一并写 `group`,勿留到建后用 `form group` 补(那是对齐补救手段)。
|
|
122
86
|
```json
|
|
123
87
|
[
|
|
124
|
-
{"componentKey":"Text","fieldName":"
|
|
125
|
-
{"componentKey":"
|
|
126
|
-
{"componentKey":"
|
|
127
|
-
{"componentKey":"Date","fieldName":"签订日期"},
|
|
128
|
-
{"componentKey":"TextArea","fieldName":"备注"}
|
|
88
|
+
{"componentKey":"Text","fieldName":"项目名称","group":"基本信息","required":true},
|
|
89
|
+
{"componentKey":"Employee","fieldName":"负责人","group":"基本信息"},
|
|
90
|
+
{"componentKey":"Number","fieldName":"项目金额","group":"财务信息","precision":2}
|
|
129
91
|
]
|
|
130
92
|
```
|
|
131
|
-
> 不写 `group` 的字段归「未分组」平铺在分组之后。分组内字段**默认两列**(一行两个),要独占一行写 `"singleRow":true`。明细表不参与分组(独立区块)。EXCEL/FLOW 布局都按 singleRow 控制两列/整行(对齐浏览器 initLayout payload)。
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
**Number/Money 精度**:用 `precision` 指定小数位数(缺省 Number=0 整数、Money=2):
|
|
135
|
-
```json
|
|
136
|
-
{"componentKey":"Number","fieldName":"单价","precision":2},
|
|
137
|
-
{"componentKey":"Money","fieldName":"金额"}
|
|
138
|
-
```
|
|
139
|
-
> 不设 precision 时 Number 建出来是整数(pointSize=0)、Money 是 2 位小数。主表/明细子字段都支持。
|
|
140
|
-
> **Number 与 Money 是两种类型**:Number=纯数字(默认无千分位/大写),Money=金额(千分位默认开)。字段名叫"金额"不代表必须用 Money 类型——类型由方案数据语义定,名称只是展示文本。
|
|
141
|
-
|
|
142
|
-
**Number/Money 千分位与大写**(按需开启,**由字段类型决定默认,与字段名无关**):
|
|
143
|
-
`"delimiter":true` 开千分位(**Number 默认关、Money 默认开**,`"delimiter":false` 关 Money 的);`"capital":true` 开大写金额显示(`isCapital` + `capitalFormat onlyUpperCase`):
|
|
144
|
-
```json
|
|
145
|
-
{"componentKey":"Number","fieldName":"费用金额","precision":2},
|
|
146
|
-
{"componentKey":"Money","fieldName":"费用金额"}
|
|
147
|
-
```
|
|
148
|
-
> - **类型决定默认,不是字段名**:上面两个字段**同名**"费用金额",但前者是 Number(千分位/大写关)、后者是 Money(千分位默认开)。判断看 `componentKey`,不看字段名。
|
|
149
|
-
> - **千分位/大写是 opt-in**:只在方案文档**明确要求**"显示千分位/金额大写"时才加 `delimiter`/`capital`,不要因字段名含"金额/费用/收款"就自动套用。
|
|
150
|
-
> - **Number 类型的金额语义字段缺省就是裸数字**:`{"componentKey":"Number","fieldName":"项目费用","precision":2}` —— 不带 delimiter/capital,这是正确写法。
|
|
151
|
-
> - add-field 用 `--delimiter` / `--no-delimiter` / `--capital`。
|
|
152
93
|
|
|
153
|
-
|
|
154
|
-
```json
|
|
155
|
-
{"componentKey":"Number","fieldName":"付款比例","percent":true,"precision":1}
|
|
156
|
-
```
|
|
157
|
-
> ⚠️ **百分比字段的公式要 ×100**:平台百分比字段是「数值直接拼 %」(不自动 ×100)。如 付款比例=付款金额/项目金额,10000/20000=0.5,会显示「**0.5%**」而非 50%。公式必须 ×100:
|
|
158
|
-
> ```json
|
|
159
|
-
> {"componentKey":"Number","fieldName":"付款比例","percent":true,"precision":1,"formula":"{付款信息.付款金额}/{主表.项目金额}*100"}
|
|
160
|
-
> ```
|
|
161
|
-
> 这样 0.5×100=50 → 显示「50%」。累加校验「比例累加=100%」也基于百分比数(50+50=100),不是比值。
|
|
94
|
+
同名 `group` 的字段进入同一个分组。分组内字段按字段顺序排列,需要整行展示的字段增加 `singleRow:true`。已有表单补充分组时使用:
|
|
162
95
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
{"componentKey":"Number","fieldName":"工时单价","defaultValue":1000}
|
|
96
|
+
```bash
|
|
97
|
+
e10-cli form group <objId> <appId> --groups '{"基本信息":["项目名称","负责人"]}'
|
|
166
98
|
```
|
|
167
|
-
> 平台机制:设默认值必须连 `isDelimiter/stepMode/step/isCapital` 一起发,否则默认值不落库(CLI 已处理)。
|
|
168
|
-
> 单位没有独立字段属性 —— 显示单位直接写在字段名里,如 `"fieldName":"工时数量(天)"`。
|
|
169
|
-
> **台账列单位显示**(绕法):平台字段无单位属性,但台账列可配显示后缀,用 `form list-unit <objId> <appId> <listId> <fieldId> "(元)"` 设置(走列表列配置 `showTrans.ruleConfig.suffix`,极简结构平台即接受)。
|
|
170
99
|
|
|
171
|
-
|
|
100
|
+
### 日期区间
|
|
172
101
|
|
|
173
|
-
|
|
174
|
-
|---|---|
|
|
175
|
-
| Text | 文本 |
|
|
176
|
-
| TextArea | 多行文本 |
|
|
177
|
-
| Email | 邮箱 |
|
|
178
|
-
| Phone | 电话 |
|
|
179
|
-
| Mobile | 手机 |
|
|
180
|
-
| IDCard | 身份证号 |
|
|
181
|
-
| Number | 数字(千分位/大写默认关,按需开;precision 缺省 0 整数) |
|
|
182
|
-
| Money | 金额(千分位默认开,大写按需开;precision 缺省 2) |
|
|
183
|
-
| Date | 日期(默认精度**年月日**,format `yyyy-MM-dd`;要带时间用 `"format"` 覆盖) |
|
|
184
|
-
| DateTime | 日期-时间(`Date` 的别名,默认带 时:分,format `yyyy-MM-dd HH:mm` 不含秒) |
|
|
185
|
-
| Employee | 人员选择 |
|
|
186
|
-
| Department | 部门选择 |
|
|
187
|
-
| FileComponent | 附件上传(**注意是 FileComponent 不是 File**) |
|
|
188
|
-
| Select | 下拉选择 |
|
|
189
|
-
| RadioBox | 单选按钮 |
|
|
190
|
-
| CheckBox | 多选按钮 |
|
|
191
|
-
| EInvoice | 电子发票(创建后无需额外配置,平台自动处理) |
|
|
192
|
-
| AudioRecord | 语音(极简字段,无特殊配置。注意不是 FileComponent 附件) |
|
|
193
|
-
| VideoRecord | 视频(极简字段,无特殊配置) |
|
|
194
|
-
| DetailTable | 明细表 |
|
|
195
|
-
| DateRange | 日期区间 |
|
|
196
|
-
| Time | 时间 |
|
|
197
|
-
| EBuilder | 关联 EB 表单(见下节) |
|
|
198
|
-
| Flow | **浏览-流程**(关联流程,如"数据来源"来自项目立项流程;`--sform-id` 为目标流程绑定的表单 objId,点击自动跳流程)。**form create 的 fields.json 直接写 `"sformId":"<流程表单objId>"` 即可**(建表后 CLI 自动绑 sformId/relateExt,与 EBuilder 同机制);add-field 用 `--sform-id`。⚠ sformId 必须是**流程绑定的表单 objId**(不是 workflowId),即"仅允许关联某流程"=Flow 字段 + sformId 指向该流程的表单 |
|
|
199
|
-
|
|
200
|
-
正常情况下,人相关的 都是用Employee
|
|
201
|
-
Time 的格式固定为 HH:mm:ss 如 17:00:00
|
|
202
|
-
> **人员/部门默认值**:默认**不配默认值**(没写就没有)。要默认当前用户/部门写 `"defaultValue": true`(建表时自动配 `defaultExtend`)。
|
|
203
|
-
> **Date/DateTime 精度与默认值**:默认**不填默认值**。要带时间用 `"format"` 覆盖精度(如 `"format":"yyyy-MM-dd HH:mm"`、`yyyy-MM-dd HH:mm:ss`);要配动态当天默认值写 `"defaultValue": true`(建表时自动配 `defaultExtend`)。add-field 加字段用 `--format` 覆盖精度。
|
|
204
|
-
> ```json
|
|
205
|
-
> {"componentKey":"Date","fieldName":"签订日期"},
|
|
206
|
-
> {"componentKey":"Date","fieldName":"精确到秒","format":"yyyy-MM-dd HH:mm:ss"},
|
|
207
|
-
> {"componentKey":"Date","fieldName":"默认今天","defaultValue":true}
|
|
208
|
-
> ```
|
|
209
|
-
>
|
|
210
|
-
> **日期限制**:A 字段**最早不得早于** B 字段写 `"minField":"B字段名"`,**最晚不得晚于**写 `"maxField":"B字段名"`(对齐平台 `min/max.dateField`,自动解析 B 的 fieldId)。**子表字段同样支持**,可指向主表字段或同子表字段。add-field 用 `--min-field` / `--max-field`。
|
|
211
|
-
> ```json
|
|
212
|
-
> {"componentKey":"Date","fieldName":"计划开始日期"},
|
|
213
|
-
> {"componentKey":"Date","fieldName":"计划结束日期","minField":"计划开始日期"},
|
|
214
|
-
> {"componentKey":"Date","fieldName":"完成日期","maxField":"计划结束日期"},
|
|
215
|
-
> {"componentKey":"DetailTable","fieldName":"行程明细","formFields":[
|
|
216
|
-
> {"componentKey":"Date","fieldName":"明细开始日期","minField":"计划开始日期"},
|
|
217
|
-
> {"componentKey":"Date","fieldName":"明细结束日期","minField":"明细开始日期"}
|
|
218
|
-
> ]}
|
|
219
|
-
> ```
|
|
220
|
-
|
|
221
|
-
**多选**:人员(Employee)/部门(Department)/关联ebuilder(EBuilder)/浏览(Browser)/下拉(Select) 默认单选,要选多个加 `"multiple": true`:
|
|
222
|
-
```json
|
|
223
|
-
{"componentKey":"Employee","fieldName":"参与人员","multiple":true},
|
|
224
|
-
{"componentKey":"Department","fieldName":"会签部门","multiple":true},
|
|
225
|
-
{"componentKey":"EBuilder","fieldName":"关联客户","sformId":"<目标表单objId>","dataTitle":"name","multiple":true},
|
|
226
|
-
{"componentKey":"Select","fieldName":"标签","multiple":true,"fieldOptions":[{"name":"A"},{"name":"B"}]}
|
|
227
|
-
```
|
|
228
|
-
> 不写 `multiple` 即单选。多选 EBuilder 选中多条记录,字段存数组值。**下拉 Select 多选 = 独立类型 `SelectMultiple`**(CLI 自动转,非 Select+开关)。
|
|
102
|
+
字段本身包含开始与结束含义,如“项目周期、合同有效期、请假时间、活动时间”,优先使用 `DateRange`。明确要求两个独立字段,或开始、结束需要分别参与公式和联动时,再拆成两个日期字段。
|
|
229
103
|
|
|
230
|
-
**文本最大长度**:Text 缺省 100、TextArea 缺省 4000,用 `"maxLen"` 覆盖(主表 + 明细子字段都支持):
|
|
231
104
|
```json
|
|
232
|
-
{"componentKey":"
|
|
233
|
-
{"componentKey":"TextArea","fieldName":"详情","maxLen":8000}
|
|
105
|
+
{"componentKey":"DateRange","fieldName":"项目周期","format":"yyyy-MM-dd"}
|
|
234
106
|
```
|
|
235
|
-
> add-field 用 `--max-len <n>`。
|
|
236
|
-
|
|
237
|
-
## EBuilder 关联字段
|
|
238
107
|
|
|
239
|
-
|
|
108
|
+
### 选项和多选
|
|
240
109
|
|
|
241
110
|
```json
|
|
242
|
-
{
|
|
243
|
-
|
|
244
|
-
"fieldName": "关联客户",
|
|
245
|
-
"sformId": "1296220571782152199",
|
|
246
|
-
"dataTitle": "客户名称"
|
|
247
|
-
}
|
|
111
|
+
{"componentKey":"Select","fieldName":"状态","fieldOptions":[{"name":"启用"},{"name":"停用"}]},
|
|
112
|
+
{"componentKey":"Employee","fieldName":"项目成员","multiple":true}
|
|
248
113
|
```
|
|
249
114
|
|
|
250
|
-
|
|
251
|
-
|------|------|------|
|
|
252
|
-
| `sformId` | 是 | **目标表单的 objId**(不是 appId/formId) |
|
|
253
|
-
| `dataTitle` | 是 | 目标表单中用于显示的字段名,选中记录后展示该字段值。传 `"name"`(或不写)默认取目标表**字段名含"名称"**的字段(如 客户名称/类型名称),无则取第一个业务字段 |
|
|
254
|
-
| `displayColumns` | 否 | **关联浏览弹窗显示列**(字段名列表)。缺省自动用目标表业务字段**最多 5 个**(去系统字段),建好即生效;要指定用这个 |
|
|
255
|
-
|
|
256
|
-
> **关联浏览弹窗显示列默认自动配好**:`form create` 建表和 `form add-field` 加 EBuilder 字段时都自动写入 `ffDisplayColumns` = 目标表**业务字段前 5 个**(排除创建者/创建时间/数据ID等系统字段),浏览弹窗直接生效。`fields.json` 里显式写 `displayColumns` 指定列不受 5 个限制。事后想改可用 `e10-cli form ebuilder-columns <objId> <appId> <fieldId> <列...>` 或 `--clear` 清空。
|
|
115
|
+
`Select`、`RadioBox`、`CheckBox` 可在 `fieldOptions` 中定义选项。人员、部门、EBuilder、Browser 和 Select 等支持按字段能力设置多选。共享选项可使用 `optionTemplate`;详细结构见 [表单字段定义参考](ref-form-fields.md)。
|
|
257
116
|
|
|
258
|
-
###
|
|
117
|
+
### 关联字段
|
|
259
118
|
|
|
260
|
-
|
|
119
|
+
EBuilder 关联字段在创建时指定目标表单 `objId` 和显示字段:
|
|
261
120
|
|
|
262
121
|
```json
|
|
263
122
|
{
|
|
264
|
-
"componentKey":
|
|
265
|
-
"fieldName":
|
|
266
|
-
"
|
|
123
|
+
"componentKey":"EBuilder",
|
|
124
|
+
"fieldName":"关联客户",
|
|
125
|
+
"sformId":"<目标表单objId>",
|
|
126
|
+
"dataTitle":"客户名称",
|
|
127
|
+
"displayColumns":["客户名称","客户类型"]
|
|
267
128
|
}
|
|
268
129
|
```
|
|
269
130
|
|
|
270
|
-
|
|
271
|
-
- `sourceFieldId`:目标表单中要复制值的字段 **fieldId(数字 ID)**。⚠️ **不能传字段名**,用 `form read --app-id` 获取
|
|
131
|
+
`Flow` 的 `sformId` 同样指向目标流程绑定的表单 `objId`。原生关联对象和通用浏览类型的配置码表见 [表单字段定义参考](ref-form-fields.md);关联数据过滤和范围分别见 [EBuilder 过滤](guide-ebuilder-filter.md) 与 [关联浏览数据范围](guide-ebuilder-scope.md)。
|
|
272
132
|
|
|
273
|
-
|
|
274
|
-
> ⚠️ `--relate-from-source` 必须传字段的**数字 fieldId**,不能传字段名。
|
|
133
|
+
### 明细表与二级明细
|
|
275
134
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
```json
|
|
279
|
-
{
|
|
280
|
-
"componentKey": "Select",
|
|
281
|
-
"fieldName": "客户等级",
|
|
282
|
-
"fieldOptions": [
|
|
283
|
-
{"name": "A级"},
|
|
284
|
-
{"name": "B级"},
|
|
285
|
-
{"name": "C级"}
|
|
286
|
-
]
|
|
287
|
-
}
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
## 明细表 DetailTable
|
|
291
|
-
|
|
292
|
-
明细表包含嵌套子字段,子字段写在其 `formFields` 数组内:
|
|
293
|
-
|
|
294
|
-
```json
|
|
295
|
-
{
|
|
296
|
-
"componentKey": "DetailTable",
|
|
297
|
-
"fieldName": "订单明细",
|
|
298
|
-
"formFields": [
|
|
299
|
-
{"componentKey": "Text", "fieldName": "商品名称"},
|
|
300
|
-
{"componentKey": "Number", "fieldName": "数量"},
|
|
301
|
-
{"componentKey": "Number", "fieldName": "单价"},
|
|
302
|
-
{"componentKey": "Date", "fieldName": "交付日期"}
|
|
303
|
-
]
|
|
304
|
-
}
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### 二级明细表
|
|
308
|
-
|
|
309
|
-
二级明细不是在明细表内再创建一张表,而是让当前明细表关联同一主表下的另一张明细表。`subForm` 和 `subField` 均可写名称;CLI 会解析为 ID、校验不能关联自身,并在保存后回读确认。
|
|
135
|
+
明细字段写入 `DetailTable.formFields`。二级明细通过当前明细表关联同一主表下的另一张明细表:
|
|
310
136
|
|
|
311
137
|
```json
|
|
312
138
|
[
|
|
313
|
-
{"componentKey":"DetailTable","fieldName":"
|
|
314
|
-
{"componentKey":"Text","fieldName":"
|
|
139
|
+
{"componentKey":"DetailTable","fieldName":"任务明细","formFields":[
|
|
140
|
+
{"componentKey":"Text","fieldName":"任务名称"}
|
|
315
141
|
]},
|
|
316
|
-
{"componentKey":"DetailTable","fieldName":"
|
|
317
|
-
"subDetailConfig":[{"subForm":"
|
|
318
|
-
{"componentKey":"
|
|
142
|
+
{"componentKey":"DetailTable","fieldName":"工时明细","enableSubDetail":true,
|
|
143
|
+
"subDetailConfig":[{"subForm":"任务明细","subField":"任务名称"}],"formFields":[
|
|
144
|
+
{"componentKey":"Number","fieldName":"工时","precision":2}
|
|
319
145
|
]}
|
|
320
146
|
]
|
|
321
147
|
```
|
|
322
148
|
|
|
323
|
-
|
|
149
|
+
已有表单使用 `form detail-table` 查询或调整二级明细关系。
|
|
324
150
|
|
|
325
|
-
|
|
151
|
+
### 字段公式
|
|
326
152
|
|
|
327
|
-
|
|
153
|
+
可在目标字段中写 `formula`,由创建流程完成公式创建和字段绑定:
|
|
328
154
|
|
|
329
|
-
编号(如 `XM-2026-001`、`YF-2026-0001`)走**复杂编号**机制:在任意文本字段上配编码段,`form serial-mark set --segments` 用 JSON 数组组合任意规则,**数组顺序即编号拼接顺序**,一条命令配完(含代字),重跑全量替换不累积。
|
|
330
|
-
|
|
331
|
-
### 配置:`set --segments`
|
|
332
|
-
|
|
333
|
-
```bash
|
|
334
|
-
e10-cli form serial-mark set <objId> <appId> <字段ID> --segments @segments.json
|
|
335
|
-
# 也支持内联 JSON:--segments '[{"type":"fixed","value":"XM-"},{"type":"serial","digits":4}]'
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
segments.json 示例(生成如 `YF-2026-0001`,按年单独流水):
|
|
339
155
|
```json
|
|
340
|
-
|
|
341
|
-
{"type":"field","fieldId":"<选择框字段ID>","shortName":{"研发":"YF","实施":"SS","运维":"YW","咨询":"ZX"}},
|
|
342
|
-
{"type":"fixed","value":"-"},
|
|
343
|
-
{"type":"year","format":"four","alone":true},
|
|
344
|
-
{"type":"serial","digits":4,"zero":true}
|
|
345
|
-
]
|
|
156
|
+
{"componentKey":"Number","fieldName":"项目收益","formula":"{主表.已收款}-{主表.项目费用}"}
|
|
346
157
|
```
|
|
347
158
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
| type | 含义 | 属性 | 平台 markFieldType |
|
|
351
|
-
|------|------|------|-------------------|
|
|
352
|
-
| `fixed` | 固定内容 | `value`(文本,如 `"XM-"`/`"-"`) | FIX_CONTEXT |
|
|
353
|
-
| `year` | 年份 | `format`:`four`(四位 2026,缺省)/`two`(两位 26);`alone`:true 按年单独流水(缺省 true) | DATE_YEAR |
|
|
354
|
-
| `serial` | 流水号 | `digits`(位数,如 4→0001);`zero`:true 补零(缺省)/false 不补零;`alone`:true 机构单独流水 | SERIAL_NUMBER |
|
|
355
|
-
| `field` | 表单字段值 | `fieldId`(取值字段);`alone`:true 机构单独流水;`shortName`:inline 代字映射(选项名→简称,见下) | FORM_FIELD |
|
|
356
|
-
| `system` | 系统字段 | `systemField`:`creator`(创建人)/`creator-dept`(创建人所属部门,自动部门代字);`alone` | SYSTEM_FIELD |
|
|
357
|
-
| `date` | 日期 | `format`:`yyyy`/`yyyyMM`/`yyyyMMdd`;`source`:`current`(当前)/`<字段ID>`;`alone` | DATE |
|
|
358
|
-
|
|
359
|
-
> - **任意规则直接组合**:把规则拆成段,按拼接顺序写入数组即可。如 `项目类型-年份-4位流水` = field + fixed("-") + year + serial
|
|
360
|
-
> - **代字自动**:field 段 markExtend=103(选项值取简称)、system creator-dept markExtend=101(部门取代字),无需手填
|
|
361
|
-
> - **inline 代字**:field 段带 `shortName` 自动配置代字映射,无需再跑 short-name
|
|
362
|
-
> - **按年单独流水**:year 段 `alone:true`(DATE_YEAR seqAlone,流水号每年重新计数)
|
|
363
|
-
> - **全量替换**:重跑时旧段进 delDefIds 清除,markDefId 复用,绑定/代字不丢失
|
|
364
|
-
> - 段对象来自 `getMarkFieldAddData` 预生成;markDefId 来自 `saveSingleMarkDef`;已有绑定时复用持久化 markDef(getMarkContext 优先用绑定记录的 targetId)
|
|
365
|
-
|
|
366
|
-
### 增量调整(可选)
|
|
367
|
-
|
|
368
|
-
`set` 是全量重建;需在已有编号上追加/微调单段用 `add-segment`,单独查/改代字用 `short-name`:
|
|
159
|
+
公式表达式、明细汇总和函数格式见 [字段公式函数参考](guide-form-formula-functions.md)。复杂编号属于建后配置,见 [表单复杂编号](guide-form-serial-mark.md)。
|
|
369
160
|
|
|
370
|
-
|
|
371
|
-
e10-cli form serial-mark add-segment <objId> <appId> <绑定字段ID> --type field --field-id <取值字段ID> [--position 0]
|
|
372
|
-
e10-cli form serial-mark add-segment <objId> <appId> <绑定字段ID> --type system --system-field creator-dept
|
|
373
|
-
e10-cli form serial-mark short-name list <objId> <appId> <选择框字段ID>
|
|
374
|
-
e10-cli form serial-mark short-name set <objId> <appId> <选择框字段ID> --map '{"研发":"YF","实施":"SS"}'
|
|
375
|
-
```
|
|
376
|
-
add-segment 段类型与 set 一致(fixed/year/serial/field/system/date),`--position` 插入位置(缺省追加末尾)。
|
|
377
|
-
|
|
378
|
-
### 查询与解除
|
|
161
|
+
## 执行创建
|
|
379
162
|
|
|
380
163
|
```bash
|
|
381
|
-
e10-cli form
|
|
382
|
-
e10-cli form serial-mark fields <objId> <appId> # 查可作为编号目标的字段
|
|
383
|
-
e10-cli form serial-mark clear <objId> <appId> <字段ID> # 解除编号绑定
|
|
164
|
+
e10-cli form create <appId> "采购合同" --fields @fields.json --layout EXCEL
|
|
384
165
|
```
|
|
385
166
|
|
|
386
|
-
|
|
387
|
-
- 被编码字段平台自动设为只读(编号自动生成,不可手工改)
|
|
388
|
-
- 流水号按 `前缀+年份+流水` 组合查重累进
|
|
389
|
-
- 机制:markField 复杂编号(getEbMarkTargetId → getMarkSetForm → saveSingleMarkDef → saveOrUpdate → saveMarkField);段对象必须来自 getMarkFieldAddData 预生成;已有绑定时复用持久化 markDef,段/代字不丢失
|
|
390
|
-
|
|
391
|
-
## 日期区间 DateRange
|
|
392
|
-
|
|
393
|
-
日期区间字段**必须**指定精度格式,通过 `format` 配置:
|
|
394
|
-
|
|
395
|
-
```json
|
|
396
|
-
{
|
|
397
|
-
"componentKey": "DateRange",
|
|
398
|
-
"fieldName": "出差时间",
|
|
399
|
-
"format": "yyyy-MM-dd HH:mm"
|
|
400
|
-
}
|
|
401
|
-
```
|
|
167
|
+
创建流程会依次完成表单主体、字段和明细、布局初始化、字段高级属性、关联关系、选项、公式、分组、基础查看权限及默认台账配置。传入 `--menu` 时同时添加台账菜单入口。
|
|
402
168
|
|
|
403
|
-
|
|
404
|
-
|------|------|------|
|
|
405
|
-
| `format` | 否 | 区间精度。缺省 `yyyy-MM-dd`(年-月-日);到分钟写 `yyyy-MM-dd HH:mm`;到秒 `yyyy-MM-dd HH:mm:ss` |
|
|
406
|
-
| `startPlaceholder` / `endPlaceholder` | 否 | 开始/结束控件占位符。缺省按 format 自动生成中文(如 `年-月-日 时:分`) |
|
|
169
|
+
记录命令返回的:
|
|
407
170
|
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
171
|
+
- `objId`:EB 表单业务对象 ID,多数 `form` 命令使用它。
|
|
172
|
+
- `formId`:底层表单 ID,布局和部分底层接口使用它。
|
|
173
|
+
- `listId`:默认台账 ID,通过 `form list-view` 查询。
|
|
411
174
|
|
|
412
|
-
##
|
|
175
|
+
## 建成后配置
|
|
413
176
|
|
|
414
|
-
|
|
177
|
+
按需求执行,未提出的配置不额外增加:
|
|
415
178
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
179
|
+
| 需求 | 命令或指南 |
|
|
180
|
+
|---|---|
|
|
181
|
+
| 字段中英文名称 | `form field-lang set` |
|
|
182
|
+
| 字段显隐、只读、必填联动 | [表单联动](guide-form-linkage.md) |
|
|
183
|
+
| 字段查重 | `form validate` |
|
|
184
|
+
| 表单和数据权限 | `form permission` |
|
|
185
|
+
| 默认台账改名、列、筛选和分组 | [表单视图](guide-form-view.md) |
|
|
186
|
+
| 表单及视图按钮 | [表单按钮](guide-form-button.md) |
|
|
187
|
+
| 关联页签 | [表单关联页签](guide-form-association.md) |
|
|
188
|
+
| 复杂编号 | [表单复杂编号](guide-form-serial-mark.md) |
|
|
423
189
|
|
|
424
|
-
|
|
190
|
+
需求写成 `中文/English`(如 `项目/project`)时,先以中文名称创建字段,再设置多语言:
|
|
425
191
|
|
|
426
|
-
```
|
|
427
|
-
|
|
192
|
+
```bash
|
|
193
|
+
e10-cli form field-lang set <objId> <appId> <fieldId> --zh "项目" --en "project"
|
|
428
194
|
```
|
|
429
195
|
|
|
430
|
-
|
|
431
|
-
|------|------|
|
|
432
|
-
| 表达式语法 | 与 `form formula set --expression` 一致,用 `{主表.字段名}` 引用主表字段、`{明细表名.字段名}` 引用**明细表**字段(如 `DAYS({行程明细.行程开始时间},{行程明细.行程结束时间})`)。**fields.json create 与 formula set 两条路径都支持明细引用** |
|
|
433
|
-
| **明细列求和** | **`SUM({明细表名.字段})`** 可对明细表某列跨行求和(如 `SUM({付款信息.付款金额})`),生效。可配合 `workflow node validate` 做"明细累加=主表字段"校验 |
|
|
434
|
-
| **日期差** | 两个日期相减**不直接支持**,要用平台函数 **`DAYS({主表.开始},{主表.结束})`** |
|
|
435
|
-
| 返回类型 | 缺省 `Number`;文本/日期类用对象形式指定 |
|
|
436
|
-
| 事后补加 | `e10-cli form formula set <objId> <appId> --expression "..." --target <fieldId>` |
|
|
437
|
-
|
|
438
|
-
> **明细表子字段选项**:`DetailTable` 的 `formFields` 里的 `Select/RadioBox/CheckBox` 也支持 `fieldOptions`,CLI 会自动给子字段配置选项(创建时无需额外操作)。
|
|
196
|
+
## 完成核对
|
|
439
197
|
|
|
440
|
-
|
|
198
|
+
使用与本次需求直接相关的读取命令核对即可:
|
|
441
199
|
|
|
442
200
|
```bash
|
|
443
|
-
e10-cli form
|
|
201
|
+
e10-cli form read <objId> --app-id <appId> --out fields-created.json
|
|
202
|
+
e10-cli form list-view <objId> <appId>
|
|
203
|
+
e10-cli form layout read <objId> <appId>
|
|
444
204
|
```
|
|
445
205
|
|
|
446
|
-
`
|
|
447
|
-
|
|
448
|
-
```json
|
|
449
|
-
[
|
|
450
|
-
{"componentKey":"Text","fieldName":"合同编号"},
|
|
451
|
-
{"componentKey":"Text","fieldName":"供应商名称"},
|
|
452
|
-
{"componentKey":"Employee","fieldName":"采购负责人"},
|
|
453
|
-
{"componentKey":"Date","fieldName":"签订日期"},
|
|
454
|
-
{"componentKey":"Money","fieldName":"总金额"},
|
|
455
|
-
{"componentKey":"Select","fieldName":"合同状态","fieldOptions":[{"name":"待审批"},{"name":"已审批"},{"name":"已完成"}]},
|
|
456
|
-
{"componentKey":"DetailTable","fieldName":"采购明细","formFields":[{"componentKey":"Text","fieldName":"物品名称"},{"componentKey":"Number","fieldName":"数量"},{"componentKey":"Number","fieldName":"单价"}]}
|
|
457
|
-
]
|
|
458
|
-
```
|
|
206
|
+
重点确认字段数量与类型、明细结构、分组和显示属性、布局类型、默认台账名称与 `listId`。需要菜单时再确认菜单入口。
|
|
459
207
|
|
|
460
|
-
##
|
|
208
|
+
## 专题参考
|
|
461
209
|
|
|
462
|
-
-
|
|
463
|
-
-
|
|
464
|
-
-
|
|
210
|
+
- [表单字段定义参考](ref-form-fields.md):完整字段类型、属性、关联类型和 JSON 结构。
|
|
211
|
+
- [表单布局规划](guide-form-layout-planning.md):FLOW/EXCEL、布局样表、布局蓝图及建后调整。
|
|
212
|
+
- [表单复杂编号](guide-form-serial-mark.md):编号段、流水和代字配置。
|
|
213
|
+
- [字段公式函数参考](guide-form-formula-functions.md):公式表达式和函数。
|
|
214
|
+
- [表单视图](guide-form-view.md):默认台账、视图名称和列表配置。
|
|
@@ -56,10 +56,11 @@ e10-cli form association create <objId> <appId> "全部合同" --view <viewId> -
|
|
|
56
56
|
|
|
57
57
|
| 参数 | 含义 |
|
|
58
58
|
|---|---|
|
|
59
|
-
| `--layouts 显示` | `showLayout="0"
|
|
59
|
+
| `--layouts 显示` | `showLayout="0"`:显示布局 |
|
|
60
|
+
| `--layouts 新建` | `showLayout="1"`:新建布局 |
|
|
60
61
|
| `--layouts 编辑` | `showLayout="2"`:仅编辑布局 |
|
|
61
|
-
| `--layouts 显示 编辑` | `showLayout="0,2"
|
|
62
|
-
| `--layouts none` |
|
|
62
|
+
| `--layouts 显示 新建 编辑` | `showLayout="0,1,2"`:三种布局都显示 |
|
|
63
|
+
| `--layouts none` | 三种布局均不显示 |
|
|
63
64
|
| `--terminals PC MOBILE` | 两端适用;可只传其中一个 |
|
|
64
65
|
| `--enabled true/false` | 启用或停用页签 |
|
|
65
66
|
|
|
@@ -71,6 +72,8 @@ e10-cli form association update <objId> <appId> <associationId> --view <newViewI
|
|
|
71
72
|
|
|
72
73
|
`update` 保留未指定属性以及原动作、权限条件和提示。布局、终端参数表示替换对应集合。修改绑定视图且已有映射时必须显式提供新映射(`[]` 可清空),避免原目标表字段被用于新视图。
|
|
73
74
|
|
|
75
|
+
仅启用或停用页签时,`update --enabled true|false` 使用 `updateIsOpenById` 独立接口并通过列表回读状态,不整包保存关联配置。
|
|
76
|
+
|
|
74
77
|
## 修改和清空关联数据筛选
|
|
75
78
|
|
|
76
79
|
```bash
|