@microi.net/cli 5.7.8 → 5.8.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.
Files changed (189) hide show
  1. package/.codebuddy-plugin/marketplace.json +2 -2
  2. package/.codebuddy-plugin/plugin.json +1 -1
  3. package/.codex-plugin/plugin.json +1 -1
  4. package/.workbuddy-plugin/marketplace.json +2 -2
  5. package/.workbuddy-plugin/plugin.json +1 -1
  6. package/LICENSE +21 -21
  7. package/README.md +71 -71
  8. package/assets/build-meta.json +6 -6
  9. package/assets/feature-matrix.json +138 -138
  10. package/assets/logo.svg +4 -4
  11. package/cordis.patch.yml +1 -1
  12. package/package.json +1 -1
  13. package/scripts/mcp-codex-stdio-adapter.js +0 -0
  14. package/scripts/mcp-server.js +113 -112
  15. package/scripts/microi-cli.js +57 -57
  16. package/scripts/microi-codex-broker.js +450 -450
  17. package/scripts/microi-codex-router.js +0 -0
  18. package/scripts/microi-skills.meta.json +364 -364
  19. package/skills/.microi-skills-version.json +2 -2
  20. package/skills/README.md +286 -286
  21. package/skills/ai-engine/SKILL.md +265 -265
  22. package/skills/ai-engine/agents/openai.yaml +4 -4
  23. package/skills/ai-platform-governance/SKILL.md +177 -177
  24. package/skills/ai-platform-governance/references/progressive-01-/345/212/237/350/203/275/345/274/200/345/205/263.md +190 -190
  25. package/skills/app-store/SKILL.md +396 -396
  26. package/skills/app-store/agents/openai.yaml +4 -4
  27. package/skills/business-blueprint/SKILL.md +193 -193
  28. package/skills/datasource-engine/SKILL.md +90 -90
  29. package/skills/datasource-engine/agents/openai.yaml +4 -4
  30. package/skills/dos-orm/references/api-reference.md +229 -229
  31. package/skills/email-engine/SKILL.md +78 -78
  32. package/skills/email-engine/references/v8-email.md +34 -34
  33. package/skills/job-engine/SKILL.md +172 -172
  34. package/skills/job-engine/agents/openai.yaml +4 -4
  35. package/skills/message-notification/SKILL.md +156 -156
  36. package/skills/message-notification/agents/openai.yaml +5 -5
  37. package/skills/message-notification/references/contracts.md +102 -102
  38. package/skills/microi-ai-app-auth.js +652 -652
  39. package/skills/microi-ai-application/SKILL.md +106 -106
  40. package/skills/microi-ai-application/agents/openai.yaml +4 -4
  41. package/skills/microi-ai-application/references/frontend-baseline.md +164 -164
  42. package/skills/microi-client-frontend/SKILL.md +237 -237
  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 +144 -144
  44. 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
  45. 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
  46. package/skills/microi-codex/SKILL.md +72 -70
  47. package/skills/microi-codex-installer/SKILL.md +225 -223
  48. package/skills/microi-codex-installer/agents/openai.yaml +7 -7
  49. package/skills/microi-datasource-mapping/SKILL.md +108 -108
  50. package/skills/microi-db-schema/SKILL.md +175 -175
  51. package/skills/microi-db-schema/agents/openai.yaml +4 -4
  52. package/skills/microi-db-schema/references/core-tables.md +695 -695
  53. package/skills/microi-db-schema/references/form-component-options.md +256 -256
  54. package/skills/microi-db-schema/references/schema-overview.md +202 -202
  55. package/skills/microi-db-schema/references/schema.md +646 -646
  56. package/skills/microi-db-schema/references/table-catalog.md +1599 -1599
  57. package/skills/microi-deployment/references/deployment-matrix.md +101 -101
  58. package/skills/microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs +894 -894
  59. package/skills/microi-form-engine/SKILL.md +226 -226
  60. package/skills/microi-form-engine/references/component-catalog.md +216 -216
  61. package/skills/microi-form-engine/references/data-source-events.md +124 -124
  62. package/skills/microi-form-layout/SKILL.md +205 -205
  63. 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
  64. package/skills/microi-frontend-sdk/SKILL.md +188 -188
  65. 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
  66. package/skills/microi-left-right-layout/SKILL.md +141 -141
  67. package/skills/microi-microservice/SKILL.md +323 -323
  68. package/skills/microi-microservice/references/runtime-delivery.md +278 -278
  69. package/skills/microi-mobile-app-quality/SKILL.md +181 -181
  70. 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
  71. 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
  72. package/skills/microi-solution-quotation/SKILL.md +78 -78
  73. package/skills/microi-solution-quotation/agents/openai.yaml +4 -4
  74. package/skills/microi-solution-quotation/scripts/build_solution_quote.py +296 -296
  75. package/skills/microi-sso/references/acceptance.md +49 -49
  76. package/skills/microi-sso/references/configuration-and-security.md +53 -53
  77. package/skills/microi-sso/references/inbound.md +53 -53
  78. package/skills/microi-sso/references/outbound.md +39 -39
  79. package/skills/microi-system-delivery/SKILL.md +134 -134
  80. 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
  81. 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
  82. package/skills/microi-ui/SKILL.md +174 -174
  83. 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
  84. package/skills/microi-uniapp-frontend/SKILL.md +193 -193
  85. 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
  86. 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
  87. package/skills/microi.v8.js +1921 -1921
  88. package/skills/module-engine/SKILL.md +250 -250
  89. package/skills/module-engine/references/module-config.md +204 -204
  90. package/skills/ocr-engine/SKILL.md +113 -113
  91. package/skills/ocr-engine/agents/openai.yaml +4 -4
  92. package/skills/page-engine/SKILL.md +182 -182
  93. 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
  94. 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
  95. package/skills/performance-testing/SKILL.md +221 -221
  96. package/skills/playwright-e2e/SKILL.md +197 -197
  97. 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
  98. 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
  99. package/skills/playwright-e2e/references/progressive-03-microi-helper-/346/250/241/346/235/277.md +221 -221
  100. package/skills/playwright-e2e/references/progressive-04-ci-/345/273/272/350/256/256.md +115 -115
  101. package/skills/print-engine/SKILL.md +259 -259
  102. package/skills/production-readonly-audit/SKILL.md +41 -41
  103. package/skills/report-engine/SKILL.md +71 -71
  104. package/skills/report-engine/agents/openai.yaml +4 -4
  105. package/skills/scripts/optimize-progressive-disclosure.mjs +204 -204
  106. package/skills/scripts/refresh-progressive-disclosure.mjs +64 -64
  107. package/skills/search-engine/SKILL.md +75 -75
  108. package/skills/search-engine/agents/openai.yaml +4 -4
  109. package/skills/spider-engine/SKILL.md +190 -190
  110. package/skills/system-observability/SKILL.md +238 -238
  111. package/skills/system-observability/references/memory-incident-triage.md +70 -70
  112. package/skills/translate-engine/SKILL.md +140 -140
  113. package/skills/translate-engine/agents/openai.yaml +4 -4
  114. package/skills/ui-design/SKILL.md +191 -191
  115. package/skills/ui-design/assets/templates/MCI-DESIGN.md +198 -198
  116. package/skills/ui-design/references/design-pattern-library.md +184 -184
  117. package/skills/ui-design/references/mci-design-contract.md +163 -163
  118. 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
  119. package/skills/ui-design/references/progressive-02-/345/255/227/344/275/223.md +137 -137
  120. 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
  121. 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
  122. 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
  123. 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
  124. 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
  125. 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
  126. package/skills/uniapp-mall-assets/SKILL.md +176 -176
  127. package/skills/unity-integration/SKILL.md +155 -155
  128. package/skills/unity-integration/agents/openai.yaml +4 -4
  129. package/skills/unity-integration/references/ai-app-delivery.md +103 -103
  130. package/skills/unity-integration/references/sdk-api.md +82 -82
  131. package/skills/unity-integration/references/toolbox-migration.md +66 -66
  132. package/skills/unity-integration/references/webgl-hosting.md +57 -57
  133. package/skills/v8-cache-pattern/SKILL.md +306 -306
  134. package/skills/v8-crud-api/SKILL.md +175 -175
  135. 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
  136. 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
  137. package/skills/v8-debugging/SKILL.md +284 -284
  138. package/skills/v8-explorer-tree/SKILL.md +228 -228
  139. package/skills/v8-export-import/SKILL.md +209 -209
  140. 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
  141. package/skills/v8-export-import/references/progressive-02-powerpoint-/345/257/274/345/207/272.md +202 -202
  142. 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
  143. package/skills/v8-file-upload/SKILL.md +263 -263
  144. 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
  145. 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
  146. package/skills/v8-formengine-http/SKILL.md +219 -219
  147. package/skills/v8-frontend-events/SKILL.md +178 -178
  148. package/skills/v8-frontend-events/references/bluetooth-print-api.md +135 -135
  149. package/skills/v8-frontend-events/references/bluetooth-print.md +246 -246
  150. package/skills/v8-frontend-events/references/progressive-01-/345/210/227/350/241/250/344/272/213/344/273/266.md +219 -219
  151. package/skills/v8-http-integration/SKILL.md +182 -182
  152. package/skills/v8-http-integration/references/progressive-01-get-/350/257/267/346/261/202.md +220 -220
  153. 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
  154. package/skills/v8-image-processing/SKILL.md +190 -190
  155. package/skills/v8-image-processing/agents/openai.yaml +4 -4
  156. package/skills/v8-image-processing/references/api-reference.md +623 -623
  157. package/skills/v8-menu-buttons/SKILL.md +180 -180
  158. 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
  159. 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
  160. 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
  161. package/skills/v8-mongodb/SKILL.md +192 -192
  162. package/skills/v8-mq-mqtt/SKILL.md +176 -176
  163. package/skills/v8-mq-mqtt/references/mqtt-production.md +342 -342
  164. package/skills/v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-/347/211/251/350/201/224/347/275/221.md +181 -181
  165. package/skills/v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs +203 -203
  166. package/skills/v8-saas-multi-tenant/SKILL.md +219 -219
  167. package/skills/v8-security/SKILL.md +168 -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
  169. package/skills/v8-security/references/progressive-02-7-/346/227/245/345/277/227/350/256/260/345/275/225.md +158 -158
  170. package/skills/v8-sql-query/SKILL.md +302 -302
  171. package/skills/v8-table-event/SKILL.md +144 -144
  172. 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
  173. 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
  174. package/skills/v8-tcp-integration/SKILL.md +147 -147
  175. package/skills/v8-tcp-integration/agents/openai.yaml +4 -4
  176. package/skills/v8-template-engine/SKILL.md +167 -167
  177. package/skills/v8-utilities/SKILL.md +90 -90
  178. package/skills/v8-utilities/references/client-api-index.md +143 -143
  179. package/skills/v8-utilities/references/platform-http-routes.md +83 -83
  180. package/skills/v8-utilities/references/server-api-index.md +188 -188
  181. package/skills/v8-workflow/SKILL.md +243 -243
  182. 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
  183. package/skills/vision-engine/SKILL.md +159 -159
  184. package/skills/vision-engine/agents/openai.yaml +4 -4
  185. package/skills/vision-engine/references/architecture-and-acceptance.md +194 -194
  186. package/skills/workspace-conventions/SKILL.md +261 -261
  187. 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
  188. 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
  189. 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,33 +1,33 @@
