@microi.net/cli 5.8.5 → 5.8.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/.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 +7 -7
- 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 +1 -1
- package/scripts/microi-cli.js +66 -65
- package/scripts/microi-codex-broker.js +450 -450
- package/scripts/microi-codex-router.js +618 -618
- package/scripts/microi-skills.meta.json +384 -384
- package/skills/.microi-skills-version.json +2 -2
- package/skills/.progressive-disclosure-manifest.json +21 -21
- package/skills/README.md +287 -287
- package/skills/ai-engine/SKILL.md +269 -265
- package/skills/ai-engine/agents/openai.yaml +4 -4
- package/skills/ai-engine/references/ai-employees.md +48 -48
- package/skills/ai-engine/references/self-hosted-digital-human.md +59 -59
- 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 +525 -525
- package/skills/app-store/agents/openai.yaml +4 -4
- package/skills/business-blueprint/SKILL.md +193 -193
- package/skills/datasource-engine/SKILL.md +93 -93
- package/skills/datasource-engine/agents/openai.yaml +4 -4
- package/skills/dos-orm/SKILL.md +97 -95
- package/skills/dos-orm/references/api-reference.md +229 -229
- package/skills/email-engine/SKILL.md +81 -81
- package/skills/email-engine/references/v8-email.md +34 -34
- package/skills/job-engine/SKILL.md +176 -176
- package/skills/job-engine/agents/openai.yaml +4 -4
- package/skills/message-notification/SKILL.md +156 -156
- package/skills/message-notification/agents/openai.yaml +5 -5
- package/skills/message-notification/references/contracts.md +102 -102
- package/skills/microi/SKILL.md +14 -14
- package/skills/microi-ai-app-auth.js +652 -652
- package/skills/microi-ai-application/SKILL.md +115 -115
- 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 +246 -244
- 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 +102 -100
- package/skills/microi-codex-installer/SKILL.md +231 -231
- package/skills/microi-codex-installer/agents/openai.yaml +7 -7
- package/skills/microi-datasource-mapping/SKILL.md +122 -122
- 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/SKILL.md +222 -220
- package/skills/microi-deployment/references/deployment-matrix.md +109 -109
- package/skills/microi-docs-coverage/SKILL.md +133 -133
- package/skills/microi-docs-coverage/references/capability-map.md +91 -91
- package/skills/microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs +894 -894
- package/skills/microi-form-engine/SKILL.md +333 -333
- 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 +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 +194 -194
- 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 +328 -326
- package/skills/microi-microservice/references/runtime-delivery.md +278 -278
- package/skills/microi-mobile-app-quality/SKILL.md +185 -185
- 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/SKILL.md +96 -90
- 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 +137 -137
- 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 +217 -217
- package/skills/microi-ui/SKILL.md +192 -192
- 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 +255 -255
- 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 +206 -206
- package/skills/page-engine/examples/compact-dashboard.json +1444 -1444
- 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 +196 -196
- 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/scripts/sync-embedded-skills.mjs +46 -46
- package/skills/scripts/validate-progressive-disclosure.mjs +57 -57
- 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 +249 -246
- package/skills/system-observability/references/memory-incident-triage.md +77 -77
- package/skills/translate-engine/SKILL.md +140 -140
- package/skills/translate-engine/agents/openai.yaml +4 -4
- package/skills/ui-design/SKILL.md +223 -223
- package/skills/ui-design/assets/pattern-showcase/app.js +54 -54
- package/skills/ui-design/assets/pattern-showcase/index.html +163 -163
- package/skills/ui-design/assets/pattern-showcase/styles.css +311 -311
- package/skills/ui-design/assets/templates/MCI-DESIGN.md +206 -206
- 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/motion-and-media.md +78 -78
- package/skills/ui-design/references/product-flow-recipes.md +94 -94
- 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 +164 -164
- 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 +142 -142
- package/skills/uniapp-mall-assets/SKILL.md +176 -176
- package/skills/unity-integration/SKILL.md +171 -171
- package/skills/unity-integration/agents/openai.yaml +4 -4
- package/skills/unity-integration/references/ai-app-delivery.md +119 -119
- 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 +388 -388
- package/skills/v8-cache-pattern/SKILL.md +312 -312
- package/skills/v8-crud-api/SKILL.md +178 -178
- 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 +219 -219
- 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 +284 -284
- 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 +263 -263
- 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 +161 -161
- package/skills/v8-formengine-http/SKILL.md +238 -238
- package/skills/v8-frontend-events/SKILL.md +180 -180
- package/skills/v8-frontend-events/references/bluetooth-print-api.md +135 -135
- package/skills/v8-frontend-events/references/bluetooth-print.md +258 -258
- 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 +186 -186
- 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 +200 -200
- package/skills/v8-mq-mqtt/SKILL.md +176 -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 +305 -305
- package/skills/v8-security/SKILL.md +210 -210
- package/skills/v8-security/references/progressive-01-2-/346/235/203/351/231/220/346/240/241/351/252/214.md +200 -200
- package/skills/v8-security/references/progressive-02-7-/346/227/245/345/277/227/350/256/260/345/275/225.md +160 -160
- package/skills/v8-sql-query/SKILL.md +302 -302
- package/skills/v8-table-event/SKILL.md +176 -176
- 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 +216 -216
- 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 +104 -104
- 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 +252 -252
- 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/v8-workflow/references/workflow-configuration.md +49 -49
- package/skills/vision-engine/SKILL.md +160 -160
- 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 +273 -273
- 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 +209 -209
- 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 +217 -217
- 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,259 +1,259 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: print-engine
|
|
3
|
-
description: 生成和审查 Microi 打印引擎 Print Engine 模板 JSON。用于创建 mic_print 模板、PageObj 布局、PrintObj 数据绑定、可打印报告、标签或合同;蓝牙 TSPL/CPCL/ESC-POS、GP-M322 或 CC4 需求转交 v8-frontend-events 蓝牙参考。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
> **Microi吾码基础规范(强制):** 任何 AI 模型与宿主每次新建或接续吾码任务,先完整读取 `../workspace-conventions/SKILL.md`,必须执行版本播报、`@microi.net/cli` 后台自动升级、Skills/MCP 同步和进度播报。安装与诊断读取 `../microi-codex-installer/SKILL.md`;更新失败延后重试,不阻断当前工作。
|
|
7
|
-
|
|
8
|
-
# Microi 打印引擎(Print Engine)模板 JSON 生成
|
|
9
|
-
|
|
10
|
-
你正在为 Microi 吾码平台生成打印引擎模板的 JSON 数据。打印模板包含 PageObj(模板定义)和 PrintObj(打印数据)。
|
|
11
|
-
|
|
12
|
-
## 设计器源码事件
|
|
13
|
-
|
|
14
|
-
扩展打印设计器源码时,可通过 `EventBus.on('savePrintJson', handler)` 接收
|
|
15
|
-
保存后的模板 JSON,并在组件卸载时调用 `EventBus.off('savePrintJson')`。
|
|
16
|
-
这是设计器内部生命周期接口,不属于运行时打印模板 JSON,也不能替代模板的
|
|
17
|
-
服务端保存与回读。
|
|
18
|
-
|
|
19
|
-
## 与蓝牙直连打印的边界
|
|
20
|
-
|
|
21
|
-
本 Skill 负责 `mic_print`、`PageObj`、`PrintObj`、浏览器预览和模板化纸张输出。
|
|
22
|
-
如果需求明确是蓝牙标签机/小票机、TSC/TSPL、CPCL、ESC/POS、佳博 GP-M322、
|
|
23
|
-
ZICOX CC4、BLE/SPP 或
|
|
24
|
-
`V8.Print.prepareSend`,应同时读取
|
|
25
|
-
`../v8-frontend-events/references/bluetooth-print.md`:
|
|
26
|
-
|
|
27
|
-
- Print Engine 决定“页面/模板如何排版”,适合 A4、PDF、浏览器打印和统一模板。
|
|
28
|
-
- `V8.Print` 生成/适配打印机原生命令并通过 BLE 或 Android SPP 写入,适合标签和热敏小票;GP-M322 保持 TSPL 原字节,CC4 可自动生成 CPCL。
|
|
29
|
-
- MicroService 不能跨 iframe 访问父页面打印组件;普通打印使用 `microi.host.v1` 的
|
|
30
|
-
`openPlatformPrint`,只传当前租户 `mic_print.Id` 和同源 `/apiengine/` 数据地址。该动作
|
|
31
|
-
不是蓝牙代理,不发送 BLE/SPP 字节。详见 `../microi-microservice/references/runtime-delivery.md`。
|
|
32
|
-
- 两者可以由同一个按钮按设备能力选择,但不能把 `PageObj` 直接交给
|
|
33
|
-
`V8.Print.prepareSend`,也不能把 TSPL/CPCL/ESC-POS 字节当作 Print Engine JSON。
|
|
34
|
-
|
|
35
|
-
## 数据模型
|
|
36
|
-
|
|
37
|
-
打印模板存储在 `mic_print` 表中:
|
|
38
|
-
|
|
39
|
-
| 字段 | 说明 |
|
|
40
|
-
|------|------|
|
|
41
|
-
| PageObj | 页面模板定义(面板 + 元素布局) |
|
|
42
|
-
| PrintObj | 打印数据(运行时填充到模板中) |
|
|
43
|
-
| DataApi | 关联的接口引擎 Id(动态数据) |
|
|
44
|
-
|
|
45
|
-
### `mic_print` 权限边界
|
|
46
|
-
|
|
47
|
-
- `mic_print` 是按角色管理的运行资源,不是只能由 `Level >= 9999` 读取的控制面表。打印渲染器通过 FormEngine 读取模板时,当前角色必须拥有菜单权限或高级表权限中的 `Read`;否则应明确返回 `NoAuth`,不能为兼容改成匿名读取。
|
|
48
|
-
- 模板新增、修改、删除分别要求明确的 `Add`、`Edit`、`Del`。只需要打印的业务角色通常只授予 `Read`,不要顺带授予设计权限。
|
|
49
|
-
- 角色授权界面只负责展示服务端策略。角色增删改接口必须从主库复核当前操作者确为活动平台管理员,不能相信 Postman 请求体中的 `_IsAdmin`、`Level`、`RoleIds` 或 `OsClient`。
|
|
50
|
-
|
|
51
|
-
## PageObj 模板结构
|
|
52
|
-
|
|
53
|
-
```json
|
|
54
|
-
{
|
|
55
|
-
"panels": [{
|
|
56
|
-
"index": 0,
|
|
57
|
-
"name": "面板名称",
|
|
58
|
-
"height": 297, // mm,A4=297
|
|
59
|
-
"width": 210, // mm,A4=210
|
|
60
|
-
"paperType": "A4",
|
|
61
|
-
"paperHeader": 49.5, // 页眉底部位置(pt)
|
|
62
|
-
"paperFooter": 780, // 页脚顶部位置(pt)
|
|
63
|
-
"printElements": []
|
|
64
|
-
}]
|
|
65
|
-
}
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### 常用纸张尺寸
|
|
69
|
-
|
|
70
|
-
| 纸张 | 宽(mm) | 高(mm) |
|
|
71
|
-
|------|--------|--------|
|
|
72
|
-
| A3 | 297 | 420 |
|
|
73
|
-
| A4 | 210 | 297 |
|
|
74
|
-
| A5 | 148 | 210 |
|
|
75
|
-
| B4 | 257 | 364 |
|
|
76
|
-
| B5 | 182 | 257 |
|
|
77
|
-
|
|
78
|
-
### 坐标系统
|
|
79
|
-
- 单位:pt(磅,约 0.35mm)
|
|
80
|
-
- 原点:面板左上角 (0, 0)
|
|
81
|
-
- 栅格间距默认 7.5pt
|
|
82
|
-
- A4 可用宽度约 571.5pt
|
|
83
|
-
|
|
84
|
-
## 元素类型
|
|
85
|
-
|
|
86
|
-
### text — 文本元素
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"options": {
|
|
91
|
-
"left": 60, "top": 30, "height": 13, "width": 120,
|
|
92
|
-
"title": "静态文本",
|
|
93
|
-
"field": "fieldName",
|
|
94
|
-
"testData": "预览数据",
|
|
95
|
-
"fontSize": 10.5, // pt,9=小五, 10.5=五号, 12=小四, 14=四号
|
|
96
|
-
"fontFamily": "微软雅黑", // SimSun(宋体), SimHei(黑体), KaiTi(楷体)
|
|
97
|
-
"fontWeight": "600", // 400=常规, 600=半粗, 700=粗
|
|
98
|
-
"color": "#333333",
|
|
99
|
-
"textAlign": "left", // left/center/right/justify
|
|
100
|
-
"textContentVerticalAlign": "middle", // top/middle/bottom
|
|
101
|
-
"lineHeight": 18,
|
|
102
|
-
"hideTitle": false, // field绑定时仅显示值
|
|
103
|
-
"fixed": false
|
|
104
|
-
},
|
|
105
|
-
"printElementType": { "type": "text" }
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
文本 `text` 与长文本 `longText` 的 `options.formatter` 接收
|
|
110
|
-
`function(title, value, options, templateData)`;文本控件还可能传第五个 `target`。
|
|
111
|
-
第一参数是标题,绑定数据在第二参数。不要直接传入 `function(value)` 编码器,否则会把
|
|
112
|
-
标题当业务值打印。表格单元格的 `formatter2(value, row, index, options)` 是另一合同,首参是当前单元格值,第三参是列索引。
|
|
113
|
-
金额应由后端精确计算后作为字符串输出,不能在打印页转换为 `Number` 再求和。
|
|
114
|
-
表格列应使用 `function(value){ return escapeText(value); }` 这一形式。验收必须检查实际打印 iframe 的商品、数量、单价及金额单元格;表头、合计正确并不能证明明细正确,设计画布的 testData 也不能作为实际打印数据。
|
|
115
|
-
|
|
116
|
-
业务文本经过 formatter 进入 HTML 时必须编码 `& < > " '`,并用含标签的值与大额金额
|
|
117
|
-
调用真实函数签名做回归。模板保存成功只证明存储,仍须用实际数据预览分页、合计与长条款。
|
|
118
|
-
|
|
119
|
-
### table — 表格元素
|
|
120
|
-
|
|
121
|
-
```json
|
|
122
|
-
{
|
|
123
|
-
"options": {
|
|
124
|
-
"left": 30, "top": 150, "height": 56, "width": 511.5,
|
|
125
|
-
"field": "tableData",
|
|
126
|
-
"columns": [[
|
|
127
|
-
{ "title": "编号", "field": "id", "width": 80, "align": "center" },
|
|
128
|
-
{ "title": "名称", "field": "name", "width": 150, "align": "left" },
|
|
129
|
-
{ "title": "金额", "field": "amount", "width": 100, "align": "right", "tableSummary": "sum" }
|
|
130
|
-
]]
|
|
131
|
-
},
|
|
132
|
-
"printElementType": { "type": "table" }
|
|
133
|
-
}
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
列属性:`title`, `field`, `width`(pt), `align`, `colspan`, `rowspan`, `checked`, `tableSummary`(count/sum/avg)
|
|
137
|
-
|
|
138
|
-
### image — 图片
|
|
139
|
-
|
|
140
|
-
```json
|
|
141
|
-
{
|
|
142
|
-
"options": {
|
|
143
|
-
"left": 60, "top": 30, "height": 80, "width": 80,
|
|
144
|
-
"field": "logoUrl",
|
|
145
|
-
"src": "默认图片URL",
|
|
146
|
-
"fit": "contain" // contain/cover/fill/scale
|
|
147
|
-
},
|
|
148
|
-
"printElementType": { "type": "image" }
|
|
149
|
-
}
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### longText — 长文本(自动分页)
|
|
153
|
-
|
|
154
|
-
```json
|
|
155
|
-
{
|
|
156
|
-
"options": {
|
|
157
|
-
"left": 30, "top": 100, "height": 40, "width": 511.5,
|
|
158
|
-
"field": "contractContent",
|
|
159
|
-
"testData": "长文本预览...",
|
|
160
|
-
"fontSize": 10.5, "lineHeight": 18
|
|
161
|
-
},
|
|
162
|
-
"printElementType": { "type": "longText" }
|
|
163
|
-
}
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### html — 自定义 HTML
|
|
167
|
-
|
|
168
|
-
```json
|
|
169
|
-
{
|
|
170
|
-
"options": {
|
|
171
|
-
"left": 30, "top": 200, "height": 80, "width": 300,
|
|
172
|
-
"formatter": "function(t, e, d) { return '<div>' + (d.customField || '') + '</div>'; }"
|
|
173
|
-
},
|
|
174
|
-
"printElementType": { "type": "html" }
|
|
175
|
-
}
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### 条形码 / 二维码
|
|
179
|
-
|
|
180
|
-
```json
|
|
181
|
-
// 条形码(text + textType)
|
|
182
|
-
{ "options": { "field": "barcodeNo", "testData": "XS888888888", "textType": "barcode", "hideTitle": true }, "printElementType": { "type": "text" } }
|
|
183
|
-
// 二维码
|
|
184
|
-
{ "options": { "field": "qrcodeUrl", "testData": "https://microi.net", "textType": "qrcode" }, "printElementType": { "type": "text" } }
|
|
185
|
-
// SVG 版本(矢量不失真)
|
|
186
|
-
{ "printElementType": { "type": "barcode" } }
|
|
187
|
-
{ "printElementType": { "type": "qrcode" } }
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### 辅助图形
|
|
191
|
-
|
|
192
|
-
```json
|
|
193
|
-
// 水平线
|
|
194
|
-
{ "options": { "left": 30, "top": 80, "height": 9, "width": 511.5, "borderStyle": "solid", "borderWidth": 0.75 }, "printElementType": { "type": "hline" } }
|
|
195
|
-
// 垂直线
|
|
196
|
-
{ "printElementType": { "type": "vline" } }
|
|
197
|
-
// 矩形
|
|
198
|
-
{ "printElementType": { "type": "rect" } }
|
|
199
|
-
// 椭圆
|
|
200
|
-
{ "printElementType": { "type": "oval" } }
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
## PrintObj 打印数据
|
|
204
|
-
|
|
205
|
-
```json
|
|
206
|
-
{
|
|
207
|
-
"companyName": "吾码科技有限公司",
|
|
208
|
-
"orderNo": "ORD-2024-001",
|
|
209
|
-
"items": [
|
|
210
|
-
{ "id": "1", "name": "商品A", "qty": "10", "price": "100", "total": "1000" }
|
|
211
|
-
]
|
|
212
|
-
}
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
**绑定规则:**
|
|
216
|
-
- 简单字段:元素 `field: "companyName"` → `PrintObj.companyName`
|
|
217
|
-
- 表格数据:表格 `field: "items"` → `PrintObj.items`(数组),列 `field: "name"` → `items[i].name`
|
|
218
|
-
- 图片:`field: "logoUrl"` → URL 或 Base64
|
|
219
|
-
- 条形码/二维码:`field` + `textType` 自动渲染
|
|
220
|
-
|
|
221
|
-
## 表格函数属性
|
|
222
|
-
|
|
223
|
-
| 属性 | 函数签名 | 说明 |
|
|
224
|
-
|------|----------|------|
|
|
225
|
-
| formatter2 | `function(value, row, index, options)` | 单元格渲染,首参为值、index为列索引 |
|
|
226
|
-
| styler2 | `function(value, row, index, options)` | 单元格样式 |
|
|
227
|
-
| rowStyler | `function(row, index, options)` | 行样式 |
|
|
228
|
-
| footerFormatter | `function(options, rows, data, el)` | 表尾渲染 |
|
|
229
|
-
| tableSummaryFormatter | `function(column, data)` | 合计行渲染 |
|
|
230
|
-
|
|
231
|
-
## 生成模板最佳实践
|
|
232
|
-
|
|
233
|
-
1. **坐标计算**:A4 可用宽度约 571.5pt,从 left=30 开始留白
|
|
234
|
-
2. **元素间距**:垂直间距 15-22.5pt
|
|
235
|
-
3. **表格列宽**:所有列宽之和应等于表格 width
|
|
236
|
-
4. **field 命名**:camelCase,与 PrintObj 键名一致
|
|
237
|
-
5. **testData**:每个绑定字段必须提供 testData
|
|
238
|
-
6. **PrintObj 值**:所有字段值应为字符串类型
|
|
239
|
-
|
|
240
|
-
### 常用布局
|
|
241
|
-
|
|
242
|
-
- **标题区(top: 15-60)**:居中大字号标题 + hline 分隔 + 右上角二维码/LOGO
|
|
243
|
-
- **信息区(top: 60-120)**:单号、日期、客户信息
|
|
244
|
-
- **数据区(top: 120+)**:表格元素,自动分页
|
|
245
|
-
- **签章区(靠近页脚)**:签名线、日期线、印章图片
|
|
246
|
-
|
|
247
|
-
## 接口引擎集成
|
|
248
|
-
|
|
249
|
-
`DataApi` 字段关联接口引擎,返回的 `Data` 对象直接作为 PrintObj 注入模板:
|
|
250
|
-
|
|
251
|
-
```javascript
|
|
252
|
-
return {
|
|
253
|
-
Code: 1,
|
|
254
|
-
Data: {
|
|
255
|
-
orderNo: "ORD-2024-001",
|
|
256
|
-
items: [{ seq: "1", name: "商品A", qty: "10", price: "100", total: "1000" }]
|
|
257
|
-
}
|
|
258
|
-
};
|
|
259
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: print-engine
|
|
3
|
+
description: 生成和审查 Microi 打印引擎 Print Engine 模板 JSON。用于创建 mic_print 模板、PageObj 布局、PrintObj 数据绑定、可打印报告、标签或合同;蓝牙 TSPL/CPCL/ESC-POS、GP-M322 或 CC4 需求转交 v8-frontend-events 蓝牙参考。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Microi吾码基础规范(强制):** 任何 AI 模型与宿主每次新建或接续吾码任务,先完整读取 `../workspace-conventions/SKILL.md`,必须执行版本播报、`@microi.net/cli` 后台自动升级、Skills/MCP 同步和进度播报。安装与诊断读取 `../microi-codex-installer/SKILL.md`;更新失败延后重试,不阻断当前工作。
|
|
7
|
+
|
|
8
|
+
# Microi 打印引擎(Print Engine)模板 JSON 生成
|
|
9
|
+
|
|
10
|
+
你正在为 Microi 吾码平台生成打印引擎模板的 JSON 数据。打印模板包含 PageObj(模板定义)和 PrintObj(打印数据)。
|
|
11
|
+
|
|
12
|
+
## 设计器源码事件
|
|
13
|
+
|
|
14
|
+
扩展打印设计器源码时,可通过 `EventBus.on('savePrintJson', handler)` 接收
|
|
15
|
+
保存后的模板 JSON,并在组件卸载时调用 `EventBus.off('savePrintJson')`。
|
|
16
|
+
这是设计器内部生命周期接口,不属于运行时打印模板 JSON,也不能替代模板的
|
|
17
|
+
服务端保存与回读。
|
|
18
|
+
|
|
19
|
+
## 与蓝牙直连打印的边界
|
|
20
|
+
|
|
21
|
+
本 Skill 负责 `mic_print`、`PageObj`、`PrintObj`、浏览器预览和模板化纸张输出。
|
|
22
|
+
如果需求明确是蓝牙标签机/小票机、TSC/TSPL、CPCL、ESC/POS、佳博 GP-M322、
|
|
23
|
+
ZICOX CC4、BLE/SPP 或
|
|
24
|
+
`V8.Print.prepareSend`,应同时读取
|
|
25
|
+
`../v8-frontend-events/references/bluetooth-print.md`:
|
|
26
|
+
|
|
27
|
+
- Print Engine 决定“页面/模板如何排版”,适合 A4、PDF、浏览器打印和统一模板。
|
|
28
|
+
- `V8.Print` 生成/适配打印机原生命令并通过 BLE 或 Android SPP 写入,适合标签和热敏小票;GP-M322 保持 TSPL 原字节,CC4 可自动生成 CPCL。
|
|
29
|
+
- MicroService 不能跨 iframe 访问父页面打印组件;普通打印使用 `microi.host.v1` 的
|
|
30
|
+
`openPlatformPrint`,只传当前租户 `mic_print.Id` 和同源 `/apiengine/` 数据地址。该动作
|
|
31
|
+
不是蓝牙代理,不发送 BLE/SPP 字节。详见 `../microi-microservice/references/runtime-delivery.md`。
|
|
32
|
+
- 两者可以由同一个按钮按设备能力选择,但不能把 `PageObj` 直接交给
|
|
33
|
+
`V8.Print.prepareSend`,也不能把 TSPL/CPCL/ESC-POS 字节当作 Print Engine JSON。
|
|
34
|
+
|
|
35
|
+
## 数据模型
|
|
36
|
+
|
|
37
|
+
打印模板存储在 `mic_print` 表中:
|
|
38
|
+
|
|
39
|
+
| 字段 | 说明 |
|
|
40
|
+
|------|------|
|
|
41
|
+
| PageObj | 页面模板定义(面板 + 元素布局) |
|
|
42
|
+
| PrintObj | 打印数据(运行时填充到模板中) |
|
|
43
|
+
| DataApi | 关联的接口引擎 Id(动态数据) |
|
|
44
|
+
|
|
45
|
+
### `mic_print` 权限边界
|
|
46
|
+
|
|
47
|
+
- `mic_print` 是按角色管理的运行资源,不是只能由 `Level >= 9999` 读取的控制面表。打印渲染器通过 FormEngine 读取模板时,当前角色必须拥有菜单权限或高级表权限中的 `Read`;否则应明确返回 `NoAuth`,不能为兼容改成匿名读取。
|
|
48
|
+
- 模板新增、修改、删除分别要求明确的 `Add`、`Edit`、`Del`。只需要打印的业务角色通常只授予 `Read`,不要顺带授予设计权限。
|
|
49
|
+
- 角色授权界面只负责展示服务端策略。角色增删改接口必须从主库复核当前操作者确为活动平台管理员,不能相信 Postman 请求体中的 `_IsAdmin`、`Level`、`RoleIds` 或 `OsClient`。
|
|
50
|
+
|
|
51
|
+
## PageObj 模板结构
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"panels": [{
|
|
56
|
+
"index": 0,
|
|
57
|
+
"name": "面板名称",
|
|
58
|
+
"height": 297, // mm,A4=297
|
|
59
|
+
"width": 210, // mm,A4=210
|
|
60
|
+
"paperType": "A4",
|
|
61
|
+
"paperHeader": 49.5, // 页眉底部位置(pt)
|
|
62
|
+
"paperFooter": 780, // 页脚顶部位置(pt)
|
|
63
|
+
"printElements": []
|
|
64
|
+
}]
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### 常用纸张尺寸
|
|
69
|
+
|
|
70
|
+
| 纸张 | 宽(mm) | 高(mm) |
|
|
71
|
+
|------|--------|--------|
|
|
72
|
+
| A3 | 297 | 420 |
|
|
73
|
+
| A4 | 210 | 297 |
|
|
74
|
+
| A5 | 148 | 210 |
|
|
75
|
+
| B4 | 257 | 364 |
|
|
76
|
+
| B5 | 182 | 257 |
|
|
77
|
+
|
|
78
|
+
### 坐标系统
|
|
79
|
+
- 单位:pt(磅,约 0.35mm)
|
|
80
|
+
- 原点:面板左上角 (0, 0)
|
|
81
|
+
- 栅格间距默认 7.5pt
|
|
82
|
+
- A4 可用宽度约 571.5pt
|
|
83
|
+
|
|
84
|
+
## 元素类型
|
|
85
|
+
|
|
86
|
+
### text — 文本元素
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"options": {
|
|
91
|
+
"left": 60, "top": 30, "height": 13, "width": 120,
|
|
92
|
+
"title": "静态文本",
|
|
93
|
+
"field": "fieldName",
|
|
94
|
+
"testData": "预览数据",
|
|
95
|
+
"fontSize": 10.5, // pt,9=小五, 10.5=五号, 12=小四, 14=四号
|
|
96
|
+
"fontFamily": "微软雅黑", // SimSun(宋体), SimHei(黑体), KaiTi(楷体)
|
|
97
|
+
"fontWeight": "600", // 400=常规, 600=半粗, 700=粗
|
|
98
|
+
"color": "#333333",
|
|
99
|
+
"textAlign": "left", // left/center/right/justify
|
|
100
|
+
"textContentVerticalAlign": "middle", // top/middle/bottom
|
|
101
|
+
"lineHeight": 18,
|
|
102
|
+
"hideTitle": false, // field绑定时仅显示值
|
|
103
|
+
"fixed": false
|
|
104
|
+
},
|
|
105
|
+
"printElementType": { "type": "text" }
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
文本 `text` 与长文本 `longText` 的 `options.formatter` 接收
|
|
110
|
+
`function(title, value, options, templateData)`;文本控件还可能传第五个 `target`。
|
|
111
|
+
第一参数是标题,绑定数据在第二参数。不要直接传入 `function(value)` 编码器,否则会把
|
|
112
|
+
标题当业务值打印。表格单元格的 `formatter2(value, row, index, options)` 是另一合同,首参是当前单元格值,第三参是列索引。
|
|
113
|
+
金额应由后端精确计算后作为字符串输出,不能在打印页转换为 `Number` 再求和。
|
|
114
|
+
表格列应使用 `function(value){ return escapeText(value); }` 这一形式。验收必须检查实际打印 iframe 的商品、数量、单价及金额单元格;表头、合计正确并不能证明明细正确,设计画布的 testData 也不能作为实际打印数据。
|
|
115
|
+
|
|
116
|
+
业务文本经过 formatter 进入 HTML 时必须编码 `& < > " '`,并用含标签的值与大额金额
|
|
117
|
+
调用真实函数签名做回归。模板保存成功只证明存储,仍须用实际数据预览分页、合计与长条款。
|
|
118
|
+
|
|
119
|
+
### table — 表格元素
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"options": {
|
|
124
|
+
"left": 30, "top": 150, "height": 56, "width": 511.5,
|
|
125
|
+
"field": "tableData",
|
|
126
|
+
"columns": [[
|
|
127
|
+
{ "title": "编号", "field": "id", "width": 80, "align": "center" },
|
|
128
|
+
{ "title": "名称", "field": "name", "width": 150, "align": "left" },
|
|
129
|
+
{ "title": "金额", "field": "amount", "width": 100, "align": "right", "tableSummary": "sum" }
|
|
130
|
+
]]
|
|
131
|
+
},
|
|
132
|
+
"printElementType": { "type": "table" }
|
|
133
|
+
}
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
列属性:`title`, `field`, `width`(pt), `align`, `colspan`, `rowspan`, `checked`, `tableSummary`(count/sum/avg)
|
|
137
|
+
|
|
138
|
+
### image — 图片
|
|
139
|
+
|
|
140
|
+
```json
|
|
141
|
+
{
|
|
142
|
+
"options": {
|
|
143
|
+
"left": 60, "top": 30, "height": 80, "width": 80,
|
|
144
|
+
"field": "logoUrl",
|
|
145
|
+
"src": "默认图片URL",
|
|
146
|
+
"fit": "contain" // contain/cover/fill/scale
|
|
147
|
+
},
|
|
148
|
+
"printElementType": { "type": "image" }
|
|
149
|
+
}
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### longText — 长文本(自动分页)
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"options": {
|
|
157
|
+
"left": 30, "top": 100, "height": 40, "width": 511.5,
|
|
158
|
+
"field": "contractContent",
|
|
159
|
+
"testData": "长文本预览...",
|
|
160
|
+
"fontSize": 10.5, "lineHeight": 18
|
|
161
|
+
},
|
|
162
|
+
"printElementType": { "type": "longText" }
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### html — 自定义 HTML
|
|
167
|
+
|
|
168
|
+
```json
|
|
169
|
+
{
|
|
170
|
+
"options": {
|
|
171
|
+
"left": 30, "top": 200, "height": 80, "width": 300,
|
|
172
|
+
"formatter": "function(t, e, d) { return '<div>' + (d.customField || '') + '</div>'; }"
|
|
173
|
+
},
|
|
174
|
+
"printElementType": { "type": "html" }
|
|
175
|
+
}
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### 条形码 / 二维码
|
|
179
|
+
|
|
180
|
+
```json
|
|
181
|
+
// 条形码(text + textType)
|
|
182
|
+
{ "options": { "field": "barcodeNo", "testData": "XS888888888", "textType": "barcode", "hideTitle": true }, "printElementType": { "type": "text" } }
|
|
183
|
+
// 二维码
|
|
184
|
+
{ "options": { "field": "qrcodeUrl", "testData": "https://microi.net", "textType": "qrcode" }, "printElementType": { "type": "text" } }
|
|
185
|
+
// SVG 版本(矢量不失真)
|
|
186
|
+
{ "printElementType": { "type": "barcode" } }
|
|
187
|
+
{ "printElementType": { "type": "qrcode" } }
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### 辅助图形
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
// 水平线
|
|
194
|
+
{ "options": { "left": 30, "top": 80, "height": 9, "width": 511.5, "borderStyle": "solid", "borderWidth": 0.75 }, "printElementType": { "type": "hline" } }
|
|
195
|
+
// 垂直线
|
|
196
|
+
{ "printElementType": { "type": "vline" } }
|
|
197
|
+
// 矩形
|
|
198
|
+
{ "printElementType": { "type": "rect" } }
|
|
199
|
+
// 椭圆
|
|
200
|
+
{ "printElementType": { "type": "oval" } }
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## PrintObj 打印数据
|
|
204
|
+
|
|
205
|
+
```json
|
|
206
|
+
{
|
|
207
|
+
"companyName": "吾码科技有限公司",
|
|
208
|
+
"orderNo": "ORD-2024-001",
|
|
209
|
+
"items": [
|
|
210
|
+
{ "id": "1", "name": "商品A", "qty": "10", "price": "100", "total": "1000" }
|
|
211
|
+
]
|
|
212
|
+
}
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**绑定规则:**
|
|
216
|
+
- 简单字段:元素 `field: "companyName"` → `PrintObj.companyName`
|
|
217
|
+
- 表格数据:表格 `field: "items"` → `PrintObj.items`(数组),列 `field: "name"` → `items[i].name`
|
|
218
|
+
- 图片:`field: "logoUrl"` → URL 或 Base64
|
|
219
|
+
- 条形码/二维码:`field` + `textType` 自动渲染
|
|
220
|
+
|
|
221
|
+
## 表格函数属性
|
|
222
|
+
|
|
223
|
+
| 属性 | 函数签名 | 说明 |
|
|
224
|
+
|------|----------|------|
|
|
225
|
+
| formatter2 | `function(value, row, index, options)` | 单元格渲染,首参为值、index为列索引 |
|
|
226
|
+
| styler2 | `function(value, row, index, options)` | 单元格样式 |
|
|
227
|
+
| rowStyler | `function(row, index, options)` | 行样式 |
|
|
228
|
+
| footerFormatter | `function(options, rows, data, el)` | 表尾渲染 |
|
|
229
|
+
| tableSummaryFormatter | `function(column, data)` | 合计行渲染 |
|
|
230
|
+
|
|
231
|
+
## 生成模板最佳实践
|
|
232
|
+
|
|
233
|
+
1. **坐标计算**:A4 可用宽度约 571.5pt,从 left=30 开始留白
|
|
234
|
+
2. **元素间距**:垂直间距 15-22.5pt
|
|
235
|
+
3. **表格列宽**:所有列宽之和应等于表格 width
|
|
236
|
+
4. **field 命名**:camelCase,与 PrintObj 键名一致
|
|
237
|
+
5. **testData**:每个绑定字段必须提供 testData
|
|
238
|
+
6. **PrintObj 值**:所有字段值应为字符串类型
|
|
239
|
+
|
|
240
|
+
### 常用布局
|
|
241
|
+
|
|
242
|
+
- **标题区(top: 15-60)**:居中大字号标题 + hline 分隔 + 右上角二维码/LOGO
|
|
243
|
+
- **信息区(top: 60-120)**:单号、日期、客户信息
|
|
244
|
+
- **数据区(top: 120+)**:表格元素,自动分页
|
|
245
|
+
- **签章区(靠近页脚)**:签名线、日期线、印章图片
|
|
246
|
+
|
|
247
|
+
## 接口引擎集成
|
|
248
|
+
|
|
249
|
+
`DataApi` 字段关联接口引擎,返回的 `Data` 对象直接作为 PrintObj 注入模板:
|
|
250
|
+
|
|
251
|
+
```javascript
|
|
252
|
+
return {
|
|
253
|
+
Code: 1,
|
|
254
|
+
Data: {
|
|
255
|
+
orderNo: "ORD-2024-001",
|
|
256
|
+
items: [{ seq: "1", name: "商品A", qty: "10", price: "100", total: "1000" }]
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
```
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: production-readonly-audit
|
|
3
|
-
description: Microi 正式环境只读业务巡检规范。用于在不改动线上数据的前提下,检查会员、余额、订单、库存卡、奖励、积分、兑换金额、日志和结算正确性等生产业务数据。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
> **Microi吾码基础规范(强制):** 任何 AI 模型与宿主每次新建或接续吾码任务,先完整读取 `../workspace-conventions/SKILL.md`,必须执行版本播报、`@microi.net/cli` 后台自动升级、Skills/MCP 同步和进度播报。安装与诊断读取 `../microi-codex-installer/SKILL.md`;更新失败延后重试,不阻断当前工作。
|
|
7
|
-
|
|
8
|
-
# Microi 正式环境只读业务巡检
|
|
9
|
-
|
|
10
|
-
## 核心边界
|
|
11
|
-
|
|
12
|
-
- 正式环境已有真实用户、余额、订单、卡券或收益数据时,线上巡检默认是只读任务。
|
|
13
|
-
- 优先使用目标租户 MCP 的读表、查结构、查日志工具;不得调用新增、更新、删除、清库、重算、补发、扣减接口。
|
|
14
|
-
- 如果用户要求“检查是否正常”,先输出异常证据、影响范围、建议修复方式和回读验证方式;没有明确授权前,不修线上业务数据。
|
|
15
|
-
- MCP 不可用时,可使用官方后台登录 token + FormEngine `getTableData` 做只读兜底,但必须在结果中说明“非 MCP,只读 API 兜底”;不得调用 `add/upt/del/run` 维护接口。
|
|
16
|
-
- 任何资金/资产异常即使明显,也只能先报告。获得修复授权后,必须小范围条件更新,并在方案文档留下 SQL/接口说明、执行时间、影响行数和回读结果。
|
|
17
|
-
|
|
18
|
-
## 商城类固定巡检表
|
|
19
|
-
|
|
20
|
-
- 会员与团队:`mall_member`
|
|
21
|
-
- 提货卡与挂单:`mall_stock_card`、`mall_stock_card_listing`
|
|
22
|
-
- 抢购/约单/商品订单:`mall_buy_order`、`mall_appointment_order`、`mall_redeem_order`
|
|
23
|
-
- 积分/兑换金/奖励:`mall_point_log`、`mall_redeem_money_log`、`mall_reward_log`
|
|
24
|
-
- 上架服务费:`mall_storage_fee_order`
|
|
25
|
-
- 提货卡扣除/流转:`mall_stock_card_redeem`、`mall_stock_card_history`
|
|
26
|
-
- 规则配置:`mall_system_config`
|
|
27
|
-
|
|
28
|
-
## 固定检查项
|
|
29
|
-
|
|
30
|
-
- 提货卡:`CardNo` 必须为 6 位大写字母+数字;金额不得为负;`OwnerId` 必须存在;同一卡只能有一条活跃挂单;状态机必须和挂单/订单一致。
|
|
31
|
-
- 抢购订单:`PendingPay` 必须有关联锁定卡与付款截止时间;`Paid` 必须有支付凭证和付款时间;`Confirmed/Completed` 必须确认卡 OwnerId 已转为 BuyerId,并有对应流转历史。
|
|
32
|
-
- 上架服务费:服务费应等于持有价 × `PlatformServiceRate`;已支付服务费必须有对应负数积分流水。
|
|
33
|
-
- 推荐奖励:`Amount = BaseAmount × Rate / 100`;直推、间推、品牌补贴合计不得超过 `MaxPerformanceCommissionRate`;`Pending` 不得生成积分流水或增加余额;`Settled` 必须有积分流水并真实到账。
|
|
34
|
-
- 商品支付:提货卡专区订单必须生成 `mall_stock_card_redeem` 并扣卡余额;兑换金专区订单必须生成负数 `mall_redeem_money_log` 并扣兑换金。
|
|
35
|
-
- 会员资产:会员页展示的提货卡资产应以当前名下有效提货卡 `HoldPrice/StockValue` 汇总为准;如 `mall_member.StockValue` 是冗余字段,必须与实际资产保持一致。
|
|
36
|
-
|
|
37
|
-
## 输出要求
|
|
38
|
-
|
|
39
|
-
- 报告必须区分“硬错误”和“风险警告”。
|
|
40
|
-
- 不输出密码、token、支付凭证图片原文、完整身份证等敏感信息。
|
|
41
|
-
- 报告需包含巡检通道、读取表数量、状态分布、异常数量、核心异常证据、未覆盖范围。
|
|
1
|
+
---
|
|
2
|
+
name: production-readonly-audit
|
|
3
|
+
description: Microi 正式环境只读业务巡检规范。用于在不改动线上数据的前提下,检查会员、余额、订单、库存卡、奖励、积分、兑换金额、日志和结算正确性等生产业务数据。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
> **Microi吾码基础规范(强制):** 任何 AI 模型与宿主每次新建或接续吾码任务,先完整读取 `../workspace-conventions/SKILL.md`,必须执行版本播报、`@microi.net/cli` 后台自动升级、Skills/MCP 同步和进度播报。安装与诊断读取 `../microi-codex-installer/SKILL.md`;更新失败延后重试,不阻断当前工作。
|
|
7
|
+
|
|
8
|
+
# Microi 正式环境只读业务巡检
|
|
9
|
+
|
|
10
|
+
## 核心边界
|
|
11
|
+
|
|
12
|
+
- 正式环境已有真实用户、余额、订单、卡券或收益数据时,线上巡检默认是只读任务。
|
|
13
|
+
- 优先使用目标租户 MCP 的读表、查结构、查日志工具;不得调用新增、更新、删除、清库、重算、补发、扣减接口。
|
|
14
|
+
- 如果用户要求“检查是否正常”,先输出异常证据、影响范围、建议修复方式和回读验证方式;没有明确授权前,不修线上业务数据。
|
|
15
|
+
- MCP 不可用时,可使用官方后台登录 token + FormEngine `getTableData` 做只读兜底,但必须在结果中说明“非 MCP,只读 API 兜底”;不得调用 `add/upt/del/run` 维护接口。
|
|
16
|
+
- 任何资金/资产异常即使明显,也只能先报告。获得修复授权后,必须小范围条件更新,并在方案文档留下 SQL/接口说明、执行时间、影响行数和回读结果。
|
|
17
|
+
|
|
18
|
+
## 商城类固定巡检表
|
|
19
|
+
|
|
20
|
+
- 会员与团队:`mall_member`
|
|
21
|
+
- 提货卡与挂单:`mall_stock_card`、`mall_stock_card_listing`
|
|
22
|
+
- 抢购/约单/商品订单:`mall_buy_order`、`mall_appointment_order`、`mall_redeem_order`
|
|
23
|
+
- 积分/兑换金/奖励:`mall_point_log`、`mall_redeem_money_log`、`mall_reward_log`
|
|
24
|
+
- 上架服务费:`mall_storage_fee_order`
|
|
25
|
+
- 提货卡扣除/流转:`mall_stock_card_redeem`、`mall_stock_card_history`
|
|
26
|
+
- 规则配置:`mall_system_config`
|
|
27
|
+
|
|
28
|
+
## 固定检查项
|
|
29
|
+
|
|
30
|
+
- 提货卡:`CardNo` 必须为 6 位大写字母+数字;金额不得为负;`OwnerId` 必须存在;同一卡只能有一条活跃挂单;状态机必须和挂单/订单一致。
|
|
31
|
+
- 抢购订单:`PendingPay` 必须有关联锁定卡与付款截止时间;`Paid` 必须有支付凭证和付款时间;`Confirmed/Completed` 必须确认卡 OwnerId 已转为 BuyerId,并有对应流转历史。
|
|
32
|
+
- 上架服务费:服务费应等于持有价 × `PlatformServiceRate`;已支付服务费必须有对应负数积分流水。
|
|
33
|
+
- 推荐奖励:`Amount = BaseAmount × Rate / 100`;直推、间推、品牌补贴合计不得超过 `MaxPerformanceCommissionRate`;`Pending` 不得生成积分流水或增加余额;`Settled` 必须有积分流水并真实到账。
|
|
34
|
+
- 商品支付:提货卡专区订单必须生成 `mall_stock_card_redeem` 并扣卡余额;兑换金专区订单必须生成负数 `mall_redeem_money_log` 并扣兑换金。
|
|
35
|
+
- 会员资产:会员页展示的提货卡资产应以当前名下有效提货卡 `HoldPrice/StockValue` 汇总为准;如 `mall_member.StockValue` 是冗余字段,必须与实际资产保持一致。
|
|
36
|
+
|
|
37
|
+
## 输出要求
|
|
38
|
+
|
|
39
|
+
- 报告必须区分“硬错误”和“风险警告”。
|
|
40
|
+
- 不输出密码、token、支付凭证图片原文、完整身份证等敏感信息。
|
|
41
|
+
- 报告需包含巡检通道、读取表数量、状态分布、异常数量、核心异常证据、未覆盖范围。
|