@fses/workbench-app 0.2.16 → 0.2.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/WORKBENCH-CLOSURE.json +18 -12
  2. package/dist/Workspace-r8ayksVF.js +23176 -0
  3. package/dist/canvas/api/index.js +1 -1
  4. package/dist/{canvasFacade-B2EHgdqA.js → canvasFacade-B8jYm_aO.js} +748 -748
  5. package/dist/cardFactory-DmEBcCf4.js +1460 -0
  6. package/dist/extensions/index.js +1 -1
  7. package/dist/fses-workbench-app.js +5 -5
  8. package/dist/{index-CMM-5ObU.js → index-DEOR_GPc.js} +350 -346
  9. package/dist/internal/personal-workbench/fde-skill-cards/runtime/fdeSkillProtocolChartDisplayData.d.ts +0 -5
  10. package/dist/internal/personal-workbench/lib/assistantPersonaProfiles.d.ts +6 -6
  11. package/dist/internal/personal-workbench/lib/cardStyleConfig.d.ts +26 -26
  12. package/dist/internal/personal-workbench/lib/echartsOptionEditorBridge.d.ts +0 -5
  13. package/dist/internal/personal-workbench/lib/historyCardBindingRestore.fixture.d.ts +0 -5
  14. package/dist/internal/personal-workbench/lib/runtimePrimitiveRegistry.d.ts +1 -1
  15. package/dist/internal/personal-workbench/lib/vueRuntimeAdapters.d.ts +0 -5
  16. package/dist/internal/personal-workbench/lib/workbenchCanvasBusinessGapChecklist.d.ts +1 -1
  17. package/dist/internal/personal-workbench/lib/workbenchCardRecommendationFallback.d.ts +1 -1
  18. package/dist/internal/personal-workbench/lib/workbenchCardRecommendationReturnItemUpsert.d.ts +0 -5
  19. package/dist/internal/personal-workbench/lib/workbenchDataBindingBadge.d.ts +0 -5
  20. package/dist/internal/personal-workbench/lib/workbenchImageComposeEntry.d.ts +1 -1
  21. package/dist/internal/personal-workbench/lib/workbenchLayout.d.ts +0 -5
  22. package/dist/runtime/index.js +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useWorkbenchRuntime-DLf_FgC7.js → useWorkbenchRuntime-DDD22mdF.js} +7817 -7813
  25. package/dist/version.d.ts +1 -1
  26. package/dist/{workbenchCustomComponentRegistry-Bt94Lgko.js → workbenchCustomComponentRegistry-CWUPjCnJ.js} +74 -74
  27. package/node_modules/@byteluck-fe/locale-message/README.md +2 -0
  28. package/node_modules/@byteluck-fe/locale-message/dist/index.d.ts +37 -0
  29. package/node_modules/@byteluck-fe/locale-message/dist/locale-message.js +55 -0
  30. package/node_modules/@byteluck-fe/locale-message/package.json +37 -0
  31. package/node_modules/@fses/ai-chat/dist/components/ContextUsageRing.vue.d.ts +5 -0
  32. package/node_modules/@fses/ai-chat/dist/components/FsesAiChat.vue.d.ts +5 -0
  33. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.js +5446 -5321
  34. package/node_modules/@fses/ai-chat/dist/fses-ai-chat.umd.cjs +16 -18
  35. package/node_modules/@fses/ai-chat/dist/style.css +1 -1
  36. package/node_modules/@fses/ai-chat/dist/utils/attachment-upload.d.ts +0 -5
  37. package/node_modules/@fses/ai-chat/package.json +6 -5
  38. package/node_modules/@fses/workbench-card/dist/fses-workbench-card-renderers.js +10144 -9914
  39. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.js +1517 -1503
  40. package/node_modules/@fses/workbench-card/dist/fses-workbench-card.umd.cjs +1 -1
  41. package/node_modules/@fses/workbench-card/dist/renderers/chart/chartRendererRegistry.d.ts +97 -97
  42. package/node_modules/@fses/workbench-card/dist/renderers/style.css +1 -1
  43. package/node_modules/@fses/workbench-card/package.json +4 -1
  44. package/node_modules/@fses/workbench-card/src/registry/cardRegistry.ts +99 -98
  45. package/node_modules/@fses/workbench-card/src/registry/compositeCardPatterns.ts +31 -30
  46. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateCategories.ts +24 -23
  47. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.js +765 -764
  48. package/node_modules/@fses/workbench-card/src/registry/echartsTemplateRegistry.generated.ts +765 -764
  49. package/node_modules/@fses/workbench-card/src/renderers/WorkbenchBlockRenderer.vue +143 -129
  50. package/node_modules/@fses/workbench-card/src/renderers/chart/ChartRegistry.vue +4 -3
  51. package/node_modules/@fses/workbench-card/src/renderers/chart/EChartsProtocolRenderer.vue +2 -1
  52. package/node_modules/@fses/workbench-card/src/renderers/chart/chartRendererRegistry.ts +99 -98
  53. package/node_modules/@fses/workbench-card/src/renderers/chart/useEchart.ts +30 -29
  54. package/node_modules/@fses/workbench-card/src/renderers/native/nativeBindings.ts +11 -10
  55. package/node_modules/@fses/workbench-card/src/renderers/nested/nestedBlockBindings.ts +102 -101
  56. package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceCompositeBindings.ts +364 -363
  57. package/node_modules/@fses/workbench-card/src/renderers/reference-composite/referenceRiskAndStrategyBindings.ts +90 -89
  58. package/node_modules/@fses/workbench-card/src/renderers/useWorkbenchBlockRendererBindings.ts +33 -32
  59. package/package.json +4 -3
  60. package/dist/Workspace-CfKvji6S.js +0 -22896
  61. package/dist/cardFactory-BK3CA-Gn.js +0 -1443
