@microi.net/cli 5.7.7 → 5.7.9
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/.workbuddy-plugin/marketplace.json +2 -2
- package/.workbuddy-plugin/plugin.json +1 -1
- package/LICENSE +21 -21
- package/README.md +71 -71
- package/assets/build-meta.json +6 -6
- package/assets/feature-matrix.json +138 -138
- package/assets/logo.svg +4 -4
- package/cordis.patch.yml +1 -1
- package/package.json +1 -1
- package/scripts/mcp-codex-stdio-adapter.js +0 -0
- package/scripts/mcp-server.js +102 -101
- package/scripts/microi-cli.js +57 -57
- package/scripts/microi-codex-broker.js +450 -450
- package/scripts/microi-codex-router.js +0 -0
- package/scripts/microi-skills.meta.json +366 -366
- package/skills/.microi-skills-version.json +2 -2
- package/skills/.progressive-disclosure-manifest.json +27 -27
- package/skills/README.md +286 -286
- package/skills/ai-engine/SKILL.md +265 -265
- package/skills/ai-engine/agents/openai.yaml +4 -4
- 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 +392 -396
- package/skills/app-store/agents/openai.yaml +4 -4
- package/skills/business-blueprint/SKILL.md +193 -193
- package/skills/datasource-engine/SKILL.md +90 -90
- package/skills/datasource-engine/agents/openai.yaml +4 -4
- package/skills/dos-orm/references/api-reference.md +229 -229
- package/skills/email-engine/SKILL.md +78 -78
- package/skills/email-engine/references/v8-email.md +34 -34
- package/skills/job-engine/SKILL.md +171 -172
- package/skills/job-engine/agents/openai.yaml +4 -4
- package/skills/message-notification/SKILL.md +155 -156
- 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 -106
- 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 +235 -240
- 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 +144 -144
- 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 +196 -196
- 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 +167 -167
- package/skills/microi-codex/SKILL.md +75 -75
- package/skills/microi-codex-installer/SKILL.md +225 -223
- package/skills/microi-codex-installer/agents/openai.yaml +7 -7
- package/skills/microi-datasource-mapping/SKILL.md +107 -111
- package/skills/microi-db-schema/SKILL.md +175 -175
- package/skills/microi-db-schema/agents/openai.yaml +4 -4
- package/skills/microi-db-schema/references/core-tables.md +695 -695
- package/skills/microi-db-schema/references/form-component-options.md +256 -256
- package/skills/microi-db-schema/references/schema-overview.md +202 -202
- package/skills/microi-db-schema/references/schema.md +646 -646
- package/skills/microi-db-schema/references/table-catalog.md +1599 -1599
- package/skills/microi-deployment/references/deployment-matrix.md +101 -101
- package/skills/microi-docs-coverage/references/capability-map.md +0 -1
- package/skills/microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs +894 -894
- package/skills/microi-form-engine/SKILL.md +226 -226
- package/skills/microi-form-engine/references/component-catalog.md +216 -216
- package/skills/microi-form-engine/references/data-source-events.md +124 -124
- package/skills/microi-form-layout/SKILL.md +205 -205
- 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 +188 -188
- 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 +176 -176
- package/skills/microi-left-right-layout/SKILL.md +141 -141
- package/skills/microi-microservice/SKILL.md +322 -323
- package/skills/microi-microservice/references/runtime-delivery.md +278 -278
- package/skills/microi-mobile-app-quality/SKILL.md +181 -181
- 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-mobile-app-quality/references/progressive-02-9-/344/270/273/351/242/230/345/210/207/346/215/242/345/277/205/351/241/273/347/234/237/345/256/236/344/270/224/345/205/250/345/261/200/347/224/237/346/225/210.md +128 -128
- 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/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/SKILL.md +134 -134
- package/skills/microi-system-delivery/references/progressive-01-/346/240/207/345/207/206/345/267/245/344/275/234/346/265/201.md +193 -193
- 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 +189 -189
- package/skills/microi-ui/SKILL.md +174 -174
- package/skills/microi-ui/references/progressive-01-/347/247/273/345/212/250/347/253/257/345/234/272/346/231/257/350/223/235/345/233/276.md +183 -183
- package/skills/microi-uniapp-frontend/SKILL.md +193 -193
- 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 +225 -225
- 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 +154 -154
- package/skills/microi.v8.js +1921 -1921
- package/skills/module-engine/SKILL.md +237 -250
- package/skills/module-engine/references/module-config.md +204 -204
- package/skills/ocr-engine/SKILL.md +113 -113
- package/skills/ocr-engine/agents/openai.yaml +4 -4
- package/skills/page-engine/SKILL.md +180 -191
- 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 +234 -234
- 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 +60 -60
- package/skills/performance-testing/SKILL.md +221 -221
- package/skills/playwright-e2e/SKILL.md +197 -197
- 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 +173 -173
- 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 +183 -183
- package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +221 -221
- package/skills/playwright-e2e/references/progressive-04-ci-/345/273/272/350/256/256.md +115 -115
- package/skills/print-engine/SKILL.md +259 -259
- package/skills/production-readonly-audit/SKILL.md +41 -41
- package/skills/report-engine/SKILL.md +71 -71
- package/skills/report-engine/agents/openai.yaml +4 -4
- package/skills/scripts/optimize-progressive-disclosure.mjs +204 -204
- package/skills/scripts/refresh-progressive-disclosure.mjs +64 -64
- package/skills/search-engine/SKILL.md +75 -75
- package/skills/search-engine/agents/openai.yaml +4 -4
- package/skills/spider-engine/SKILL.md +190 -190
- package/skills/system-observability/SKILL.md +238 -238
- package/skills/system-observability/references/memory-incident-triage.md +70 -70
- package/skills/translate-engine/SKILL.md +140 -140
- package/skills/translate-engine/agents/openai.yaml +4 -4
- package/skills/ui-design/SKILL.md +191 -191
- package/skills/ui-design/assets/templates/MCI-DESIGN.md +198 -198
- package/skills/ui-design/references/design-pattern-library.md +184 -184
- package/skills/ui-design/references/mci-design-contract.md +163 -163
- package/skills/ui-design/references/progressive-01-/351/242/234/350/211/262/344/275/223/347/263/273-css-variables-/346/224/257/346/214/201/344/270/273/351/242/230/345/210/207/346/215/242.md +218 -218
- package/skills/ui-design/references/progressive-02-/345/255/227/344/275/223.md +137 -137
- package/skills/ui-design/references/progressive-03-/345/212/250/346/225/210/350/247/204/350/214/203-/344/270/260/345/257/214/344/275/206/344/270/215/345/215/241.md +235 -235
- package/skills/ui-design/references/progressive-04-/347/273/204/344/273/266/351/243/216/346/240/274/351/200/237/346/237/245.md +152 -152
- package/skills/ui-design/references/progressive-05-/347/247/273/345/212/250/347/253/257/344/270/223/347/224/250/350/247/204/350/214/203.md +238 -238
- package/skills/ui-design/references/progressive-06-/344/270/273/351/242/230/345/210/207/346/215/242/345/256/236/347/216/260.md +194 -194
- package/skills/ui-design/references/progressive-07-/351/200/237/346/237/245-/344/273/216/345/244/264/346/220/255/345/273/272/344/270/200/344/270/252/347/247/273/345/212/250/347/253/257/351/241/265/351/235/242.md +207 -207
- package/skills/ui-design/references/progressive-08-/350/241/250/345/215/225/345/210/206/347/273/204/350/247/204/350/214/203-tabs-vs-collapsegroup-/345/274/272/345/210/266.md +117 -117
- package/skills/uniapp-mall-assets/SKILL.md +176 -176
- 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-cache-pattern/SKILL.md +306 -306
- package/skills/v8-crud-api/SKILL.md +175 -175
- 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 +226 -226
- package/skills/v8-crud-api/references/progressive-02-where-/346/235/241/344/273/266/350/257/255/346/263/225/351/200/237/346/237/245.md +49 -49
- package/skills/v8-debugging/SKILL.md +284 -284
- package/skills/v8-explorer-tree/SKILL.md +228 -228
- package/skills/v8-export-import/SKILL.md +209 -209
- 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 +211 -211
- package/skills/v8-export-import/references/progressive-02-powerpoint-/345/257/274/345/207/272.md +202 -202
- 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 +42 -42
- package/skills/v8-file-upload/SKILL.md +256 -263
- 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 +101 -101
- 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 +150 -150
- package/skills/v8-formengine-http/SKILL.md +219 -219
- package/skills/v8-frontend-events/SKILL.md +178 -178
- package/skills/v8-frontend-events/references/bluetooth-print-api.md +135 -135
- package/skills/v8-frontend-events/references/bluetooth-print.md +246 -246
- package/skills/v8-frontend-events/references/progressive-01-/345/210/227/350/241/250/344/272/213/344/273/266.md +219 -219
- package/skills/v8-http-integration/SKILL.md +182 -182
- package/skills/v8-http-integration/references/progressive-01-get-/350/257/267/346/261/202.md +220 -220
- 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 +44 -44
- 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 +180 -180
- package/skills/v8-menu-buttons/references/progressive-01-2-/346/214/211/351/222/256/345/257/271/350/261/241-schema.md +222 -222
- 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 +104 -104
- package/skills/v8-mongodb/SKILL.md +192 -192
- package/skills/v8-mq-mqtt/SKILL.md +175 -176
- 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 +181 -181
- package/skills/v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs +203 -203
- package/skills/v8-saas-multi-tenant/SKILL.md +219 -219
- package/skills/v8-security/SKILL.md +168 -168
- package/skills/v8-security/references/progressive-01-2-/346/235/203/351/231/220/346/240/241/351/252/214.md +198 -198
- package/skills/v8-security/references/progressive-02-7-/346/227/245/345/277/227/350/256/260/345/275/225.md +158 -158
- package/skills/v8-sql-query/SKILL.md +302 -302
- package/skills/v8-table-event/SKILL.md +144 -144
- 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 +197 -197
- 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 +46 -46
- package/skills/v8-tcp-integration/SKILL.md +147 -147
- package/skills/v8-tcp-integration/agents/openai.yaml +4 -4
- package/skills/v8-template-engine/SKILL.md +167 -167
- package/skills/v8-utilities/SKILL.md +90 -90
- 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 +188 -188
- package/skills/v8-workflow/SKILL.md +216 -243
- package/skills/v8-workflow/references/progressive-01-/350/212/202/347/202/271/345/274/200/345/247/213-v8-/344/272/213/344/273/266.md +180 -180
- package/skills/vision-engine/SKILL.md +159 -159
- package/skills/vision-engine/agents/openai.yaml +4 -4
- package/skills/vision-engine/references/architecture-and-acceptance.md +194 -194
- package/skills/workspace-conventions/SKILL.md +261 -261
- 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 +216 -216
- 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 +27 -27
|
@@ -1,186 +1,186 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: v8-menu-buttons
|
|
3
|
-
description: Microi 菜单按钮与 Tab V8 指南。用于配置 sys_menu MoreBtns、FormBtns、BatchSelectMoreBtns、PageTabs、PageBtns、ExportMoreBtns、显隐代码和行操作。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
> **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
|
|
7
|
-
|
|
8
|
-
# v8-menu-buttons — 菜单按钮 / Tab / 批量操作 V8 写法
|
|
9
|
-
|
|
10
|
-
> 适用于 sys_menu 表的 MoreBtns、FormBtns、BatchSelectMoreBtns、PageTabs、ExportMoreBtns、PageBtns 字段。
|
|
11
|
-
> 这些字段统一存为 **JSON 字符串**(数组),每个数组元素是一个按钮/Tab 对象。
|
|
12
|
-
> AI 通过 MCP `microi_create_module` 创建菜单时应**主动**传入这些字段,业务系统才"活"。
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
<!-- microi-progressive:begin -->
|
|
17
|
-
<!-- microi-progressive:chunk id=v8-menu-buttons-000 sha256=9ed7af82b50d25263818ad4b1ec1b5c6290d9d4a5a8cdc7f046440c0e6a0a1ff -->
|
|
18
|
-
## 1. 字段总览
|
|
19
|
-
|
|
20
|
-
| 字段 | 渲染位置 | 必填项 |
|
|
21
|
-
|------|---------|--------|
|
|
22
|
-
| `MoreBtns` | 列表每行尾的"…更多"操作 | `Id, Name, V8Code`,建议 `ShowRow:true` |
|
|
23
|
-
| `FormBtns` | 表单右上角 / 移动端 FAB | `Id, Name, V8Code` |
|
|
24
|
-
| `BatchSelectMoreBtns` | 列表勾选多行后顶部出现 | `Id, Name, V8Code`,按钮里用 `V8.TableRowSelected` 取选中行 |
|
|
25
|
-
| `PageTabs` | 列表页模块 Hero 下方的页签切换 | `Id, Name`,当前模块筛选用 `V8Code`;跨模块切换用 `TargetSysMenuId` |
|
|
26
|
-
| `ExportMoreBtns` | 列表"导出"下拉的扩展 | `Id, Name, V8Code` |
|
|
27
|
-
| `PageBtns` | 页面级顶部按钮 | `Id, Name, V8Code` |
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
<!-- /microi-progressive:chunk -->
|
|
32
|
-
<!-- microi-progressive:chunk id=v8-menu-buttons-001 sha256=21a4d64e3ddf27766ecf2325a8af935c3b6e3134c4fa4df484ace9f1f356de6c -->
|
|
33
|
-
## 3. 模式 A:弹窗收集参数 → 调接口引擎(最常用)
|
|
34
|
-
|
|
35
|
-
```js
|
|
36
|
-
V8.OpenAnyForm({
|
|
37
|
-
TableName: 'Diy_Order',
|
|
38
|
-
DialogType: 'Dialog',
|
|
39
|
-
Id: V8.Form.Id,
|
|
40
|
-
FormMode: 'Edit',
|
|
41
|
-
SelectFields: ['AssigneeId', 'AssigneeName', 'AssignTime'], // 只显示这几个字段
|
|
42
|
-
Width: '600px',
|
|
43
|
-
EventReplace: {
|
|
44
|
-
// 替换默认提交:改为调用业务接口引擎
|
|
45
|
-
Submit: async function (v8, param, callback) {
|
|
46
|
-
var result = await V8.ApiEngine.Run({
|
|
47
|
-
ApiEngineKey: 'order_assign',
|
|
48
|
-
Id: v8.Form.Id,
|
|
49
|
-
AssigneeId: v8.Form.AssigneeId,
|
|
50
|
-
AssigneeName: v8.Form.AssigneeName
|
|
51
|
-
});
|
|
52
|
-
callback(result); // 必须 callback
|
|
53
|
-
V8.RefreshTable({ _PageIndex: 1 });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
<!-- /microi-progressive:chunk -->
|
|
60
|
-
<!-- microi-progressive:chunk id=v8-menu-buttons-002 sha256=911b9cddbd448bb27d39d0de93274b0f67622e0b61026267d13300297931f34a -->
|
|
61
|
-
## 4. 模式 B:直接确认 + 接口调用
|
|
62
|
-
|
|
63
|
-
`ConfirmTips` 使用 HTML 模式渲染内容,只传固定文案或经过 HTML 转义的简单文本;不要拼接用户输入、接口消息或数据库富文本。
|
|
64
|
-
|
|
65
|
-
```js
|
|
66
|
-
V8.ConfirmTips('确认领取该任务?', function () {
|
|
67
|
-
V8.ApiEngine.Run({
|
|
68
|
-
ApiEngineKey: 'order_take',
|
|
69
|
-
Id: V8.Form.Id
|
|
70
|
-
}, function (r) {
|
|
71
|
-
if (r.Code == 1) V8.Tips('领取成功', true);
|
|
72
|
-
else V8.Tips(r.Msg || '失败', false);
|
|
73
|
-
V8.RefreshTable({ _PageIndex: 1 });
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
<!-- /microi-progressive:chunk -->
|
|
79
|
-
<!-- microi-progressive:chunk id=v8-menu-buttons-003 sha256=b58b1c9990f905a0b65bb72c472461bb46ce22eb1f5c73bec68938a162bdcb55 -->
|
|
80
|
-
## 4.1 模式 B2:在线微服务定制页(OpenAppDialog)
|
|
81
|
-
|
|
82
|
-
当弹窗包含复杂布局、多步骤交互、实时校验或后续需要 AI 在线维护时,优先把页面实现为在线微服务,按钮 V8 代码只负责打开页面、传入上下文和接收结果。不要把长篇 HTML/CSS 写进 `V8Code`。
|
|
83
|
-
|
|
84
|
-
```js
|
|
85
|
-
V8.OpenAppDialog({
|
|
86
|
-
AppKey: 'order_batch_processor',
|
|
87
|
-
RoutePath: '/execute',
|
|
88
|
-
Title: '批量处理订单',
|
|
89
|
-
TitleIcon: 'fas fa-layer-group',
|
|
90
|
-
Width: 'min(960px, calc(100vw - 32px))',
|
|
91
|
-
OpenType: 'Dialog',
|
|
92
|
-
Data: {
|
|
93
|
-
ids: (V8.TableRowSelected || []).map(function (row) { return row.Id; }),
|
|
94
|
-
source: 'order-list'
|
|
95
|
-
},
|
|
96
|
-
OnSuccess: function (data) {
|
|
97
|
-
V8.Tips(data.message || '处理成功', true);
|
|
98
|
-
V8.RefreshTable({ _PageIndex: -1 });
|
|
99
|
-
},
|
|
100
|
-
OnCancel: function () {},
|
|
101
|
-
OnError: function (error) {
|
|
102
|
-
V8.Tips(error.message || '应用执行失败', false);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
参数规则:
|
|
108
|
-
|
|
109
|
-
| 参数 | 必传 | 默认值 | 用法 |
|
|
110
|
-
|------|------|--------|------|
|
|
111
|
-
| `AppKey` | 是 | - | `sys_microiservice.MsKey`,目标微服务必须已经编译发布。 |
|
|
112
|
-
| `RoutePath` | 否 | `/` | 子应用内部路由;`MicroRoute` 是兼容别名,优先取 `RoutePath`。 |
|
|
113
|
-
| `Version` | 否 | 当前 `BuildVersion` | 固定加载某个发布版本;通常省略以使用当前版本。 |
|
|
1
|
+
---
|
|
2
|
+
name: v8-menu-buttons
|
|
3
|
+
description: Microi 菜单按钮与 Tab V8 指南。用于配置 sys_menu MoreBtns、FormBtns、BatchSelectMoreBtns、PageTabs、PageBtns、ExportMoreBtns、显隐代码和行操作。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
|
|
7
|
+
|
|
8
|
+
# v8-menu-buttons — 菜单按钮 / Tab / 批量操作 V8 写法
|
|
9
|
+
|
|
10
|
+
> 适用于 sys_menu 表的 MoreBtns、FormBtns、BatchSelectMoreBtns、PageTabs、ExportMoreBtns、PageBtns 字段。
|
|
11
|
+
> 这些字段统一存为 **JSON 字符串**(数组),每个数组元素是一个按钮/Tab 对象。
|
|
12
|
+
> AI 通过 MCP `microi_create_module` 创建菜单时应**主动**传入这些字段,业务系统才"活"。
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
<!-- microi-progressive:begin -->
|
|
17
|
+
<!-- microi-progressive:chunk id=v8-menu-buttons-000 sha256=9ed7af82b50d25263818ad4b1ec1b5c6290d9d4a5a8cdc7f046440c0e6a0a1ff -->
|
|
18
|
+
## 1. 字段总览
|
|
19
|
+
|
|
20
|
+
| 字段 | 渲染位置 | 必填项 |
|
|
21
|
+
|------|---------|--------|
|
|
22
|
+
| `MoreBtns` | 列表每行尾的"…更多"操作 | `Id, Name, V8Code`,建议 `ShowRow:true` |
|
|
23
|
+
| `FormBtns` | 表单右上角 / 移动端 FAB | `Id, Name, V8Code` |
|
|
24
|
+
| `BatchSelectMoreBtns` | 列表勾选多行后顶部出现 | `Id, Name, V8Code`,按钮里用 `V8.TableRowSelected` 取选中行 |
|
|
25
|
+
| `PageTabs` | 列表页模块 Hero 下方的页签切换 | `Id, Name`,当前模块筛选用 `V8Code`;跨模块切换用 `TargetSysMenuId` |
|
|
26
|
+
| `ExportMoreBtns` | 列表"导出"下拉的扩展 | `Id, Name, V8Code` |
|
|
27
|
+
| `PageBtns` | 页面级顶部按钮 | `Id, Name, V8Code` |
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
<!-- /microi-progressive:chunk -->
|
|
32
|
+
<!-- microi-progressive:chunk id=v8-menu-buttons-001 sha256=21a4d64e3ddf27766ecf2325a8af935c3b6e3134c4fa4df484ace9f1f356de6c -->
|
|
33
|
+
## 3. 模式 A:弹窗收集参数 → 调接口引擎(最常用)
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
V8.OpenAnyForm({
|
|
37
|
+
TableName: 'Diy_Order',
|
|
38
|
+
DialogType: 'Dialog',
|
|
39
|
+
Id: V8.Form.Id,
|
|
40
|
+
FormMode: 'Edit',
|
|
41
|
+
SelectFields: ['AssigneeId', 'AssigneeName', 'AssignTime'], // 只显示这几个字段
|
|
42
|
+
Width: '600px',
|
|
43
|
+
EventReplace: {
|
|
44
|
+
// 替换默认提交:改为调用业务接口引擎
|
|
45
|
+
Submit: async function (v8, param, callback) {
|
|
46
|
+
var result = await V8.ApiEngine.Run({
|
|
47
|
+
ApiEngineKey: 'order_assign',
|
|
48
|
+
Id: v8.Form.Id,
|
|
49
|
+
AssigneeId: v8.Form.AssigneeId,
|
|
50
|
+
AssigneeName: v8.Form.AssigneeName
|
|
51
|
+
});
|
|
52
|
+
callback(result); // 必须 callback
|
|
53
|
+
V8.RefreshTable({ _PageIndex: 1 });
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
<!-- /microi-progressive:chunk -->
|
|
60
|
+
<!-- microi-progressive:chunk id=v8-menu-buttons-002 sha256=911b9cddbd448bb27d39d0de93274b0f67622e0b61026267d13300297931f34a -->
|
|
61
|
+
## 4. 模式 B:直接确认 + 接口调用
|
|
62
|
+
|
|
63
|
+
`ConfirmTips` 使用 HTML 模式渲染内容,只传固定文案或经过 HTML 转义的简单文本;不要拼接用户输入、接口消息或数据库富文本。
|
|
64
|
+
|
|
65
|
+
```js
|
|
66
|
+
V8.ConfirmTips('确认领取该任务?', function () {
|
|
67
|
+
V8.ApiEngine.Run({
|
|
68
|
+
ApiEngineKey: 'order_take',
|
|
69
|
+
Id: V8.Form.Id
|
|
70
|
+
}, function (r) {
|
|
71
|
+
if (r.Code == 1) V8.Tips('领取成功', true);
|
|
72
|
+
else V8.Tips(r.Msg || '失败', false);
|
|
73
|
+
V8.RefreshTable({ _PageIndex: 1 });
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<!-- /microi-progressive:chunk -->
|
|
79
|
+
<!-- microi-progressive:chunk id=v8-menu-buttons-003 sha256=b58b1c9990f905a0b65bb72c472461bb46ce22eb1f5c73bec68938a162bdcb55 -->
|
|
80
|
+
## 4.1 模式 B2:在线微服务定制页(OpenAppDialog)
|
|
81
|
+
|
|
82
|
+
当弹窗包含复杂布局、多步骤交互、实时校验或后续需要 AI 在线维护时,优先把页面实现为在线微服务,按钮 V8 代码只负责打开页面、传入上下文和接收结果。不要把长篇 HTML/CSS 写进 `V8Code`。
|
|
83
|
+
|
|
84
|
+
```js
|
|
85
|
+
V8.OpenAppDialog({
|
|
86
|
+
AppKey: 'order_batch_processor',
|
|
87
|
+
RoutePath: '/execute',
|
|
88
|
+
Title: '批量处理订单',
|
|
89
|
+
TitleIcon: 'fas fa-layer-group',
|
|
90
|
+
Width: 'min(960px, calc(100vw - 32px))',
|
|
91
|
+
OpenType: 'Dialog',
|
|
92
|
+
Data: {
|
|
93
|
+
ids: (V8.TableRowSelected || []).map(function (row) { return row.Id; }),
|
|
94
|
+
source: 'order-list'
|
|
95
|
+
},
|
|
96
|
+
OnSuccess: function (data) {
|
|
97
|
+
V8.Tips(data.message || '处理成功', true);
|
|
98
|
+
V8.RefreshTable({ _PageIndex: -1 });
|
|
99
|
+
},
|
|
100
|
+
OnCancel: function () {},
|
|
101
|
+
OnError: function (error) {
|
|
102
|
+
V8.Tips(error.message || '应用执行失败', false);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
参数规则:
|
|
108
|
+
|
|
109
|
+
| 参数 | 必传 | 默认值 | 用法 |
|
|
110
|
+
|------|------|--------|------|
|
|
111
|
+
| `AppKey` | 是 | - | `sys_microiservice.MsKey`,目标微服务必须已经编译发布。 |
|
|
112
|
+
| `RoutePath` | 否 | `/` | 子应用内部路由;`MicroRoute` 是兼容别名,优先取 `RoutePath`。 |
|
|
113
|
+
| `Version` | 否 | 当前 `BuildVersion` | 固定加载某个发布版本;通常省略以使用当前版本。 |
|
|
114
114
|
| `Title` | 否 | `应用` | Dialog/Drawer 标题。 |
|
|
115
115
|
| `Header` | 否 | - | 初始外层标题栏 `{ title, tags, actions }`;仅可序列化文本和动作标识。 |
|
|
116
116
|
| `OnHeaderAction(actionId, V8)` | 否 | - | 可选调用方前端 V8 动作;不设置时由子应用处理按钮点击。 |
|
|
117
|
-
| `TitleIcon` | 否 | `fas fa-window-maximize` | 标题图标 class。 |
|
|
118
|
-
| `Width` | 否 | `min(920px, calc(100vw - 32px))` | CSS 宽度值,推荐带移动端安全边距。 |
|
|
119
|
-
| `OpenType` | 否 | `Dialog` | `Dialog` 或 `Drawer`。 |
|
|
120
|
-
| `Data` | 否 | `{}` | 业务参数,子应用从 `window.microApp.getData().dialogData` 获取;只放普通可序列化数据。 |
|
|
121
|
-
| `OnSuccess(data)` | 否 | - | 子应用成功回调,回调后自动关闭。 |
|
|
122
|
-
| `OnCancel(data)` | 否 | - | 子应用取消回调,回调后自动关闭。 |
|
|
123
|
-
| `OnError(error)` | 否 | - | 加载或执行错误回调,不自动关闭。 |
|
|
124
|
-
|
|
117
|
+
| `TitleIcon` | 否 | `fas fa-window-maximize` | 标题图标 class。 |
|
|
118
|
+
| `Width` | 否 | `min(920px, calc(100vw - 32px))` | CSS 宽度值,推荐带移动端安全边距。 |
|
|
119
|
+
| `OpenType` | 否 | `Dialog` | `Dialog` 或 `Drawer`。 |
|
|
120
|
+
| `Data` | 否 | `{}` | 业务参数,子应用从 `window.microApp.getData().dialogData` 获取;只放普通可序列化数据。 |
|
|
121
|
+
| `OnSuccess(data)` | 否 | - | 子应用成功回调,回调后自动关闭。 |
|
|
122
|
+
| `OnCancel(data)` | 否 | - | 子应用取消回调,回调后自动关闭。 |
|
|
123
|
+
| `OnError(error)` | 否 | - | 加载或执行错误回调,不自动关闭。 |
|
|
124
|
+
|
|
125
125
|
宿主还会自动传入 `apiBase`、`osClient`、`token`、`appKey`、`version`、`microRoute`、`dialog:true`。子应用返回协议:
|
|
126
126
|
|
|
127
127
|
宿主支持 `dialogHeaderBridge:true` 时,子应用可隐藏内部工具栏,使用 `window.microApp.forceDispatch({ type:'app-dialog:header', data:{ title:'单据号', tags:[{text:'待审核',tone:'warning'}], actions:[{id:'approve',text:'审核',tone:'success'}] } })` 更新外层标题栏。若未传 `OnHeaderAction`,宿主会把按钮点击作为 `host:dialog-action` 数据消息回传 `actionId/requestId`,子应用仍需向后端重新核验权限;旧宿主继续显示子应用自己的工具栏。
|
|
128
|
-
|
|
129
|
-
```js
|
|
130
|
-
window.microApp.dispatch({ type: 'app-dialog:success', data: { message: '已提交' } });
|
|
131
|
-
window.microApp.dispatch({ type: 'app-dialog:cancel', data: {} });
|
|
132
|
-
window.microApp.dispatch({ type: 'app-dialog:error', data: { message: '校验失败' } });
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
- `success` / `cancel` 会自动关闭,`error` 保持页面打开。
|
|
136
|
-
- 禁止把回调函数放进 `Data`;回调必须使用 `OnSuccess` / `OnCancel` / `OnError`。
|
|
137
|
-
- 不要把 Token 拼接到 URL;使用宿主自动下发的 `token`。
|
|
138
|
-
- `OpenAppDialog` 加载在线微服务;`OpenDialog` 加载 Microi.Client 内已注册的 Vue 组件,两者不要混用。
|
|
139
|
-
|
|
140
|
-
### 4.2 业务面板复用通用弹窗宿主
|
|
141
|
-
|
|
142
|
-
某个模块是否出现入口、入口名称、排序、图标和显隐规则属于 `sys_menu.MoreBtns` 配置,禁止在 `diy-table.vue`、卡片模板或通用 mixin 中按菜单 Id、Url、表名直接渲染业务按钮。主前端已有 Vue 面板时先全局注册组件,再用 `V8.OpenDialog`;独立发布、跨应用升级的页面用 `V8.OpenAppDialog`。禁止为单个业务面板扩展 `V8.Open<业务名>` 包装方法。
|
|
143
|
-
|
|
144
|
-
系统账号的访问密钥入口示例:
|
|
145
|
-
|
|
146
|
-
```js
|
|
147
|
-
// V8CodeShow
|
|
148
|
-
var currentUser = V8.CurrentUser || {};
|
|
149
|
-
var currentUserId = String(currentUser.Id || "").toLowerCase();
|
|
150
|
-
var targetUserId = String((V8.Form && V8.Form.Id) || "").toLowerCase();
|
|
151
|
-
V8.Result = typeof V8.OpenDialog === "function"
|
|
152
|
-
&& currentUser._AccessKeySession !== true
|
|
153
|
-
&& !!targetUserId
|
|
154
|
-
&& (currentUser._IsAdmin === true
|
|
155
|
-
|| Number(currentUser.Level || 0) >= 9999
|
|
156
|
-
|| currentUserId === targetUserId);
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
```js
|
|
160
|
-
// V8Code
|
|
161
|
-
var user = V8.Form || {};
|
|
162
|
-
V8.OpenDialog({
|
|
163
|
-
ComponentName: "UserAccessKeyPanel",
|
|
164
|
-
Title: "访问密钥 - " + (user.Name || user.Account || ""),
|
|
165
|
-
TitleIcon: "fas fa-key",
|
|
166
|
-
Width: "min(980px, calc(100vw - 32px))",
|
|
167
|
-
OpenType: "Dialog",
|
|
168
|
-
DataAppend: { User: user }
|
|
169
|
-
});
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
按钮应设置稳定 `Id`、`ShowRow:true`、`Icon:"fas fa-key"`。前端显隐只改善体验,创建、查询、吊销等接口仍必须在服务端重新校验普通登录会话以及本人/平台管理员权限。
|
|
173
|
-
|
|
174
|
-
复杂策略编辑器(例如角色 AI 数据权限)应把行按钮持久化到菜单 `MoreBtns`,按钮只通过
|
|
175
|
-
`V8.OpenDialog({ ComponentName, DataAppend })` 打开已注册的 Vue 组件。验收需同时回读菜单按钮 JSON、
|
|
176
|
-
确认组件进入生产构建,并在真实列表行打开弹层;只保留旧定制页面里的按钮不算低代码菜单已迁移。
|
|
177
|
-
|
|
178
|
-
<!-- /microi-progressive:chunk -->
|
|
179
|
-
## 详细参考路由(渐进披露)
|
|
180
|
-
|
|
181
|
-
仅在当前任务涉及对应主题时读取;下列文件合计保留了原 SKILL.md 的全部详细知识。
|
|
182
|
-
|
|
183
|
-
- [references/progressive-01-2-按钮对象-schema.md](references/progressive-01-2-按钮对象-schema.md):2. 按钮对象 Schema;5. 模式 C:状态机推进(无需弹窗);6. 模式 D:批量操作(BatchSelectMoreBtns);7. 模式 E:PageTabs 切换筛选
|
|
184
|
-
- [references/progressive-02-8-模式-f-后台任务按钮-长任务.md](references/progressive-02-8-模式-f-后台任务按钮-长任务.md):8. 模式 F:后台任务按钮(长任务);9. 通过 MCP 创建菜单 + 按钮(一次到位);前端 FormEngine 权限与兼容;10. 与接口引擎配套的工作流;10.1 后台直充/调账类行按钮
|
|
185
|
-
- [references/progressive-03-10-反模式-避免.md](references/progressive-03-10-反模式-避免.md):10. 反模式(避免);10.2 复杂定制弹窗必须使用微服务;11. ⚠️ `V8.CurrentUser` 拿不到的历史陷阱(必看)
|
|
186
|
-
<!-- microi-progressive:end -->
|
|
128
|
+
|
|
129
|
+
```js
|
|
130
|
+
window.microApp.dispatch({ type: 'app-dialog:success', data: { message: '已提交' } });
|
|
131
|
+
window.microApp.dispatch({ type: 'app-dialog:cancel', data: {} });
|
|
132
|
+
window.microApp.dispatch({ type: 'app-dialog:error', data: { message: '校验失败' } });
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
- `success` / `cancel` 会自动关闭,`error` 保持页面打开。
|
|
136
|
+
- 禁止把回调函数放进 `Data`;回调必须使用 `OnSuccess` / `OnCancel` / `OnError`。
|
|
137
|
+
- 不要把 Token 拼接到 URL;使用宿主自动下发的 `token`。
|
|
138
|
+
- `OpenAppDialog` 加载在线微服务;`OpenDialog` 加载 Microi.Client 内已注册的 Vue 组件,两者不要混用。
|
|
139
|
+
|
|
140
|
+
### 4.2 业务面板复用通用弹窗宿主
|
|
141
|
+
|
|
142
|
+
某个模块是否出现入口、入口名称、排序、图标和显隐规则属于 `sys_menu.MoreBtns` 配置,禁止在 `diy-table.vue`、卡片模板或通用 mixin 中按菜单 Id、Url、表名直接渲染业务按钮。主前端已有 Vue 面板时先全局注册组件,再用 `V8.OpenDialog`;独立发布、跨应用升级的页面用 `V8.OpenAppDialog`。禁止为单个业务面板扩展 `V8.Open<业务名>` 包装方法。
|
|
143
|
+
|
|
144
|
+
系统账号的访问密钥入口示例:
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
// V8CodeShow
|
|
148
|
+
var currentUser = V8.CurrentUser || {};
|
|
149
|
+
var currentUserId = String(currentUser.Id || "").toLowerCase();
|
|
150
|
+
var targetUserId = String((V8.Form && V8.Form.Id) || "").toLowerCase();
|
|
151
|
+
V8.Result = typeof V8.OpenDialog === "function"
|
|
152
|
+
&& currentUser._AccessKeySession !== true
|
|
153
|
+
&& !!targetUserId
|
|
154
|
+
&& (currentUser._IsAdmin === true
|
|
155
|
+
|| Number(currentUser.Level || 0) >= 9999
|
|
156
|
+
|| currentUserId === targetUserId);
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```js
|
|
160
|
+
// V8Code
|
|
161
|
+
var user = V8.Form || {};
|
|
162
|
+
V8.OpenDialog({
|
|
163
|
+
ComponentName: "UserAccessKeyPanel",
|
|
164
|
+
Title: "访问密钥 - " + (user.Name || user.Account || ""),
|
|
165
|
+
TitleIcon: "fas fa-key",
|
|
166
|
+
Width: "min(980px, calc(100vw - 32px))",
|
|
167
|
+
OpenType: "Dialog",
|
|
168
|
+
DataAppend: { User: user }
|
|
169
|
+
});
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
按钮应设置稳定 `Id`、`ShowRow:true`、`Icon:"fas fa-key"`。前端显隐只改善体验,创建、查询、吊销等接口仍必须在服务端重新校验普通登录会话以及本人/平台管理员权限。
|
|
173
|
+
|
|
174
|
+
复杂策略编辑器(例如角色 AI 数据权限)应把行按钮持久化到菜单 `MoreBtns`,按钮只通过
|
|
175
|
+
`V8.OpenDialog({ ComponentName, DataAppend })` 打开已注册的 Vue 组件。验收需同时回读菜单按钮 JSON、
|
|
176
|
+
确认组件进入生产构建,并在真实列表行打开弹层;只保留旧定制页面里的按钮不算低代码菜单已迁移。
|
|
177
|
+
|
|
178
|
+
<!-- /microi-progressive:chunk -->
|
|
179
|
+
## 详细参考路由(渐进披露)
|
|
180
|
+
|
|
181
|
+
仅在当前任务涉及对应主题时读取;下列文件合计保留了原 SKILL.md 的全部详细知识。
|
|
182
|
+
|
|
183
|
+
- [references/progressive-01-2-按钮对象-schema.md](references/progressive-01-2-按钮对象-schema.md):2. 按钮对象 Schema;5. 模式 C:状态机推进(无需弹窗);6. 模式 D:批量操作(BatchSelectMoreBtns);7. 模式 E:PageTabs 切换筛选
|
|
184
|
+
- [references/progressive-02-8-模式-f-后台任务按钮-长任务.md](references/progressive-02-8-模式-f-后台任务按钮-长任务.md):8. 模式 F:后台任务按钮(长任务);9. 通过 MCP 创建菜单 + 按钮(一次到位);前端 FormEngine 权限与兼容;10. 与接口引擎配套的工作流;10.1 后台直充/调账类行按钮
|
|
185
|
+
- [references/progressive-03-10-反模式-避免.md](references/progressive-03-10-反模式-避免.md):10. 反模式(避免);10.2 复杂定制弹窗必须使用微服务;11. ⚠️ `V8.CurrentUser` 拿不到的历史陷阱(必看)
|
|
186
|
+
<!-- microi-progressive:end -->
|