@microi.net/cli 5.5.8 → 5.6.0
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/.codebuddy-plugin/marketplace.json +2 -2
- package/.codebuddy-plugin/plugin.json +1 -1
- package/.codex-plugin/plugin.json +1 -1
- package/.mcp.json +1 -1
- package/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/README.md +71 -71
- package/assets/build-meta.json +5 -5
- package/assets/feature-matrix.json +129 -129
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
- package/scripts/codex-marketplace.json +20 -20
- package/scripts/mcp-codex-stdio-adapter.js +189 -189
- package/scripts/mcp-trae-windows-launcher.cmd +21 -21
- package/scripts/microi-cli-mcp.js +7 -7
- package/scripts/microi-codex-broker.js +447 -447
- package/scripts/microi-codex-router.js +582 -582
- package/scripts/microi-skills.meta.json +336 -336
- package/skills/.microi-skills-version.json +2 -2
- package/skills/.progressive-disclosure-manifest.json +3566 -3566
- package/skills/README.md +3 -3
- package/skills/ai-engine/SKILL.md +45 -43
- package/skills/ai-platform-governance/SKILL.md +177 -177
- package/skills/ai-platform-governance/references/progressive-01-/345/212/237/350/203/275/345/274/200/345/205/263.md +190 -190
- package/skills/app-store/SKILL.md +177 -177
- package/skills/business-blueprint/SKILL.md +85 -85
- package/skills/datasource-engine/SKILL.md +91 -91
- package/skills/dos-orm/SKILL.md +81 -81
- package/skills/dos-orm/references/api-reference.md +229 -229
- package/skills/email-engine/SKILL.md +80 -80
- package/skills/email-engine/references/v8-email.md +34 -34
- package/skills/job-engine/SKILL.md +154 -143
- package/skills/message-notification/SKILL.md +126 -126
- package/skills/message-notification/agents/openai.yaml +5 -5
- package/skills/message-notification/references/contracts.md +102 -102
- package/skills/microi-ai-app-auth.js +652 -652
- package/skills/microi-ai-application/SKILL.md +102 -94
- package/skills/microi-ai-application/agents/openai.yaml +4 -4
- package/skills/microi-ai-application/references/frontend-baseline.md +164 -164
- package/skills/microi-client-frontend/SKILL.md +43 -43
- package/skills/microi-client-frontend/references/progressive-01-3-/345/212/250/346/200/201/346/214/211/351/222/256/347/263/273/347/273/237.md +2 -2
- package/skills/microi-client-frontend/references/progressive-02-8-/350/277/220/350/241/214/346/227/266/351/253/230/351/242/221/345/235/221/345/244/215/347/233/230.md +28 -28
- package/skills/microi-client-frontend/references/progressive-03-vue3-/345/211/215/347/253/257/345/276/256/346/234/215/345/212/241/345/256/277/344/270/273/350/247/204/345/210/231.md +56 -56
- package/skills/microi-codex/SKILL.md +46 -46
- package/skills/microi-codex-installer/SKILL.md +216 -216
- package/skills/microi-codex-installer/agents/openai.yaml +7 -7
- package/skills/microi-datasource-mapping/SKILL.md +67 -67
- package/skills/microi-db-schema/SKILL.md +6 -6
- package/skills/microi-db-schema/references/core-tables.md +18 -18
- package/skills/microi-db-schema/references/form-component-options.md +256 -256
- package/skills/microi-db-schema/references/schema-overview.md +11 -11
- package/skills/microi-db-schema/references/schema.md +46 -46
- package/skills/microi-db-schema/references/table-catalog.md +57 -57
- package/skills/microi-deployment/SKILL.md +18 -1
- package/skills/microi-deployment/references/deployment-matrix.md +101 -101
- package/skills/microi-docs-coverage/SKILL.md +123 -123
- package/skills/microi-docs-coverage/references/capability-map.md +1 -0
- package/skills/microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs +894 -894
- package/skills/microi-form-engine/SKILL.md +50 -50
- package/skills/microi-form-engine/references/component-catalog.md +218 -218
- package/skills/microi-form-engine/references/data-source-events.md +124 -124
- package/skills/microi-form-layout/SKILL.md +13 -13
- package/skills/microi-form-layout/references/progressive-01-3-/344/270/211/347/247/215/345/210/206/347/273/204/347/232/204/345/255/230/345/202/250/344/270/216/351/205/215/347/275/256.md +235 -235
- package/skills/microi-frontend-sdk/SKILL.md +4 -4
- package/skills/microi-frontend-sdk/references/progressive-01-token-/345/275/223/345/211/215/347/231/273/345/275/225/347/224/250/346/210/267/344/270/216/345/275/223/345/211/215/347/273/210/347/253/257/347/231/273/345/275/225/345/215/217/350/256/256.md +175 -175
- package/skills/microi-left-right-layout/SKILL.md +141 -141
- package/skills/microi-microservice/SKILL.md +12 -10
- package/skills/microi-microservice/references/runtime-delivery.md +278 -278
- package/skills/microi-mobile-app-quality/references/progressive-01-4-/351/207/215/350/246/201/346/214/211/351/222/256/345/277/205/351/241/273/345/270/246/345/233/276/346/240/207.md +213 -213
- package/skills/microi-solution-quotation/SKILL.md +78 -78
- package/skills/microi-solution-quotation/agents/openai.yaml +4 -4
- package/skills/microi-solution-quotation/scripts/build_solution_quote.py +296 -296
- package/skills/microi-sso/SKILL.md +85 -85
- package/skills/microi-sso/references/acceptance.md +49 -49
- package/skills/microi-sso/references/configuration-and-security.md +53 -53
- package/skills/microi-sso/references/inbound.md +53 -53
- package/skills/microi-sso/references/outbound.md +39 -39
- package/skills/microi-system-delivery/references/progressive-02-/350/207/252/345/212/250/345/214/226/346/265/213/350/257/225/345/277/205/351/241/273/350/246/206/347/233/226/347/232/204/345/235/221.md +20 -20
- package/skills/microi-ui/SKILL.md +7 -2
- package/skills/microi-uniapp-frontend/SKILL.md +134 -134
- package/skills/microi-uniapp-frontend/references/progressive-01-/347/247/273/345/212/250/347/253/257/345/210/206/347/261/273-/345/217/214/346/240/217/345/210/227/350/241/250/347/213/254/347/253/213/346/273/232/345/212/250.md +136 -136
- package/skills/microi-uniapp-frontend/references/progressive-02-/345/205/263/351/224/256/344/270/232/345/212/241/350/265/204/344/272/247/344/270/215/345/276/227/351/273/230/350/256/244/351/200/211/344/270/255.md +124 -124
- package/skills/module-engine/SKILL.md +16 -16
- package/skills/ocr-engine/SKILL.md +2 -2
- package/skills/ocr-engine/agents/openai.yaml +1 -1
- package/skills/page-engine/SKILL.md +28 -28
- package/skills/page-engine/references/progressive-01-/346/211/200/346/234/211/347/273/204/344/273/266/347/261/273/345/236/213.md +126 -126
- package/skills/page-engine/references/progressive-02-/347/211/210/346/234/254/345/216/206/345/217/262-/345/271/266/345/217/221/344/277/235/345/255/230/344/270/216/345/233/236/346/273/232.md +42 -42
- package/skills/performance-testing/SKILL.md +120 -120
- package/skills/playwright-e2e/SKILL.md +84 -84
- package/skills/playwright-e2e/references/progressive-01-/345/205/250/350/207/252/345/212/250/347/231/273/345/275/225-/345/205/215/351/252/214/350/257/201/347/240/201-/344/275/206/344/270/215/345/205/215/345/257/206/347/240/201-/345/277/205/350/257/273.md +68 -68
- package/skills/playwright-e2e/references/progressive-02-/346/226/207/345/255/227/345/257/271/346/257/224/345/272/246/344/270/216/345/217/257/350/257/273/346/200/247/350/207/252/345/212/250/345/214/226/346/243/200/346/237/245-/345/277/205/345/201/232.md +64 -64
- package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +20 -20
- package/skills/playwright-e2e/references/progressive-04-ci-/345/273/272/350/256/256.md +69 -69
- package/skills/print-engine/SKILL.md +36 -36
- package/skills/production-readonly-audit/SKILL.md +41 -41
- package/skills/report-engine/SKILL.md +71 -71
- package/skills/scripts/optimize-progressive-disclosure.mjs +204 -204
- package/skills/scripts/refresh-progressive-disclosure.mjs +64 -64
- package/skills/scripts/validate-progressive-disclosure.mjs +52 -52
- package/skills/search-engine/SKILL.md +75 -75
- package/skills/spider-engine/SKILL.md +190 -190
- package/skills/system-observability/SKILL.md +162 -162
- package/skills/system-observability/references/memory-incident-triage.md +73 -73
- package/skills/translate-engine/SKILL.md +1 -1
- package/skills/ui-design/SKILL.md +3 -1
- package/skills/uniapp-mall-assets/SKILL.md +170 -170
- package/skills/unity-integration/SKILL.md +155 -155
- package/skills/unity-integration/agents/openai.yaml +4 -4
- package/skills/unity-integration/references/ai-app-delivery.md +103 -103
- package/skills/unity-integration/references/sdk-api.md +82 -82
- package/skills/unity-integration/references/toolbox-migration.md +66 -66
- package/skills/unity-integration/references/webgl-hosting.md +57 -57
- package/skills/v8-api-config/SKILL.md +378 -378
- package/skills/v8-cache-pattern/SKILL.md +306 -306
- package/skills/v8-crud-api/SKILL.md +29 -29
- package/skills/v8-crud-api/references/progressive-01-/346/237/245/350/257/242/345/210/227/350/241/250-/345/210/206/351/241/265.md +56 -56
- package/skills/v8-debugging/SKILL.md +143 -143
- package/skills/v8-explorer-tree/SKILL.md +64 -64
- package/skills/v8-export-import/references/progressive-01-excellayout-/351/253/230/347/272/247/350/207/252/347/224/261/345/270/203/345/261/200.md +201 -201
- package/skills/v8-export-import/references/progressive-02-powerpoint-/345/257/274/345/207/272.md +118 -118
- package/skills/v8-export-import/references/progressive-03-/345/256/211/345/205/250-/346/200/247/350/203/275/346/263/250/346/204/217.md +32 -32
- package/skills/v8-file-upload/SKILL.md +154 -154
- package/skills/v8-file-upload/references/progressive-01-/345/205/254/346/234/211/346/241/266-vs-/347/247/201/346/234/211/346/241/266.md +133 -133
- package/skills/v8-file-upload/references/progressive-02-office-/346/226/207/344/273/266/345/234/250/347/272/277/347/274/226/350/276/221/347/211/210/346/234/254/345/217/267/350/247/204/345/210/231.md +138 -138
- package/skills/v8-formengine-http/SKILL.md +107 -107
- package/skills/v8-frontend-events/SKILL.md +22 -22
- package/skills/v8-frontend-events/references/bluetooth-print-api.md +135 -135
- package/skills/v8-frontend-events/references/bluetooth-print.md +247 -247
- package/skills/v8-frontend-events/references/progressive-01-/345/210/227/350/241/250/344/272/213/344/273/266.md +50 -50
- package/skills/v8-http-integration/SKILL.md +106 -106
- package/skills/v8-http-integration/references/progressive-01-get-/350/257/267/346/261/202.md +31 -31
- package/skills/v8-http-integration/references/progressive-02-/351/224/231/350/257/257/345/244/204/347/220/206/346/250/241/345/274/217.md +5 -5
- package/skills/v8-image-processing/SKILL.md +190 -190
- package/skills/v8-image-processing/agents/openai.yaml +4 -4
- package/skills/v8-image-processing/references/api-reference.md +623 -623
- package/skills/v8-menu-buttons/SKILL.md +103 -103
- package/skills/v8-menu-buttons/references/progressive-01-2-/346/214/211/351/222/256/345/257/271/350/261/241-schema.md +145 -145
- package/skills/v8-menu-buttons/references/progressive-02-8-/346/250/241/345/274/217-f-/345/220/216/345/217/260/344/273/273/345/212/241/346/214/211/351/222/256-/351/225/277/344/273/273/345/212/241.md +228 -228
- package/skills/v8-menu-buttons/references/progressive-03-10-/345/217/215/346/250/241/345/274/217-/351/201/277/345/205/215.md +43 -43
- package/skills/v8-mongodb/SKILL.md +65 -65
- package/skills/v8-mq-mqtt/SKILL.md +175 -175
- package/skills/v8-mq-mqtt/references/mqtt-production.md +342 -342
- package/skills/v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-/347/211/251/350/201/224/347/275/221.md +137 -137
- package/skills/v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs +203 -203
- package/skills/v8-saas-multi-tenant/SKILL.md +223 -223
- package/skills/v8-security/SKILL.md +25 -25
- package/skills/v8-security/references/progressive-01-2-/346/235/203/351/231/220/346/240/241/351/252/214.md +122 -122
- package/skills/v8-sql-query/SKILL.md +127 -127
- package/skills/v8-table-event/SKILL.md +20 -20
- package/skills/v8-table-event/references/progressive-01-informv8-js-/350/241/250/345/215/225/346/211/223/345/274/200/344/272/213/344/273/266.md +18 -18
- package/skills/v8-table-event/references/progressive-02-/345/211/215/347/253/257/344/272/213/344/273/266/345/220/215-v8-eventname-/345/217/257/350/203/275/347/232/204/345/200/274.md +15 -15
- package/skills/v8-tcp-integration/SKILL.md +1 -1
- package/skills/v8-tcp-integration/agents/openai.yaml +4 -4
- package/skills/v8-template-engine/SKILL.md +59 -59
- package/skills/v8-utilities/SKILL.md +92 -92
- package/skills/v8-utilities/references/client-api-index.md +143 -143
- package/skills/v8-utilities/references/platform-http-routes.md +83 -83
- package/skills/v8-utilities/references/server-api-index.md +74 -74
- package/skills/v8-workflow/SKILL.md +44 -44
- package/skills/vision-engine/SKILL.md +19 -19
- package/skills/vision-engine/references/architecture-and-acceptance.md +34 -34
- package/skills/workspace-conventions/SKILL.md +236 -236
- package/skills/workspace-conventions/references/progressive-01-/347/211/210/346/234/254/346/233/264/346/226/260/346/227/245/345/277/227/344/277/235/346/212/244/350/247/204/345/210/231-/345/274/272/345/210/266.md +208 -208
- package/skills/workspace-conventions/references/progressive-02-microi-net-api-/346/234/254/345/234/260/345/220/257/345/212/250/347/272/246/345/256/232.md +179 -179
- package/skills/workspace-conventions/references/progressive-03-cli-/344/270/216-ide-/346/217/222/344/273/266/351/224/231/347/211/210/345/205/261/345/255/230/347/272/246/345/256/232.md +21 -21
|
@@ -1,124 +1,124 @@
|
|
|
1
|
-
# 字段数据源、属性与事件
|
|
2
|
-
|
|
3
|
-
## 数据源类型
|
|
4
|
-
|
|
5
|
-
| 类型 | 适用场景 | 配置要点 |
|
|
6
|
-
|---|---|---|
|
|
7
|
-
| `Data` | 显示值和保存值相同的固定数组 | 适合少量稳定枚举 |
|
|
8
|
-
| `KeyValue` | 保存 Key、显示 Label | 推荐;便于翻译和状态演进 |
|
|
9
|
-
| `Sql` | 基于当前库的受控查询 | 参数化、限制条数、选择明确字段 |
|
|
10
|
-
| `DataSource` | 复用数据源引擎 | 使用稳定 DataSourceId/Key |
|
|
11
|
-
| `ApiEngine` | 复杂权限、跨表或外部数据 | 接口返回稳定的 Label/Value 字段 |
|
|
12
|
-
|
|
13
|
-
KeyValue 示例:
|
|
14
|
-
|
|
15
|
-
```text
|
|
16
|
-
draft|草稿,enabled|启用,disabled|禁用
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
对应核心语义:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"DataSource": "KeyValue",
|
|
24
|
-
"SelectLabel": "Value",
|
|
25
|
-
"SelectSaveField": "Key"
|
|
26
|
-
}
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
动态 SQL 示例只选择必要字段并限制返回量:
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"DataSource": "Sql",
|
|
34
|
-
"Sql": "select Id,Name from biz_customer where Name like '%$Keyword$%' limit 0,20",
|
|
35
|
-
"SelectLabel": "Name",
|
|
36
|
-
"SelectSaveField": "Id",
|
|
37
|
-
"DataSourceSqlRemote": true
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
SQL 仍必须经过平台受控数据源;不要把用户文本拼成标识符或任意 SQL。复杂权限、
|
|
42
|
-
跨库或外部服务使用数据源引擎/接口引擎。
|
|
43
|
-
|
|
44
|
-
## 动态联动
|
|
45
|
-
|
|
46
|
-
字段值变化时可用前端 V8 更新另一个字段的数据源:
|
|
47
|
-
|
|
48
|
-
```javascript
|
|
49
|
-
if (V8.LoadMode === 'Design') return;
|
|
50
|
-
|
|
51
|
-
var result = await V8.FormEngine.GetTableData('biz_contact', {
|
|
52
|
-
_SelectFields: ['Id', 'Name'],
|
|
53
|
-
_Where: [['CustomerId', '=', V8.ThisValue]],
|
|
54
|
-
_PageIndex: 1,
|
|
55
|
-
_PageSize: 100
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
V8.FieldSet('ContactId', 'Data', result.Code === 1 ? result.Data : []);
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
前端联动不能替代后端权限和提交校验。
|
|
62
|
-
|
|
63
|
-
## 表单生命周期
|
|
64
|
-
|
|
65
|
-
| 配置 | 运行端 | 用途 |
|
|
66
|
-
|---|---|---|
|
|
67
|
-
| `InFormV8` | 前端 | 默认值、字段显隐、初始化交互 |
|
|
68
|
-
| `SubmitFormV8` | 前端 | 即时校验;HTTP 直调不会触发 |
|
|
69
|
-
| `SubmitBeforeServerV8` | 后端事务内 | 最终校验、加工、阻止提交 |
|
|
70
|
-
| `SubmitAfterServerV8` | 后端事务内 | 同事务联动其它表 |
|
|
71
|
-
| `OutFormV8` | 前端 | 关闭后刷新/跳转 |
|
|
72
|
-
| `DataFilterV8` | 后端 | 每行脱敏/展示加工 |
|
|
73
|
-
|
|
74
|
-
事件代码、版本和表单属性都必须从当前 `diy_table/diy_field` 回读。后端阻止提交:
|
|
75
|
-
|
|
76
|
-
```javascript
|
|
77
|
-
if (!V8.Form.Name) return { Code: 0, Msg: '名称不能为空' };
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## 字段属性
|
|
81
|
-
|
|
82
|
-
常用属性包括 `Visible`、`AppVisible`、`Required`、`Readonly`、`Data`、
|
|
83
|
-
`Config`、`FormWidth`、`TableWidth`、`Tab`、角色绑定和前端事件代码。
|
|
84
|
-
|
|
85
|
-
- 除非明确隐藏,`Visible=1`、`AppVisible=1`。
|
|
86
|
-
- 角色绑定只缩小界面可见性,不能代替服务器数据权限。
|
|
87
|
-
- 修改防抖编辑器/代码字段前必须刷新待保存值,避免最后一次输入未入库。
|
|
88
|
-
- `Data/Config` 修改后回读并刷新 schema 缓存。
|
|
89
|
-
|
|
90
|
-
### 历史字段 V8 双存储兼容
|
|
91
|
-
|
|
92
|
-
- `diy_field.V8Code` 是历史租户和官方应用包实际使用的物理列,按钮点击/字段值变更代码可能只存在于该列;`Config.V8Code` 是部分新版前端使用的镜像,不能假定它是唯一事实源。
|
|
93
|
-
- 后端 `DiyField` 实体、字段查询投影和 `DiyFieldParam` 必须保留 `V8Code`,否则数据库代码虽然仍在,设计器列表和单字段回读都会表现成“0 字”。
|
|
94
|
-
- 前端回读顺序固定为:先安全解码历史 Base64,再取“非空物理 `V8Code` 优先、否则 `Config.V8Code`”,最后同步两处。禁止用空镜像覆盖非空物理代码;保存和显式清空时则必须同步写入两处。
|
|
95
|
-
- 回归至少包含一个 `Component=Button`、根级 `V8Code` 非空而 `Config.V8Code` 为空的官方包字段,并验证列表回读、选中编辑、保存、刷新后代码仍完整。
|
|
96
|
-
|
|
97
|
-
## DevComponent 定制组件
|
|
98
|
-
|
|
99
|
-
定制组件至少处理:
|
|
100
|
-
|
|
101
|
-
- `value/modelValue` 的输入与变更通知;
|
|
102
|
-
- 当前字段模型、表单模型、表单模式和只读状态;
|
|
103
|
-
- 校验错误、清空、禁用、加载与销毁;
|
|
104
|
-
- Add/Edit/View 回显;
|
|
105
|
-
- PC、移动端和暗色主题;
|
|
106
|
-
- 组件内部请求的 Token/OsClient 传递与错误态。
|
|
107
|
-
|
|
108
|
-
定制组件需要修改并发布主前端。若只服务单一租户、包含多个字段或复杂页面,
|
|
109
|
-
优先创建 MicroService 页面,通过 `V8.OpenAppDialog` 与宿主交互。
|
|
110
|
-
|
|
111
|
-
历史 Options API 定制组件可通过宿主 facade 调用数据源引擎:
|
|
112
|
-
|
|
113
|
-
```javascript
|
|
114
|
-
this.Microi.DataSourceEngine.Run('customer_summary', { Id: customerId }, (result) => {
|
|
115
|
-
if (this.Microi.CheckResult(result)) {
|
|
116
|
-
this.summary = result.Data;
|
|
117
|
-
}
|
|
118
|
-
});
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
`Microi.DataSourceEngine.Run` 是回调式宿主接口,`Microi.CheckResult` 负责按
|
|
122
|
-
DosResult 约定判断并展示错误。组件卸载后要阻止迟到回调继续写状态;新页面
|
|
123
|
-
优先使用项目现有的组合式 facade,不要假定 `this.Microi` 在任意 Vue 组件中
|
|
124
|
-
都存在。
|
|
1
|
+
# 字段数据源、属性与事件
|
|
2
|
+
|
|
3
|
+
## 数据源类型
|
|
4
|
+
|
|
5
|
+
| 类型 | 适用场景 | 配置要点 |
|
|
6
|
+
|---|---|---|
|
|
7
|
+
| `Data` | 显示值和保存值相同的固定数组 | 适合少量稳定枚举 |
|
|
8
|
+
| `KeyValue` | 保存 Key、显示 Label | 推荐;便于翻译和状态演进 |
|
|
9
|
+
| `Sql` | 基于当前库的受控查询 | 参数化、限制条数、选择明确字段 |
|
|
10
|
+
| `DataSource` | 复用数据源引擎 | 使用稳定 DataSourceId/Key |
|
|
11
|
+
| `ApiEngine` | 复杂权限、跨表或外部数据 | 接口返回稳定的 Label/Value 字段 |
|
|
12
|
+
|
|
13
|
+
KeyValue 示例:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
draft|草稿,enabled|启用,disabled|禁用
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
对应核心语义:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"DataSource": "KeyValue",
|
|
24
|
+
"SelectLabel": "Value",
|
|
25
|
+
"SelectSaveField": "Key"
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
动态 SQL 示例只选择必要字段并限制返回量:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"DataSource": "Sql",
|
|
34
|
+
"Sql": "select Id,Name from biz_customer where Name like '%$Keyword$%' limit 0,20",
|
|
35
|
+
"SelectLabel": "Name",
|
|
36
|
+
"SelectSaveField": "Id",
|
|
37
|
+
"DataSourceSqlRemote": true
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
SQL 仍必须经过平台受控数据源;不要把用户文本拼成标识符或任意 SQL。复杂权限、
|
|
42
|
+
跨库或外部服务使用数据源引擎/接口引擎。
|
|
43
|
+
|
|
44
|
+
## 动态联动
|
|
45
|
+
|
|
46
|
+
字段值变化时可用前端 V8 更新另一个字段的数据源:
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
if (V8.LoadMode === 'Design') return;
|
|
50
|
+
|
|
51
|
+
var result = await V8.FormEngine.GetTableData('biz_contact', {
|
|
52
|
+
_SelectFields: ['Id', 'Name'],
|
|
53
|
+
_Where: [['CustomerId', '=', V8.ThisValue]],
|
|
54
|
+
_PageIndex: 1,
|
|
55
|
+
_PageSize: 100
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
V8.FieldSet('ContactId', 'Data', result.Code === 1 ? result.Data : []);
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
前端联动不能替代后端权限和提交校验。
|
|
62
|
+
|
|
63
|
+
## 表单生命周期
|
|
64
|
+
|
|
65
|
+
| 配置 | 运行端 | 用途 |
|
|
66
|
+
|---|---|---|
|
|
67
|
+
| `InFormV8` | 前端 | 默认值、字段显隐、初始化交互 |
|
|
68
|
+
| `SubmitFormV8` | 前端 | 即时校验;HTTP 直调不会触发 |
|
|
69
|
+
| `SubmitBeforeServerV8` | 后端事务内 | 最终校验、加工、阻止提交 |
|
|
70
|
+
| `SubmitAfterServerV8` | 后端事务内 | 同事务联动其它表 |
|
|
71
|
+
| `OutFormV8` | 前端 | 关闭后刷新/跳转 |
|
|
72
|
+
| `DataFilterV8` | 后端 | 每行脱敏/展示加工 |
|
|
73
|
+
|
|
74
|
+
事件代码、版本和表单属性都必须从当前 `diy_table/diy_field` 回读。后端阻止提交:
|
|
75
|
+
|
|
76
|
+
```javascript
|
|
77
|
+
if (!V8.Form.Name) return { Code: 0, Msg: '名称不能为空' };
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## 字段属性
|
|
81
|
+
|
|
82
|
+
常用属性包括 `Visible`、`AppVisible`、`Required`、`Readonly`、`Data`、
|
|
83
|
+
`Config`、`FormWidth`、`TableWidth`、`Tab`、角色绑定和前端事件代码。
|
|
84
|
+
|
|
85
|
+
- 除非明确隐藏,`Visible=1`、`AppVisible=1`。
|
|
86
|
+
- 角色绑定只缩小界面可见性,不能代替服务器数据权限。
|
|
87
|
+
- 修改防抖编辑器/代码字段前必须刷新待保存值,避免最后一次输入未入库。
|
|
88
|
+
- `Data/Config` 修改后回读并刷新 schema 缓存。
|
|
89
|
+
|
|
90
|
+
### 历史字段 V8 双存储兼容
|
|
91
|
+
|
|
92
|
+
- `diy_field.V8Code` 是历史租户和官方应用包实际使用的物理列,按钮点击/字段值变更代码可能只存在于该列;`Config.V8Code` 是部分新版前端使用的镜像,不能假定它是唯一事实源。
|
|
93
|
+
- 后端 `DiyField` 实体、字段查询投影和 `DiyFieldParam` 必须保留 `V8Code`,否则数据库代码虽然仍在,设计器列表和单字段回读都会表现成“0 字”。
|
|
94
|
+
- 前端回读顺序固定为:先安全解码历史 Base64,再取“非空物理 `V8Code` 优先、否则 `Config.V8Code`”,最后同步两处。禁止用空镜像覆盖非空物理代码;保存和显式清空时则必须同步写入两处。
|
|
95
|
+
- 回归至少包含一个 `Component=Button`、根级 `V8Code` 非空而 `Config.V8Code` 为空的官方包字段,并验证列表回读、选中编辑、保存、刷新后代码仍完整。
|
|
96
|
+
|
|
97
|
+
## DevComponent 定制组件
|
|
98
|
+
|
|
99
|
+
定制组件至少处理:
|
|
100
|
+
|
|
101
|
+
- `value/modelValue` 的输入与变更通知;
|
|
102
|
+
- 当前字段模型、表单模型、表单模式和只读状态;
|
|
103
|
+
- 校验错误、清空、禁用、加载与销毁;
|
|
104
|
+
- Add/Edit/View 回显;
|
|
105
|
+
- PC、移动端和暗色主题;
|
|
106
|
+
- 组件内部请求的 Token/OsClient 传递与错误态。
|
|
107
|
+
|
|
108
|
+
定制组件需要修改并发布主前端。若只服务单一租户、包含多个字段或复杂页面,
|
|
109
|
+
优先创建 MicroService 页面,通过 `V8.OpenAppDialog` 与宿主交互。
|
|
110
|
+
|
|
111
|
+
历史 Options API 定制组件可通过宿主 facade 调用数据源引擎:
|
|
112
|
+
|
|
113
|
+
```javascript
|
|
114
|
+
this.Microi.DataSourceEngine.Run('customer_summary', { Id: customerId }, (result) => {
|
|
115
|
+
if (this.Microi.CheckResult(result)) {
|
|
116
|
+
this.summary = result.Data;
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`Microi.DataSourceEngine.Run` 是回调式宿主接口,`Microi.CheckResult` 负责按
|
|
122
|
+
DosResult 约定判断并展示错误。组件卸载后要阻止迟到回调继续写状态;新页面
|
|
123
|
+
优先使用项目现有的组合式 facade,不要假定 `this.Microi` 在任意 Vue 组件中
|
|
124
|
+
都存在。
|
|
@@ -22,15 +22,15 @@ Microi 吾码低代码提供 **三种** 表单分组能力,但每种都有明
|
|
|
22
22
|
|
|
23
23
|
`CollapseGroup` 的运行态视觉统一使用清爽的白色/主题表面卡片:短主题色指示条、紧凑
|
|
24
24
|
标题、可选图标、单行副标题、标题旁轻量 `x 项` 文案,以及最右侧无底色的折叠箭头。
|
|
25
|
-
不得使用整块主题色填充、蓝色大描边或醒目的实心数量胶囊;分组内容与标题属于同一张
|
|
26
|
-
卡片,展开后不再嵌套第二套外框。深色模式使用 Element 主题变量,不能写死白色/蓝色。
|
|
27
|
-
|
|
28
|
-
## 配置类表单的二级分组硬规则
|
|
29
|
-
|
|
30
|
-
- `sys_config`、`sys_user`、SaaS 设置、接口参数、打印/工作流设置等“配置类表单”不能因为已经有表级 Tab 就停止信息架构审计。表级 Tab 只负责一级领域;同一 Tab 内存在 **7 个以上可见设置**或 **2 个以上明确语义域**时,必须继续按语义放入 `CollapseGroup`。
|
|
31
|
-
- 水印、主题、菜单、登录入口、安全策略、桌面偏好等一组相互关联的开关/参数必须由一个带图标、说明、计数的 CollapseGroup 包裹;不能把 5~20 个设置直接平铺在 Tab 中,也不能让每个小设置单独占一个 Tab。
|
|
32
|
-
- 新增设置字段时必须同时审计所在 Tab 的现有字段,而不只是包住本次新增字段。若相邻设置已形成稳定语义域,应一次性补齐该域的 CollapseGroup;隐藏兼容字段继续保留但不计入可见项数。
|
|
33
|
-
- 配置表采用“表级 Tab + Tab 内 CollapseGroup”时,CollapseGroup 必须与成员字段写入同一个 `Tab`,并用连续 `Sort` 保证作用范围在下一个布局节点前结束。发布前必须打开真实编辑表单验证,不能只凭元数据字符串判断布局成功。
|
|
25
|
+
不得使用整块主题色填充、蓝色大描边或醒目的实心数量胶囊;分组内容与标题属于同一张
|
|
26
|
+
卡片,展开后不再嵌套第二套外框。深色模式使用 Element 主题变量,不能写死白色/蓝色。
|
|
27
|
+
|
|
28
|
+
## 配置类表单的二级分组硬规则
|
|
29
|
+
|
|
30
|
+
- `sys_config`、`sys_user`、SaaS 设置、接口参数、打印/工作流设置等“配置类表单”不能因为已经有表级 Tab 就停止信息架构审计。表级 Tab 只负责一级领域;同一 Tab 内存在 **7 个以上可见设置**或 **2 个以上明确语义域**时,必须继续按语义放入 `CollapseGroup`。
|
|
31
|
+
- 水印、主题、菜单、登录入口、安全策略、桌面偏好等一组相互关联的开关/参数必须由一个带图标、说明、计数的 CollapseGroup 包裹;不能把 5~20 个设置直接平铺在 Tab 中,也不能让每个小设置单独占一个 Tab。
|
|
32
|
+
- 新增设置字段时必须同时审计所在 Tab 的现有字段,而不只是包住本次新增字段。若相邻设置已形成稳定语义域,应一次性补齐该域的 CollapseGroup;隐藏兼容字段继续保留但不计入可见项数。
|
|
33
|
+
- 配置表采用“表级 Tab + Tab 内 CollapseGroup”时,CollapseGroup 必须与成员字段写入同一个 `Tab`,并用连续 `Sort` 保证作用范围在下一个布局节点前结束。发布前必须打开真实编辑表单验证,不能只凭元数据字符串判断布局成功。
|
|
34
34
|
|
|
35
35
|
<!-- microi-progressive:begin -->
|
|
36
36
|
<!-- microi-progressive:chunk id=microi-form-layout-000 sha256=79fcf1787c0fbdbe51363f25fcf72b060b714eed9cbc5593760f9080cff48e31 -->
|
|
@@ -145,10 +145,10 @@ V8 事件中可用 `V8.HideFormTab('tabId')` / `V8.ShowFormTab('tabId')` / `V8.C
|
|
|
145
145
|
- 字段数 13~30 的表单,必须有可见的**业务分组**(Tab 或 CollapseGroup 二选一),不能让用户上下滚动 5 屏找字段。
|
|
146
146
|
- 创建 CollapseGroup 分组时,必须设置 `Icon`(如 `fas fa-calculator` / `fas fa-info-circle`),不要默认空白。
|
|
147
147
|
- 任何 Tab / CollapseGroup 都必须有 `Description` 解释分组用途,不要只放一个标题。
|
|
148
|
-
- 每个 CollapseGroup 必须回读到 `FormWidth=24`;`Config.CollapseGroup.ShowFieldCount` 默认必须为 `true`。
|
|
149
|
-
- 可扩展配置表或设置页的末尾 CollapseGroup 不得无边界使用 `ScopeMode=UntilNextGroup`。已知标准子项数量时必须改用 `ScopeMode=FieldCount` 并显式保存准确 `FieldCount`;否则必须增加后续分组边界,避免未来新增字段或租户扩展字段被末尾分组误吞。
|
|
150
|
-
- 表级 Tab 与 CollapseGroup 的 `Description` 作为副标题显示;开启计数时统一追加 `x 项`,禁止继续显示 `x 个字段`。运行时动态显隐字段后必须重算计数,已有数字角标配置继续生效,不能被静态字段数覆盖。
|
|
151
|
-
- 分组/Tab 的字段计数必须基于字段原始可见性(如 `_baseIsShow`),不能把“当前因折叠而隐藏”误判成不可见,否则收起后的分组会错误显示 `0 项`。
|
|
148
|
+
- 每个 CollapseGroup 必须回读到 `FormWidth=24`;`Config.CollapseGroup.ShowFieldCount` 默认必须为 `true`。
|
|
149
|
+
- 可扩展配置表或设置页的末尾 CollapseGroup 不得无边界使用 `ScopeMode=UntilNextGroup`。已知标准子项数量时必须改用 `ScopeMode=FieldCount` 并显式保存准确 `FieldCount`;否则必须增加后续分组边界,避免未来新增字段或租户扩展字段被末尾分组误吞。
|
|
150
|
+
- 表级 Tab 与 CollapseGroup 的 `Description` 作为副标题显示;开启计数时统一追加 `x 项`,禁止继续显示 `x 个字段`。运行时动态显隐字段后必须重算计数,已有数字角标配置继续生效,不能被静态字段数覆盖。
|
|
151
|
+
- 分组/Tab 的字段计数必须基于字段原始可见性(如 `_baseIsShow`),不能把“当前因折叠而隐藏”误判成不可见,否则收起后的分组会错误显示 `0 项`。
|
|
152
152
|
- 表级分组方向完整支持 `TabsPosition=left/top/right/bottom`;每个方向都要检查标题、副标题、动态角标和选中指示线,纵向指示线端点固定为直角。
|
|
153
153
|
- 修改 `diy_table.Tabs` 或 `diy_field.Tab` / `Config.CollapseGroup` / `Config.FieldTabs` 后,必须调用 `microi_refresh_schema_cache`。
|
|
154
154
|
- Tab 内嵌套 CollapseGroup 时,CollapseGroup 必须设 `DefaultCollapsed=true`(默认收起),避免 Tab 内继续被折叠分组抢首屏空间。
|