1
- ---
2
- name: v8-table-event
1
+ ---
2
+ name: v8-table-event
3
3
  description: Microi V8 表单事件开发。用于编写 InFormV8、SubmitFormV8、SubmitBeforeServerV8、SubmitAfterServerV8、OutFormV8、DataFilterV8 和事务感知事件。
4
- ---
5
-
6
- > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
-
8
- # Microi V8 表单事件开发
9
-
10
- 你正在开发 Microi 吾码平台的 V8 表单事件。事件绑定在表单引擎的表上,在数据操作的不同阶段自动触发。
11
-
12
- <!-- microi-progressive:begin -->
13
- <!-- microi-progressive:chunk id=v8-table-event-000 sha256=dd86294c8cf42f580b2eb806d981c239c0efc2934505c0716e804de2f8a9235c -->
14
- ## 本地优先与版本头(必做)
15
-
4
+ ---
5
+
6
+ > **Codex 非阻塞自动更新:** 当前宿主为 Codex 时,吾码 CLI、Codex 插件与工作区 AI/MCP 由后台自动更新;需要诊断时读取 `../microi-codex-installer/SKILL.md`。更新失败、等待空闲或尚未重载均不得阻断当前、正在进行或新建任务。非 Codex 宿主跳过此项。
7
+
8
+ # Microi V8 表单事件开发
9
+
10
+ 你正在开发 Microi 吾码平台的 V8 表单事件。事件绑定在表单引擎的表上,在数据操作的不同阶段自动触发。
11
+
12
+ <!-- microi-progressive:begin -->
13
+ <!-- microi-progressive:chunk id=v8-table-event-000 sha256=dd86294c8cf42f580b2eb806d981c239c0efc2934505c0716e804de2f8a9235c -->
14
+ ## 本地优先与版本头(必做)
15
+
16
16
  AI 本地开发表单 V8 事件时,优先修改 `microi-v8-engine/<租户>/<项目>/表单引擎/.../<事件Label>(<EventType>).js` 本地文件,再通过 MCP 或 VS Code 插件同步到数据库。文件中文名必须取 `diy_table` 对应 `diy_field.Label`,其中 `SubmitFormV8` 为 `前端表单提交前V8事件(SubmitFormV8).js`,`OutFormV8` 为 `前端表单提交后V8事件(OutFormV8).js`。若插件显示“本地和远端不一致”,先读取本地与远端并合并有效差异,不能直接覆盖。
