bpmax-cli 0.2.1-beta.9 → 0.2.1-beta.91
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/README.md +30 -7
- package/dist/bin.js +45782 -12836
- package/dist/bin.js.map +1 -1
- package/package.json +12 -5
- package/scripts/install-skills.mjs +27 -60
- package/scripts/run-source-cli.mjs +145 -0
- package/skills/bpmax-ai-taskbook/SKILL.md +17 -1
- package/skills/bpmax-ai-taskbook/references/blueprint-taskbook-gates.md +141 -0
- package/skills/bpmax-ai-taskbook/references/taskbook-template.md +43 -3
- package/skills/bpmax-api-platform-editor/SKILL.md +24 -31
- package/skills/bpmax-api-platform-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-api-platform-editor/references/platform-api-map.md +2 -2
- package/skills/bpmax-api-platform-editor/references/runtime-workflow.md +3 -3
- package/skills/bpmax-approval-matrix/SKILL.md +54 -2
- package/skills/bpmax-blueprint-doc-workflow/SKILL.md +38 -5
- package/skills/bpmax-blueprint-doc-workflow/references/blueprint-structure.md +24 -8
- package/skills/bpmax-blueprint-doc-workflow/references/business-language.md +74 -0
- package/skills/bpmax-blueprint-doc-workflow/references/per-flow-required-structure.md +13 -0
- package/skills/bpmax-blueprint-doc-workflow/references/review-and-confirmation-dialogue.md +70 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-modeling-review.xml +23 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-missing-review-record.xml +72 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-paragraph-flow-details.xml +27 -0
- package/skills/bpmax-blueprint-doc-workflow/references/sample-pass.xml +59 -35
- package/skills/bpmax-blueprint-doc-workflow/references/sample-system-identifier.xml +79 -0
- package/skills/bpmax-blueprint-doc-workflow/references/source-traceability-and-flow-modeling.md +115 -0
- package/skills/bpmax-blueprint-doc-workflow/scripts/lint_blueprint_doc.py +586 -5
- package/skills/bpmax-bug-reporting/SKILL.md +72 -0
- package/skills/bpmax-builder-shared/SKILL.md +1 -0
- package/skills/bpmax-builder-shared/configuration-impact-review.md +76 -0
- package/skills/bpmax-builder-shared/template_script_hard_rules.py +3 -1
- package/skills/bpmax-builder-shared/tests/test_template_script_hard_rules.py +16 -0
- package/skills/bpmax-business-skill/SKILL.md +3 -1
- package/skills/bpmax-cli/SKILL.md +46 -0
- package/skills/bpmax-config-latest/SKILL.md +4 -0
- package/skills/bpmax-console-template-editor/SKILL.md +113 -523
- package/skills/bpmax-console-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-console-template-editor/references/full-detail-guide.md +45 -0
- package/skills/bpmax-console-template-editor/references/local-temp-workflow.md +13 -12
- package/skills/bpmax-console-template-editor/scripts/console_template_editor_common.py +299 -78
- package/skills/bpmax-console-template-editor/tests/test_console_template_editor.py +344 -30
- package/skills/bpmax-dataset-field-template-editor/SKILL.md +131 -594
- package/skills/bpmax-dataset-field-template-editor/references/full-detail-guide.md +570 -0
- package/skills/bpmax-dataset-field-template-editor/references/nested-field-patterns.md +8 -8
- package/skills/bpmax-dataset-field-template-editor/references/runtime-verified-field-page-shape.md +1 -1
- package/skills/bpmax-dataset-field-template-editor/scripts/dataset_field_editor_common.py +11 -77
- package/skills/bpmax-dataset-field-template-editor/scripts/export_dataset_field.py +4 -57
- package/skills/bpmax-dataset-field-template-editor/scripts/init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-field-template-editor/scripts/inspect_dataset_field_runtime.py +4 -78
- package/skills/bpmax-dataset-field-template-editor/scripts/submit_dataset_field.py +3 -89
- package/skills/bpmax-dataset-field-template-editor/tests/test_dataset_field_editor.py +14 -0
- package/skills/bpmax-dataset-field-template-editor/tests/test_init_create_dataset_field.py +2 -0
- package/skills/bpmax-dataset-template-editor/SKILL.md +123 -778
- package/skills/bpmax-dataset-template-editor/references/dataset-script-runtime-matrix.md +11 -0
- package/skills/bpmax-dataset-template-editor/references/full-detail-guide.md +753 -0
- package/skills/bpmax-dataset-template-editor/references/runtime-gotchas.md +12 -0
- package/skills/bpmax-dataset-template-editor/references/ui-to-backend-field-map.md +1 -0
- package/skills/bpmax-dataset-template-editor/references/work-file-to-submit-mapping.md +2 -2
- package/skills/bpmax-dataset-template-editor/scripts/basic_table_audit.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/dataset_editor_common.py +9 -90
- package/skills/bpmax-dataset-template-editor/scripts/export_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/resolve_dataset.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/submit_dataset.py +1 -2
- package/skills/bpmax-dataset-template-editor/scripts/verify_dataset_list.py +8 -1
- package/skills/bpmax-dataset-template-editor/scripts/verify_publish_health.py +8 -1
- package/skills/bpmax-dataset-template-editor/tests/test_dataset_editor.py +6 -40
- package/skills/bpmax-e2e-flow-config-orchestrator/SKILL.md +18 -4
- package/skills/bpmax-e2e-flow-config-orchestrator/agents/openai.yaml +2 -2
- package/skills/bpmax-e2e-flow-config-orchestrator/references/orchestration-matrix.md +13 -9
- package/skills/bpmax-e2e-flow-test-operator/SKILL.md +174 -546
- package/skills/bpmax-e2e-flow-test-operator/agents/openai.yaml +2 -3
- package/skills/bpmax-e2e-flow-test-operator/references/ai-test-suite.md +181 -15
- package/skills/bpmax-e2e-flow-test-operator/references/browser-action-dsl.md +169 -0
- package/skills/bpmax-e2e-flow-test-operator/references/browser-only-checkpoints.md +15 -7
- package/skills/bpmax-e2e-flow-test-operator/references/full-detail-guide.md +589 -0
- package/skills/bpmax-e2e-flow-test-operator/references/minimal-test-loop.md +12 -8
- package/skills/bpmax-e2e-flow-test-operator/references/negative-sale-api-matrix.md +4 -4
- package/skills/bpmax-e2e-flow-test-operator/references/profile-schema.md +1 -1
- package/skills/bpmax-e2e-flow-test-operator/references/state-schema.md +3 -1
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_doc.py +7 -5
- package/skills/bpmax-e2e-flow-test-operator/scripts/e2e_state.py +2 -2
- package/skills/bpmax-e2e-flow-test-operator/scripts/flow_runner.py +5 -1
- package/skills/bpmax-e2e-flow-test-operator/tests/test_negative_sale_api_tools.py +71 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/SKILL.md +64 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/agents/openai.yaml +7 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/automation-generation-pipeline.md +33 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/autonomous-execution.md +40 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/batch-generation-and-execution.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-action-runner.md +19 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/browser-recording-and-replay.md +95 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/form-script-generation.md +41 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/identity-and-failure-routing.md +92 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/multi-request-mutation.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scenario-coverage-generation.md +17 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/scoped-execution.md +13 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/step-restartability-and-state.md +23 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-assets-and-evidence.md +9 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-data-and-selector-contract.md +51 -0
- package/skills/bpmax-e2e-flow-test-operator-v2/references/test-preflight-and-confirmation.md +32 -0
- package/skills/bpmax-filter-template-editor/SKILL.md +114 -551
- package/skills/bpmax-filter-template-editor/references/experience-coverage-matrix.md +18 -18
- package/skills/bpmax-filter-template-editor/references/filter-content-schema.md +21 -0
- package/skills/bpmax-filter-template-editor/references/filter-request-shape.md +29 -26
- package/skills/bpmax-filter-template-editor/references/filter-runtime-patterns.md +19 -2
- package/skills/bpmax-filter-template-editor/references/full-detail-guide.md +56 -0
- package/skills/bpmax-filter-template-editor/references/runtime-verified-filter-page-shape.md +10 -9
- package/skills/bpmax-filter-template-editor/scripts/filter_template_editor_common.py +7 -57
- package/skills/bpmax-filter-template-editor/tests/test_filter_template_editor.py +4 -48
- package/skills/bpmax-flow/SKILL.md +2 -0
- package/skills/bpmax-flow-detail-template-editor/SKILL.md +53 -0
- package/skills/bpmax-flow-template-editor/SKILL.md +140 -1137
- package/skills/bpmax-flow-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-flow-template-editor/references/diff-strategy.md +3 -3
- package/skills/bpmax-flow-template-editor/references/editor-runtime-vs-draft.md +9 -9
- package/skills/bpmax-flow-template-editor/references/flow-template-api-workflow.md +9 -1
- package/skills/bpmax-flow-template-editor/references/full-detail-guide.md +1162 -0
- package/skills/bpmax-flow-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-flow-template-editor/references/message-card-professional-standard.md +234 -0
- package/skills/bpmax-flow-template-editor/references/payload-checklist.md +2 -0
- package/skills/bpmax-flow-template-editor/references/project-create-runtime-gotchas.md +17 -0
- package/skills/bpmax-flow-template-editor/references/requirement-to-node-mapping.md +8 -3
- package/skills/bpmax-flow-template-editor/references/runtime-verified-flow-detail-shape.md +7 -7
- package/skills/bpmax-flow-template-editor/references/runtime-verified-meta-fields.md +2 -2
- package/skills/bpmax-flow-template-editor/references/runtime-verified-node-fields.md +12 -2
- package/skills/bpmax-flow-template-editor/references/save-draft-request-shape.md +7 -23
- package/skills/bpmax-flow-template-editor/references/script-review-hard-rules.md +17 -0
- package/skills/bpmax-flow-template-editor/references/work-file-to-submit-mapping.md +1 -1
- package/skills/bpmax-flow-template-editor/tests/test_flow_template_editor.py +19 -75
- package/skills/bpmax-form-template-editor/SKILL.md +138 -1151
- package/skills/bpmax-form-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-form-template-editor/references/dynamic-field-state.md +167 -0
- package/skills/bpmax-form-template-editor/references/form-template-api-workflow.md +51 -51
- package/skills/bpmax-form-template-editor/references/full-detail-guide.md +1115 -0
- package/skills/bpmax-form-template-editor/references/local-temp-workflow.md +4 -4
- package/skills/bpmax-form-template-editor/references/payload-checklist.md +3 -1
- package/skills/bpmax-form-template-editor/references/sub-form-patterns.md +6 -0
- package/skills/bpmax-form-template-editor/scripts/form_template_editor_common.py +8 -0
- package/skills/bpmax-form-template-editor/tests/test_form_template_editor.py +42 -19
- package/skills/bpmax-functional-test-design/LICENSE.upstream +24 -0
- package/skills/bpmax-functional-test-design/SKILL.md +80 -0
- package/skills/bpmax-functional-test-design/agents/openai.yaml +4 -0
- package/skills/bpmax-functional-test-design/references/bpmax-test-suite-output.md +95 -0
- package/skills/bpmax-functional-test-design/references/decision-table-testing.md +50 -0
- package/skills/bpmax-functional-test-design/references/domain-testing.md +43 -0
- package/skills/bpmax-functional-test-design/references/state-transition-testing.md +47 -0
- package/skills/bpmax-functional-test-design/references/technique-selection.md +38 -0
- package/skills/bpmax-functional-test-design/references/use-case-testing.md +55 -0
- package/skills/bpmax-group-model-editor/SKILL.md +24 -0
- package/skills/bpmax-home-portal-editor/SKILL.md +81 -0
- package/skills/bpmax-icon-catalog/SKILL.md +18 -0
- package/skills/bpmax-icon-catalog/agents/openai.yaml +4 -0
- package/skills/bpmax-icon-catalog/assets/ri-icons.json +3140 -0
- package/skills/bpmax-icon-catalog/references/source-contract.md +3 -0
- package/skills/bpmax-list-template-editor/SKILL.md +133 -466
- package/skills/bpmax-list-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-list-template-editor/references/content-config-shape.md +16 -4
- package/skills/bpmax-list-template-editor/references/full-detail-guide.md +461 -0
- package/skills/bpmax-list-template-editor/references/list-template-api-workflow.md +6 -9
- package/skills/bpmax-list-template-editor/references/local-temp-workflow.md +1 -1
- package/skills/bpmax-list-template-editor/references/runtime-verified-workflow.md +50 -2
- package/skills/bpmax-list-template-editor/references/special-formats.md +5 -2
- package/skills/bpmax-list-template-editor/scripts/list_template_editor_common.py +9 -78
- package/skills/bpmax-memory-protocol/SKILL.md +7 -6
- package/skills/bpmax-nav-config-editor/SKILL.md +14 -17
- package/skills/bpmax-nav-config-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-nav-config-editor/references/api-workflow.md +2 -2
- package/skills/bpmax-nav-config-editor/references/runtime-probing.md +11 -12
- package/skills/bpmax-page-composition-template-editor/SKILL.md +398 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/catalog.json +41 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/full-capability-workbench.json +294 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-detail-step-panel.json +184 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-list-quick-process.json +177 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-dashboard.json +400 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-visual-light.json +214 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/step-related-projects.json +184 -0
- package/skills/bpmax-page-composition-template-editor/references/resource-api.md +9 -0
- package/skills/bpmax-plugin-config/SKILL.md +55 -5
- package/skills/bpmax-project/SKILL.md +37 -1
- package/skills/bpmax-project-detail-template-editor/SKILL.md +13 -39
- package/skills/bpmax-project-detail-template-editor/agents/openai.yaml +2 -2
- package/skills/bpmax-role-editor/SKILL.md +11 -30
- package/skills/bpmax-shared/SKILL.md +19 -9
- package/skills/bpmax-team-editor/SKILL.md +27 -0
- package/skills/bpmax-ui-ux-audit/LICENSE.upstream +23 -0
- package/skills/bpmax-ui-ux-audit/SKILL.md +42 -0
- package/skills/bpmax-ui-ux-audit/agents/openai.yaml +4 -0
- package/skills/bpmax-ui-ux-audit/references/audit-framework.md +39 -0
- package/skills/bpmax-ui-ux-audit/references/bpmax-ux-findings.md +56 -0
- package/skills/bpmax-user/SKILL.md +33 -1
- package/skills/bpmax-user-mock-operator/SKILL.md +58 -56
- package/skills/bpmax-user-mock-operator/agents/openai.yaml +2 -2
- package/skills/bpmax-user-mock-operator/scripts/chrome_identity_bridge.mjs +1766 -0
- package/skills/bpmax-user-model-editor/SKILL.md +24 -0
- package/skills/bpmax-workspace-editor/SKILL.md +1 -0
- package/skills/form-control-library/references/form-template-submit-schema.md +3 -1
- package/skills/bpmax-user-mock-operator/scripts/switch_user_identity.py +0 -37
- package/skills/bpmax-user-mock-operator/scripts/user_mock_operator_common.py +0 -136
- package/skills/bpmax-user-mock-operator/tests/test_user_mock_operator.py +0 -138
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bpmax-page-composition-template-editor
|
|
3
|
+
version: 1.1.0
|
|
4
|
+
description: "Use typed bpmax-cli when creating, editing, previewing, exporting, submitting, verifying, or managing static resources for the independent BPMAX composition-template type."
|
|
5
|
+
metadata:
|
|
6
|
+
requires:
|
|
7
|
+
bins: ["bpmax-cli"]
|
|
8
|
+
cliHelp: "bpmax-cli config page-template --help"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# BPMAX Page Composition Template Editor
|
|
12
|
+
|
|
13
|
+
用于新的独立 `page-composition-template` 类型。它使用 `think_page_composition_template` 和 `/api/page_composition_template`,不得改写旧的 `flow_page_template`、列表、详情或控制台模板。
|
|
14
|
+
|
|
15
|
+
## 适用范围
|
|
16
|
+
|
|
17
|
+
- 页面模板的 export、lint、impact、preview、build、submit、verify 和 readback。
|
|
18
|
+
- 页面模板专属静态资源(图片、字体、Less/CSS、JSON、JavaScript)的上传、登记、列表、引用和删除保护。
|
|
19
|
+
- 页面模板方法注入:模板可直接调用 `data.methods` 中的白名单方法,context/query/action 可通过 `transform`/`prepare` 引用方法。
|
|
20
|
+
- 跨 `project-list`、`project-detail`、`step-process`、`custom` 入口的运行验证。
|
|
21
|
+
|
|
22
|
+
旧 `flow_page_template type=4` 看板必须使用 `bpmax-console-template-editor`,不要用本 skill 代替它。
|
|
23
|
+
|
|
24
|
+
## 页面模板预设
|
|
25
|
+
|
|
26
|
+
业务样例预设由本 skill 维护,平台前端只提供通用编辑器和运行时,不内置业务样例。预设位于 `examples/presets/`,包括项目运营看板、项目列表、项目详情和环节处理等可复用起点。
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
bpmax-cli config page-template preset list --format json
|
|
30
|
+
bpmax-cli config page-template preset export \
|
|
31
|
+
--id project-operations-visual-light \
|
|
32
|
+
--out page-template.work.json \
|
|
33
|
+
--format json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`preset export` 只写出本地 page-template work JSON,不访问服务端,也不会提交配置。导出后必须按标准闭环执行:
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
lint → preview → build → submit dry-run → verify
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
预设可以复制后修改名称、Key、查询、方法、资源和渲染内容;不要直接修改已提交模板来代替新的预设文件。新增业务样例时,在 `examples/presets/` 增加 JSON 并同步 `catalog.json`,不要把业务 HTML、Less 或查询重新写回平台前端。
|
|
43
|
+
|
|
44
|
+
## 资源工作流
|
|
45
|
+
|
|
46
|
+
1. 先确认当前 profile、配置工作区和 `config.page_template.asset.*` capability;不要把 API key、cookie 或本地敏感路径写进 work、报告或 skill。
|
|
47
|
+
2. 对已有模板执行:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
bpmax-cli config page-template asset-upload \
|
|
51
|
+
--template-id <id> --file <path> --kind asset|script \
|
|
52
|
+
--work <page-template-work.json> --out-work <page-template-work-with-asset.json> \
|
|
53
|
+
--profile <profile> --format json
|
|
54
|
+
bpmax-cli config page-template asset-list --template-id <id> --profile <profile> --format json
|
|
55
|
+
bpmax-cli config page-template asset-delete --asset-id <asset-id> --profile <profile> --format json
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
3. 上传成功必须同时核对返回的 URL、名称、MIME、大小、SHA-256 和模板归属;`--work` 只在取得服务端 URL 后追加 `template.resources`,不能猜 URL。
|
|
59
|
+
4. 在 `render.template`、`render.style` 或数据声明中引用资源 URL 后,先 lint/preview,再 build/submit;Less 的 `url(...)` 只能引用已登记资源,禁止外部未登记地址、`@import`、脚本标签和危险表达式。
|
|
60
|
+
5. 方法资源必须是已登记、带 SHA-256 的 ESM `.mjs`;方法签名为 `export function name(ctx, ...args)`,模板调用时只写 `name(args)`,不能访问 Vue `this` 或浏览器全局对象。
|
|
61
|
+
6. Inline/resource 方法按受控解释器执行,禁止 DOM、网络、动态代码、Vue 实例和全局对象;不能使用 `for/for-in/for-of/while/do`、`class`、`with`、`yield`,同步方法不能使用 `await`,`new` 仅允许 `Date`/`Array`。context transform 必须同步,query transform/action prepare 可按声明使用异步方法。复杂数据聚合优先交给服务端 `/project/aggregate`,不要把全量明细搬进方法计算。
|
|
62
|
+
7. 删除前先从最新模板 readback 检查引用。服务端返回引用冲突时保持资源和模板不变,记录可恢复动作:先移除模板引用并重新提交,再删除资源。
|
|
63
|
+
8. 二进制浏览器上传需要真实 `FileUpload`/chooser 证据;CLI multipart 上传成功不能替代浏览器 E2E 或业务验收。
|
|
64
|
+
|
|
65
|
+
## 标准配置闭环
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
bpmax-cli config page-template export --id <id> --out <dir> --profile <profile> --format json
|
|
69
|
+
bpmax-cli config page-template lint --work <dir>/work/<file>.json --profile <profile> --format json
|
|
70
|
+
bpmax-cli config page-template impact --raw <dir>/raw/<file>.json --work <dir>/work/<file>.json --out <dir>/result/impact.json --profile <profile> --format json
|
|
71
|
+
bpmax-cli config page-template preview --work <dir>/work/<file>.json --out <dir>/preview --mode mock --format json
|
|
72
|
+
bpmax-cli config page-template build --work <dir>/work/<file>.json --meta <dir>/meta/<file>.meta.json --preview-manifest <dir>/preview/preview.manifest.json --boundary-manifest <dir>/result/scope.json --out <dir>/submit/<file>.json --profile <profile> --format json
|
|
73
|
+
bpmax-cli config page-template submit --id <id> --payload <dir>/submit/<file>.json --profile <profile> --format json
|
|
74
|
+
bpmax-cli config page-template verify --id <id> --expect <dir>/work/<file>.json --profile <profile> --format json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 编辑范围门禁(edit 必需)
|
|
78
|
+
|
|
79
|
+
编辑已有模板时,`build` 必须传 `--boundary-manifest`,声明本次只允许修改的 JSON 路径;新建(`mode: "create"`)不需要。
|
|
80
|
+
|
|
81
|
+
```json
|
|
82
|
+
{
|
|
83
|
+
"schema_version": 1,
|
|
84
|
+
"change_type": "page-template-scope",
|
|
85
|
+
"allowed_paths": ["/template/render/template"],
|
|
86
|
+
"forbidden_paths": ["/key", "/template/data/queries"],
|
|
87
|
+
"rationale": "只修改页面标题文案"
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
- 路径为 JSON Pointer;`/a/b` 与 `/a/b/**` 都覆盖其子路径。`/` 和 `/template` 被视为过宽而拒绝;`/id`、`/uuid` 默认禁止修改。
|
|
92
|
+
- build 用导出的 raw 基线(hash 必须等于 `meta.base_hash`)做两层比对:raw→work 的字面修改,和 canonical(raw)→payload 的提交变化。每个变化被分为 `requested`(在 allowed 内)、`required_collateral`(由已请求修改推导出的字段,例如 `render.style` 变化导致的 `render.css`)或 `out_of_scope`。只要存在 `out_of_scope` 或命中 `forbidden_paths`,build 以 `[page_template_scope_exceeded]` 阻断并列出路径。
|
|
93
|
+
- 结果写入 submit 文件的 `page_template_scope`,绑定 `raw_hash` 和 `payload_hash`。非 dry-run 的 edit submit 缺少该产物、产物与 payload 不一致或含越界路径时,以 `[page_template_scope_artifact_required]` 在远端请求前阻断。
|
|
94
|
+
- 越界时先撤回无关修改;确实需要改的字段才加入 `allowed_paths`,不要用放宽路径绕过门禁。
|
|
95
|
+
|
|
96
|
+
带有 `build --preview-manifest` 生成且仍与 canonical payload hash 匹配的 page-template submit payload,会复用该 manifest 作为确认凭据,因此不再要求重复传入 `--confirm`。显式传入 `--dry-run` 始终只输出计划、不写远端;缺少或过期 manifest 的真实写入会在远端请求前阻断。若额外传入 `--confirm`,其值必须与目标对象匹配,否则在远端请求前拒绝。
|
|
97
|
+
|
|
98
|
+
## 数据层查询引擎(默认 ES)
|
|
99
|
+
|
|
100
|
+
`template.data.queries.<name>.engine` 只允许 `es`、`sql`、`api`,CLI 在 lint/build/preview 时规范化并写入 canonical payload、lint 结果 `page_template_queries` 和 `data-trace.json` 的 `query_engines`。
|
|
101
|
+
|
|
102
|
+
- `/project/list` 默认走 ES:必须声明 `params.data_set_key`(优先)或 `params.data_set_id`;只写 `engine: "es"` 时 CLI 补全 `resource: "/project/list"`。
|
|
103
|
+
- ES `/project/list` 只能使用 `POST`,省略 `method` 时 CLI 在 canonical payload 中补为 `POST`,显式 `GET` 会被拒绝。运行时也会拒绝 ES `GET`,避免请求体丢失;明确声明 SQL 的兼容查询不受此 ES 约束。
|
|
104
|
+
- ES 项目列表必须带分页参数;CLI canonical payload 会补全 `params.page: 1` 和 `params.page_size: 20`,显式提供时保留调用方值。运行时把这两个字段放到请求 query string(服务端 `Pagination` 从 query 校验),其余 ES DTO 放在 POST body;旧模板也会使用同样的只读默认值,避免服务端返回“无效的页码”。
|
|
105
|
+
- ES 行字段可能使用 `__id`、`__owner_id`、`__create_time` 或业务字段 JSON 字符串,而页面能力读取通用字段。可在查询上声明安全的 `row_mapping` 点路径,运行时会保留原始 ES 行并补出页面字段;例如:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"row_mapping": {
|
|
110
|
+
"id": "__id",
|
|
111
|
+
"name": "lcbh.value",
|
|
112
|
+
"owner_id": "__owner_id",
|
|
113
|
+
"owner_name": "__project_owner.name",
|
|
114
|
+
"create_time": "__create_time",
|
|
115
|
+
"current_step_name": "current_step_name"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`row_mapping` 只允许安全的字段点路径,不能执行表达式;CLI lint/build 会规范为 snake_case 的 `row_mapping` 并拒绝非法路径。模板应优先使用这些通用字段,业务字段仍可从原始 ES 行读取。
|
|
121
|
+
|
|
122
|
+
服务端筛选字段也必须在列表查询上显式声明,并保持逻辑控件名与 ES 字段的映射稳定。只允许 `status`、`keyword`、`owner` 和 `created_date` 四个逻辑键;`createdDate` 仅作为输入兼容别名,lint/build 会规范为 `created_date`。字段值只能是安全的 ES 点路径,不能写表达式或从当前结果行推导:
|
|
123
|
+
|
|
124
|
+
```json
|
|
125
|
+
{
|
|
126
|
+
"filterMode": "server",
|
|
127
|
+
"filterGroup": "dashboard",
|
|
128
|
+
"filter_fields": {
|
|
129
|
+
"status": "status",
|
|
130
|
+
"keyword": "xmmc1",
|
|
131
|
+
"owner": "__owner_id",
|
|
132
|
+
"created_date": "__create_time"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
`filter_fields` 只能用于 `engine: "es"` 的 `/project/list` 查询,并应与对应聚合查询使用同一个 `filterGroup`。筛选按钮提交后,运行时会把逻辑控件转换为受控的 term/wildcard/range ES 查询并刷新整组查询;不要把 `filter_fields` 放在聚合查询、SQL 查询或客户端查询体中。CLI lint 会拒绝未知逻辑键、危险字段路径、重复的 `created_date`/`createdDate` 声明和未声明 `filterMode: "server"` 的映射。
|
|
138
|
+
|
|
139
|
+
交互筛选的 `filterGroup` 必须是稳定的字母开头名称(例如 `dashboard`)。为避免刷新时列表和聚合失去同步,带 `filterGroup` 的 `/project/list` 查询必须同时声明 `filterMode: "server"` 和完整的 `filter_fields`;聚合查询使用相同的 `filterGroup`。固定的 `params.query` 在受控字段上只能使用 `term` 或 `terms`,不能使用 `raw`、`range`、`wildcard` 等无法与用户输入安全求交的条件;这类配置会在 lint 阶段失败,而不是等到点击筛选后才报错。只有没有列表成员的聚合组会给出 `page_template.filter.group_list_missing` warning,因为它没有可供交互刷新挂载的列表查询。
|
|
140
|
+
- 服务端只在请求体含 `data_set_id|data_set_key|query|is_select_all|_source|aggs` 时走 ES。未声明 engine 且不含这些字段的 `/project/list` 查询会被 lint 拒绝(`page_template.query.implicit_sql`),不能静默走 SQL。
|
|
141
|
+
- ES 查询没有 fixture 回退;空结果或请求失败要按实际数据展示空态或错误,不能用样例行冒充 ES 结果。
|
|
142
|
+
- 确需 SQL(例如跨多个业务流程、没有统一数据集)时显式写 `engine: "sql"` 并填写 `reason`;`sql` 查询不得携带 ES 字段。不要为跨流程看板凭空指定某个数据集。
|
|
143
|
+
- 自定义接口使用 `engine: "api"`,不得指向 `/project/list`。
|
|
144
|
+
- 数据集 key/id 必须来自真实配置 readback(如 `bpmax-cli config dataset export` 或 `project search` 验证有数据),不能猜测。
|
|
145
|
+
|
|
146
|
+
### ES 聚合查询
|
|
147
|
+
|
|
148
|
+
看板的全量 KPI、状态分布、负责人分布和时间趋势必须由服务端 ES 聚合生成,不能从 `page_size=20` 的 `projectRows` 在浏览器逐行统计。使用受控的 `/project/aggregate` 查询,并与列表查询通过相同的 `filterGroup` 绑定:
|
|
149
|
+
|
|
150
|
+
```json
|
|
151
|
+
{
|
|
152
|
+
"projects": {
|
|
153
|
+
"engine": "es",
|
|
154
|
+
"resource": "/project/list",
|
|
155
|
+
"method": "POST",
|
|
156
|
+
"filterMode": "server",
|
|
157
|
+
"filterGroup": "dashboard",
|
|
158
|
+
"filter_fields": {
|
|
159
|
+
"status": "status",
|
|
160
|
+
"keyword": "xmmc1",
|
|
161
|
+
"owner": "__owner_id",
|
|
162
|
+
"created_date": "__create_time"
|
|
163
|
+
},
|
|
164
|
+
"params": {
|
|
165
|
+
"data_set_key": "main",
|
|
166
|
+
"flow_type": "flow636354625",
|
|
167
|
+
"flow_key": ""
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"dashboardStats": {
|
|
171
|
+
"engine": "es",
|
|
172
|
+
"mode": "aggregate",
|
|
173
|
+
"resource": "/project/aggregate",
|
|
174
|
+
"method": "POST",
|
|
175
|
+
"params": {
|
|
176
|
+
"data_set_key": "main",
|
|
177
|
+
"flow_type": "flow636354625",
|
|
178
|
+
"flow_key": ""
|
|
179
|
+
},
|
|
180
|
+
"aggs": {
|
|
181
|
+
"by_status": { "type": "terms", "field": "status", "size": 8 },
|
|
182
|
+
"by_owner": { "type": "terms", "field": "__owner_id", "size": 20 },
|
|
183
|
+
"by_month": {
|
|
184
|
+
"type": "date_histogram",
|
|
185
|
+
"field": "__create_time",
|
|
186
|
+
"calendar_interval": "month"
|
|
187
|
+
},
|
|
188
|
+
"total_projects": { "type": "value_count", "field": "__id" }
|
|
189
|
+
},
|
|
190
|
+
"filterGroup": "dashboard"
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
约定和限制:
|
|
196
|
+
|
|
197
|
+
- 聚合查询必须显式使用 `engine: "es"`、`mode: "aggregate"`、`resource: "/project/aggregate"` 和 `POST`,并提供真实数据集 `data_set_key` 或 `data_set_id`。使用 `data_set_key` 时必须能从配置或当前路由得到字符串 `flow_type` 和 `flow_key`(主流程的 `flow_key` 可以是空字符串);CLI lint 会在配置未写死流程范围时发出 `page_template.query.dataset_scope` warning,服务端仍会拒绝缺少流程范围的请求。
|
|
198
|
+
- 聚合查询参数只能包含数据集选择器(`data_set_key` 或 `data_set_id` 二选一)、流程范围(`flow_type`、`flow_key`)、受控的 `query` 和可选的 `pagination`;顶层不能传 `page`/`page_size`、`is_select_all`、`sort`、hook、`_source` 或任意 ES DSL。桶分页和桶排序必须写在 `params.pagination` 内,不能复用列表分页参数。
|
|
199
|
+
- 支持 `terms`、`date_histogram`、`top_hits`、`sum`、`avg`、`min`、`max`、`stats`、`cardinality`、`value_count`。字段必须是安全的点路径;`terms.size`、`top_hits.size` 不得超过 100,`terms.min_doc_count` 只接受 0–1000000 的整数,`top_hits._source` 必须列出 1–30 个安全字段,聚合总节点数和嵌套深度由 CLI 限制。
|
|
200
|
+
- `terms` 可用 `include`/`exclude` 过滤桶键,每个数组只能包含 1–100 个字符串且单个值不超过 1024 字符。`top_hits` 只允许声明在本节点(不能再嵌套 `aggs`),`size` 默认 1,`sort` 只允许一个安全字段映射到 `asc|desc`,`_source` 不能省略;它用于读取桶内少量明细,不能替代全量导出。
|
|
201
|
+
- `top_hits` 会把每个已物化桶的明细一起带回,必须同时控制桶窗口和 `top_hits.size`:分页桶窗口乘以内层命中数不得超过 100000。大结果集应优先分页或导出,而不是一次请求全部明细。
|
|
202
|
+
- 指标聚合(`sum`、`avg`、`min`、`max`、`stats`、`cardinality`、`value_count`)不能再包含子聚合;同一节点不能同时使用 `aggs` 和 `aggregations`。列表查询中的 `params.aggs`/`params.aggregations` 会被拒绝,因为列表接口不会执行这些统计,必须使用独立的 `mode: "aggregate"` 查询。
|
|
203
|
+
- 不得配置 `script`、`runtime_mappings`、任意 `query/body/dsl`、原始 `aggregations` 或客户端指定的 ES index。数据集、工作区、项目可见性、负责人和权限过滤由服务端解析并执行。
|
|
204
|
+
- 列表查询和聚合查询使用相同的 `filterGroup`。筛选按钮触发该组的服务端刷新;列表使用 `page`/`page_size`,聚合只能使用 `params.pagination`。刷新列表时不得把 `{ page: 1 }` 合并进聚合参数,否则服务端会返回 `project.validation.invalidAggregations`。
|
|
205
|
+
- `/project/aggregate` 返回标准化 `aggregations`,配置了桶分页时还会返回 `pagination: { agg, page, page_size, total_agg?, total }`。模板方法可以读取 `queryAggregations('dashboardStats')` 和 `queryPagination('dashboardStats')`,但不应以当前分页行数推导全量指标;空聚合和 ES 错误必须显示可恢复空态/错误态。
|
|
206
|
+
- `page-chart` 绑定聚合时应显式传入 `:aggregation="dashboardAggregations.by_status"` 等值;聚合为空表示真实的空态,组件不会回退到当前页 rows。状态桶可传 `:aggregation-labels="statusLabels"`,负责人 ID 桶可用 `aggregation-label-prefix="负责人 "` 或由模板提供独立、完整的负责人字典。`__project_owner` 是 nested 字段,不能直接作为这十种公开聚合的 terms field;若必须展示全量负责人名称,应先提供受控字典查询或由服务端返回 `key_as_string`,不能把当前 20 行当作全量字典。
|
|
207
|
+
- 运行时刷新失败会保留上次成功的列表、KPI 和聚合结果,并暴露错误与重试入口;模板仍应提供明确的刷新/重试操作,不得把错误伪装成空数据。
|
|
208
|
+
- CLI lint 会输出 `page_template_queries` 的 `mode`、聚合摘要和分页摘要;preview 的 `data-trace.json` 只记录聚合名称、类型、字段、深度、桶分页窗口和 `top_hits` 字段数量,不记录完整结果或源码。修改聚合或分页定义后必须重新 lint、preview、build,旧 manifest 会因 canonical hash 失效。
|
|
209
|
+
|
|
210
|
+
聚合配置完成后按以下顺序验证,并使用真实数据集 readback 确认字段 mapping:
|
|
211
|
+
|
|
212
|
+
```text
|
|
213
|
+
lint → preview --mode mock → build → submit --dry-run → verify → 运行页只读检查
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### 聚合桶分页
|
|
217
|
+
|
|
218
|
+
明细型聚合(例如按状态、月份、负责人分组后展示桶内样本)不要在浏览器里一次拉取全部桶。为某个根级 `terms` 或 `date_histogram` 声明 `params.pagination`,运行时会把 `page/page_size` 交给服务端 `bucket_sort`:
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"dashboardDetail": {
|
|
223
|
+
"engine": "es",
|
|
224
|
+
"mode": "aggregate",
|
|
225
|
+
"resource": "/project/aggregate",
|
|
226
|
+
"method": "POST",
|
|
227
|
+
"params": {
|
|
228
|
+
"data_set_key": "main",
|
|
229
|
+
"flow_type": "flow636354625",
|
|
230
|
+
"flow_key": "",
|
|
231
|
+
"pagination": {
|
|
232
|
+
"agg": "by_status",
|
|
233
|
+
"page": 1,
|
|
234
|
+
"page_size": 10,
|
|
235
|
+
"total_agg": "status_bucket_count",
|
|
236
|
+
"sort": { "_count": "desc" }
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"aggs": {
|
|
240
|
+
"by_status": {
|
|
241
|
+
"type": "terms",
|
|
242
|
+
"field": "status",
|
|
243
|
+
"size": 10,
|
|
244
|
+
"aggs": {
|
|
245
|
+
"latest_project": {
|
|
246
|
+
"type": "top_hits",
|
|
247
|
+
"size": 1,
|
|
248
|
+
"sort": { "__create_time": "desc" },
|
|
249
|
+
"_source": ["__id", "xmmc1", "status", "__create_time"]
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"status_bucket_count": { "type": "cardinality", "field": "status" }
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
分页边界必须按服务端契约配置:
|
|
260
|
+
|
|
261
|
+
- `pagination.agg` 必须是已声明的根级 `terms`/`date_histogram`,不能指向指标或 `top_hits`;只允许 `agg`、`page`、`page_size`、`total_agg`、`sort` 五个键。
|
|
262
|
+
- `page` 为 1–10000,`page_size` 为 1–100,且 `page * page_size <= 10000`;服务端不接受客户端直接传 `bucket_sort`。
|
|
263
|
+
- `total_agg` 必须指向根级 `cardinality`,不能使用 `value_count`(后者统计文档数,不是桶数)。响应中的 `total` 和 `totalPages` 依赖该指标。
|
|
264
|
+
- `sort` 只允许一个键:`_count`、`_key`,或目标桶下已声明的单值数值指标(`sum/avg/min/max/value_count/cardinality`);`stats` 不能作为排序键。未声明 `sort` 时沿用桶自身的 `order`。
|
|
265
|
+
- 目标桶下存在 `top_hits` 时,`page * page_size * max(top_hits.size)` 不得超过 100000;`top_hits.size` 为 1–100。
|
|
266
|
+
- 模板使用 `queryPagination('dashboardDetail')` 读取分页元数据,用 `setAggregatePage('dashboardDetail', page)` 切页,并绑定运行时已注册的 `el-pagination`。筛选刷新应重置为第 1 页,但不要把列表的 `{ page: 1 }` 原样合并到聚合 `params`。
|
|
267
|
+
- `total_agg` 未配置时服务端只能返回当前页信息;需要稳定总页数时必须配置根级 `cardinality`,不能从当前页桶数推导。
|
|
268
|
+
|
|
269
|
+
### 筛选器选项必须独立于查询结果
|
|
270
|
+
|
|
271
|
+
状态、类型、负责人等筛选器的可选项是业务枚举或独立字典,不能从当前查询结果、分页结果或已筛选结果动态生成。否则服务端筛选返回 0 行或少量行时,下拉选项会错误地消失。
|
|
272
|
+
|
|
273
|
+
对于项目状态筛选,使用运行时提供的稳定 `statusOptions`,或在模板中写入完整的静态选项列表:
|
|
274
|
+
|
|
275
|
+
```vue
|
|
276
|
+
<el-select v-model="filterStatus">
|
|
277
|
+
<el-option
|
|
278
|
+
v-for="status in statusOptions"
|
|
279
|
+
:key="status.key"
|
|
280
|
+
:label="status.label"
|
|
281
|
+
:value="status.key"
|
|
282
|
+
/>
|
|
283
|
+
</el-select>
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
禁止使用 `projectRows`、`filteredProjectRows`、`paginatedProjectRows`、`statusRows` 或 `queryRows(...)` 作为状态选项的 `v-for` 来源,也不要在 `data.methods` 中覆盖保留的 `statusOptions` 方法。CLI lint 会以 `page_template.filter.options_dynamic` 拒绝这类配置;lint 输出的 `page_template_filters.status.options_must_be_static=true` 是该约定的可审计证据。修改模板后必须重新执行 lint/preview/build,不能只修改运行时数据来掩盖选项缺失。
|
|
287
|
+
|
|
288
|
+
预览只能生成 mock 或 live-readonly 证据;真实写入只能走 typed CLI,并必须使用锁定的 canonical payload。HTTP 200、preview 或 build 不能单独证明运行态或业务验收。
|
|
289
|
+
|
|
290
|
+
方法示例:
|
|
291
|
+
|
|
292
|
+
```json
|
|
293
|
+
{
|
|
294
|
+
"data": {
|
|
295
|
+
"methods": {
|
|
296
|
+
"formatOwner": {
|
|
297
|
+
"source": "inline",
|
|
298
|
+
"mode": "sync",
|
|
299
|
+
"permissions": [],
|
|
300
|
+
"code": "return value && value.owner_name ? value.owner_name : '未分配';"
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### Action 数据导出
|
|
308
|
+
|
|
309
|
+
页面模板的导出按钮可以通过 `data.actions` 声明服务端 CSV 导出,不需要在浏览器逐页拼接全量数据。动作 key 由模板传给 `exportProjects`,例如 `@click="exportProjects({ exportKey: 'exportDetail', expectedDisplay: '当前筛选明细' })"`。运行时先检查 `canExportData(key)`,再通过 `POST /project/get_report_list_url` 执行 `dataSource` 和 `config`,最后由 HPT 分页流式生成 CSV。
|
|
310
|
+
|
|
311
|
+
```json
|
|
312
|
+
{
|
|
313
|
+
"actions": {
|
|
314
|
+
"exportDetail": {
|
|
315
|
+
"capability": "project.export",
|
|
316
|
+
"name": "明细导出",
|
|
317
|
+
"role_key": "orgadmin",
|
|
318
|
+
"exportCount": 10000,
|
|
319
|
+
"dataSource": "const range = ctx.appliedDateRange; const page = Number(ctx.pageInfo?.value?.page || 1); const pageSize = Number(ctx.pageInfo?.value?.page_size || 2000); return { tickets: { driver: 'es', config: { data_set_key: 'main', flow_type: 'flow636354625', flow_key: '', body: { from: (page - 1) * pageSize, size: pageSize, query: { bool: { must: range ? [{ range: { __create_time: range } }] : [] } }, _source: ['__id', 'xmmc1', 'status'] } } } };",
|
|
320
|
+
"config": "const hits = ctx.tickets?.hits; const rows = (hits?.hits || []).map(hit => hit._source || {}); const total = Number(hits?.total?.value ?? hits?.total ?? 0); return { data: rows, cols: [{ label: '项目ID', prop: '__id' }, { label: '项目名称', prop: 'xmmc1' }, { label: '状态', prop: 'status' }], pageInfo: { page: Number(ctx.pageInfo?.value?.page || 1), page_size: Number(ctx.pageInfo?.value?.page_size || 2000), count: total }, exportNotify: true };"
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
约定:
|
|
327
|
+
|
|
328
|
+
- 带 `dataSource` 或 `config` 的 action 必须声明已注册的 `capability`(通常为 `project.export`);前端用该 capability 和 `role_key` 判断按钮是否可用,未声明 `capability` 时 action key 会被当成 capability,导致权限校验失败。
|
|
329
|
+
- `dataSource` 负责生成查询定义,返回 `{ <key>: { driver: 'es', config: { data_set_key|data_set_id, flow_type, flow_key, body } } }`;`page`/`page_size` 从 `ctx.pageInfo.value` 读取,时间范围从 `ctx.appliedDateRange` 读取,不能把列表页行数当作全量。
|
|
330
|
+
- `config` 负责把一个查询结果映射为 CSV:必须返回 `data`(行数组)、`cols`(`label`/`prop` 数组)和 `pageInfo.count`;`exportNotify: false` 可关闭导出完成通知。每个 `prop` 必须对应数据行字段,不能依赖浏览器端未定义的 helper。
|
|
331
|
+
- `exportCount` 是导出上限,默认 10000,必须为正整数;服务端按 2000 条左右分页执行,连续两页为空或达到上限后停止。超过所需规模时应提示用户缩小筛选范围,而不是无限增大上限。
|
|
332
|
+
- `role_key` 是额外的角色限制,必须与当前用户角色 key 完全匹配;没有该限制时省略。`name` 只用于文件名前缀,运行时会把非法字符替换为 `_`。
|
|
333
|
+
- `dataSource`/`config` 在服务端执行,不得写 DOM、网络请求、动态代码、Vue 实例或未声明的全局对象;导出脚本中的异步逻辑应遵守 HPT 的脚本执行约束,先 lint/preview 再用真实模板验证。
|
|
334
|
+
|
|
335
|
+
## 页面模板查询的数据源约定
|
|
336
|
+
|
|
337
|
+
页面模板中的项目列表查询默认使用 Elasticsearch。配置时建议显式声明 `engine: "es"`;带 ES 字段的 `/project/list` 即使省略 engine,CLI 也会规范为 ES。通过 `params.data_set_key`(优先)或经 readback 验证的 `params.data_set_id` 指定数据集:
|
|
338
|
+
|
|
339
|
+
```json
|
|
340
|
+
{
|
|
341
|
+
"projects": {
|
|
342
|
+
"engine": "es",
|
|
343
|
+
"resource": "/project/list",
|
|
344
|
+
"method": "POST",
|
|
345
|
+
"params": {
|
|
346
|
+
"data_set_key": "main",
|
|
347
|
+
"flow_type": "flow636354625",
|
|
348
|
+
"flow_key": "",
|
|
349
|
+
"with_step": 1
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
`data_set_key` 与流程身份共同确定 ES index;跨流程页面可以省略流程身份,由运行时从当前页面路由补齐,但 lint 会提示必须验证该绑定。裸 `/project/list` 会落到 SQL,页面模板 lint 将其拒绝。只有有明确理由的跨流程查询才允许 `engine: "sql"`,并应填写 `reason`。
|
|
356
|
+
|
|
357
|
+
## 测试与审查
|
|
358
|
+
|
|
359
|
+
资源至少覆盖:可支持扩展名、空文件、超过 10MB、未知 MIME、模板归属隔离、列表回读、URL 在模板/Less/数据中的引用、引用资源删除保护、未引用资源删除、重复刷新和失败恢复。UX 审查先使用 `bpmax-functional-test-design`,再使用 `bpmax-ui-ux-audit`;每个当前运行确认的问题登记为 P0–P3 BUG,并执行:
|
|
360
|
+
|
|
361
|
+
```bash
|
|
362
|
+
bpmax-cli test-suite lint-report --root .ai_test/report/<run> --format json
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
未完成 FileUpload chooser、权限矩阵、正式 submit/readback 或 business acceptance 时,只报告 `partial`,不得升级为 `pass`。
|
|
366
|
+
|
|
367
|
+
## 页面模板图标约定
|
|
368
|
+
|
|
369
|
+
页面模板中的按钮、输入框和状态操作应优先使用平台已有的 Element UI 组件,并使用平台图标目录中的完整 Remix Icon class。图标选择必须先查询和校验,不能凭名称猜测:
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
bpmax-cli icon search --query refresh --format json
|
|
373
|
+
bpmax-cli icon get ri_refresh-line --format json
|
|
374
|
+
bpmax-cli icon validate "ri ri_refresh-line" --format json
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
运行时 class 必须包含 `ri` 前缀和下划线名称,例如 `ri ri_refresh-line`、`ri ri_search-line`;不能使用缺少前缀的 `ri_refresh-line`,不得将 Remix 名称直接改成 `el-icon-*`;同一业务操作组优先统一为 Remix line 风格。可用图标来自随 CLI 发布的 `skills/bpmax-icon-catalog/assets/ri-icons.json`(Remix Icon line/fill 图标集合),`bpmax-cli icon search/get/validate` 是配置时的唯一查询和校验入口。
|
|
378
|
+
|
|
379
|
+
当前前端图标库与边界:
|
|
380
|
+
|
|
381
|
+
| 图标库 | class / 用法 | 校验与选型 |
|
|
382
|
+
| --- | --- | --- |
|
|
383
|
+
| Remix Icon(首选) | 完整 `ri ri_<name>`,优先 `line` | `bpmax-cli icon search/get/validate` 使用分发 catalog;真实页面仍须检查 CSS/字体加载和字形 |
|
|
384
|
+
| Element UI 2 内置图标 | `el-icon-*`,可使用 `el-button icon`、`el-input prefix-icon`;loading 由组件自动处理 | 不属于 Remix catalog;使用当前 Element UI 提供的类名并核对实际渲染,不用 `icon validate` 声称已校验 |
|
|
385
|
+
| BPMAX / Untitled UI 字体图标 | `bp-i-*`(前端已有 `bp-iconfont/style.css`) | 不属于 Remix catalog;仅沿用当前样式表中可验证的类名,不猜新名称 |
|
|
386
|
+
|
|
387
|
+
无需为平台已有图标另外上传 JS 或字体,也不要默认引入外部 CDN 图标库。若命令从配置 workspace 执行提示 catalog 路径不存在,可使用 `BPMAX_ICON_CATALOG` 指向当前 CLI 分发的 `skills/bpmax-icon-catalog/assets/ri-icons.json` 后重试;不要绕过集合校验。
|
|
388
|
+
|
|
389
|
+
Vue 模板示例:
|
|
390
|
+
|
|
391
|
+
```vue
|
|
392
|
+
<el-button type="default" size="small" :loading="dashboardRefreshing" :disabled="dashboardRefreshing" @click="refreshAll" aria-label="刷新数据">
|
|
393
|
+
<i v-if="!dashboardRefreshing" class="ri ri_refresh-line" aria-hidden="true"></i>
|
|
394
|
+
<span>刷新数据</span>
|
|
395
|
+
</el-button>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
图标应放在对应操作控件内部;保留可读文字或 `aria-label`,确保图标不是唯一信息。筛选器、刷新等页面操作应保持 Element UI 的 loading/disabled 状态,并通过既有 capability、查询或刷新方法执行,不在模板中直接发起请求。
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"presets": [
|
|
4
|
+
{
|
|
5
|
+
"id": "project-operations-dashboard",
|
|
6
|
+
"file": "project-operations-dashboard.json",
|
|
7
|
+
"label": "项目运营数据看板 + 交互列表",
|
|
8
|
+
"description": "页面模板定义页头、指标、状态分布、筛选、项目列表和快速处理抽屉。"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "project-operations-visual-light",
|
|
12
|
+
"file": "project-operations-visual-light.json",
|
|
13
|
+
"label": "项目运营可视化看板(浅色)",
|
|
14
|
+
"description": "浅色平面化图表看板,标题单行展示。"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "project-list-quick-process",
|
|
18
|
+
"file": "project-list-quick-process.json",
|
|
19
|
+
"label": "项目列表 + 快速处理抽屉",
|
|
20
|
+
"description": "项目列表行级作用域,点击行操作打开环节处理抽屉。"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "project-detail-step-panel",
|
|
24
|
+
"file": "project-detail-step-panel.json",
|
|
25
|
+
"label": "项目详情 + 环节处理侧栏",
|
|
26
|
+
"description": "项目详情和环节表单、操作能力并列组合。"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "step-related-projects",
|
|
30
|
+
"file": "step-related-projects.json",
|
|
31
|
+
"label": "环节处理 + 关联项目列表",
|
|
32
|
+
"description": "环节表单、操作和关联项目列表组合。"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"id": "full-capability-workbench",
|
|
36
|
+
"file": "full-capability-workbench.json",
|
|
37
|
+
"label": "全能力组合工作台",
|
|
38
|
+
"description": "覆盖项目、环节和报表能力的只读预览与 dry-run 验证样例。"
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
}
|