bpmax-cli 0.2.1-beta.74 → 0.2.1-beta.77

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.
@@ -0,0 +1,400 @@
1
+ {
2
+ "name": "项目运营数据看板",
3
+ "key": "project.operations.dashboard",
4
+ "intro": "只读项目运营看板:用状态、负责人、部门、仓库和需求月份判断处理负荷、资源压力与交付节奏。",
5
+ "template": {
6
+ "version": 1,
7
+ "entry": {
8
+ "kind": "project-list"
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
+ "flow_type": "flow636354625",
31
+ "flow_key": ""
32
+ },
33
+ "filterMode": "server",
34
+ "filterGroup": "dashboard",
35
+ "row_mapping": {
36
+ "id": "__id",
37
+ "name": "xmmc1.0",
38
+ "owner_id": "__owner_id",
39
+ "owner_name": "__project_owner.name",
40
+ "create_time": "__create_time",
41
+ "current_step_name": "current_step_name",
42
+ "department": "tjbm",
43
+ "request_date": "tjrq",
44
+ "need_date": "xqrq",
45
+ "request_reason": "sqyy",
46
+ "warehouse": "ckck",
47
+ "branch": "szfb"
48
+ },
49
+ "filter_fields": {
50
+ "status": "status",
51
+ "keyword": "xmmc1",
52
+ "owner": "__owner_id",
53
+ "created_date": "__create_time"
54
+ }
55
+ },
56
+ "dashboardStats": {
57
+ "engine": "es",
58
+ "mode": "aggregate",
59
+ "resource": "/project/aggregate",
60
+ "method": "POST",
61
+ "params": {
62
+ "data_set_key": "main",
63
+ "flow_type": "flow636354625",
64
+ "flow_key": ""
65
+ },
66
+ "aggs": {
67
+ "by_status": {
68
+ "type": "terms",
69
+ "field": "status",
70
+ "size": 8
71
+ },
72
+ "by_owner": {
73
+ "type": "terms",
74
+ "field": "__owner_id",
75
+ "size": 20
76
+ },
77
+ "by_department": {
78
+ "type": "terms",
79
+ "field": "tjbm",
80
+ "size": 20
81
+ },
82
+ "by_warehouse": {
83
+ "type": "terms",
84
+ "field": "ckck",
85
+ "size": 20
86
+ },
87
+ "by_branch": {
88
+ "type": "terms",
89
+ "field": "szfb",
90
+ "size": 12
91
+ },
92
+ "by_month": {
93
+ "type": "date_histogram",
94
+ "field": "__create_time",
95
+ "calendar_interval": "month"
96
+ },
97
+ "by_demand_month": {
98
+ "type": "date_histogram",
99
+ "field": "xqrq",
100
+ "calendar_interval": "month"
101
+ },
102
+ "by_apply_month": {
103
+ "type": "date_histogram",
104
+ "field": "tjrq",
105
+ "calendar_interval": "month"
106
+ },
107
+ "department_count": {
108
+ "type": "cardinality",
109
+ "field": "tjbm"
110
+ },
111
+ "warehouse_count": {
112
+ "type": "cardinality",
113
+ "field": "ckck"
114
+ },
115
+ "owner_count": {
116
+ "type": "cardinality",
117
+ "field": "__owner_id"
118
+ },
119
+ "total_projects": {
120
+ "type": "value_count",
121
+ "field": "__id"
122
+ }
123
+ },
124
+ "filterGroup": "dashboard"
125
+ }
126
+ },
127
+ "methods": {},
128
+ "actions": {
129
+ "resolveCurrentStep": {
130
+ "capability": "step.quick-process",
131
+ "schema": {
132
+ "required": [
133
+ "projectId"
134
+ ],
135
+ "properties": {
136
+ "projectId": {
137
+ "type": "number"
138
+ }
139
+ }
140
+ }
141
+ },
142
+ "submitStep": {
143
+ "capability": "step.operation",
144
+ "previewOnly": true,
145
+ "action": "approve",
146
+ "schema": {
147
+ "required": [
148
+ "projectId",
149
+ "stepId"
150
+ ],
151
+ "properties": {
152
+ "projectId": {
153
+ "type": "number"
154
+ },
155
+ "stepId": {
156
+ "type": "number"
157
+ },
158
+ "comments": {
159
+ "type": "string"
160
+ }
161
+ }
162
+ },
163
+ "refresh": [
164
+ "projects"
165
+ ]
166
+ },
167
+ "createProject": {
168
+ "capability": "project.create",
169
+ "previewOnly": true,
170
+ "action": "create",
171
+ "schema": {
172
+ "required": [
173
+ "name"
174
+ ],
175
+ "properties": {
176
+ "name": {
177
+ "type": "string"
178
+ }
179
+ }
180
+ },
181
+ "refresh": [
182
+ "projects"
183
+ ]
184
+ },
185
+ "updateProject": {
186
+ "capability": "project.form",
187
+ "previewOnly": true,
188
+ "action": "update",
189
+ "schema": {
190
+ "required": [
191
+ "projectId",
192
+ "name"
193
+ ],
194
+ "properties": {
195
+ "projectId": {
196
+ "type": "number"
197
+ },
198
+ "name": {
199
+ "type": "string"
200
+ }
201
+ }
202
+ },
203
+ "refresh": [
204
+ "projects"
205
+ ]
206
+ },
207
+ "exportProjects": {
208
+ "capability": "project.export",
209
+ "previewOnly": true,
210
+ "action": "export",
211
+ "schema": {
212
+ "required": [
213
+ "projectIds"
214
+ ],
215
+ "properties": {
216
+ "projectIds": {
217
+ "type": "array"
218
+ }
219
+ }
220
+ }
221
+ },
222
+ "bulkEditProjects": {
223
+ "capability": "project.bulk-edit",
224
+ "previewOnly": true,
225
+ "action": "bulk-edit",
226
+ "schema": {
227
+ "required": [
228
+ "projectIds",
229
+ "status"
230
+ ],
231
+ "properties": {
232
+ "projectIds": {
233
+ "type": "array"
234
+ },
235
+ "status": {
236
+ "type": "string"
237
+ }
238
+ }
239
+ },
240
+ "refresh": [
241
+ "projects"
242
+ ]
243
+ }
244
+ }
245
+ },
246
+ "render": {
247
+ "template": "<main class=\"ops-dashboard\">\n <header class=\"dashboard-header\">\n <div>\n <p class=\"dashboard-eyebrow\">OPERATIONS / PAGE COMPOSITION</p>\n <h1>{{ template.name || '项目运营数据看板' }}</h1>\n <p class=\"dashboard-subtitle\">{{ template.intro || '用统一页面模板组合项目指标、状态分布和处理列表。' }}</p>\n </div>\n <div class=\"dashboard-actions\">\n <el-button class=\"dashboard-button\" type=\"primary\" :loading=\"dashboardRefreshing\" :disabled=\"dashboardRefreshing\" @click=\"refreshAll\">\n {{ dashboardRefreshing ? '刷新中…' : '刷新数据' }}\n </el-button>\n <el-button class=\"dashboard-button dashboard-button-muted\" plain @click=\"clearSelection\">清除选择</el-button>\n </div>\n </header>\n\n <div v-if=\"runtimeError\" class=\"dashboard-alert\" role=\"alert\">{{ runtimeError }}</div>\n\n <section class=\"dashboard-kpis\" aria-label=\"项目指标\">\n <article v-for=\"metric in dashboardMetrics\" :key=\"metric.key\" class=\"dashboard-kpi\" :class=\"'tone-' + metric.tone\">\n <span>{{ metric.label }}</span>\n <strong>{{ metric.value }}</strong>\n </article>\n </section>\n\n <section class=\"dashboard-charts\" aria-label=\"项目图表\">\n <page-chart chart-type=\"status-donut\" title=\"项目状态构成\" :rows=\"projectRows\" :aggregation=\"dashboardAggregations.by_status\" :aggregation-labels=\"statusLabels\" />\n <page-chart chart-type=\"owner-bar\" title=\"负责人项目量\" :rows=\"projectRows\" :aggregation=\"dashboardAggregations.by_owner\" aggregation-label-prefix=\"负责人 \" />\n <page-chart chart-type=\"terms-bar\" title=\"申请部门项目量\" eyebrow=\"DEPARTMENT LOAD\" :rows=\"projectRows\" :aggregation=\"dashboardAggregations.by_department\" />\n <page-chart chart-type=\"terms-bar\" title=\"仓库需求分布\" eyebrow=\"WAREHOUSE DEMAND\" :rows=\"projectRows\" :aggregation=\"dashboardAggregations.by_warehouse\" />\n <page-chart chart-type=\"terms-bar\" title=\"所属分部项目量\" eyebrow=\"BRANCH MIX\" :rows=\"projectRows\" :aggregation=\"dashboardAggregations.by_branch\" />\n <page-chart chart-type=\"created-trend\" title=\"需求月份趋势\" eyebrow=\"DEMAND PLAN\" :rows=\"projectRows\" :aggregation=\"dashboardAggregations.by_demand_month\" />\n \n <page-chart chart-type=\"created-trend\" title=\"申请月份趋势\" eyebrow=\"REQUEST INTAKE\" :rows=\"projectRows\" :aggregation=\"dashboardAggregations.by_apply_month\" />\n </section>\n\n <section class=\"dashboard-customization\" aria-label=\"看板业务说明\">\n <page-block v-for=\"(block, index) in blocks\" v-if=\"block.type === 'report-preview'\" :key=\"'report-' + index\" :block=\"block\" :block-index=\"index\" :insight-context=\"insightContext\" />\n </section>\n\n <section class=\"dashboard-grid\">\n <article class=\"dashboard-panel dashboard-status-panel\">\n <div class=\"dashboard-panel-heading\"><div><p class=\"dashboard-overline\">DISTRIBUTION</p><h2>项目状态</h2></div><span>{{ formatNumber(dashboardMetrics[0] && dashboardMetrics[0].value) }} 项</span></div>\n <div class=\"dashboard-status-list\">\n <button v-for=\"status in statusRows\" :key=\"status.key\" type=\"button\" class=\"dashboard-status-row\" :class=\"{ 'is-active': filterStatus === status.key }\" @click=\"selectDashboardStatus(status.key)\">\n <span class=\"dashboard-status-label\"><i :class=\"'status-dot status-' + status.key\"></i>{{ status.label }}</span>\n <span class=\"dashboard-status-value\">{{ status.value }}</span>\n <span class=\"dashboard-progress\"><i :style=\"{ width: (Math.round(status.value / ((dashboardMetrics[0] && dashboardMetrics[0].value) || 1) * 100) + '%') }\"></i></span>\n </button>\n <p v-if=\"!statusRows.length\" class=\"dashboard-empty\">暂无状态数据</p>\n </div>\n </article>\n\n <article class=\"dashboard-panel dashboard-filter-panel\">\n <div class=\"dashboard-panel-heading\"><div><p class=\"dashboard-overline\">FILTERS</p><h2>筛选与选中项</h2></div></div>\n <label class=\"dashboard-label\" for=\"dashboard-status\">状态</label>\n <el-select id=\"dashboard-status\" v-model=\"filterStatus\" class=\"dashboard-control dashboard-element-control\" size=\"small\" placeholder=\"选择项目状态\" :popper-append-to-body=\"false\">\n <el-option v-for=\"status in statusOptions\" :key=\"status.key\" :label=\"status.label\" :value=\"status.key\" />\n </el-select>\n <label class=\"dashboard-label\" for=\"dashboard-keyword\">关键词</label>\n <el-input id=\"dashboard-keyword\" v-model=\"filterKeyword\" class=\"dashboard-control dashboard-element-control\" size=\"small\" clearable prefix-icon=\"el-icon-search\" placeholder=\"搜索项目名称或 ID\" />\n <label class=\"dashboard-label\" for=\"dashboard-owner\">负责人 ID</label>\n <el-input id=\"dashboard-owner\" v-model=\"filterOwner\" class=\"dashboard-control dashboard-element-control\" size=\"small\" clearable placeholder=\"按负责人 ID 筛选\" />\n <label class=\"dashboard-label\" for=\"dashboard-created-date\">创建日期</label>\n <el-date-picker id=\"dashboard-created-date\" v-model=\"filterCreatedDate\" class=\"dashboard-control dashboard-element-control\" size=\"small\" type=\"date\" format=\"yyyy-MM-dd\" value-format=\"yyyy-MM-dd\" clearable :popper-append-to-body=\"false\" placeholder=\"选择创建日期\" />\n <el-button class=\"dashboard-filter-submit\" type=\"primary\" size=\"small\" :loading=\"dashboardRefreshing\" :disabled=\"dashboardRefreshing\" @click=\"applyFilters\"><i class=\"ri ri_search-line\"></i> 筛选</el-button>\n <div v-if=\"selectedProject\" class=\"dashboard-selected\">\n <span>当前项目</span><strong>{{ selectedProject.name || selectedProject.title || selectedProject.id }}</strong>\n <small>{{ currentStep ? stepLabel(currentStep) : '没有唯一可处理环节' }}</small>\n </div>\n <p v-else class=\"dashboard-empty\">从列表选择项目后查看上下文。</p>\n </article>\n\n <article class=\"dashboard-panel dashboard-list-panel\">\n <div class=\"dashboard-panel-heading\"><div><p class=\"dashboard-overline\">PROJECT LIST</p><h2>项目列表</h2></div><span>{{ projectCount }} 个结果</span></div>\n <page-block\n v-for=\"(block, index) in blocks\"\n v-if=\"block.type === 'project-table'\"\n :key=\"'table-' + index\"\n :block=\"block\"\n :block-index=\"index\"\n :rows=\"filteredProjectRows\"\n :selected-project=\"selectedProject\"\n :current-step=\"currentStep\"\n :draft-comment=\"draftComment\"\n :action-busy=\"actionBusy\"\n :selected-project-ids=\"selectedProjectIds\"\n @select-project=\"selectProject\"\n @open-quick-process=\"openQuickProcess\"\n />\n </article>\n\n <article class=\"dashboard-panel dashboard-detail-panel\">\n <div class=\"dashboard-panel-heading\"><div><p class=\"dashboard-overline\">CONTEXT</p><h2>项目详情</h2></div></div>\n <page-block\n v-for=\"(block, index) in blocks\"\n v-if=\"block.type === 'project-detail'\"\n :key=\"'detail-' + 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 :selected-project-ids=\"selectedProjectIds\"\n @load-project-detail=\"loadProjectDetail\"\n />\n <p v-if=\"!selectedProject\" class=\"dashboard-empty\">选择列表中的项目查看详情。</p>\n </article>\n </section>\n\n <div v-if=\"quickProcessVisible\" class=\"dashboard-overlay\" role=\"dialog\" aria-modal=\"true\" aria-label=\"快速处理\">\n <section class=\"dashboard-drawer\">\n <div class=\"dashboard-drawer-heading\"><div><p class=\"dashboard-overline\">ACTION</p><h2>快速处理</h2></div><el-button class=\"dashboard-close\" plain @click=\"clearSelection\">关闭</el-button></div>\n <p v-if=\"selectedProject\" class=\"dashboard-drawer-project\">{{ 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=\"'action-' + 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 :selected-project-ids=\"selectedProjectIds\"\n @submit-step=\"submitStep\"\n @update-comment=\"draftComment = $event\"\n />\n <p v-if=\"!currentStep\" class=\"dashboard-empty\">当前项目没有唯一可处理环节。</p>\n </section>\n </div>\n</main>",
248
+ "style": ".ops-dashboard { min-height: 100%; padding: 24px 32px 48px; background: #f5f7fa; color: #1f2937; }\n.dashboard-header { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }\n.dashboard-eyebrow, .dashboard-overline { margin: 0; color: #2563eb; font-size: 11px; font-weight: 700; letter-spacing: .12em; }\n.dashboard-header h1 { margin: 6px 0; font-size: 26px; letter-spacing: -.02em; }\n.dashboard-subtitle { max-width: 680px; margin: 0; color: #64748b; line-height: 1.6; }\n.dashboard-actions { display: flex; gap: 8px; flex-wrap: wrap; }\n.dashboard-button, .dashboard-close { min-height: 44px; padding: 9px 14px; border: 1px solid #2563eb; border-radius: 8px; background: #2563eb; color: #fff; cursor: pointer; }\n.dashboard-button-muted, .dashboard-close { border-color: #cbd5e1; background: #fff; color: #334155; }\n.dashboard-button:focus-visible, .dashboard-close:focus-visible, .dashboard-status-row:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }\n.dashboard-button:disabled { cursor: not-allowed; opacity: .55; }\n.dashboard-alert { margin-top: 16px; padding: 12px 16px; border: 1px solid #fecaca; border-radius: 10px; background: #fff1f2; color: #991b1b; }\n.dashboard-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }\n.dashboard-kpi { position: relative; min-height: 104px; padding: 16px 18px; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; overflow: hidden; }\n.dashboard-kpi:before { position: absolute; inset: 0 auto 0 0; width: 4px; content: ''; background: #2563eb; }\n.dashboard-kpi.tone-amber:before { background: #d97706; } .dashboard-kpi.tone-violet:before { background: #7c3aed; } .dashboard-kpi.tone-green:before { background: #16a34a; }\n.dashboard-kpi span { display: block; color: #64748b; font-size: 12px; } .dashboard-kpi strong { display: block; margin-top: 12px; font-size: 28px; font-variant-numeric: tabular-nums; } .dashboard-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }\n.dashboard-grid { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(260px, .8fr) minmax(460px, 1.8fr); gap: 16px; margin-top: 16px; align-items: start; }\n.dashboard-charts .page-composition-chart { min-width: 0; }\n.dashboard-panel { min-width: 0; padding: 20px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; }\n.dashboard-list-panel { grid-column: 1 / -1; } .dashboard-detail-panel { grid-column: 1 / -1; }\n.dashboard-panel-heading, .dashboard-drawer-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }\n.dashboard-panel-heading h2, .dashboard-drawer-heading h2 { margin: 4px 0 0; font-size: 17px; } .dashboard-panel-heading > span { color: #64748b; font-size: 12px; }\n.dashboard-status-list { display: grid; gap: 4px; } .dashboard-status-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; min-height: 52px; padding: 8px 0; border: 0; border-bottom: 1px solid #f1f5f9; background: transparent; color: #334155; text-align: left; cursor: pointer; }\n.dashboard-status-row.is-active .dashboard-status-label, .dashboard-status-row:hover .dashboard-status-label { color: #2563eb; } .dashboard-status-label { display: flex; gap: 8px; align-items: center; }\n.dashboard-status-value { font-variant-numeric: tabular-nums; font-weight: 600; } .dashboard-progress { grid-column: 1 / -1; display: block; height: 5px; border-radius: 999px; background: #e2e8f0; overflow: hidden; } .dashboard-progress i { display: block; height: 100%; border-radius: inherit; background: #60a5fa; }\n.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; } .status-2, .status-6, .status-pending { background: #d97706; } .status-3, .status-processing { background: #7c3aed; } .status-4, .status-completed, .status-done { background: #16a34a; }\n.dashboard-label { display: block; margin: 12px 0 6px; color: #475569; font-size: 12px; font-weight: 600; } .dashboard-control { width: 100%; min-height: 42px; box-sizing: border-box; padding: 9px 10px; border: 1px solid #cbd5e1; border-radius: 8px; background: #fff; color: #1f2937; } .dashboard-element-control { min-height: 32px; padding: 0; } .dashboard-element-control.el-select, .dashboard-element-control.el-date-editor { display: block; } .dashboard-element-control .el-input__inner, .dashboard-element-control.el-input .el-input__inner { min-height: 32px; height: 32px; border-color: #cbd5e1; border-radius: 6px; background: #fff; color: #1f2937; } .dashboard-element-control .el-input__inner:focus { border-color: #2563eb; }\n.dashboard-control:focus { border-color: #2563eb; outline: 2px solid #bfdbfe; outline-offset: 1px; } .dashboard-selected { margin-top: 20px; padding: 12px; border-radius: 10px; background: #eff6ff; } .dashboard-selected span, .dashboard-selected small { display: block; color: #475569; font-size: 12px; } .dashboard-selected strong { display: block; margin: 5px 0; }\n.dashboard-empty { margin: 0; color: #64748b; font-size: 13px; } .dashboard-overlay { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: rgba(15, 23, 42, .32); } .dashboard-drawer { width: min(520px, 100vw); height: 100%; box-sizing: border-box; padding: 24px; overflow: auto; background: #fff; } .dashboard-drawer-project { margin: 0 0 20px; font-weight: 600; }\n@media (max-width: 1024px) { .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dashboard-list-panel, .dashboard-detail-panel { grid-column: 1 / -1; } }\n@media (max-width: 1024px) { .dashboard-charts .page-composition-chart:last-child { grid-column: 1 / -1; } }\n@media (max-width: 720px) { .ops-dashboard { padding: 16px 16px 32px; } .dashboard-header { flex-direction: column; } .dashboard-kpis, .dashboard-charts, .dashboard-grid { grid-template-columns: 1fr; } .dashboard-list-panel, .dashboard-detail-panel { grid-column: auto; } } .dashboard-customization { margin-top: 16px; padding: 20px; border: 1px solid #e5e7eb; border-radius: 14px; background: #fff; } .dashboard-customization .page-block-report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } @media (max-width: 720px) { .dashboard-customization .page-block-report-grid { grid-template-columns: 1fr; } }",
249
+ "blocks": [
250
+ {
251
+ "type": "project-table",
252
+ "capability": "project.table",
253
+ "query": "projects",
254
+ "title": "项目列表",
255
+ "columns": [
256
+ {
257
+ "key": "id",
258
+ "label": "项目 ID"
259
+ },
260
+ {
261
+ "key": "name",
262
+ "label": "项目名称"
263
+ },
264
+ {
265
+ "key": "__statusLabel",
266
+ "label": "状态"
267
+ },
268
+ {
269
+ "key": "__currentStepName",
270
+ "label": "当前环节"
271
+ },
272
+ {
273
+ "key": "owner_name",
274
+ "label": "负责人"
275
+ },
276
+ {
277
+ "key": "department",
278
+ "label": "申请部门"
279
+ },
280
+ {
281
+ "key": "branch",
282
+ "label": "所属分部"
283
+ },
284
+ {
285
+ "key": "request_date",
286
+ "label": "申请日期"
287
+ },
288
+ {
289
+ "key": "need_date",
290
+ "label": "需求日期"
291
+ },
292
+ {
293
+ "key": "warehouse",
294
+ "label": "出入库仓库"
295
+ },
296
+ {
297
+ "key": "__createTimeLabel",
298
+ "label": "创建时间"
299
+ }
300
+ ]
301
+ },
302
+ {
303
+ "type": "project-pagination",
304
+ "capability": "project.pagination",
305
+ "query": "projects",
306
+ "pageSize": 5
307
+ },
308
+ {
309
+ "type": "report-preview",
310
+ "capability": "report.preview",
311
+ "title": "业务口径与可定制分析",
312
+ "eyebrow": "CUSTOMIZATION",
313
+ "items": [
314
+ {
315
+ "key": "data-scope",
316
+ "label": "数据范围",
317
+ "valueKey": "dataScope",
318
+ "description": "指标和图表来自服务端全量聚合,不随当前分页变化。"
319
+ },
320
+ {
321
+ "key": "department-count",
322
+ "label": "部门维度",
323
+ "valueKey": "departmentCount",
324
+ "description": "识别需求来源与部门负荷,cardinality 为全量去重数。"
325
+ },
326
+ {
327
+ "key": "warehouse-count",
328
+ "label": "仓库维度",
329
+ "valueKey": "warehouseCount",
330
+ "description": "识别仓库需求压力和资源分布。"
331
+ },
332
+ {
333
+ "key": "owner-count",
334
+ "label": "负责人维度",
335
+ "valueKey": "ownerCount",
336
+ "description": "观察工作量是否集中在少数负责人。"
337
+ },
338
+ {
339
+ "key": "filter-summary",
340
+ "label": "当前筛选",
341
+ "valueKey": "filterSummary",
342
+ "description": "筛选提交后同步刷新列表与所有聚合。"
343
+ },
344
+ {
345
+ "key": "apply-peak-month",
346
+ "label": "申请峰值月份",
347
+ "valueKey": "applyPeakMonth",
348
+ "description": "识别申请量最高的月份,辅助安排资源与库存。"
349
+ },
350
+ {
351
+ "key": "custom-elements",
352
+ "label": "可组合元素",
353
+ "value": "KPI · 图表 · 说明卡 · 筛选 · 分页",
354
+ "description": "同一页面模板可按业务目标组合指标、分析维度和交互控件。"
355
+ },
356
+ {
357
+ "key": "business-definition",
358
+ "label": "业务口径",
359
+ "value": "项目总数、状态、负责人、组织与需求节奏均以当前筛选条件下的服务端全量聚合为准。"
360
+ },
361
+ {
362
+ "key": "page-summary",
363
+ "label": "当前页",
364
+ "valueKey": "currentPage",
365
+ "description": "明确当前页码与分页范围,便于回测。"
366
+ }
367
+ ]
368
+ },
369
+ {
370
+ "type": "project-detail",
371
+ "capability": "project.detail",
372
+ "context": "selectedProject",
373
+ "title": "项目详情"
374
+ },
375
+ {
376
+ "type": "step-form",
377
+ "capability": "step.form",
378
+ "context": "currentStep",
379
+ "title": "环节表单"
380
+ },
381
+ {
382
+ "type": "step-operation",
383
+ "capability": "step.operation",
384
+ "action": "submitStep",
385
+ "title": "环节操作"
386
+ }
387
+ ]
388
+ },
389
+ "dependencies": {
390
+ "capabilities": [
391
+ "project.detail",
392
+ "project.pagination",
393
+ "project.table",
394
+ "report.preview",
395
+ "step.form",
396
+ "step.operation"
397
+ ]
398
+ }
399
+ }
400
+ }
@@ -0,0 +1,214 @@
1
+ {
2
+ "name": "项目运营可视化看板(浅色)",
3
+ "key": "project.operations.visual-light",
4
+ "intro": "",
5
+ "template": {
6
+ "version": 1,
7
+ "entry": {
8
+ "kind": "project-list"
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
+ "flow_type": "flow636354625",
31
+ "flow_key": ""
32
+ },
33
+ "filterMode": "server",
34
+ "filterGroup": "dashboard",
35
+ "row_mapping": {
36
+ "id": "__id",
37
+ "name": "xmmc1.0",
38
+ "owner_id": "__owner_id",
39
+ "owner_name": "__project_owner.name",
40
+ "create_time": "__create_time",
41
+ "current_step_name": "current_step_name"
42
+ },
43
+ "filter_fields": {
44
+ "status": "status",
45
+ "keyword": "xmmc1",
46
+ "owner": "__owner_id",
47
+ "created_date": "__create_time"
48
+ }
49
+ },
50
+ "dashboardStats": {
51
+ "engine": "es",
52
+ "mode": "aggregate",
53
+ "resource": "/project/aggregate",
54
+ "method": "POST",
55
+ "params": {
56
+ "data_set_key": "main",
57
+ "flow_type": "flow636354625",
58
+ "flow_key": ""
59
+ },
60
+ "aggs": {
61
+ "by_status": {
62
+ "type": "terms",
63
+ "field": "status",
64
+ "size": 8
65
+ },
66
+ "by_owner": {
67
+ "type": "terms",
68
+ "field": "__owner_id",
69
+ "size": 20
70
+ },
71
+ "by_month": {
72
+ "type": "date_histogram",
73
+ "field": "__create_time",
74
+ "calendar_interval": "month"
75
+ },
76
+ "total_projects": {
77
+ "type": "value_count",
78
+ "field": "__id"
79
+ }
80
+ },
81
+ "filterGroup": "dashboard"
82
+ }
83
+ },
84
+ "methods": {},
85
+ "actions": {
86
+ "resolveCurrentStep": {
87
+ "capability": "step.quick-process",
88
+ "schema": {
89
+ "required": [
90
+ "projectId"
91
+ ],
92
+ "properties": {
93
+ "projectId": {
94
+ "type": "number"
95
+ }
96
+ }
97
+ }
98
+ },
99
+ "submitStep": {
100
+ "capability": "step.operation",
101
+ "previewOnly": true,
102
+ "action": "approve",
103
+ "schema": {
104
+ "required": [
105
+ "projectId",
106
+ "stepId"
107
+ ],
108
+ "properties": {
109
+ "projectId": {
110
+ "type": "number"
111
+ },
112
+ "stepId": {
113
+ "type": "number"
114
+ },
115
+ "comments": {
116
+ "type": "string"
117
+ }
118
+ }
119
+ },
120
+ "refresh": [
121
+ "projects"
122
+ ]
123
+ },
124
+ "createProject": {
125
+ "capability": "project.create",
126
+ "previewOnly": true,
127
+ "action": "create",
128
+ "schema": {
129
+ "required": [
130
+ "name"
131
+ ],
132
+ "properties": {
133
+ "name": {
134
+ "type": "string"
135
+ }
136
+ }
137
+ },
138
+ "refresh": [
139
+ "projects"
140
+ ]
141
+ },
142
+ "updateProject": {
143
+ "capability": "project.form",
144
+ "previewOnly": true,
145
+ "action": "update",
146
+ "schema": {
147
+ "required": [
148
+ "projectId",
149
+ "name"
150
+ ],
151
+ "properties": {
152
+ "projectId": {
153
+ "type": "number"
154
+ },
155
+ "name": {
156
+ "type": "string"
157
+ }
158
+ }
159
+ },
160
+ "refresh": [
161
+ "projects"
162
+ ]
163
+ },
164
+ "exportProjects": {
165
+ "capability": "project.export",
166
+ "previewOnly": true,
167
+ "action": "export",
168
+ "schema": {
169
+ "required": [
170
+ "projectIds"
171
+ ],
172
+ "properties": {
173
+ "projectIds": {
174
+ "type": "array"
175
+ }
176
+ }
177
+ }
178
+ },
179
+ "bulkEditProjects": {
180
+ "capability": "project.bulk-edit",
181
+ "previewOnly": true,
182
+ "action": "bulk-edit",
183
+ "schema": {
184
+ "required": [
185
+ "projectIds",
186
+ "status"
187
+ ],
188
+ "properties": {
189
+ "projectIds": {
190
+ "type": "array"
191
+ },
192
+ "status": {
193
+ "type": "string"
194
+ }
195
+ }
196
+ },
197
+ "refresh": [
198
+ "projects"
199
+ ]
200
+ }
201
+ }
202
+ },
203
+ "render": {
204
+ "template": "<main class=\"visual-dashboard\">\n <header class=\"visual-dashboard__header\">\n <h1>{{ template.name || '项目运营可视化看板' }}</h1>\n <el-button type=\"primary\" :loading=\"dashboardRefreshing\" :disabled=\"dashboardRefreshing\" @click=\"refreshAll\">\n {{ dashboardRefreshing ? '刷新中…' : '刷新数据' }}\n </el-button>\n </header>\n\n <div v-if=\"runtimeError\" class=\"visual-dashboard__alert\" role=\"alert\">{{ runtimeError }}</div>\n\n <section class=\"visual-dashboard__metrics\" aria-label=\"项目指标\">\n <article v-for=\"metric in dashboardMetrics\" :key=\"metric.key\" class=\"visual-dashboard__metric\">\n <span>{{ metric.label }}</span>\n <strong>{{ metric.value }}</strong>\n </article>\n </section>\n\n <section class=\"visual-dashboard__charts\" aria-label=\"项目可视化图表\">\n <page-chart theme=\"light\" eyebrow=\"\" chart-type=\"status-donut\" title=\"项目状态\" :rows=\"filteredProjectRows\" :aggregation=\"dashboardAggregations.by_status\" :aggregation-labels=\"statusLabels\" />\n <page-chart theme=\"light\" eyebrow=\"\" chart-type=\"owner-bar\" title=\"负责人项目量\" :rows=\"filteredProjectRows\" :aggregation=\"dashboardAggregations.by_owner\" aggregation-label-prefix=\"负责人 \" />\n <page-chart theme=\"light\" eyebrow=\"\" chart-type=\"created-trend\" title=\"项目创建趋势\" :rows=\"filteredProjectRows\" :aggregation=\"dashboardAggregations.by_month\" />\n <page-chart theme=\"light\" eyebrow=\"\" chart-type=\"project-graph\" title=\"项目关系\" :rows=\"filteredProjectRows\" />\n </section>\n\n <section class=\"visual-dashboard__filters\" aria-label=\"看板筛选\">\n <el-select v-model=\"filterStatus\" size=\"small\" class=\"visual-dashboard__control\" placeholder=\"全部状态\" :popper-append-to-body=\"false\">\n <el-option v-for=\"status in statusOptions\" :key=\"status.key\" :label=\"status.label\" :value=\"status.key\" />\n </el-select>\n <el-input v-model=\"filterKeyword\" size=\"small\" class=\"visual-dashboard__control\" clearable prefix-icon=\"el-icon-search\" placeholder=\"按项目名称搜索\" />\n <el-button type=\"primary\" size=\"small\" :loading=\"dashboardRefreshing\" :disabled=\"dashboardRefreshing\" @click=\"applyFilters\">筛选</el-button>\n <span class=\"visual-dashboard__count\">{{ projectCount }} 项</span>\n </section>\n</main>",
205
+ "style": ".visual-dashboard { min-height: 100%; box-sizing: border-box; padding: 24px 32px 48px; background: #f6f8fb; color: #1f2937; }\n.visual-dashboard__header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }\n.visual-dashboard__header h1 { min-width: 0; margin: 0; overflow: hidden; color: #111827; font-size: 26px; font-weight: 700; line-height: 36px; letter-spacing: -.02em; text-overflow: ellipsis; white-space: nowrap; }\n.visual-dashboard__header .el-button { min-width: 96px; min-height: 44px; border-radius: 8px; }\n.visual-dashboard__alert { margin-top: 16px; padding: 12px 16px; border: 1px solid #fecaca; border-radius: 10px; background: #fff1f2; color: #991b1b; }\n.visual-dashboard__metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }\n.visual-dashboard__metric { min-width: 0; min-height: 100px; box-sizing: border-box; padding: 18px 20px; border: 1px solid #dbe3ec; border-radius: 12px; background: #fff; }\n.visual-dashboard__metric span { display: block; overflow: hidden; color: #64748b; font-size: 12px; line-height: 18px; text-overflow: ellipsis; white-space: nowrap; }\n.visual-dashboard__metric strong { display: block; margin-top: 10px; color: #111827; font-size: 28px; font-variant-numeric: tabular-nums; line-height: 34px; }\n.visual-dashboard__charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }\n.visual-dashboard__charts .page-composition-chart { min-width: 0; border: 1px solid #dbe3ec; border-radius: 12px; }\n.visual-dashboard__filters { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; border: 1px solid #dbe3ec; border-radius: 12px; background: #fff; }\n.visual-dashboard__control { width: 180px; } .visual-dashboard__filters .el-button { min-width: 88px; min-height: 32px; border-radius: 6px; }\n.visual-dashboard__count { margin-left: auto; color: #64748b; font-size: 13px; font-variant-numeric: tabular-nums; }\n@media (max-width: 1024px) { .visual-dashboard__metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }\n@media (max-width: 720px) { .visual-dashboard { padding: 16px 16px 32px; } .visual-dashboard__header { align-items: flex-start; } .visual-dashboard__header h1 { font-size: 22px; } .visual-dashboard__metrics, .visual-dashboard__charts { grid-template-columns: 1fr; } .visual-dashboard__filters { align-items: stretch; flex-direction: column; } .visual-dashboard__control { width: 100%; } .visual-dashboard__count { margin-left: 0; } }",
206
+ "blocks": []
207
+ },
208
+ "dependencies": {
209
+ "capabilities": [
210
+ "project.list"
211
+ ]
212
+ }
213
+ }
214
+ }