@@ -1,1443 +0,0 @@
1
- import "@fses/workbench-card";
2
- import { resolveCardRegistryEntry as X, compositeCardPatternById as J } from "@fses/workbench-card/registry";
3
- import "@fses/workbench-card/renderers";
4
- let I = {}, E = {}, N = {};
5
- function Q(e) {
6
- I = e;
7
- }
8
- function Je(e, a, t) {
9
- E = e, N = a, Q(t);
10
- }
11
- function Qe() {
12
- return E;
13
- }
14
- function Z() {
15
- return N;
16
- }
17
- function Ze() {
18
- return I;
19
- }
20
- function ea() {
21
- var e;
22
- return (e = I.fde) == null ? void 0 : e.generatedTemplateShell;
23
- }
24
- const ee = {
25
- "card.metric.numeric": { previewKind: "metricNumeric", layoutHint: "metric", sampleTone: "info", sampleTitle: "核心数值" },
26
- "card.metric.combo": { previewKind: "metricCombo", layoutHint: "metric", sampleTone: "info", sampleTitle: "组合指标" },
27
- "card.metric.comparison": { previewKind: "metricComparison", layoutHint: "metric", sampleTone: "success", sampleTitle: "指标对比" },
28
- "card.metric.alert": { previewKind: "metricAlert", layoutHint: "metric", sampleTone: "warning", sampleTitle: "预警指标" },
29
- "card.metric.targetAchievement": { previewKind: "metricTarget", layoutHint: "metric", sampleTone: "success", sampleTitle: "目标达成" },
30
- "card.metric.yoyMom": { previewKind: "metricYoyMom", layoutHint: "metric", sampleTone: "info", sampleTitle: "同比环比" },
31
- "card.metric.segmentedProgress": { previewKind: "metricSegmentedProgress", layoutHint: "metric", sampleTone: "success", sampleTitle: "分段进度" },
32
- "card.metric.abnormalMetric": { previewKind: "metricAbnormal", layoutHint: "metric", sampleTone: "danger", sampleTitle: "异常指标" },
33
- "card.metric.slaMetric": { previewKind: "metricSla", layoutHint: "metric", sampleTone: "warning", sampleTitle: "SLA 指标" },
34
- "card.table.list": { previewKind: "tableRecordList", layoutHint: "table", sampleTone: "neutral", sampleTitle: "明细清单" },
35
- "card.analysis.insight": { previewKind: "analysisInsight", layoutHint: "narrative", sampleTone: "info", sampleTitle: "经营洞察" },
36
- "card.analysis.reportSummary": { previewKind: "analysisReportSummary", layoutHint: "narrative", sampleTone: "info", sampleTitle: "报告摘要" },
37
- "card.analysis.rootCause": { previewKind: "analysisRootCause", layoutHint: "narrative", sampleTone: "warning", sampleTitle: "根因分析" },
38
- "card.analysis.riskInterpretation": { previewKind: "analysisRisk", layoutHint: "narrative", sampleTone: "danger", sampleTitle: "风险解读" },
39
- "card.analysis.businessSuggestion": { previewKind: "analysisSuggestion", layoutHint: "narrative", sampleTone: "success", sampleTitle: "经营建议" },
40
- "card.analysis.weeklyReport": { previewKind: "analysisWeeklyReport", layoutHint: "narrative", sampleTone: "info", sampleTitle: "周报摘要" },
41
- "card.analysis.retrospective": { previewKind: "analysisRetrospective", layoutHint: "narrative", sampleTone: "neutral", sampleTitle: "复盘结论" },
42
- "card.graph.knowledge": { previewKind: "graphKnowledge", layoutHint: "network", sampleTone: "info", sampleTitle: "知识图谱" },
43
- "card.graph.ontology": { previewKind: "graphOntology", layoutHint: "network", sampleTone: "info", sampleTitle: "本体图谱" },
44
- "card.graph.relationship": { previewKind: "graphRelationship", layoutHint: "network", sampleTone: "neutral", sampleTitle: "关系网络" },
45
- "card.graph.dataLineage": { previewKind: "graphDataLineage", layoutHint: "network", sampleTone: "info", sampleTitle: "数据血缘" },
46
- "card.graph.impactChain": { previewKind: "graphImpactChain", layoutHint: "network", sampleTone: "warning", sampleTitle: "影响链路" },
47
- "card.graph.metricLineage": { previewKind: "graphMetricLineage", layoutHint: "network", sampleTone: "success", sampleTitle: "指标血缘" },
48
- "card.graph.permissionRelation": { previewKind: "graphPermission", layoutHint: "network", sampleTone: "warning", sampleTitle: "权限关系" },
49
- "card.identity.directory": { previewKind: "identityDirectory", layoutHint: "table", sampleTone: "neutral", sampleTitle: "通讯录" },
50
- "card.identity.orgChart": { previewKind: "identityOrgChart", layoutHint: "network", sampleTone: "info", sampleTitle: "组织架构" },
51
- "card.identity.personProfile": { previewKind: "identityPersonProfile", layoutHint: "profile", sampleTone: "info", sampleTitle: "人员画像" },
52
- "card.identity.teamDistribution": { previewKind: "identityTeamDistribution", layoutHint: "metric", sampleTone: "success", sampleTitle: "团队分布" },
53
- "card.identity.permissionRelation": { previewKind: "identityPermission", layoutHint: "network", sampleTone: "warning", sampleTitle: "身份权限" },
54
- "card.workflow.todoList": { previewKind: "workflowTodo", layoutHint: "workflow", sampleTone: "warning", sampleTitle: "待办清单" },
55
- "card.workflow.approvalList": { previewKind: "workflowApprovalList", layoutHint: "table", sampleTone: "warning", sampleTitle: "审批列表" },
56
- "card.workflow.processStatus": { previewKind: "workflowProcessStatus", layoutHint: "metric", sampleTone: "info", sampleTitle: "流程状态" },
57
- "card.workflow.approvalChain": { previewKind: "workflowApprovalChain", layoutHint: "network", sampleTone: "info", sampleTitle: "审批链路" },
58
- "card.workflow.sla": { previewKind: "workflowSla", layoutHint: "metric", sampleTone: "warning", sampleTitle: "流程 SLA" },
59
- "card.workflow.taskTimeline": { previewKind: "workflowTaskTimeline", layoutHint: "timeline", sampleTone: "info", sampleTitle: "任务时间线" },
60
- "card.workflow.bottleneck": { previewKind: "workflowBottleneck", layoutHint: "metric", sampleTone: "danger", sampleTitle: "流程瓶颈" },
61
- "card.utility.quickLinks": { previewKind: "utilityQuickLinks", layoutHint: "customCanvas", sampleTone: "info", sampleTitle: "快捷入口" },
62
- "card.utility.announcement": { previewKind: "utilityAnnouncement", layoutHint: "customCanvas", sampleTone: "warning", sampleTitle: "公告通知" },
63
- "card.utility.search": { previewKind: "utilitySearch", layoutHint: "customCanvas", sampleTone: "info", sampleTitle: "搜索入口" },
64
- "card.utility.reminder": { previewKind: "utilityReminder", layoutHint: "workflow", sampleTone: "warning", sampleTitle: "提醒事项" },
65
- "card.utility.favorites": { previewKind: "utilityFavorites", layoutHint: "customCanvas", sampleTone: "success", sampleTitle: "收藏夹" },
66
- "card.utility.weather": { previewKind: "utilityWeather", layoutHint: "metric", sampleTone: "info", sampleTitle: "天气状态" },
67
- "card.utility.calendar": { previewKind: "utilityCalendar", layoutHint: "timeline", sampleTone: "info", sampleTitle: "日程安排" },
68
- "card.chart.bar": { previewKind: "chartBarComparison", layoutHint: "metric", sampleTone: "info", sampleTitle: "柱状对比" },
69
- "card.chart.customEcharts": { previewKind: "chartCustomEcharts", layoutHint: "metric", sampleTone: "neutral", sampleTitle: "自定义图表" },
70
- "card.chart.mixedBarLine": { previewKind: "chartMixedTrend", layoutHint: "metric", sampleTone: "success", sampleTitle: "柱线混合" },
71
- "card.chart.line": { previewKind: "chartLineTrend", layoutHint: "metric", sampleTone: "info", sampleTitle: "趋势折线" },
72
- "card.chart.waterfall": { previewKind: "chartWaterfallSteps", layoutHint: "metric", sampleTone: "info", sampleTitle: "瀑布分解" },
73
- "card.chart.heatmap": { previewKind: "chartHeatmapMatrix", layoutHint: "matrix", sampleTone: "warning", sampleTitle: "热力矩阵" },
74
- "card.chart.area": { previewKind: "chartAreaAccumulation", layoutHint: "metric", sampleTone: "success", sampleTitle: "累计面积" },
75
- "card.chart.pie": { previewKind: "chartPieShare", layoutHint: "metric", sampleTone: "info", sampleTitle: "占比饼图" },
76
- "card.chart.donut": { previewKind: "chartDonutProgress", layoutHint: "metric", sampleTone: "success", sampleTitle: "环形进度" },
77
- "card.chart.radar": { previewKind: "chartRadarMetrics", layoutHint: "metric", sampleTone: "info", sampleTitle: "雷达指标" },
78
- "card.chart.scatter": { previewKind: "chartScatterDistribution", layoutHint: "metric", sampleTone: "info", sampleTitle: "散点分布" },
79
- "card.chart.bubble": { previewKind: "chartBubbleScale", layoutHint: "metric", sampleTone: "warning", sampleTitle: "气泡规模" },
80
- "card.chart.funnel": { previewKind: "chartFunnelStages", layoutHint: "workflow", sampleTone: "info", sampleTitle: "漏斗转化" },
81
- "card.chart.gauge": { previewKind: "chartGaugeMetric", layoutHint: "metric", sampleTone: "success", sampleTitle: "仪表盘" },
82
- "card.chart.map": { previewKind: "chartMapRegion", layoutHint: "map", sampleTone: "info", sampleTitle: "地图分布" },
83
- "card.chart.sankey": { previewKind: "chartSankeyFlow", layoutHint: "network", sampleTone: "info", sampleTitle: "桑基流向" },
84
- "card.chart.tree": { previewKind: "chartTreeHierarchy", layoutHint: "network", sampleTone: "info", sampleTitle: "树状层级" },
85
- "card.chart.gantt": { previewKind: "chartGanttTasks", layoutHint: "timeline", sampleTone: "info", sampleTitle: "甘特任务" },
86
- "card.chart.candlestick": { previewKind: "chartCandlestickSeries", layoutHint: "metric", sampleTone: "warning", sampleTitle: "K 线走势" },
87
- "card.chart.boxplot": { previewKind: "chartBoxplotSeries", layoutHint: "metric", sampleTone: "neutral", sampleTitle: "箱线分布" },
88
- "card.chart.stackedBar": { previewKind: "chartStackedBar", layoutHint: "metric", sampleTone: "info", sampleTitle: "堆叠柱图" },
89
- "card.chart.pareto": { previewKind: "chartParetoSeries", layoutHint: "metric", sampleTone: "warning", sampleTitle: "帕累托分析" },
90
- "card.chart.drilldownTree": { previewKind: "chartDrilldownTree", layoutHint: "network", sampleTone: "info", sampleTitle: "下钻树图" },
91
- "card.chart.network": { previewKind: "chartNetworkRelation", layoutHint: "network", sampleTone: "info", sampleTitle: "网络关系" },
92
- "card.geo.earth3d": { previewKind: "geoEarthArc", layoutHint: "map", sampleTone: "info", sampleTitle: "全球流向" },
93
- "card.geo.siteDistribution": { previewKind: "geoSiteDistribution", layoutHint: "map", sampleTone: "success", sampleTitle: "网点分布" },
94
- "card.geo.regionalHeat": { previewKind: "geoRegionalHeat", layoutHint: "map", sampleTone: "warning", sampleTitle: "区域热力" },
95
- "card.geo.migrationFlow": { previewKind: "geoMigrationFlow", layoutHint: "network", sampleTone: "info", sampleTitle: "迁徙飞线" },
96
- "card.geo.routeTrack": { previewKind: "geoRouteTrack", layoutHint: "network", sampleTone: "info", sampleTitle: "路线轨迹" },
97
- "card.embedded.iframe": { previewKind: "embeddedIframe", layoutHint: "embed", sampleTone: "neutral", sampleTitle: "内嵌页面" },
98
- "card.fde.customComponent": { previewKind: "fdeCustomComponent", layoutHint: "embed", sampleTone: "neutral", sampleTitle: "FDE 组件" },
99
- "card.fde.templateWeather": { previewKind: "fdeTemplateWeather", layoutHint: "metric", sampleTone: "info", sampleTitle: "模板天气" },
100
- "card.custom.blankCanvas": { previewKind: "customBlankCanvas", layoutHint: "customCanvas", sampleTone: "neutral", sampleTitle: "空白画布" },
101
- "card.custom.nestedContainer": { previewKind: "customNestedContainer", layoutHint: "customCanvas", sampleTone: "info", sampleTitle: "嵌套容器" },
102
- "card.entity.customerDetail": { previewKind: "entityCustomer", layoutHint: "profile", sampleTone: "info", sampleTitle: "客户详情" },
103
- "card.entity.projectDetail": { previewKind: "entityProject", layoutHint: "profile", sampleTone: "success", sampleTitle: "项目详情" },
104
- "card.entity.contractDetail": { previewKind: "entityContract", layoutHint: "profile", sampleTone: "warning", sampleTitle: "合同详情" },
105
- "card.entity.supplierDetail": { previewKind: "entitySupplier", layoutHint: "profile", sampleTone: "neutral", sampleTitle: "供应商详情" },
106
- "card.entity.assetDetail": { previewKind: "entityAsset", layoutHint: "profile", sampleTone: "info", sampleTitle: "资产详情" },
107
- "card.entity.ticketDetail": { previewKind: "entityTicket", layoutHint: "workflow", sampleTone: "danger", sampleTitle: "工单详情" }
108
- };
109
- function ae(e) {
110
- const a = ee[e.capabilityId];
111
- if (a) return { capabilityId: e.capabilityId, explicit: !0, ...a };
112
- const t = e.dataShape === "metricSummary" ? "metric" : e.dataShape === "rows" ? "table" : e.dataShape === "networkGraph" ? "network" : e.dataShape === "customCanvas" ? "customCanvas" : e.dataShape === "embeddedFrame" ? "embed" : "metric";
113
- return {
114
- capabilityId: e.capabilityId,
115
- previewKind: `${e.category.replace(/^card\./u, "").replace(/[^a-z0-9]+/giu, "_")}_${e.type}`,
116
- layoutHint: t,
117
- sampleTone: "neutral",
118
- sampleTitle: e.title,
119
- explicit: !1
120
- };
121
- }
122
- const d = 100, g = 5, x = {
123
- small: { w: 33.333, h: 20 },
124
- medium: { w: 33.333, h: 34 },
125
- componentTall: { w: 33.333, h: 42 },
126
- large: { w: 100, h: 32 },
127
- screen: { w: 100, h: 50 }
128
- }, te = {
129
- small: 3,
130
- medium: 3,
131
- componentTall: 3,
132
- large: 1,
133
- screen: 1
134
- }, ie = 0.75;
135
- function h(e, a) {
136
- const t = Number(e);
137
- return Number.isFinite(t) ? t : a;
138
- }
139
- function aa(e) {
140
- return Math.max(1, e) / d;
141
- }
142
- function ta(e, a) {
143
- return e * a;
144
- }
145
- function ia(e, a) {
146
- return e / Math.max(1e-4, a);
147
- }
148
- function ra(e, a = g) {
149
- return Math.round(e / a) * a;
150
- }
151
- function o(e) {
152
- return Math.round(e * 1e3) / 1e3;
153
- }
154
- function W(e = "small") {
155
- return { ...x[e] };
156
- }
157
- function C(e) {
158
- const a = Math.min(d, Math.max(g, o(h(e.w, 30)))), t = Math.max(g, o(h(e.h, 20))), i = Math.min(d - a, Math.max(0, o(h(e.x, 0)))), r = Math.max(0, o(h(e.y, 0)));
159
- return { x: i, y: r, w: a, h: t };
160
- }
161
- function y(e) {
162
- const a = Math.min(d, Math.max(g, o(h(e.w, 30)))), t = Math.max(g, o(h(e.h, 20))), i = Math.min(d - a, Math.max(0, o(h(e.x, 0)))), r = Math.max(0, o(h(e.y, 0)));
163
- return { x: i, y: r, w: a, h: t };
164
- }
165
- function re(e, a) {
166
- return !(e.x + e.w <= a.x || a.x + a.w <= e.x || e.y + e.h <= a.y || a.y + a.h <= e.y);
167
- }
168
- function K(e, a) {
169
- return e.x >= 0 && e.y >= 0 && e.x + e.w <= d && a.every((t) => !re(e, t));
170
- }
171
- function ne(e, a) {
172
- return o(e.w) === o(a.w) && o(e.h) === o(a.h);
173
- }
174
- function A(e) {
175
- return [...new Set(e.map((a) => o(a)))].filter((a) => Number.isFinite(a)).sort((a, t) => a - t);
176
- }
177
- function le(e) {
178
- return e.map(C).sort((a, t) => {
179
- const i = a.y - t.y;
180
- if (i !== 0) return i;
181
- const r = a.x - t.x;
182
- return r !== 0 ? r : a.w - t.w || a.h - t.h;
183
- });
184
- }
185
- function se(e) {
186
- const a = /* @__PURE__ */ new Map();
187
- return le(e).forEach((t) => {
188
- const i = o(t.y);
189
- a.set(i, [...a.get(i) || [], t]);
190
- }), [...a.entries()].map(([t, i]) => ({ y: t, rects: i.sort((r, l) => r.x - l.x) })).sort((t, i) => t.y - i.y);
191
- }
192
- function H(e) {
193
- return e.reduce((a, t) => Math.max(a, t.h), 0);
194
- }
195
- function oe(e) {
196
- return e.reduce((a, t) => a + t.w, 0);
197
- }
198
- function ce(e, a) {
199
- return e >= a * ie;
200
- }
201
- function O(e) {
202
- for (const a of ["screen", "large", "componentTall", "medium", "small"]) {
203
- const t = x[a].w, i = te[a];
204
- if (e.length >= i && e.every((r) => r.w === t))
205
- return a;
206
- }
207
- return null;
208
- }
209
- function G(e, a) {
210
- const t = se(a), i = t.map((n) => ({
211
- ...n,
212
- width: oe(n.rects),
213
- height: H(n.rects),
214
- hasSameSize: n.rects.some((c) => ne(c, e))
215
- })).filter(
216
- (n) => n.width + e.w <= d && ce(n.height, e.h)
217
- ), l = i.filter((n) => n.height === e.h || n.hasSameSize).sort((n, c) => n.hasSameSize !== c.hasSameSize ? n.hasSameSize ? -1 : 1 : n.y - c.y)[0] || i[0];
218
- if (l) {
219
- const n = { ...e, x: o(l.width), y: l.y };
220
- if (K(n, a)) return n;
221
- }
222
- const s = t.reduce((n, c) => Math.max(n, c.y + H(c.rects)), 0);
223
- return { ...e, x: 0, y: o(s) };
224
- }
225
- function q(e, a) {
226
- const t = C(e);
227
- if (K(t, a)) return t;
228
- const i = G(t, a);
229
- if (K(i, a)) return i;
230
- const r = a.reduce((n, c) => Math.max(n, c.y + c.h), 0), l = A([
231
- 0,
232
- t.x,
233
- ...a.flatMap((n) => [n.x, n.x + n.w])
234
- ]).filter((n) => n >= 0 && n + t.w <= d), s = A([
235
- 0,
236
- t.y,
237
- r,
238
- ...a.flatMap((n) => [n.y, n.y + n.h])
239
- ]).filter((n) => n >= 0);
240
- for (const n of s)
241
- for (const c of l) {
242
- const p = { ...t, x: c, y: n };
243
- if (K(p, a)) return p;
244
- }
245
- return { ...t, x: 0, y: o(r + g) };
246
- }
247
- function ue(e, a) {
248
- const t = C(e), i = G(t, a);
249
- return K(i, a) ? i : q(t, a);
250
- }
251
- function na(e) {
252
- const a = /* @__PURE__ */ new Map();
253
- return e.forEach((t) => {
254
- const i = o(y(t.layout).y);
255
- a.set(i, [...a.get(i) || [], t]);
256
- }), [...a.entries()].sort((t, i) => t[0] - i[0]).flatMap(([t, i]) => {
257
- const r = i.slice().sort((u, b) => {
258
- const f = y(u.layout), v = y(b.layout), k = f.x - v.x;
259
- return k !== 0 ? k : f.w - v.w || f.h - v.h;
260
- }), l = r.reduce((u, b) => u + y(b.layout).w, 0), s = Math.max(0, d - l), n = r.reduce((u, b) => Math.min(u, y(b.layout).w), d), c = O(r.map((u) => y(u.layout))), p = !!c && s > 0 && s < n, w = p ? r.filter((u) => y(u.layout).w === x[c].w) : [], m = w.length > 0 ? s / w.length : 0;
261
- let T = 0;
262
- return r.map((u, b) => {
263
- const f = y(u.layout), v = b === r.length - 1, k = w.length > 0 ? w.includes(u) : p && v, V = p && v ? Math.max(g, o(d - T)) : Math.max(g, o(k ? f.w + m : f.w)), P = {
264
- ...f,
265
- x: o(T),
266
- y: t,
267
- w: V
268
- };
269
- return T += P.w, {
270
- ...u,
271
- layout: {
272
- ...u.layout,
273
- ...P
274
- }
275
- };
276
- });
277
- });
278
- }
279
- function de(e, a) {
280
- const t = e.reduce((m, T) => m + T.rect.w, 0), i = Math.max(0, d - t), r = O(e.map((m) => m.rect)), l = !!r, s = l ? e.filter((m) => m.rect.w === x[r].w) : [], n = l && s.length === 0 ? e[e.length - 1] : null, c = s.length || (n ? 1 : 0), p = c > 0 ? i / c : 0;
281
- let w = 0;
282
- return e.map((m, T) => {
283
- const u = T === e.length - 1, b = s.includes(m) || m === n, f = u && l ? Math.max(g, o(d - w)) : Math.max(g, o(m.rect.w + (b ? p : 0))), v = {
284
- ...m.rect,
285
- x: o(w),
286
- y: a,
287
- w: f
288
- };
289
- return w += v.w, {
290
- ...m.item,
291
- layout: {
292
- ...m.item.layout,
293
- ...v
294
- }
295
- };
296
- });
297
- }
298
- function me(e) {
299
- const a = [];
300
- let t = 0, i = [];
301
- const r = () => {
302
- i.length !== 0 && (a.push(...de(i, o(t))), t += H(i.map((l) => l.rect)), i = []);
303
- };
304
- return e.forEach((l) => {
305
- const s = y(l.layout);
306
- if (s.w >= d) {
307
- r(), i = [{ item: l, rect: { ...s, x: 0, w: d } }], r();
308
- return;
309
- }
310
- const n = i.reduce((c, p) => c + p.rect.w, 0);
311
- i.length > 0 && n + s.w > d && r(), i.push({ item: l, rect: s });
312
- }), r(), a;
313
- }
314
- function la(e) {
315
- const a = [...e].sort((l, s) => {
316
- const n = y(l.layout), c = y(s.layout), p = n.y - c.y;
317
- if (p !== 0) return p;
318
- const w = n.x - c.x;
319
- return w !== 0 ? w : l.id.localeCompare(s.id);
320
- });
321
- let t = 0, i = 0, r = 0;
322
- return a.map((l) => {
323
- const s = y(l.layout);
324
- t > 0 && t + s.w > d && (t = 0, i = o(i + r), r = 0);
325
- const n = {
326
- ...s,
327
- x: o(t),
328
- y: o(i)
329
- };
330
- return t = o(t + n.w), r = Math.max(r, n.h), {
331
- ...l,
332
- layout: {
333
- ...l.layout,
334
- ...n,
335
- i: l.id
336
- }
337
- };
338
- });
339
- }
340
- function sa(e) {
341
- const a = [...e].sort((t, i) => {
342
- const r = y(t.layout), l = y(i.layout), s = r.y - l.y;
343
- if (s !== 0) return s;
344
- const n = r.x - l.x;
345
- return n !== 0 ? n : t.id.localeCompare(i.id);
346
- });
347
- return me(a).map((t) => ({
348
- ...t,
349
- layout: {
350
- ...t.layout,
351
- i: t.id
352
- }
353
- }));
354
- }
355
- function oa(e, a = 20) {
356
- return e.reduce((t, i) => Math.max(t, i.y + i.h), 0) + a;
357
- }
358
- function pe(e) {
359
- var i, r, l, s;
360
- const a = W(e.preset), t = C({
361
- x: h((i = e.layout) == null ? void 0 : i.x, 0),
362
- y: h((r = e.layout) == null ? void 0 : r.y, 0),
363
- w: h(((l = e.layout) == null ? void 0 : l.w) ?? e.width, a.w),
364
- h: h(((s = e.layout) == null ? void 0 : s.h) ?? e.height, a.h)
365
- });
366
- return q(t, e.placed);
367
- }
368
- function he(e) {
369
- var i, r, l, s;
370
- const a = W(e.preset), t = C({
371
- x: h((i = e.layout) == null ? void 0 : i.x, 0),
372
- y: h((r = e.layout) == null ? void 0 : r.y, 0),
373
- w: h(((l = e.layout) == null ? void 0 : l.w) ?? e.width, a.w),
374
- h: h(((s = e.layout) == null ? void 0 : s.h) ?? e.height, a.h)
375
- });
376
- return ue(t, e.placed);
377
- }
378
- function we(e, a) {
379
- return {
380
- i: e,
381
- ...C(a),
382
- minW: g,
383
- minH: g,
384
- maxW: d,
385
- static: !1
386
- };
387
- }
388
- const $ = "echarts-system-card-templates", L = /* @__PURE__ */ new Map();
389
- async function B(e) {
390
- const a = L.get(e);
391
- if (a) return await a;
392
- const t = ye(e);
393
- return L.set(e, t), t.catch(() => {
394
- L.get(e) === t && L.delete(e);
395
- }), await t;
396
- }
397
- async function ye(e) {
398
- const t = ve(e, fe()) ?? e, i = await be(t);
399
- if (i.ok) return i.value;
400
- throw i.error;
401
- }
402
- async function be(e) {
403
- try {
404
- const a = await fetch(e, { credentials: "same-origin" });
405
- return a.ok ? { ok: !0, value: await a.json() } : { ok: !1, error: new Error(`加载 ECharts 模板资源失败:${e} (${a.status})`) };
406
- } catch (a) {
407
- const t = a instanceof Error ? a.message : String(a);
408
- return { ok: !1, error: new Error(`加载 ECharts 模板资源失败:${e}: ${t}`) };
409
- }
410
- }
411
- function fe() {
412
- var a, t;
413
- return ((t = (a = Z().assets) == null ? void 0 : a.echartsTemplateCdnBaseUrl) == null ? void 0 : t.trim()) || void 0;
414
- }
415
- function ve(e, a) {
416
- if (!a) return;
417
- const t = a.replace(/\/+$/u, ""), i = e.replace(/^\/+/u, "");
418
- return t.endsWith(`/${$}`) ? `${t}/${i.slice(`${$}/`.length)}` : `${t}/${i}`;
419
- }
420
- const ge = ["extraction", "officialComparison", "officialSourceReplay"], Te = ["params", "reloadPolicy", "extraction"];
421
- function ca(e) {
422
- let a = !1;
423
- const t = e.blocks.map((i) => {
424
- const r = Se(i);
425
- return r !== i && (a = !0), r;
426
- });
427
- return a ? { ...e, blocks: t } : e;
428
- }
429
- function Se(e) {
430
- if (!S(e.data)) return e;
431
- const a = R(e.data);
432
- return a === e.data ? e : { ...e, data: a };
433
- }
434
- function R(e) {
435
- let a = !1;
436
- const t = Ce(e) ? { ...e } : e;
437
- if (S(t.protocolConfig)) {
438
- const i = _(t.protocolConfig, ge);
439
- i !== t.protocolConfig && (t.protocolConfig = i, a = !0);
440
- }
441
- if (S(t.protocolData)) {
442
- const i = _(t.protocolData, Te);
443
- i !== t.protocolData && (t.protocolData = i, a = !0);
444
- }
445
- if (Array.isArray(t.nestedBlocks)) {
446
- const i = t.nestedBlocks.map((r) => S(r) ? Ke(r) : r);
447
- if (i.some((r, l) => r !== t.nestedBlocks[l])) {
448
- if (t === e) return { ...e, nestedBlocks: i };
449
- t.nestedBlocks = i, a = !0;
450
- }
451
- }
452
- return a ? t : e;
453
- }
454
- function Ce(e) {
455
- return e.shape === "protocolRender" && e.rendererType === "echarts" && S(e.protocolConfig);
456
- }
457
- function Ke(e) {
458
- let a = !1, t = R(e);
459
- if (t !== e && (a = !0), S(t.data)) {
460
- const i = R(t.data);
461
- i !== t.data && (t = t === e ? { ...e, data: i } : { ...t, data: i }, a = !0);
462
- }
463
- return a ? t : e;
464
- }
465
- function S(e) {
466
- return !!(e && typeof e == "object" && !Array.isArray(e));
467
- }
468
- function _(e, a) {
469
- let t = !1;
470
- const i = { ...e };
471
- return a.forEach((r) => {
472
- r in i && (delete i[r], t = !0);
473
- }), t ? i : e;
474
- }
475
- async function ke(e) {
476
- try {
477
- const a = await B(e.echarts.configPath), t = e.echarts.dataPath ? await B(e.echarts.dataPath) : void 0, i = R({
478
- shape: "protocolRender",
479
- rendererType: "echarts",
480
- protocolConfig: a,
481
- ...t ? { protocolData: t } : {}
482
- }), r = i.protocolConfig, l = i.protocolData;
483
- return {
484
- ok: !0,
485
- data: {
486
- shape: "protocolRender",
487
- rendererType: "echarts",
488
- sourceLabel: "ECharts 官方示例",
489
- protocolConfig: r,
490
- ...l ? { protocolData: l } : {},
491
- template: {
492
- exampleId: e.echarts.exampleId,
493
- mainCategory: e.echarts.mainCategory,
494
- tags: e.echarts.tags,
495
- requires: e.echarts.requires
496
- }
497
- },
498
- renderer: {
499
- engine: "echarts",
500
- rendererKey: "echartsProtocol"
501
- },
502
- meta: {
503
- capabilityId: e.capabilityId,
504
- rendererKey: e.rendererKey,
505
- dataShape: e.dataShape,
506
- echartsTemplate: e.echarts
507
- }
508
- };
509
- } catch (a) {
510
- return {
511
- ok: !1,
512
- reason: a instanceof Error ? a.message : "ECharts 模板资源加载失败。"
513
- };
514
- }
515
- }
516
- function Le(e) {
517
- return !!(e && typeof e == "object" && typeof e.capabilityId == "string" && e.capabilityId.startsWith("card.echarts.") && typeof e.echarts == "object");
518
- }
519
- function Re(e = "canvas-card") {
520
- return typeof crypto < "u" && "randomUUID" in crypto ? `${e}-${crypto.randomUUID()}` : `${e}-${Date.now()}-${Math.random().toString(36).slice(2)}`;
521
- }
522
- function xe() {
523
- return {
524
- mode: "final",
525
- status: "ready",
526
- refreshable: !0,
527
- cacheable: !0,
528
- drilldown: !1,
529
- editable: !0,
530
- submitable: !1
531
- };
532
- }
533
- function He(e) {
534
- if (e.category !== "card.composite_cards") return null;
535
- const a = J(e.type);
536
- if (!a) return null;
537
- if (a.id === "threePanelAnalysis") return Ie(a.scene);
538
- const t = a.dataContract.nestedBlockKinds.slice(0, 4).map((i, r) => ({
539
- id: `${a.id}-sample-${r + 1}`,
540
- title: F(a.id, i, r),
541
- kind: Me(i),
542
- visualKind: i,
543
- slot: r < 2 ? "body" : "footer",
544
- dataBindingStatus: r === 0 ? "business_input" : "none",
545
- ...r === 0 ? {
546
- dataBindingId: `binding-${a.id}-sample-${r + 1}`,
547
- dataBinding: {
548
- id: `binding-${a.id}-sample-${r + 1}`,
549
- status: "business_input",
550
- queryIntent: `查询${F(a.id, i, r)}`,
551
- refreshApi: `/workbench/v2/documents/{workspaceId}/data-bindings/binding-${a.id}-sample-${r + 1}/query`
552
- },
553
- humanIntervention: {
554
- required: !0,
555
- reason: "sample_business_input",
556
- hint: "补充业务口径后由宿主问数并 setData。"
557
- }
558
- } : {},
559
- data: De(i)
560
- }));
561
- return {
562
- shape: "customCanvas",
563
- sourceLabel: "Workbench Card Library",
564
- narrative: a.scene,
565
- elements: [],
566
- nestedLayoutMode: "stack",
567
- nestedLayoutStacks: [
568
- { id: `${a.id}-left`, childIds: t.filter((i, r) => r % 2 === 0).map((i) => i.id) },
569
- { id: `${a.id}-right`, childIds: t.filter((i, r) => r % 2 === 1).map((i) => i.id) }
570
- ],
571
- nestedBlocks: t
572
- };
573
- }
574
- function Ie(e) {
575
- return {
576
- shape: "customCanvas",
577
- sourceLabel: "Workbench Card Library",
578
- narrative: e,
579
- elements: [],
580
- nestedLayoutMode: "grid",
581
- nestedBlocks: [
582
- {
583
- id: "three-panel-bar",
584
- title: "左侧柱状图",
585
- capabilityId: "card.chart.bar",
586
- dataShape: "multiSeries",
587
- visualKind: "bar",
588
- renderer: { engine: "custom", rendererKey: "bar" },
589
- layout: { i: "three-panel-bar", x: 0, y: 0, w: 6, h: 10, parentId: "three-panel-analysis" },
590
- data: {
591
- shape: "multiSeries",
592
- categories: ["A", "B", "C"],
593
- series: [{ name: "待问数", type: "bar", data: [0, 0, 0] }]
594
- }
595
- },
596
- {
597
- id: "three-panel-line",
598
- title: "右上折线图",
599
- capabilityId: "card.chart.line",
600
- dataShape: "singleSeries",
601
- visualKind: "line",
602
- renderer: { engine: "custom", rendererKey: "line" },
603
- layout: { i: "three-panel-line", x: 6, y: 0, w: 6, h: 5, parentId: "three-panel-analysis" },
604
- data: {
605
- shape: "singleSeries",
606
- categories: ["一月", "二月", "三月"],
607
- series: [{ name: "待问数", type: "line", data: [0, 0, 0] }]
608
- }
609
- },
610
- {
611
- id: "three-panel-metric",
612
- title: "右下指标卡",
613
- capabilityId: "card.metric.numeric",
614
- dataShape: "metricSummary",
615
- visualKind: "metric",
616
- renderer: { engine: "custom", rendererKey: "metricStrip" },
617
- layout: { i: "three-panel-metric", x: 6, y: 5, w: 6, h: 5, parentId: "three-panel-analysis" },
618
- data: {
619
- shape: "metricSummary",
620
- primaryLabel: "待问数指标",
621
- primaryValue: "待补口径"
622
- }
623
- }
624
- ].map((t, i) => {
625
- const r = `binding-three-panel-${i + 1}`;
626
- return {
627
- id: t.id,
628
- title: t.title,
629
- kind: t.visualKind === "metric" ? "metric" : "chart",
630
- capabilityId: t.capabilityId,
631
- dataShape: t.dataShape,
632
- visualKind: t.visualKind,
633
- slot: "main",
634
- renderer: t.renderer,
635
- dataBindingId: r,
636
- dataBindingStatus: "business_input",
637
- dataBinding: {
638
- id: r,
639
- bindingId: r,
640
- status: "business_input",
641
- queryIntent: `查询${t.title}`,
642
- refreshApi: `/workbench/v2/documents/{workspaceId}/data-bindings/${r}/query`
643
- },
644
- humanIntervention: {
645
- required: !0,
646
- reason: "sample_business_input",
647
- hint: "补充业务口径后由宿主问数并 setData。"
648
- },
649
- queryIntent: `查询${t.title}`,
650
- layout: t.layout,
651
- data: {
652
- ...t.data,
653
- dataBindingStatus: "business_input",
654
- dataBindingId: r,
655
- humanIntervention: {
656
- required: !0,
657
- reason: "sample_business_input"
658
- },
659
- capabilityId: t.capabilityId,
660
- dataShape: t.dataShape,
661
- visualKind: t.visualKind,
662
- rendererKey: t.renderer.rendererKey,
663
- queryIntent: `查询${t.title}`
664
- }
665
- };
666
- })
667
- };
668
- }
669
- function F(e, a, t) {
670
- var r;
671
- return ((r = {
672
- asset: ["资产台账", "成本分析", "资产异常", "成本优化"],
673
- project: ["重点 IT 项目看板", "个人待办", "快捷入口", "研发与运维效能"],
674
- ops: ["全局服务监控", "资源负载监控", "故障与告警中心", "近七日趋势"],
675
- security: ["安全风险总览", "账号权限风险", "合规审计", "整改待办"],
676
- businessMetricMatrix: ["核心 KPI", "趋势缩略图", "业务动态", "风险提醒"]
677
- }[e]) == null ? void 0 : r[t]) || a;
678
- }
679
- function Me(e) {
680
- return /metric|score/i.test(e) ? "metric" : /chart|donut|bars/i.test(e) ? "chart" : "list";
681
- }
682
- function De(e) {
683
- return /metric|score/i.test(e) ? { shape: "metricSummary", primaryValue: "待补口径", primaryLabel: "示例指标" } : /donut/i.test(e) ? { shape: "pieSlices", slices: [{ label: "已用", value: 62 }, { label: "剩余", value: 38 }] } : /chart|bars/i.test(e) ? { shape: "singleSeries", categories: ["周一", "周二", "周三"], series: [{ name: "趋势", type: "line", data: [82, 88, 91] }] } : {
684
- shape: "categoryRanking",
685
- items: [
686
- { label: "示例事项 A", value: "待确认" },
687
- { label: "示例事项 B", value: "可跟进" }
688
- ]
689
- };
690
- }
691
- function Pe(e, a) {
692
- const t = {
693
- multiPanel: ["核心指标趋势", "业务分布", "结构占比", "健康度监控"],
694
- executiveCockpit: ["经营目标达成", "收入趋势", "费用结构", "风险预警"],
695
- projectCockpit: ["项目进度", "里程碑趋势", "资源占比", "交付健康度"],
696
- riskCockpit: ["风险总览", "风险趋势", "风险类型占比", "处置完成率"],
697
- regionalCockpit: ["区域贡献", "区域趋势", "区域结构", "区域达成率"]
698
- }, [i, r, l, s] = t[e.type] || t.multiPanel;
699
- return {
700
- shape: "dashboardGrid",
701
- sourceLabel: "Canvas Runtime",
702
- narrative: a,
703
- panels: [
704
- {
705
- id: `${e.type}-trend`,
706
- title: i,
707
- subtitle: "月度走势",
708
- rendererKey: "line",
709
- data: {
710
- shape: "singleSeries",
711
- categories: ["一月", "二月", "三月", "四月", "五月", "六月"],
712
- metricFormat: "number",
713
- unit: "趋势值",
714
- series: [{ name: "本期", type: "line", data: [82, 96, 91, 118, 126, 138] }]
715
- }
716
- },
717
- {
718
- id: `${e.type}-bars`,
719
- title: r,
720
- subtitle: "分组对比",
721
- rendererKey: "bar",
722
- data: {
723
- shape: "multiSeries",
724
- categories: ["华东", "华北", "华南", "西部"],
725
- metricFormat: "number",
726
- unit: "业务量",
727
- series: [
728
- { name: "本期", type: "bar", data: [128, 96, 112, 78] },
729
- { name: "上期", type: "bar", data: [110, 88, 104, 72] }
730
- ]
731
- }
732
- },
733
- {
734
- id: `${e.type}-structure`,
735
- title: l,
736
- subtitle: "结构拆分",
737
- rendererKey: "donut",
738
- data: {
739
- shape: "pieSlices",
740
- innerRadius: 0.52,
741
- slices: [
742
- { label: "A 类", value: 45, share: 0.45 },
743
- { label: "B 类", value: 32, share: 0.32 },
744
- { label: "C 类", value: 23, share: 0.23 }
745
- ]
746
- }
747
- },
748
- {
749
- id: `${e.type}-combo`,
750
- title: s,
751
- subtitle: "完成与趋势",
752
- rendererKey: "mixedBarLine",
753
- data: {
754
- shape: "multiSeries",
755
- categories: ["一月", "二月", "三月", "四月"],
756
- metricFormat: "percent",
757
- unit: "完成率",
758
- series: [
759
- { name: "完成率", type: "bar", data: [66, 72, 79, 84] },
760
- { name: "趋势线", type: "line", data: [61, 69, 77, 88] }
761
- ]
762
- }
763
- }
764
- ]
765
- };
766
- }
767
- function Ae() {
768
- return {
769
- shape: "customCanvas",
770
- sourceLabel: "Canvas Runtime",
771
- narrative: "拖拽卡片到容器中进行分组,子卡可独立问数。",
772
- elements: [],
773
- nestedLayoutMode: "grid",
774
- nestedBlocks: [],
775
- containerRole: "nested-card-container"
776
- };
777
- }
778
- function $e(e, a) {
779
- const i = {
780
- metricNumeric: { value: 128, delta: 0.062, compare: "较上期", secondary: [{ label: "本期值", format: "number", value: 128 }, { label: "样本数", format: "number", value: 24 }] },
781
- metricCombo: { value: 386, delta: 0.094, compare: "组合提升", secondary: [{ label: "收入", format: "currency", value: 218 }, { label: "订单", format: "number", value: 168 }] },
782
- metricComparison: { value: 112, delta: 0.047, compare: "领先对照组", secondary: [{ label: "A 组", format: "number", value: 112 }, { label: "B 组", format: "number", value: 97 }] },
783
- metricAlert: { value: 7, delta: -0.18, compare: "异常下降", secondary: [{ label: "告警数", format: "number", value: 3 }, { label: "处置率", format: "percent", value: 0.62 }] },
784
- metricYoyMom: { value: 128, delta: 0.062, compare: "同比环比", secondary: [{ label: "同比", format: "percent", value: 0.12 }, { label: "环比", format: "percent", value: -0.03 }] },
785
- metricAbnormal: { value: 12, delta: 0.24, compare: "异常上升", secondary: [{ label: "异常项", format: "number", value: 12 }, { label: "影响率", format: "percent", value: 0.18 }] },
786
- metricSegmentedProgress: { value: 76, delta: 0.08, compare: "阶段推进", secondary: [{ label: "已完成", format: "number", value: 76 }, { label: "完成率", format: "percent", value: 0.76 }] },
787
- metricTarget: { value: 0.92, delta: 0.12, compare: "目标达成", secondary: [{ label: "目标", format: "number", value: 100 }, { label: "达成率", format: "percent", value: 0.92 }] },
788
- metricSla: { value: 0.96, delta: -0.03, compare: "SLA 压线", secondary: [{ label: "目标线", format: "percent", value: 0.98 }, { label: "当前值", format: "percent", value: 0.96 }] },
789
- workflowSla: { value: 0.94, delta: -0.04, compare: "即将超时", secondary: [{ label: "超时单", format: "number", value: 2 }, { label: "准时率", format: "percent", value: 0.94 }] },
790
- workflowProcessStatus: { value: 18, delta: 0.11, compare: "流转中", secondary: [{ label: "进行中", format: "number", value: 18 }, { label: "完成率", format: "percent", value: 0.71 }] }
791
- }[a.previewKind] || {
792
- value: 128,
793
- delta: 0.062,
794
- compare: "较上期",
795
- secondary: [{ label: "目标", format: "number", value: 150 }, { label: "完成率", format: "percent", value: 0.85 }]
796
- };
797
- return {
798
- shape: "metricSummary",
799
- primaryLabel: a.sampleTitle || e.title,
800
- primaryFormat: a.previewKind === "metricTarget" || a.previewKind === "metricSla" ? "percent" : "number",
801
- primaryValue: i.value,
802
- deltaPct: i.delta,
803
- compareLabel: i.compare,
804
- periodLabel: "预览样例",
805
- sourceLabel: "Canvas Runtime",
806
- secondary: i.secondary
807
- };
808
- }
809
- function Be(e, a) {
810
- const t = {
811
- analysisInsight: ["核心指标保持稳定。", "结构变化主要来自重点分组。", "建议继续观察趋势拐点。"],
812
- analysisRootCause: ["波动来源集中在输入、过程、结果三层。", "主因需要结合明细数据确认。", "建议优先排查异常链路。"],
813
- analysisRisk: ["当前存在可恢复风险。", "风险影响集中在关键节点。", "建议设置负责人和截止时间。"],
814
- analysisSuggestion: ["优先推进高收益动作。", "保留低风险试点空间。", "按周复盘动作收益。"],
815
- analysisWeeklyReport: ["本周目标推进平稳。", "重点事项按计划收敛。", "下周关注跨团队阻塞。"],
816
- analysisRetrospective: ["目标完成情况与预期基本一致。", "过程问题集中在协同节奏。", "下阶段需要沉淀标准动作。"]
817
- };
818
- if (e.dataShape === "reportSummary") {
819
- const i = t[a.previewKind] || ["关键变化已归纳。", "后续可继续下钻。"];
820
- return {
821
- shape: "reportSummary",
822
- summary: `${a.sampleTitle || e.title}预览摘要。`,
823
- highlights: i,
824
- sourceLabel: "Canvas Runtime",
825
- dataStatus: "sample"
826
- };
827
- }
828
- return {
829
- shape: "insightNarrative",
830
- bullets: t[a.previewKind] || ["本期摘要已生成。", "关键变化已归纳。", "后续可继续下钻。"],
831
- confidence: a.sampleTone === "danger" ? 0.74 : 0.86,
832
- owner: a.sampleTitle,
833
- sourceLabel: "Canvas Runtime"
834
- };
835
- }
836
- function U() {
837
- return {
838
- shape: "rows",
839
- sourceLabel: "Canvas Runtime",
840
- visualKind: "genericRows",
841
- columns: ["项目", "状态", "数值"],
842
- rows: [
843
- { id: "row-1", cells: ["样例 A", "正常", "128"] },
844
- { id: "row-2", cells: ["样例 B", "关注", "76"] }
845
- ]
846
- };
847
- }
848
- function _e(e, a) {
849
- return {
850
- tableRecordList: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableRecordList", columns: ["事项", "负责人", "状态", "数值"], rows: [
851
- { id: "row-1", cells: ["客户跟进", "张明", "进行中", "12"] },
852
- { id: "row-2", cells: ["方案确认", "李然", "待处理", "8"] }
853
- ] },
854
- tableCompactList: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableCompactList", columns: ["名称", "状态", "备注"], rows: [
855
- { id: "row-1", cells: ["示例项 A", "正常", "已同步"] },
856
- { id: "row-2", cells: ["示例项 B", "关注", "待确认"] }
857
- ] },
858
- tableSummary: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableSummary", columns: ["分组", "本期", "上期", "变化"], rows: [
859
- { id: "row-1", cells: ["销售", "128", "116", "+12"] },
860
- { id: "row-2", cells: ["交付", "92", "88", "+4"] }
861
- ] },
862
- tableComparison: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableComparison", columns: ["对象", "效率", "质量", "风险"], rows: [
863
- { id: "row-1", cells: ["A 组", "高", "稳定", "低"] },
864
- { id: "row-2", cells: ["B 组", "中", "提升", "中"] }
865
- ] },
866
- tableParameter: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableParameter", columns: ["参数", "当前值", "说明"], rows: [
867
- { id: "row-1", cells: ["刷新周期", "15 分钟", "自动更新"] },
868
- { id: "row-2", cells: ["预警阈值", "80%", "超过提醒"] }
869
- ] },
870
- tableIndex: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableIndex", columns: ["指标", "口径", "负责人"], rows: [
871
- { id: "row-1", cells: ["收入", "已确认金额", "财务"] },
872
- { id: "row-2", cells: ["履约率", "按期完成占比", "交付"] }
873
- ] },
874
- tablePartition: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tablePartition", columns: ["分区", "记录数", "更新时间"], rows: [
875
- { id: "row-1", cells: ["华东", "12,680", "09:20"] },
876
- { id: "row-2", cells: ["华北", "8,914", "09:18"] }
877
- ] },
878
- tableMapping: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableMapping", columns: ["来源字段", "目标字段", "状态"], rows: [
879
- { id: "row-1", cells: ["customer_id", "客户 ID", "已映射"] },
880
- { id: "row-2", cells: ["owner_id", "负责人", "待确认"] }
881
- ] },
882
- tableLevel: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableLevel", columns: ["等级", "阈值", "动作"], rows: [
883
- { id: "row-1", cells: ["高", "> 90%", "重点保障"] },
884
- { id: "row-2", cells: ["中", "70%-90%", "持续观察"] }
885
- ] },
886
- tableTimeline: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableTimeline", columns: ["时间", "节点", "状态"], rows: [
887
- { id: "row-1", cells: ["09:00", "提交申请", "完成"] },
888
- { id: "row-2", cells: ["10:30", "主管审批", "进行中"] }
889
- ] },
890
- tableMatrix: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableMatrix", columns: ["维度", "销售", "交付", "财务"], rows: [
891
- { id: "row-1", cells: ["风险", "低", "中", "低"] },
892
- { id: "row-2", cells: ["优先级", "高", "中", "高"] }
893
- ] },
894
- tableNested: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableNested", columns: ["层级", "对象", "状态"], rows: [
895
- { id: "row-1", cells: ["一级", "项目群", "运行中"] },
896
- { id: "row-2", cells: ["二级", "交付任务", "待确认"] }
897
- ] },
898
- tableSteps: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableSteps", columns: ["步骤", "动作", "状态"], rows: [
899
- { id: "row-1", cells: ["1", "发起", "完成"] },
900
- { id: "row-2", cells: ["2", "复核", "进行中"] }
901
- ] },
902
- tableDescription: { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "tableDescription", columns: ["名称", "含义", "备注"], rows: [
903
- { id: "row-1", cells: ["完成率", "已完成 / 目标", "百分比"] },
904
- { id: "row-2", cells: ["响应时长", "首次响应耗时", "分钟"] }
905
- ] }
906
- }[a.previewKind] || {
907
- ...U(),
908
- visualKind: a.previewKind,
909
- columns: ["类型", "状态", "说明"],
910
- rows: [
911
- { id: "row-1", cells: [a.sampleTitle || e.title, "正常", "预览样例"] },
912
- { id: "row-2", cells: ["更新", "待确认", "可接入真实数据"] }
913
- ]
914
- };
915
- }
916
- function Fe(e, a) {
917
- return e.category === "card.table_cards" ? _e(e, a) : e.capabilityId === "card.identity.directory" ? { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "identityDirectory", columns: ["姓名", "角色", "状态"], rows: [
918
- { id: "row-1", cells: ["张明", "销售负责人", "在线"] },
919
- { id: "row-2", cells: ["李然", "交付负责人", "忙碌"] }
920
- ] } : e.capabilityId === "card.workflow.approvalList" ? { shape: "rows", sourceLabel: "Canvas Runtime", visualKind: "workflowApprovalList", columns: ["单据", "节点", "状态"], rows: [
921
- { id: "row-1", cells: ["合同审批", "法务复核", "待处理"] },
922
- { id: "row-2", cells: ["费用申请", "部门确认", "进行中"] }
923
- ] } : U();
924
- }
925
- function ze(e, a) {
926
- if (a.previewKind === "chartBubbleScale")
927
- return {
928
- shape: "scatterPoints",
929
- xLabel: "投入",
930
- yLabel: "产出",
931
- sizeLabel: "规模",
932
- points: [
933
- { label: "A", x: 18, y: 42, size: 18 },
934
- { label: "B", x: 38, y: 70, size: 44 },
935
- { label: "C", x: 66, y: 76, size: 30 }
936
- ],
937
- narrative: `${a.sampleTitle}预览。`
938
- };
939
- if (e.dataShape === "scatterPoints")
940
- return {
941
- shape: "scatterPoints",
942
- xLabel: "投入",
943
- yLabel: "产出",
944
- sizeLabel: "规模",
945
- points: [
946
- { label: "样本 A", x: 18, y: 42, size: 24 },
947
- { label: "样本 B", x: 36, y: 68, size: 36 },
948
- { label: "样本 C", x: 56, y: 72, size: 18 },
949
- { label: "样本 D", x: 74, y: 84, size: 28 }
950
- ],
951
- narrative: `${a.sampleTitle}预览。`
952
- };
953
- if (a.previewKind === "chartAreaAccumulation")
954
- return {
955
- shape: e.dataShape,
956
- categories: ["一月", "二月", "三月", "四月", "五月", "六月"],
957
- metricFormat: "number",
958
- unit: "累计值",
959
- narrative: `${a.sampleTitle}预览。`,
960
- series: [{ name: "累计面积", type: "line", data: [32, 68, 105, 149, 188, 236] }]
961
- };
962
- const t = e.rendererKey === "line" || e.rendererKey === "area" ? "line" : "bar";
963
- return {
964
- shape: e.dataShape,
965
- categories: ["一月", "二月", "三月", "四月", "五月", "六月"],
966
- metricFormat: "number",
967
- unit: a.previewKind === "chartLineTrend" ? "趋势值" : "业务量",
968
- narrative: `${a.sampleTitle}预览。`,
969
- series: [
970
- { name: a.previewKind === "chartLineTrend" ? "趋势" : a.sampleTitle, type: t, data: [88, 112, 96, 128, 142, 156] },
971
- ...e.dataShape === "multiSeries" ? [{ name: "上期", type: "bar", data: [76, 90, 105, 118, 124, 136] }] : []
972
- ]
973
- };
974
- }
975
- function Ee(e) {
976
- return e.previewKind === "chartDonutProgress" ? {
977
- shape: "pieSlices",
978
- innerRadius: 0.58,
979
- slices: [
980
- { label: "已完成", value: 68, share: 0.68 },
981
- { label: "未完成", value: 32, share: 0.32 }
982
- ],
983
- narrative: `${e.sampleTitle}预览。`
984
- } : {
985
- shape: "pieSlices",
986
- slices: [
987
- { label: "华东", value: 45, share: 0.45 },
988
- { label: "华北", value: 35, share: 0.35 },
989
- { label: "华南", value: 20, share: 0.2 }
990
- ],
991
- narrative: `${e.sampleTitle}预览。`
992
- };
993
- }
994
- function Ne(e) {
995
- return {
996
- shape: "mapRegions",
997
- regions: e.previewKind === "geoRegionalHeat" ? [
998
- { name: "华东", value: 96, status: "high" },
999
- { name: "华北", value: 82, status: "high" },
1000
- { name: "西部", value: 44, status: "low" }
1001
- ] : [
1002
- { name: "上海网点", value: 28, status: "high" },
1003
- { name: "北京网点", value: 18, status: "medium" },
1004
- { name: "深圳网点", value: 16, status: "medium" }
1005
- ],
1006
- narrative: `${e.sampleTitle}预览。`
1007
- };
1008
- }
1009
- function We(e, a) {
1010
- const t = a.previewKind === "chartDrilldownTree" || a.previewKind === "workflowApprovalChain";
1011
- return {
1012
- shape: "treeHierarchy",
1013
- root: {
1014
- id: "root",
1015
- label: a.sampleTitle || e.title,
1016
- children: t ? [
1017
- { id: "node-a", label: "一级分类", value: 42, children: [{ id: "node-a-1", label: "明细 A", value: 18 }] },
1018
- { id: "node-b", label: "二级分类", value: 31, children: [{ id: "node-b-1", label: "明细 B", value: 12 }] }
1019
- ] : [
1020
- { id: "node-a", label: "收入", value: 42 },
1021
- { id: "node-b", label: "成本", value: 31 },
1022
- { id: "node-c", label: "风险", value: 18 }
1023
- ]
1024
- },
1025
- narrative: `${a.sampleTitle}预览。`
1026
- };
1027
- }
1028
- function Oe(e) {
1029
- return {
1030
- shape: "geoGlobe",
1031
- title: e.sampleTitle,
1032
- centerLabel: e.sampleTitle,
1033
- arcs: [
1034
- { from: "上海", to: "新加坡", value: 76 },
1035
- { from: "上海", to: "东京", value: 54 },
1036
- { from: "上海", to: "法兰克福", value: 38 }
1037
- ],
1038
- metrics: [
1039
- { label: "节点", value: "18" },
1040
- { label: "流向", value: "3" }
1041
- ],
1042
- narrative: `${e.sampleTitle}预览。`
1043
- };
1044
- }
1045
- function Ge(e, a) {
1046
- const t = a.sampleTitle || e.title, i = a.previewKind === "geoMigrationFlow" ? ["出发地", "中转点", "目的地"] : a.previewKind === "geoRouteTrack" ? ["起点", "途经站", "终点"] : a.previewKind.includes("Permission") || a.previewKind.includes("permission") ? ["用户", "角色", "权限"] : a.previewKind.includes("Lineage") || a.previewKind.includes("lineage") ? ["来源表", "指标", "报表"] : a.previewKind === "graphKnowledge" ? ["概念", "属性", "事实"] : ["对象 A", "关系", "对象 B"];
1047
- return {
1048
- shape: "networkGraph",
1049
- nodes: [
1050
- { id: "root", label: t, value: 48, category: "root" },
1051
- { id: "node-a", label: i[0], value: 30, category: "object" },
1052
- { id: "node-b", label: i[1], value: 28, category: "metric" },
1053
- { id: "node-c", label: i[2], value: 24, category: "target" }
1054
- ],
1055
- links: [
1056
- { source: "root", target: "node-a", value: 2 },
1057
- { source: "node-a", target: "node-b", value: 1 },
1058
- { source: "node-b", target: "node-c", value: 1 }
1059
- ],
1060
- narrative: `${t}预览关系。`
1061
- };
1062
- }
1063
- function qe(e, a) {
1064
- return e.dataShape === "weatherCurrent" ? {
1065
- shape: "weatherCurrent",
1066
- location: "上海",
1067
- observedAt: (/* @__PURE__ */ new Date()).toISOString(),
1068
- condition: "cloudy",
1069
- conditionLabel: "多云",
1070
- temperatureC: 22,
1071
- sourceLabel: "Canvas Runtime",
1072
- dataStatus: "sample",
1073
- forecast: [
1074
- { label: "明日", conditionLabel: "小雨", highC: 24, lowC: 19, precipitationPct: 0.62 },
1075
- { label: "周末", conditionLabel: "晴", highC: 27, lowC: 21, precipitationPct: 0.12 }
1076
- ]
1077
- } : e.dataShape === "calendarCard" ? {
1078
- shape: "calendarCard",
1079
- timezone: "Asia/Shanghai",
1080
- today: (/* @__PURE__ */ new Date()).toISOString().slice(0, 10),
1081
- dateLabel: "今日",
1082
- weekLabel: "工作日",
1083
- sourceLabel: "Canvas Runtime",
1084
- dataStatus: "sample",
1085
- items: [
1086
- { id: "event-1", time: "09:30", title: "晨会同步", type: "meeting", status: "scheduled" },
1087
- { id: "event-2", time: "14:00", title: "项目评审", type: "deadline", status: "due" }
1088
- ]
1089
- } : e.dataShape === "embeddedFrame" ? {
1090
- shape: "embeddedFrame",
1091
- title: a.sampleTitle,
1092
- srcUrl: "",
1093
- sandbox: "allow-scripts allow-same-origin",
1094
- status: "missing_url",
1095
- sourceLabel: "Canvas Runtime",
1096
- fallbackText: "配置白名单 URL 后展示内嵌页面。"
1097
- } : e.dataShape === "fdeCustomComponent" ? {
1098
- shape: "fdeCustomComponent",
1099
- componentRef: a.previewKind === "fdeTemplateWeather" ? "@byteluck-fe/workbench-template/weather" : "unregistered-component",
1100
- componentName: a.sampleTitle,
1101
- props: a.previewKind === "fdeTemplateWeather" ? { city: "上海", mode: "compact" } : {},
1102
- status: a.previewKind === "fdeTemplateWeather" ? "ready" : "unregistered",
1103
- sourceLabel: "Canvas Runtime",
1104
- fallbackText: a.previewKind === "fdeTemplateWeather" ? "模板天气组件预览。" : "注册 FDE 组件后展示定制内容。"
1105
- } : null;
1106
- }
1107
- function z(e, a) {
1108
- if (a.previewKind === "customNestedContainer") return Ae();
1109
- const i = {
1110
- customBlankCanvas: "blank-card-canvas",
1111
- utilityQuickLinks: "quick-links",
1112
- utilityAnnouncement: "announcement",
1113
- utilitySearch: "search-entry",
1114
- utilityReminder: "reminder-list",
1115
- utilityFavorites: "favorite-list",
1116
- identityPersonProfile: "identity-profile",
1117
- entityCustomer: "customer-profile",
1118
- entityProject: "project-profile",
1119
- entityContract: "contract-profile",
1120
- entitySupplier: "supplier-profile",
1121
- entityAsset: "asset-profile",
1122
- entityTicket: "ticket-workflow"
1123
- }[a.previewKind] || "profile-card", r = a.previewKind === "utilitySearch" ? [
1124
- { id: "search", kind: "text", label: "搜索", value: "输入关键词查找对象" },
1125
- { id: "scope", kind: "badge", label: "范围", value: "全部" }
1126
- ] : a.previewKind === "utilityQuickLinks" ? [
1127
- { id: "link-a", kind: "badge", label: "入口", value: "新建事项" },
1128
- { id: "link-b", kind: "badge", label: "入口", value: "查看报表" },
1129
- { id: "link-c", kind: "badge", label: "入口", value: "发起审批" }
1130
- ] : [
1131
- { id: "title", kind: "text", label: a.sampleTitle || e.title, value: a.sampleTitle || e.title },
1132
- { id: "status", kind: "text", label: "状态", value: a.sampleTone === "danger" ? "需处理" : a.sampleTone === "warning" ? "待关注" : "正常" },
1133
- { id: "summary", kind: "text", label: "摘要", value: `${i} 示例结构` }
1134
- ];
1135
- return {
1136
- shape: "customCanvas",
1137
- sourceLabel: "Canvas Runtime",
1138
- narrative: `${a.sampleTitle || e.title}预览。`,
1139
- containerRole: i,
1140
- elements: r
1141
- };
1142
- }
1143
- function Ue(e, a) {
1144
- if (a && typeof a == "object") return a;
1145
- const t = `${e.title}由左画布 Canvas Runtime 生成。`, i = ae(e), r = He(e);
1146
- if (r) return r;
1147
- if (e.dataShape === "metricSummary") return $e(e, i);
1148
- if (e.dataShape === "rows") return Fe(e, i);
1149
- if (e.dataShape === "insightNarrative" || e.dataShape === "reportSummary") return Be(e, i);
1150
- if (e.dataShape === "dashboardGrid")
1151
- return Pe(e, t);
1152
- if (e.dataShape === "pieSlices") return Ee(i);
1153
- if (e.dataShape === "singleSeries" || e.dataShape === "multiSeries" || e.dataShape === "scatterPoints") return ze(e, i);
1154
- if (e.dataShape === "waterfallSteps")
1155
- return {
1156
- shape: "waterfallSteps",
1157
- unit: "万元",
1158
- steps: [
1159
- { label: "预算", value: 860 },
1160
- { label: "增长", delta: 120 },
1161
- { label: "费用优化", delta: -68 },
1162
- { label: "实际", value: 912 }
1163
- ],
1164
- narrative: t
1165
- };
1166
- if (e.dataShape === "heatmapMatrix")
1167
- return {
1168
- shape: "heatmapMatrix",
1169
- rows: ["销售", "交付", "研发", "运营"],
1170
- columns: ["效率", "质量", "成本", "风险"],
1171
- values: [
1172
- [86, 74, 68, 42],
1173
- [79, 88, 73, 51],
1174
- [92, 81, 64, 48],
1175
- [76, 69, 72, 57]
1176
- ],
1177
- narrative: t
1178
- };
1179
- if (e.dataShape === "radarMetrics")
1180
- return {
1181
- shape: "radarMetrics",
1182
- max: 100,
1183
- axes: [
1184
- { label: "收入", value: 82 },
1185
- { label: "效率", value: 76 },
1186
- { label: "风险", value: 54 },
1187
- { label: "质量", value: 88 },
1188
- { label: "成本", value: 69 }
1189
- ],
1190
- narrative: t
1191
- };
1192
- if (e.dataShape === "scatterPoints")
1193
- return {
1194
- shape: "scatterPoints",
1195
- xLabel: "投入",
1196
- yLabel: "产出",
1197
- sizeLabel: "规模",
1198
- points: [
1199
- { label: "A", x: 18, y: 42, size: 24 },
1200
- { label: "B", x: 36, y: 68, size: 36 },
1201
- { label: "C", x: 56, y: 72, size: 18 },
1202
- { label: "D", x: 74, y: 84, size: 28 }
1203
- ],
1204
- narrative: t
1205
- };
1206
- if (e.dataShape === "funnelStages")
1207
- return {
1208
- shape: "funnelStages",
1209
- stages: [
1210
- { label: "线索", value: 1200, rate: 1 },
1211
- { label: "商机", value: 760, rate: 0.63 },
1212
- { label: "方案", value: 420, rate: 0.35 },
1213
- { label: "成交", value: 180, rate: 0.15 }
1214
- ],
1215
- narrative: t
1216
- };
1217
- if (e.dataShape === "gaugeMetric")
1218
- return {
1219
- shape: "gaugeMetric",
1220
- label: e.title,
1221
- value: 78,
1222
- max: 100,
1223
- unit: "%",
1224
- thresholds: [
1225
- { label: "风险", value: 60, color: "#dc2626" },
1226
- { label: "健康", value: 80, color: "#d97706" },
1227
- { label: "优秀", value: 100, color: "#16a34a" }
1228
- ],
1229
- narrative: t
1230
- };
1231
- if (e.dataShape === "mapRegions") return Ne(i);
1232
- if (e.dataShape === "sankeyFlow")
1233
- return {
1234
- shape: "sankeyFlow",
1235
- nodes: [
1236
- { id: "market", label: "市场" },
1237
- { id: "sales", label: "销售" },
1238
- { id: "service", label: "服务" },
1239
- { id: "renew", label: "续约" }
1240
- ],
1241
- links: [
1242
- { source: "market", target: "sales", value: 120 },
1243
- { source: "sales", target: "service", value: 86 },
1244
- { source: "service", target: "renew", value: 54 }
1245
- ],
1246
- narrative: t
1247
- };
1248
- if (e.dataShape === "treeHierarchy") return We(e, i);
1249
- if (e.dataShape === "ganttTasks")
1250
- return {
1251
- shape: "ganttTasks",
1252
- timeline: ["05-01", "05-08", "05-15", "05-22", "05-29"],
1253
- tasks: [
1254
- { label: "需求", start: 0, end: 1, status: "done", owner: "产品" },
1255
- { label: "开发", start: 1, end: 3, status: "running", owner: "研发" },
1256
- { label: "验收", start: 3, end: 4, status: "pending", owner: "业务" }
1257
- ],
1258
- narrative: t
1259
- };
1260
- if (e.dataShape === "candlestickSeries")
1261
- return {
1262
- shape: "candlestickSeries",
1263
- categories: ["05-01", "05-08", "05-15", "05-22", "05-29"],
1264
- values: [
1265
- { open: 92, close: 98, low: 88, high: 104 },
1266
- { open: 99, close: 95, low: 90, high: 108 },
1267
- { open: 96, close: 112, low: 94, high: 118 },
1268
- { open: 111, close: 108, low: 102, high: 121 },
1269
- { open: 109, close: 124, low: 106, high: 130 }
1270
- ],
1271
- narrative: t
1272
- };
1273
- if (e.dataShape === "boxplotSeries")
1274
- return {
1275
- shape: "boxplotSeries",
1276
- categories: ["销售", "交付", "财务", "研发", "运营"],
1277
- values: [
1278
- [18, 32, 48, 66, 78],
1279
- [22, 38, 55, 72, 86],
1280
- [14, 28, 43, 61, 74],
1281
- [20, 36, 58, 76, 92],
1282
- [16, 31, 49, 68, 82]
1283
- ],
1284
- narrative: t
1285
- };
1286
- if (e.dataShape === "paretoSeries")
1287
- return {
1288
- shape: "paretoSeries",
1289
- categories: ["合同条款", "回款滞后", "资料缺失", "交付偏差"],
1290
- bars: [42, 31, 18, 9],
1291
- cumulative: [42, 73, 91, 100],
1292
- narrative: t
1293
- };
1294
- if (e.dataShape === "networkGraph") return Ge(e, i);
1295
- if (e.dataShape === "geoGlobe") return Oe(i);
1296
- if (e.dataShape === "taskSummary")
1297
- return {
1298
- shape: "taskSummary",
1299
- total: 12,
1300
- overdue: 1,
1301
- dueToday: 4,
1302
- completed: 7,
1303
- sourceLabel: "Canvas Runtime",
1304
- items: [
1305
- { id: "task-1", title: "审批销售合同", type: "workflow", owner: "张总", status: "pending", dueAt: "今日" },
1306
- { id: "task-2", title: "确认回款计划", type: "document", owner: "李经理", status: "reading", dueAt: "明日" }
1307
- ]
1308
- };
1309
- const l = qe(e, i);
1310
- return l || (e.dataShape === "customCanvas", z(e, i));
1311
- }
1312
- function ua(e, a) {
1313
- const t = Y(e), i = j(e, t);
1314
- return i || (t ? D(e, a, t) : M(e));
1315
- }
1316
- async function da(e, a) {
1317
- const t = Y(e), i = j(e, t);
1318
- return i || (t ? Le(t) ? await je(e, a, t) : D(e, a, t) : M(e));
1319
- }
1320
- function j(e, a) {
1321
- return a ? e.registryEntry && e.capabilityId && e.capabilityId !== e.registryEntry.capabilityId ? {
1322
- status: "failed",
1323
- registryEntry: a,
1324
- reason: `宿主注册项与 capabilityId 不一致:${e.capabilityId}`,
1325
- suggestion: "修正 userCustomCards.ts 中的 capabilityId。"
1326
- } : a.status === "placeholder" ? {
1327
- status: "failed",
1328
- registryEntry: a,
1329
- reason: a.honestFailure || `能力暂未实现:${a.capabilityId}`,
1330
- suggestion: "该能力需要后续补齐实现后再开放。"
1331
- } : a.status === "lifecycle" ? {
1332
- status: "failed",
1333
- registryEntry: a,
1334
- reason: `生命周期能力不能通过 insertCard 创建:${a.capabilityId}`,
1335
- suggestion: "请使用 updateCard.operation 进入改卡生命周期。"
1336
- } : null : M(e);
1337
- }
1338
- function Y(e) {
1339
- return e.registryEntry ?? X(e);
1340
- }
1341
- function M(e) {
1342
- return {
1343
- status: "failed",
1344
- reason: `能力不存在或未登记:${e.capabilityId || `${e.category || "-"}/${e.type || "-"}`}`,
1345
- suggestion: "请使用 Card Registry 中已登记的 capabilityId,或补齐对应卡片能力。"
1346
- };
1347
- }
1348
- function D(e, a, t, i) {
1349
- var p, w, m, T, u, b, f, v;
1350
- const r = String(((p = e.meta) == null ? void 0 : p.id) || ((w = e.layout) == null ? void 0 : w.i) || Re()), s = (e.layout ? pe : he)({
1351
- preset: ((m = e.size) == null ? void 0 : m.preset) || "medium",
1352
- width: (T = e.size) == null ? void 0 : T.width,
1353
- height: (u = e.size) == null ? void 0 : u.height,
1354
- layout: e.layout,
1355
- placed: a
1356
- }), n = ((b = e.renderer) == null ? void 0 : b.rendererKey) || t.rendererKey;
1357
- return { status: "success", block: {
1358
- id: r,
1359
- version: 1,
1360
- blockType: t.blockType,
1361
- subType: t.subType,
1362
- title: e.title || t.title,
1363
- subtitle: e.subtitle || t.description,
1364
- layout: we(r, s),
1365
- intent: {
1366
- scene: "personal_workbench_canvas_runtime",
1367
- bizIntent: e.title || t.title,
1368
- roleTemplate: "canvas_runtime"
1369
- },
1370
- source: {
1371
- sourceType: "canvas_runtime",
1372
- service: "card_factory",
1373
- resourceKey: t.capabilityId,
1374
- params: {
1375
- capabilityId: t.capabilityId,
1376
- category: t.category,
1377
- type: t.type,
1378
- variant: t.variant
1379
- }
1380
- },
1381
- renderer: (i == null ? void 0 : i.renderer) ?? {
1382
- engine: ((f = e.renderer) == null ? void 0 : f.engine) || "echarts",
1383
- rendererKey: n,
1384
- preset: (v = e.renderer) == null ? void 0 : v.preset
1385
- },
1386
- state: xe(),
1387
- data: (i == null ? void 0 : i.data) ?? Ue(t, e.data),
1388
- meta: {
1389
- ...e.meta,
1390
- ...(i == null ? void 0 : i.meta) ?? {},
1391
- capabilityId: t.capabilityId,
1392
- macroCapabilityId: t.category,
1393
- handlerClassName: t.handlerClassName,
1394
- dataShape: t.dataShape,
1395
- shell: t.shell,
1396
- styleVariants: t.styleVariants,
1397
- canvasRuntime: !0,
1398
- layoutBasis: {
1399
- baseCols: 100,
1400
- w: s.w,
1401
- h: s.h
1402
- }
1403
- }
1404
- }, registryEntry: t };
1405
- }
1406
- async function je(e, a, t) {
1407
- const i = await ke(t);
1408
- return i.ok ? D(e, a, t, {
1409
- renderer: i.renderer,
1410
- data: i.data,
1411
- meta: i.meta
1412
- }) : { status: "failed", registryEntry: t, reason: i.reason };
1413
- }
1414
- export {
1415
- x as D,
1416
- d as L,
1417
- g as S,
1418
- da as a,
1419
- sa as b,
1420
- ua as c,
1421
- Je as d,
1422
- oa as e,
1423
- C as f,
1424
- na as g,
1425
- W as h,
1426
- ue as i,
1427
- q as j,
1428
- aa as k,
1429
- we as l,
1430
- K as m,
1431
- ta as n,
1432
- re as o,
1433
- ia as p,
1434
- la as q,
1435
- pe as r,
1436
- he as s,
1437
- ra as t,
1438
- ca as u,
1439
- Ze as v,
1440
- ea as w,
1441
- Z as x,
1442
- Qe as y
1443
- };