17
-
18
- 每一次修改、上传、推送 `InFormV8.js`、`SubmitFormV8.js`、`SubmitBeforeServerV8.js`、`SubmitAfterServerV8.js`、`OutFormV8.js`、`DataFilterV8.js` 等事件文件,都必须维护顶部版本区域。版本号从 `v1.0.0` 开始;每次上传/推送/修改递增 1;补丁位和次版本位最大为 9 并向前进位(`v1.0.9 -> v1.1.0`、`v1.9.9 -> v2.0.0`、`v9.9.9 -> v10.0.0`)。代码头只写完整功能说明,不写修改历史、时间戳或 ChangeLog。
19
-
20
- ```javascript
21
- /*
22
- * V8 Event
17
+
18
+ 每一次修改、上传、推送 `InFormV8.js`、`SubmitFormV8.js`、`SubmitBeforeServerV8.js`、`SubmitAfterServerV8.js`、`OutFormV8.js`、`DataFilterV8.js` 等事件文件,都必须维护顶部版本区域。版本号从 `v1.0.0` 开始;每次上传/推送/修改递增 1;补丁位和次版本位最大为 9 并向前进位(`v1.0.9 -> v1.1.0`、`v1.9.9 -> v2.0.0`、`v9.9.9 -> v10.0.0`)。代码头只写完整功能说明,不写修改历史、时间戳或 ChangeLog。
19
+
20
+ ```javascript
21
+ /*
22
+ * V8 Event
23
23
  * TableKey: 示例表Key
24
- * EventType: SubmitBeforeServerV8
25
- * Version: v1.0.0
24
+ * EventType: SubmitBeforeServerV8
25
+ * Version: v1.0.0
26
26
  * 功能说明:
27
- * - 完整说明该事件的触发时机、校验/加工逻辑、读写字段和阻止提交条件。
28
- */
29
- ```
30
-
27
+ * - 完整说明该事件的触发时机、校验/加工逻辑、读写字段和阻止提交条件。
28
+ */
29
+ ```
30
+
31
31
  同步流程:`读取远端 -> 修改本地并递增语义版本头 -> JS 语法检查 -> 保存远端 -> 回读远端确认版本头一致 -> 查询 mic_data_version 确认形成新版本 -> 执行触发该事件的最小表单操作验证`。表单设计器保存和 MCP 保存共用服务端代码版本链路;只有代码真实变化才新增版本,普通布局/字段属性保存不得产生代码版本。修改记录不得写进事件代码头。
