bpmax-cli 0.2.1-beta.73 → 0.2.1-beta.76
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 +10 -0
- package/dist/bin.js +2572 -906
- package/dist/bin.js.map +1 -1
- package/package.json +3 -1
- package/skills/bpmax-cli/SKILL.md +1 -0
- package/skills/bpmax-page-composition-template-editor/SKILL.md +207 -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 +191 -0
- package/skills/bpmax-page-composition-template-editor/examples/presets/project-operations-visual-light.json +165 -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-role-editor/SKILL.md +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpmax-cli",
|
|
3
|
-
"version": "0.2.1-beta.
|
|
3
|
+
"version": "0.2.1-beta.76",
|
|
4
4
|
"description": "CLI for BPMAX environments with multi-profile config and local login callback flow",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -32,10 +32,12 @@
|
|
|
32
32
|
"axios": "^1.9.0",
|
|
33
33
|
"commander": "^14.0.0",
|
|
34
34
|
"jszip": "^3.10.1",
|
|
35
|
+
"less": "^4.9.1",
|
|
35
36
|
"open": "^10.1.2",
|
|
36
37
|
"playwright-core": "1.61.1"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
40
|
+
"@types/less": "^3.0.8",
|
|
39
41
|
"@types/node": "^22.15.17",
|
|
40
42
|
"tsup": "^8.5.0",
|
|
41
43
|
"tsx": "^4.19.4",
|
|
@@ -89,6 +89,7 @@ bpmax-cli issue create --title "<标题>" --description-file <file.md> --label b
|
|
|
89
89
|
- 本地 schema manifest:读 `../bpmax-schema/SKILL.md`
|
|
90
90
|
- 服务端能力白名单:先用 `capabilities status/refresh` 查看当前 profile 已授权 capability,不要绕过白名单手写 raw API
|
|
91
91
|
- 插件安装、组织/工作区激活、插件提供的配置 Skill:先进入 `../bpmax-plugin-config/SKILL.md`。先用 typed activation overview 证明插件在目标工作区生效,再按远端 sha256 发现或更新 Skill;依赖过期或冲突 Skill 的配置 lint/build/submit 不得继续。
|
|
92
|
+
- 独立跨页面组合模板、Vue/Less、模板专属静态资源上传与引用:读 `../bpmax-page-composition-template-editor/SKILL.md`。
|
|
92
93
|
- BPMAX Business Skills 查询、同步、安装、更新、卸载:读 `../bpmax-business-skill/SKILL.md`
|
|
93
94
|
- AI 任务方案、任务书、任务拆解、subagent 分工、实施任务表、进度 CSV:读 `../bpmax-ai-taskbook/SKILL.md`
|
|
94
95
|
- 审批矩阵、角色矩阵、矩阵规则记录、`matrix_owner`、`cc_matrix`、规则 seed、审批人映射:读 `../bpmax-approval-matrix/SKILL.md`
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: bpmax-page-composition-template-editor
|
|
3
|
+
version: 1.0.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 方法只能使用受控纯函数体;禁止 DOM、网络、动态代码、Vue 实例和全局对象。context transform 必须同步,query transform/action prepare 可按声明使用异步方法。
|
|
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 --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> --confirm "submit page-template <id>" --format json
|
|
74
|
+
bpmax-cli config page-template verify --id <id> --expect <dir>/work/<file>.json --profile <profile> --format json
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## 数据层查询引擎(默认 ES)
|
|
78
|
+
|
|
79
|
+
`template.data.queries.<name>.engine` 只允许 `es`、`sql`、`api`,CLI 在 lint/build/preview 时规范化并写入 canonical payload、lint 结果 `page_template_queries` 和 `data-trace.json` 的 `query_engines`。
|
|
80
|
+
|
|
81
|
+
- `/project/list` 默认走 ES:必须声明 `params.data_set_key`(优先)或 `params.data_set_id`;只写 `engine: "es"` 时 CLI 补全 `resource: "/project/list"`。
|
|
82
|
+
- ES `/project/list` 只能使用 `POST`,省略 `method` 时 CLI 在 canonical payload 中补为 `POST`,显式 `GET` 会被拒绝。运行时也会拒绝 ES `GET`,避免请求体丢失;明确声明 SQL 的兼容查询不受此 ES 约束。
|
|
83
|
+
- ES 项目列表必须带分页参数;CLI canonical payload 会补全 `params.page: 1` 和 `params.page_size: 20`,显式提供时保留调用方值。运行时把这两个字段放到请求 query string(服务端 `Pagination` 从 query 校验),其余 ES DTO 放在 POST body;旧模板也会使用同样的只读默认值,避免服务端返回“无效的页码”。
|
|
84
|
+
- ES 行字段可能使用 `__id`、`__owner_id`、`__create_time` 或业务字段 JSON 字符串,而页面能力读取通用字段。可在查询上声明安全的 `row_mapping` 点路径,运行时会保留原始 ES 行并补出页面字段;例如:
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"row_mapping": {
|
|
89
|
+
"id": "__id",
|
|
90
|
+
"name": "lcbh.value",
|
|
91
|
+
"owner_id": "__owner_id",
|
|
92
|
+
"owner_name": "__project_owner.name",
|
|
93
|
+
"create_time": "__create_time",
|
|
94
|
+
"current_step_name": "current_step_name"
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
`row_mapping` 只允许安全的字段点路径,不能执行表达式;CLI lint/build 会规范为 snake_case 的 `row_mapping` 并拒绝非法路径。模板应优先使用这些通用字段,业务字段仍可从原始 ES 行读取。
|
|
100
|
+
- 服务端只在请求体含 `data_set_id|data_set_key|query|is_select_all|_source|aggs` 时走 ES。未声明 engine 且不含这些字段的 `/project/list` 查询会被 lint 拒绝(`page_template.query.implicit_sql`),不能静默走 SQL。
|
|
101
|
+
- ES 查询没有 fixture 回退;空结果或请求失败要按实际数据展示空态或错误,不能用样例行冒充 ES 结果。
|
|
102
|
+
- 确需 SQL(例如跨多个业务流程、没有统一数据集)时显式写 `engine: "sql"` 并填写 `reason`;`sql` 查询不得携带 ES 字段。不要为跨流程看板凭空指定某个数据集。
|
|
103
|
+
- 自定义接口使用 `engine: "api"`,不得指向 `/project/list`。
|
|
104
|
+
- 数据集 key/id 必须来自真实配置 readback(如 `bpmax-cli config dataset export` 或 `project search` 验证有数据),不能猜测。
|
|
105
|
+
|
|
106
|
+
### 筛选器选项必须独立于查询结果
|
|
107
|
+
|
|
108
|
+
状态、类型、负责人等筛选器的可选项是业务枚举或独立字典,不能从当前查询结果、分页结果或已筛选结果动态生成。否则服务端筛选返回 0 行或少量行时,下拉选项会错误地消失。
|
|
109
|
+
|
|
110
|
+
对于项目状态筛选,使用运行时提供的稳定 `statusOptions`,或在模板中写入完整的静态选项列表:
|
|
111
|
+
|
|
112
|
+
```vue
|
|
113
|
+
<el-select v-model="filterStatus">
|
|
114
|
+
<el-option
|
|
115
|
+
v-for="status in statusOptions"
|
|
116
|
+
:key="status.key"
|
|
117
|
+
:label="status.label"
|
|
118
|
+
:value="status.key"
|
|
119
|
+
/>
|
|
120
|
+
</el-select>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
禁止使用 `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,不能只修改运行时数据来掩盖选项缺失。
|
|
124
|
+
|
|
125
|
+
预览只能生成 mock 或 live-readonly 证据;真实写入只能走 typed CLI,并必须使用锁定的 canonical payload。HTTP 200、preview 或 build 不能单独证明运行态或业务验收。
|
|
126
|
+
|
|
127
|
+
方法示例:
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"data": {
|
|
132
|
+
"methods": {
|
|
133
|
+
"formatOwner": {
|
|
134
|
+
"source": "inline",
|
|
135
|
+
"mode": "sync",
|
|
136
|
+
"permissions": [],
|
|
137
|
+
"code": "return value && value.owner_name ? value.owner_name : '未分配';"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## 页面模板查询的数据源约定
|
|
145
|
+
|
|
146
|
+
页面模板中的项目列表查询默认使用 Elasticsearch。配置时建议显式声明 `engine: "es"`;带 ES 字段的 `/project/list` 即使省略 engine,CLI 也会规范为 ES。通过 `params.data_set_key`(优先)或经 readback 验证的 `params.data_set_id` 指定数据集:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"projects": {
|
|
151
|
+
"engine": "es",
|
|
152
|
+
"resource": "/project/list",
|
|
153
|
+
"method": "POST",
|
|
154
|
+
"params": {
|
|
155
|
+
"data_set_key": "main",
|
|
156
|
+
"flow_type": "flow636354625",
|
|
157
|
+
"flow_key": "",
|
|
158
|
+
"with_step": 1
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
`data_set_key` 与流程身份共同确定 ES index;跨流程页面可以省略流程身份,由运行时从当前页面路由补齐,但 lint 会提示必须验证该绑定。裸 `/project/list` 会落到 SQL,页面模板 lint 将其拒绝。只有有明确理由的跨流程查询才允许 `engine: "sql"`,并应填写 `reason`。
|
|
165
|
+
|
|
166
|
+
## 测试与审查
|
|
167
|
+
|
|
168
|
+
资源至少覆盖:可支持扩展名、空文件、超过 10MB、未知 MIME、模板归属隔离、列表回读、URL 在模板/Less/数据中的引用、引用资源删除保护、未引用资源删除、重复刷新和失败恢复。UX 审查先使用 `bpmax-functional-test-design`,再使用 `bpmax-ui-ux-audit`;每个当前运行确认的问题登记为 P0–P3 BUG,并执行:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
bpmax-cli test-suite lint-report --root .ai_test/report/<run> --format json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
未完成 FileUpload chooser、权限矩阵、正式 submit/readback 或 business acceptance 时,只报告 `partial`,不得升级为 `pass`。
|
|
175
|
+
|
|
176
|
+
## 页面模板图标约定
|
|
177
|
+
|
|
178
|
+
页面模板中的按钮、输入框和状态操作应优先使用平台已有的 Element UI 组件,并使用平台图标目录中的完整 Remix Icon class。图标选择必须先查询和校验,不能凭名称猜测:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
bpmax-cli icon search --query refresh --format json
|
|
182
|
+
bpmax-cli icon get ri_refresh-line --format json
|
|
183
|
+
bpmax-cli icon validate "ri ri_refresh-line" --format json
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
运行时 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` 是配置时的唯一查询和校验入口。
|
|
187
|
+
|
|
188
|
+
当前前端图标库与边界:
|
|
189
|
+
|
|
190
|
+
| 图标库 | class / 用法 | 校验与选型 |
|
|
191
|
+
| --- | --- | --- |
|
|
192
|
+
| Remix Icon(首选) | 完整 `ri ri_<name>`,优先 `line` | `bpmax-cli icon search/get/validate` 使用分发 catalog;真实页面仍须检查 CSS/字体加载和字形 |
|
|
193
|
+
| Element UI 2 内置图标 | `el-icon-*`,可使用 `el-button icon`、`el-input prefix-icon`;loading 由组件自动处理 | 不属于 Remix catalog;使用当前 Element UI 提供的类名并核对实际渲染,不用 `icon validate` 声称已校验 |
|
|
194
|
+
| BPMAX / Untitled UI 字体图标 | `bp-i-*`(前端已有 `bp-iconfont/style.css`) | 不属于 Remix catalog;仅沿用当前样式表中可验证的类名,不猜新名称 |
|
|
195
|
+
|
|
196
|
+
无需为平台已有图标另外上传 JS 或字体,也不要默认引入外部 CDN 图标库。若命令从配置 workspace 执行提示 catalog 路径不存在,可使用 `BPMAX_ICON_CATALOG` 指向当前 CLI 分发的 `skills/bpmax-icon-catalog/assets/ri-icons.json` 后重试;不要绕过集合校验。
|
|
197
|
+
|
|
198
|
+
Vue 模板示例:
|
|
199
|
+
|
|
200
|
+
```vue
|
|
201
|
+
<el-button type="default" size="small" :loading="dashboardRefreshing" :disabled="dashboardRefreshing" @click="refreshAll" aria-label="刷新数据">
|
|
202
|
+
<i v-if="!dashboardRefreshing" class="ri ri_refresh-line" aria-hidden="true"></i>
|
|
203
|
+
<span>刷新数据</span>
|
|
204
|
+
</el-button>
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
图标应放在对应操作控件内部;保留可读文字或 `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
|
+
}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "全能力组合工作台",
|
|
3
|
+
"key": "page.composition.full-capability-workbench",
|
|
4
|
+
"intro": "",
|
|
5
|
+
"template": {
|
|
6
|
+
"version": 1,
|
|
7
|
+
"entry": {
|
|
8
|
+
"kind": "custom"
|
|
9
|
+
},
|
|
10
|
+
"contexts": {
|
|
11
|
+
"selectedProject": {
|
|
12
|
+
"source": "selected-row"
|
|
13
|
+
},
|
|
14
|
+
"currentStep": {
|
|
15
|
+
"source": "selectedProject",
|
|
16
|
+
"resolver": "current-step"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"data": {
|
|
20
|
+
"queries": {
|
|
21
|
+
"projects": {
|
|
22
|
+
"engine": "es",
|
|
23
|
+
"resource": "/project/list",
|
|
24
|
+
"method": "POST",
|
|
25
|
+
"params": {
|
|
26
|
+
"data_set_key": "main",
|
|
27
|
+
"page": 1,
|
|
28
|
+
"page_size": 20,
|
|
29
|
+
"with_step": 1
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"methods": {},
|
|
34
|
+
"actions": {
|
|
35
|
+
"resolveCurrentStep": {
|
|
36
|
+
"capability": "step.quick-process",
|
|
37
|
+
"schema": {
|
|
38
|
+
"required": [
|
|
39
|
+
"projectId"
|
|
40
|
+
],
|
|
41
|
+
"properties": {
|
|
42
|
+
"projectId": {
|
|
43
|
+
"type": "number"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"submitStep": {
|
|
49
|
+
"capability": "step.operation",
|
|
50
|
+
"previewOnly": true,
|
|
51
|
+
"action": "approve",
|
|
52
|
+
"schema": {
|
|
53
|
+
"required": [
|
|
54
|
+
"projectId",
|
|
55
|
+
"stepId"
|
|
56
|
+
],
|
|
57
|
+
"properties": {
|
|
58
|
+
"projectId": {
|
|
59
|
+
"type": "number"
|
|
60
|
+
},
|
|
61
|
+
"stepId": {
|
|
62
|
+
"type": "number"
|
|
63
|
+
},
|
|
64
|
+
"comments": {
|
|
65
|
+
"type": "string"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"refresh": [
|
|
70
|
+
"projects"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"createProject": {
|
|
74
|
+
"capability": "project.create",
|
|
75
|
+
"previewOnly": true,
|
|
76
|
+
"action": "create",
|
|
77
|
+
"schema": {
|
|
78
|
+
"required": [
|
|
79
|
+
"name"
|
|
80
|
+
],
|
|
81
|
+
"properties": {
|
|
82
|
+
"name": {
|
|
83
|
+
"type": "string"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
"refresh": [
|
|
88
|
+
"projects"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"updateProject": {
|
|
92
|
+
"capability": "project.form",
|
|
93
|
+
"previewOnly": true,
|
|
94
|
+
"action": "update",
|
|
95
|
+
"schema": {
|
|
96
|
+
"required": [
|
|
97
|
+
"projectId",
|
|
98
|
+
"name"
|
|
99
|
+
],
|
|
100
|
+
"properties": {
|
|
101
|
+
"projectId": {
|
|
102
|
+
"type": "number"
|
|
103
|
+
},
|
|
104
|
+
"name": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"refresh": [
|
|
110
|
+
"projects"
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"exportProjects": {
|
|
114
|
+
"capability": "project.export",
|
|
115
|
+
"previewOnly": true,
|
|
116
|
+
"action": "export",
|
|
117
|
+
"schema": {
|
|
118
|
+
"required": [
|
|
119
|
+
"projectIds"
|
|
120
|
+
],
|
|
121
|
+
"properties": {
|
|
122
|
+
"projectIds": {
|
|
123
|
+
"type": "array"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"bulkEditProjects": {
|
|
129
|
+
"capability": "project.bulk-edit",
|
|
130
|
+
"previewOnly": true,
|
|
131
|
+
"action": "bulk-edit",
|
|
132
|
+
"schema": {
|
|
133
|
+
"required": [
|
|
134
|
+
"projectIds",
|
|
135
|
+
"status"
|
|
136
|
+
],
|
|
137
|
+
"properties": {
|
|
138
|
+
"projectIds": {
|
|
139
|
+
"type": "array"
|
|
140
|
+
},
|
|
141
|
+
"status": {
|
|
142
|
+
"type": "string"
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"refresh": [
|
|
147
|
+
"projects"
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
"render": {
|
|
153
|
+
"template": "<section class=\"composition-shell\">\n <header class=\"composition-header\">\n <div>\n <p class=\"composition-eyebrow\">PAGE COMPOSITION</p>\n <h1>{{ template.name || '跨页面组合' }}</h1>\n <p>{{ template.intro || '由页面上下文和公开业务能力组合而成。' }}</p>\n </div>\n <button type=\"button\" class=\"composition-refresh\" :disabled=\"dashboardRefreshing\" @click=\"refreshAll\">\n {{ dashboardRefreshing ? '刷新中…' : '刷新数据' }}\n </button>\n </header>\n <div v-if=\"runtimeError\" class=\"composition-alert\" role=\"alert\">{{ runtimeError }}</div>\n <section v-for=\"(block, index) in blocks\" :key=\"block.type + '-' + index\" class=\"composition-section\">\n <div class=\"composition-section-heading\">\n <h2>{{ block.title || block.type }}</h2>\n <span>{{ block.capability || '' }}</span>\n </div>\n <page-block\n :block=\"block\"\n :block-index=\"index\"\n :rows=\"block.paginated ? paginatedProjectRows : queryRows(block.query || 'projects')\"\n :selected-project=\"selectedProject\"\n :current-step=\"currentStep\"\n :draft-comment=\"draftComment\"\n :action-busy=\"actionBusy\"\n :filter-status=\"filterStatus\"\n :filter-keyword=\"filterKeyword\"\n :status-options=\"statusOptions\"\n :pagination-page=\"paginationPage\"\n :pagination-page-size=\"paginationPageSize\"\n :project-count=\"projectCount\"\n :selected-project-ids=\"selectedProjectIds\"\n :step-logs=\"stepLogs\"\n :attachment-drafts=\"attachmentDrafts\"\n :report-metrics=\"dashboardMetrics\"\n @select-project=\"selectProject\"\n @select-step=\"selectStep\"\n @open-quick-process=\"openQuickProcess\"\n @load-project-detail=\"loadProjectDetail\"\n @submit-step=\"submitStep\"\n @update-comment=\"draftComment = $event\"\n @set-filter-status=\"filterStatus = $event\"\n @set-filter-keyword=\"filterKeyword = $event\"\n @set-page=\"setPage\"\n @create-project=\"createProject\"\n @submit-project-form=\"submitProjectForm\"\n @export-projects=\"exportProjects\"\n @bulk-edit-projects=\"bulkEditProjects\"\n @add-attachment=\"addAttachment\"\n @selection-change=\"setSelectedProjectIds\"\n />\n </section>\n <div v-if=\"quickProcessVisible\" class=\"composition-dialog\" role=\"dialog\" aria-modal=\"true\">\n <div class=\"composition-dialog-panel\">\n <div class=\"composition-dialog-heading\"><h2>快速处理</h2><button type=\"button\" @click=\"clearSelection\">关闭</button></div>\n <p v-if=\"selectedProject\">{{ selectedProject.name || selectedProject.title || ('项目 ' + selectedProject.id) }}</p>\n <page-block\n v-for=\"(block, index) in blocks\"\n v-if=\"block.type === 'step-form' || block.type === 'step-operation'\"\n :key=\"'dialog-' + block.type + '-' + index\"\n :block=\"block\"\n :block-index=\"index\"\n :selected-project=\"selectedProject\"\n :current-step=\"currentStep\"\n :draft-comment=\"draftComment\"\n :action-busy=\"actionBusy\"\n :filter-status=\"filterStatus\"\n :filter-keyword=\"filterKeyword\"\n :status-options=\"statusOptions\"\n :pagination-page=\"paginationPage\"\n :pagination-page-size=\"paginationPageSize\"\n :project-count=\"projectCount\"\n :selected-project-ids=\"selectedProjectIds\"\n :step-logs=\"stepLogs\"\n :attachment-drafts=\"attachmentDrafts\"\n :report-metrics=\"dashboardMetrics\"\n @submit-step=\"submitStep\"\n @update-comment=\"draftComment = $event\"\n />\n </div>\n </div>\n</section>",
|
|
154
|
+
"style": ".composition-shell { min-height: 100%; padding: 24px 32px; background: #f5f7fa; color: #1f2937; }\n.composition-header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; padding: 20px 24px; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; }\n.composition-eyebrow { margin: 0; color: #2563eb; font-size: 11px; letter-spacing: .12em; font-weight: 700; }\n.composition-header h1 { margin: 6px 0; font-size: 24px; }\n.composition-header p:last-child { margin: 0; color: #64748b; }\n.composition-refresh, .composition-dialog-heading button { min-height: 40px; padding: 8px 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; cursor: pointer; }\n.composition-alert { margin-top: 16px; padding: 12px 16px; border: 1px solid #fecaca; border-radius: 8px; background: #fff1f2; color: #991b1b; }\n.composition-section { margin-top: 16px; padding: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 16px; }\n.composition-section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }\n.composition-section-heading h2 { margin: 0; font-size: 16px; }\n.composition-section-heading span { color: #64748b; font-size: 12px; }\n.composition-dialog { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: rgba(15, 23, 42, .32); }\n.composition-dialog-panel { width: min(520px, 100vw); height: 100%; overflow: auto; box-sizing: border-box; padding: 24px; background: #fff; }\n.composition-dialog-heading { display: flex; justify-content: space-between; align-items: center; }\n.composition-dialog-heading h2 { margin: 0; }\n@media (max-width: 720px) { .composition-shell { padding: 16px; } .composition-header { flex-direction: column; } }",
|
|
155
|
+
"blocks": [
|
|
156
|
+
{
|
|
157
|
+
"type": "project-list",
|
|
158
|
+
"capability": "project.list",
|
|
159
|
+
"query": "projects",
|
|
160
|
+
"title": "项目列表能力"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
"type": "project-filter",
|
|
164
|
+
"capability": "project.filter",
|
|
165
|
+
"title": "项目筛选"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"type": "project-table",
|
|
169
|
+
"capability": "project.table",
|
|
170
|
+
"query": "projects",
|
|
171
|
+
"selectable": true,
|
|
172
|
+
"title": "项目表格"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"type": "project-pagination",
|
|
176
|
+
"capability": "project.pagination",
|
|
177
|
+
"title": "项目分页"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"type": "project-detail",
|
|
181
|
+
"capability": "project.detail",
|
|
182
|
+
"context": "selectedProject",
|
|
183
|
+
"title": "项目详情"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"type": "project-detail-drawer",
|
|
187
|
+
"capability": "project.detail-drawer",
|
|
188
|
+
"context": "selectedProject",
|
|
189
|
+
"title": "项目详情抽屉"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"type": "project-form",
|
|
193
|
+
"capability": "project.form",
|
|
194
|
+
"action": "updateProject",
|
|
195
|
+
"title": "项目表单"
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"type": "project-step-list",
|
|
199
|
+
"capability": "project.step-list",
|
|
200
|
+
"context": "selectedProject",
|
|
201
|
+
"title": "项目环节列表"
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
"type": "project-create",
|
|
205
|
+
"capability": "project.create",
|
|
206
|
+
"action": "createProject",
|
|
207
|
+
"title": "创建项目"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
"type": "project-export",
|
|
211
|
+
"capability": "project.export",
|
|
212
|
+
"action": "exportProjects",
|
|
213
|
+
"title": "导出项目"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"type": "project-bulk-edit",
|
|
217
|
+
"capability": "project.bulk-edit",
|
|
218
|
+
"action": "bulkEditProjects",
|
|
219
|
+
"title": "批量编辑项目"
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"type": "step-context",
|
|
223
|
+
"capability": "step.context",
|
|
224
|
+
"context": "currentStep",
|
|
225
|
+
"title": "环节上下文"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"type": "step-form",
|
|
229
|
+
"capability": "step.form",
|
|
230
|
+
"context": "currentStep",
|
|
231
|
+
"title": "环节表单"
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"type": "step-operation",
|
|
235
|
+
"capability": "step.operation",
|
|
236
|
+
"action": "submitStep",
|
|
237
|
+
"title": "环节操作"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"type": "step-quick-process",
|
|
241
|
+
"capability": "step.quick-process",
|
|
242
|
+
"action": "submitStep",
|
|
243
|
+
"title": "快速处理"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
"type": "step-comment",
|
|
247
|
+
"capability": "step.comment",
|
|
248
|
+
"context": "currentStep",
|
|
249
|
+
"title": "环节评论"
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
"type": "step-attachment",
|
|
253
|
+
"capability": "step.attachment",
|
|
254
|
+
"context": "currentStep",
|
|
255
|
+
"title": "环节附件"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"type": "step-log",
|
|
259
|
+
"capability": "step.log",
|
|
260
|
+
"context": "currentStep",
|
|
261
|
+
"title": "环节日志"
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"type": "report-preview",
|
|
265
|
+
"capability": "report.preview",
|
|
266
|
+
"title": "报表预览"
|
|
267
|
+
}
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
"dependencies": {
|
|
271
|
+
"capabilities": [
|
|
272
|
+
"project.list",
|
|
273
|
+
"project.filter",
|
|
274
|
+
"project.table",
|
|
275
|
+
"project.pagination",
|
|
276
|
+
"project.detail",
|
|
277
|
+
"project.detail-drawer",
|
|
278
|
+
"project.form",
|
|
279
|
+
"project.step-list",
|
|
280
|
+
"project.create",
|
|
281
|
+
"project.export",
|
|
282
|
+
"project.bulk-edit",
|
|
283
|
+
"step.context",
|
|
284
|
+
"step.form",
|
|
285
|
+
"step.operation",
|
|
286
|
+
"step.quick-process",
|
|
287
|
+
"step.comment",
|
|
288
|
+
"step.attachment",
|
|
289
|
+
"step.log",
|
|
290
|
+
"report.preview"
|
|
291
|
+
]
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|