32
32
 
33
33
  使用 MCP 时,先调用 `microi_list_events` 发现事件,再用
@@ -36,71 +36,71 @@ AI 本地开发表单 V8 事件时,优先修改 `microi-v8-engine/<租户>/<
36
36
  版本时直接覆盖。
37
37
 
38
38
  生成 V8 事件代码时,代码内容本身(文件头、普通注释、`console.log`、返回 `Msg` 等)不要包含 `Microi`、`吾码` 等平台品牌文字,除非业务数据或字段值本身必须如此。生成代码要有可维护注释:每个 `function` 前写清用途、关键参数和返回值;提交前校验、提交后联动、字段显隐、数据脱敏、跨表写入、复杂条件判断等代码段前写短注释说明业务原因;避免“给变量赋值”这类无信息量注释。
39
-
40
- <!-- /microi-progressive:chunk -->
41
- <!-- microi-progressive:chunk id=v8-table-event-001 sha256=7bad55ca6781e6ca458a0333a47c71a3bad30334d146e940496c45c4ffa7ddf5 -->
42
- ## 事件类型
43
-
44
- | 事件 | 运行端 | V8.EventName | 触发时机 | 用途 |
45
- |------|--------|-------------|---------|------|
46
- | `InFormV8.js` | **前端** | `FormIn` | 表单打开时 | 初始化字段显隐、默认值 |
47
- | `SubmitFormV8.js` | **前端** | `FormSubmitBefore` | 表单提交时 | 前端校验、数据预处理 |
48
- | `OutFormV8.js` | **前端** | `FormOut` | 表单提交后离开时 | 刷新列表、跳转 |
49
- | `SubmitBeforeServerV8.js` | **后端** | `FormSubmitBefore` | 数据写入 DB 之前 | 服务端校验、数据加工 |
50
- | `SubmitAfterServerV8.js` | **后端** | `FormSubmitAfter` | 数据写入 DB 之后 | 触发通知、同步其它表、日志 |
51
- | `DataFilterV8.js` | **后端** | `DataFilter` | 获取列表/表单数据后 | 每行数据加工、脱敏、补充字段 |
52
-
53
- <!-- /microi-progressive:chunk -->
54
- <!-- microi-progressive:chunk id=v8-table-event-002 sha256=86c13bfd4dbc035e5498fe072ed176780ed31975b64eda09c1a378de986ab73d -->
55
- ## 事件触发规则
56
-
57
- - 后端 V8 事件 / 接口引擎中调用 `V8.FormEngine` 增删改 → **不触发**表单 V8 事件
58
- - 传入 `_InvokeType: 'Client'` → **触发**表单 V8 事件
59
- - Postman 等直接调用接口 → 前端事件**不执行**,后端事件**仍执行**
39
+
40
+ <!-- /microi-progressive:chunk -->
41
+ <!-- microi-progressive:chunk id=v8-table-event-001 sha256=7bad55ca6781e6ca458a0333a47c71a3bad30334d146e940496c45c4ffa7ddf5 -->
42
+ ## 事件类型
43
+
44
+ | 事件 | 运行端 | V8.EventName | 触发时机 | 用途 |
45
+ |------|--------|-------------|---------|------|
46
+ | `InFormV8.js` | **前端** | `FormIn` | 表单打开时 | 初始化字段显隐、默认值 |
47
+ | `SubmitFormV8.js` | **前端** | `FormSubmitBefore` | 表单提交时 | 前端校验、数据预处理 |
48
+ | `OutFormV8.js` | **前端** | `FormOut` | 表单提交后离开时 | 刷新列表、跳转 |
49
+ | `SubmitBeforeServerV8.js` | **后端** | `FormSubmitBefore` | 数据写入 DB 之前 | 服务端校验、数据加工 |
50
+ | `SubmitAfterServerV8.js` | **后端** | `FormSubmitAfter` | 数据写入 DB 之后 | 触发通知、同步其它表、日志 |
51
+ | `DataFilterV8.js` | **后端** | `DataFilter` | 获取列表/表单数据后 | 每行数据加工、脱敏、补充字段 |
52
+
53
+ <!-- /microi-progressive:chunk -->
54
+ <!-- microi-progressive:chunk id=v8-table-event-002 sha256=86c13bfd4dbc035e5498fe072ed176780ed31975b64eda09c1a378de986ab73d -->
55
+ ## 事件触发规则
56
+
57
+ - 后端 V8 事件 / 接口引擎中调用 `V8.FormEngine` 增删改 → **不触发**表单 V8 事件
58
+ - 传入 `_InvokeType: 'Client'` → **触发**表单 V8 事件
59
+ - Postman 等直接调用接口 → 前端事件**不执行**,后端事件**仍执行**
60
60
  - 服务器端提交前/后 V8 事件在**同一事务**中执行
61
61
  - `diy_table.V8Limit` 是表后端提交前、提交后和数据处理 V8 的正向开关:缺失、`null`、`0/false` 均不设置 Jint 单次超时、语句、函数递归和累计分配预算,只有 `1/true` 才启用这些限制。旧 `V8Unlimited` 仅在新字段不存在时反向推断,新的 MCP、Manifest 和应用资源只写 `V8Limit`。进程常驻内存、取消、并发、接口嵌套深度、权限和数据库保护始终生效。
62
-
63
- <!-- /microi-progressive:chunk -->
64
- <!-- microi-progressive:chunk id=v8-table-event-003 sha256=a6313d9007c8c72e1b8fb56ca7764eb0856029c9937c35d5f2e294539b3c7134 -->
65
- ## ⚠️ 关键陷阱(必读)
66
-
67
- ### 1. 设计模式保护(前端事件必加)
68
-
69
- ```javascript
70
- // 防止【表单设计器】中编辑字段时误触发事件
71
- if (V8.LoadMode === 'Design') return;
72
- ```
73
-
74
- ### 2. 死循环禁忌
75
-
76
- - ❌ **禁止** 在 `SubmitFormV8.js` 中调 `V8.FormSubmit()` —— 无限递归
77
- - ❌ **禁止** 在 `FieldValueChange` 中 `V8.FormSet(同字段, ...)` —— 循环触发
62
+
63
+ <!-- /microi-progressive:chunk -->
64
+ <!-- microi-progressive:chunk id=v8-table-event-003 sha256=a6313d9007c8c72e1b8fb56ca7764eb0856029c9937c35d5f2e294539b3c7134 -->
65
+ ## ⚠️ 关键陷阱(必读)
66
+
67
+ ### 1. 设计模式保护(前端事件必加)
68
+
69
+ ```javascript
70
+ // 防止【表单设计器】中编辑字段时误触发事件
71
+ if (V8.LoadMode === 'Design') return;
72
+ ```
73
+
74
+ ### 2. 死循环禁忌
75
+
76
+ - ❌ **禁止** 在 `SubmitFormV8.js` 中调 `V8.FormSubmit()` —— 无限递归
77
+ - ❌ **禁止** 在 `FieldValueChange` 中 `V8.FormSet(同字段, ...)` —— 循环触发
78
78
  - ❌ **禁止** 在后端提交前/后事件中再次写当前表;即使默认 Server 调用不递归,也可能覆盖本次增量数据、引发死锁或重复副作用。确需跨表联动时使用同一 `V8.DbTrans`,且不要传 `_InvokeType:'Client'`
79
-
80
- ### 3. 阻止提交(后端)
81
-
82
- 后端事件返回 `{ Code: 0, Msg: '错误' }` 平台自动回滚事务并阻止提交:
83
-
84
- ```javascript
85
- if (V8.Form.Money > 100000 && V8.CurrentUser.RoleName.indexOf('总经理') === -1) {
86
- return { Code: 0, Msg: '金额超过 10 万必须总经理提交' };
87
- }
88
- ```
89
-
79
+
80
+ ### 3. 阻止提交(后端)
81
+
82
+ 后端事件返回 `{ Code: 0, Msg: '错误' }` 平台自动回滚事务并阻止提交:
83
+
84
+ ```javascript
85
+ if (V8.Form.Money > 100000 && V8.CurrentUser.RoleName.indexOf('总经理') === -1) {
86
+ return { Code: 0, Msg: '金额超过 10 万必须总经理提交' };
87
+ }
88
+ ```
89
+
90
90
  ### 4. 共享事务操作其它表
91
91
 
92
92
  提交前与提交后事件可能在同一 Jint 全局环境依次运行。两个事件复用生成库时,顶层初始化变量使用可重复声明的 `var`,或放入各事件独立函数作用域;不要在两段代码里重复声明同名顶层 `let/const`。验收须真实新增/更新走完 Before → After,并验证提交后回读及审计;分别做语法检查不能发现跨事件重复声明。
93
-
94
- ```javascript
95
- // 在 SubmitBeforeServerV8 / SubmitAfterServerV8 中
96
- V8.FormEngine.UptFormData('OtherTable', { Id: 'x', Field: 'v' }, V8.DbTrans);
97
- V8.ApiEngine.Run('other-engine', { Form: V8.Form }, V8.DbTrans);
98
- // 不传 V8.DbTrans 会导致并行事务、可能死锁或脏读
99
- ```
100
-
93
+
94
+ ```javascript
95
+ // 在 SubmitBeforeServerV8 / SubmitAfterServerV8 中
96
+ V8.FormEngine.UptFormData('OtherTable', { Id: 'x', Field: 'v' }, V8.DbTrans);
97
+ V8.ApiEngine.Run('other-engine', { Form: V8.Form }, V8.DbTrans);
98
+ // 不传 V8.DbTrans 会导致并行事务、可能死锁或脏读
99
+ ```
100
+
101
101
  ### 5. 模板引擎与 DataFilterV8 的区别
102
-
103
- - 数据**加工**(计算字段、脱敏、查关联表名)→ 用 `DataFilterV8`(后端,每行执行,可用 `V8.CacheData` 防 N+1)
102
+
103
+ - 数据**加工**(计算字段、脱敏、查关联表名)→ 用 `DataFilterV8`(后端,每行执行,可用 `V8.CacheData` 防 N+1)
104
104
  - 数据**渲染**(颜色徽章、HTML、图片)→ 用【表格 V8 模板引擎】,详见 `v8-template-engine/SKILL.md`
105
105
 
106
106
  ### 6. 新增主键与跨表引用
@@ -109,68 +109,68 @@ V8.ApiEngine.Run('other-engine', { Form: V8.Form }, V8.DbTrans);
109
109
  - 依赖最终主键的附属记录放在 `SubmitAfterServerV8`,核验 `V8.Form.Id` 后在同一 `V8.DbTrans` 中回读主记录,再创建附属记录。After 仍在提交前,任一附属写入失败必须返回失败并回滚主表;外部消息仍走 outbox。
110
110
  - 原生删除事件的权威删除前记录由 `V8.Form` 提供,`V8.OldForm` 可能为空;删除审计、关系清理应按 `FormSubmitAction` 选择上下文。原生删除的 `Form.Version` 来自数据库快照,不能把它当作客户端最后看到的版本。需要拒绝过期删除时,通过受控接口接收期望版本、锁定主库记录并验证,再在同一事务执行删除。
111
111
  - 回归必须比较“新增接口返回 Id、主表实际 Id、附属外键、审计 RowId”四者一致,并覆盖唯一冲突时主表及附属记录同时回滚,不能只断言新增接口 `Code=1`。
112
-
113
- ---
114
-
115
- <!-- /microi-progressive:chunk -->
116
- <!-- microi-progressive:chunk id=v8-table-event-004 sha256=d3852ea4ed2f399ca19b537372d7f53a7d8f667d39ebd215210957fb8b6d9c0f -->
117
- ## 前端事件特有 API
118
-
119
- ```javascript
112
+
113
+ ---
114
+
115
+ <!-- /microi-progressive:chunk -->
116
+ <!-- microi-progressive:chunk id=v8-table-event-004 sha256=d3852ea4ed2f399ca19b537372d7f53a7d8f667d39ebd215210957fb8b6d9c0f -->
117
+ ## 前端事件特有 API
118
+
119
+ ```javascript
120
120
  // 普通 diy-form 中设置字段值(触发目标字段值变更事件)
121
121
  // diy-table 列表上下文只更新当前行和模板,不递归触发目标字段 V8
122
- V8.FormSet('FieldName', 'value');
123
- V8.FormSet('DropdownField', { Id: 1, Name: '选项' }); // 下拉框
124
-
125
- // 设置字段属性
126
- V8.FieldSet('FieldName', 'Visible', false); // 隐藏字段
127
- V8.FieldSet('FieldName', 'Readonly', true); // 只读字段
128
- V8.FieldSet('FieldName', 'Required', true); // 必填
129
- V8.FieldSet('FieldName', 'Data', [{Id:1, Name:'选项'}]); // 动态设置数据源
130
-
131
- // 访问字段属性
132
- var isReadonly = V8.Field.UserName.Readonly;
133
- // 属性:Name, Label, Config, Data, Readonly, Visible, Placeholder 等
134
-
135
- // 前端提示
136
- V8.Tips('操作成功', true); // 成功提示(1秒消失)
137
- V8.Tips('操作失败', false); // 错误提示(5秒消失)
138
-
122
+ V8.FormSet('FieldName', 'value');
123
+ V8.FormSet('DropdownField', { Id: 1, Name: '选项' }); // 下拉框
124
+
125
+ // 设置字段属性
126
+ V8.FieldSet('FieldName', 'Visible', false); // 隐藏字段
127
+ V8.FieldSet('FieldName', 'Readonly', true); // 只读字段
128
+ V8.FieldSet('FieldName', 'Required', true); // 必填
129
+ V8.FieldSet('FieldName', 'Data', [{Id:1, Name:'选项'}]); // 动态设置数据源
130
+
131
+ // 访问字段属性
132
+ var isReadonly = V8.Field.UserName.Readonly;
133
+ // 属性:Name, Label, Config, Data, Readonly, Visible, Placeholder 等
134
+
135
+ // 前端提示
136
+ V8.Tips('操作成功', true); // 成功提示(1秒消失)
137
+ V8.Tips('操作失败', false); // 错误提示(5秒消失)
138
+
139
139
  // 确认框
140
140
  V8.ConfirmTips('确定删除?', function() { /* 确定 */ }, function() { /* 取消 */ });
141
141
  // content 使用 HTML 模式渲染;只能传固定文案或已转义内容,复杂交互用 OpenAppDialog
142
-
143
- // 前端 HTTP 请求
144
- V8.Post('/api/xxx', { key: 'value' }, function(res) { });
145
- V8.Get('/api/xxx', {}, function(res) { });
146
-
147
- // 前端调用接口引擎
148
- var result = await V8.ApiEngine.Run('engineKey', { param1: 'value' });
149
-
150
- // 当前表单模式
151
- V8.FormMode // 'Add' / 'Edit' / 'View'
152
- V8.FormOutAction // 'Insert' / 'Update' / 'Close' / 'Delete'
153
-
154
- // 刷新表格
155
- V8.RefreshTable({ _PageIndex: 1 }); // -1 = 最后一页
156
-
157
- // 表单操作
158
- V8.FormSubmit({ CloseForm: true }); // 提交表单(不能在提交前事件中调用)
159
- V8.FormClose(); // 关闭表单
160
- V8.ReloadForm({ Id: 'xxx' }, 'Edit'); // 重新加载
161
-
162
- // 按钮和Tab控制
163
- V8.HideFormBtn('Update'); // 隐藏按钮:'Delete' / 'Save' / 'Update'
164
- V8.HideFormTab('tabName'); // 隐藏Tab
165
- V8.ShowFormTab('tabName'); // 显示Tab
166
- V8.ClickFormTab('tabName'); // 选中Tab
167
- ```
168
-
169
- <!-- /microi-progressive:chunk -->
170
- ## 详细参考路由(渐进披露)
171
-
172
- 仅在当前任务涉及对应主题时读取;下列文件合计保留了原 SKILL.md 的全部详细知识。
173
-
174
- - [references/progressive-01-informv8-js-表单打开事件.md](references/progressive-01-informv8-js-表单打开事件.md):InFormV8.js — 表单打开事件;SubmitFormV8.js — 前端提交校验;SubmitBeforeServerV8.js — 服务端提交前;SubmitAfterServerV8.js — 服务端提交后;DataFilterV8.js — 服务端数据处理事件;事件上下文变量
175
- - [references/progressive-02-前端事件名-v8-eventname-可能的值.md](references/progressive-02-前端事件名-v8-eventname-可能的值.md):前端事件名(V8.EventName 可能的值);注意事项
176
- <!-- microi-progressive:end -->
142
+
143
+ // 前端 HTTP 请求
144
+ V8.Post('/api/xxx', { key: 'value' }, function(res) { });
145
+ V8.Get('/api/xxx', {}, function(res) { });
146
+
147
+ // 前端调用接口引擎
148
+ var result = await V8.ApiEngine.Run('engineKey', { param1: 'value' });
149
+
150
+ // 当前表单模式
151
+ V8.FormMode // 'Add' / 'Edit' / 'View'
152
+ V8.FormOutAction // 'Insert' / 'Update' / 'Close' / 'Delete'
153
+
154
+ // 刷新表格
155
+ V8.RefreshTable({ _PageIndex: 1 }); // -1 = 最后一页
156
+
157
+ // 表单操作
158
+ V8.FormSubmit({ CloseForm: true }); // 提交表单(不能在提交前事件中调用)
159
+ V8.FormClose(); // 关闭表单
160
+ V8.ReloadForm({ Id: 'xxx' }, 'Edit'); // 重新加载
161
+
162
+ // 按钮和Tab控制
163
+ V8.HideFormBtn('Update'); // 隐藏按钮:'Delete' / 'Save' / 'Update'
164
+ V8.HideFormTab('tabName'); // 隐藏Tab
165
+ V8.ShowFormTab('tabName'); // 显示Tab
166
+ V8.ClickFormTab('tabName'); // 选中Tab
167
+ ```
168
+
169
+ <!-- /microi-progressive:chunk -->
170
+ ## 详细参考路由(渐进披露)
171
+
172
+ 仅在当前任务涉及对应主题时读取;下列文件合计保留了原 SKILL.md 的全部详细知识。
173
+
174
+ - [references/progressive-01-informv8-js-表单打开事件.md](references/progressive-01-informv8-js-表单打开事件.md):InFormV8.js — 表单打开事件;SubmitFormV8.js — 前端提交校验;SubmitBeforeServerV8.js — 服务端提交前;SubmitAfterServerV8.js — 服务端提交后;DataFilterV8.js — 服务端数据处理事件;事件上下文变量
175
+ - [references/progressive-02-前端事件名-v8-eventname-可能的值.md](references/progressive-02-前端事件名-v8-eventname-可能的值.md):前端事件名(V8.EventName 可能的值);注意事项
176
+ <!-- microi-progressive:end -->