@liujitcn/kratos-admin-bi 0.0.0-stage → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +43 -2
- package/dist/package/declarations/index.d.ts +1 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_card.d.ts +18 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_card.js +46 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_dashboard.d.ts +17 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_dashboard.js +30 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query.d.ts +11 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query.js +41 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query_record.d.ts +10 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_query_record.js +14 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_source.d.ts +26 -0
- package/dist/package/declarations/src/api/bi/admin/v1/bi_source.js +46 -0
- package/dist/package/declarations/src/bi-core.d.ts +17 -0
- package/dist/package/declarations/src/bi-core.js +22 -0
- package/dist/package/declarations/src/bi-dashboard-schema.d.ts +31 -0
- package/dist/package/declarations/src/bi-dashboard-schema.js +39 -0
- package/dist/package/declarations/src/bi-messages.d.ts +247 -0
- package/dist/package/declarations/src/bi-messages.js +247 -0
- package/dist/package/declarations/src/bi-response.d.ts +10 -0
- package/dist/package/declarations/src/bi-response.js +33 -0
- package/dist/package/declarations/src/bi-vue.d.ts +10 -0
- package/dist/package/declarations/src/bi-vue.js +10 -0
- package/dist/package/declarations/src/card-schema.d.ts +30 -0
- package/dist/package/declarations/src/card-schema.js +87 -0
- package/dist/package/declarations/src/components/BiCardChartEditor.vue.d.ts +17 -0
- package/dist/package/declarations/src/components/BiCardChartEditor.vue.js +527 -0
- package/dist/package/declarations/src/components/BiCardFormDialog.vue.d.ts +20 -0
- package/dist/package/declarations/src/components/BiCardFormDialog.vue.js +495 -0
- package/dist/package/declarations/src/components/BiCardLibrary.vue.d.ts +3 -0
- package/dist/package/declarations/src/components/BiCardLibrary.vue.js +807 -0
- package/dist/package/declarations/src/components/BiCardVisualization.vue.d.ts +10 -0
- package/dist/package/declarations/src/components/BiCardVisualization.vue.js +97 -0
- package/dist/package/declarations/src/components/BiChart.vue.d.ts +20 -0
- package/dist/package/declarations/src/components/BiChart.vue.js +112 -0
- package/dist/package/declarations/src/components/BiDashboard.vue.d.ts +9 -0
- package/dist/package/declarations/src/components/BiDashboard.vue.js +81 -0
- package/dist/package/declarations/src/components/BiDashboardMenuDialog.vue.d.ts +12 -0
- package/dist/package/declarations/src/components/BiDashboardMenuDialog.vue.js +252 -0
- package/dist/package/declarations/src/components/BiDataCard.vue.d.ts +36 -0
- package/dist/package/declarations/src/components/BiDataCard.vue.js +372 -0
- package/dist/package/declarations/src/components/BiDesigner.vue.d.ts +17 -0
- package/dist/package/declarations/src/components/BiDesigner.vue.js +666 -0
- package/dist/package/declarations/src/components/BiSourceModelDialog.vue.d.ts +17 -0
- package/dist/package/declarations/src/components/BiSourceModelDialog.vue.js +2118 -0
- package/dist/package/declarations/src/components/BiWorkbenchPreview.vue.d.ts +7 -0
- package/dist/package/declarations/src/components/BiWorkbenchPreview.vue.js +176 -0
- package/dist/package/declarations/src/components/source-model-layout.d.ts +3 -0
- package/dist/package/declarations/src/components/source-model-layout.js +66 -0
- package/dist/package/declarations/src/dataset/index.d.ts +7 -0
- package/dist/package/declarations/src/dataset/index.js +25 -0
- package/dist/package/declarations/src/dataset/labels.d.ts +2 -0
- package/dist/package/declarations/src/dataset/labels.js +21 -0
- package/dist/package/declarations/src/dataset/transform.d.ts +20 -0
- package/dist/package/declarations/src/dataset/transform.js +173 -0
- package/dist/package/declarations/src/engine/chart-types.d.ts +14 -0
- package/dist/package/declarations/src/engine/chart-types.js +37 -0
- package/dist/package/declarations/src/engine/echarts.d.ts +16 -0
- package/dist/package/declarations/src/engine/echarts.js +491 -0
- package/dist/package/declarations/src/engine/types.d.ts +36 -0
- package/dist/package/declarations/src/engine/types.js +20 -0
- package/dist/package/declarations/src/env.d.ts +17 -0
- package/dist/package/declarations/src/env.js +67 -0
- package/dist/package/declarations/src/index.d.ts +1 -0
- package/dist/package/declarations/src/index.js +1 -0
- package/dist/package/declarations/src/locales/en-US.json +254 -0
- package/dist/package/declarations/src/locales/generated.d.ts +1021 -0
- package/dist/package/declarations/src/locales/generated.js +13 -0
- package/dist/package/declarations/src/locales/ja-JP.json +254 -0
- package/dist/package/declarations/src/locales/zh-CN.json +254 -0
- package/dist/package/declarations/src/locales/zh-TW.json +254 -0
- package/dist/package/declarations/src/module.d.ts +2 -0
- package/dist/package/declarations/src/module.js +9 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_card.d.ts +145 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_card.js +6 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_dashboard.d.ts +107 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_dashboard.js +6 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query.d.ts +157 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query.js +6 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query_record.d.ts +83 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_query_record.js +15 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_source.d.ts +301 -0
- package/dist/package/declarations/src/rpc/bi/admin/v1/bi_source.js +6 -0
- package/dist/package/declarations/src/rpc/common/v1/types.d.ts +60 -0
- package/dist/package/declarations/src/rpc/common/v1/types.js +6 -0
- package/dist/package/declarations/src/schema/layout.d.ts +7 -0
- package/dist/package/declarations/src/schema/layout.js +52 -0
- package/dist/package/declarations/src/schema/types.d.ts +83 -0
- package/dist/package/declarations/src/schema/types.js +1 -0
- package/dist/package/declarations/src/theme/index.d.ts +29 -0
- package/dist/package/declarations/src/theme/index.js +83 -0
- package/dist/package/declarations/src/theme/palettes.d.ts +7 -0
- package/dist/package/declarations/src/theme/palettes.js +28 -0
- package/dist/package/declarations/src/theme/presets.d.ts +73 -0
- package/dist/package/declarations/src/theme/presets.js +235 -0
- package/dist/package/declarations/src/views/card/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/card/index.vue.js +18 -0
- package/dist/package/declarations/src/views/dashboard/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/dashboard/index.vue.js +107 -0
- package/dist/package/declarations/src/views/designer/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/designer/index.vue.js +332 -0
- package/dist/package/declarations/src/views/manage/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/manage/index.vue.js +325 -0
- package/dist/package/declarations/src/views/query/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/query/index.vue.js +876 -0
- package/dist/package/declarations/src/views/source/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/source/index.vue.js +343 -0
- package/dist/package/declarations/src/views/workbench/index.vue.d.ts +3 -0
- package/dist/package/declarations/src/views/workbench/index.vue.js +362 -0
- package/dist/package/src/api/bi/admin/v1/bi_card.ts +67 -0
- package/dist/package/src/api/bi/admin/v1/bi_dashboard.ts +51 -0
- package/dist/package/src/api/bi/admin/v1/bi_query.ts +55 -0
- package/dist/package/src/api/bi/admin/v1/bi_query_record.ts +25 -0
- package/dist/package/src/api/bi/admin/v1/bi_source.ts +80 -0
- package/dist/package/src/bi-core.ts +43 -0
- package/dist/package/src/bi-dashboard-schema.ts +69 -0
- package/dist/package/src/bi-messages.ts +249 -0
- package/dist/package/src/bi-response.ts +39 -0
- package/dist/package/src/bi-vue.ts +13 -0
- package/dist/package/src/card-schema.ts +111 -0
- package/dist/package/src/components/BiCardChartEditor.vue +139 -0
- package/dist/package/src/components/BiCardFormDialog.vue +289 -0
- package/dist/package/src/components/BiCardLibrary.vue +310 -0
- package/dist/package/src/components/BiCardVisualization.vue +95 -0
- package/dist/package/src/components/BiChart.vue +134 -0
- package/dist/package/src/components/BiDashboard.vue +53 -0
- package/dist/package/src/components/BiDashboardMenuDialog.vue +177 -0
- package/dist/package/src/components/BiDataCard.vue +231 -0
- package/dist/package/src/components/BiDesigner.vue +287 -0
- package/dist/package/src/components/BiSourceModelDialog.vue +846 -0
- package/dist/package/src/components/BiWorkbenchPreview.vue +131 -0
- package/dist/package/src/components/source-model-layout.ts +62 -0
- package/dist/package/src/dataset/index.ts +28 -0
- package/dist/package/src/dataset/labels.ts +19 -0
- package/dist/package/src/dataset/transform.ts +189 -0
- package/dist/package/src/engine/chart-types.ts +44 -0
- package/dist/package/src/engine/echarts.ts +568 -0
- package/dist/package/src/engine/types.ts +60 -0
- package/dist/package/src/env.ts +82 -0
- package/dist/package/src/index.ts +1 -0
- package/dist/package/src/locales/en-US.json +254 -0
- package/dist/package/src/locales/generated.ts +16 -0
- package/dist/package/src/locales/ja-JP.json +254 -0
- package/dist/package/src/locales/zh-CN.json +254 -0
- package/dist/package/src/locales/zh-TW.json +254 -0
- package/dist/package/src/module.ts +12 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_card.ts +169 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_dashboard.ts +126 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_query.ts +187 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_query_record.ts +98 -0
- package/dist/package/src/rpc/bi/admin/v1/bi_source.ts +338 -0
- package/dist/package/src/rpc/common/v1/types.ts +77 -0
- package/dist/package/src/schema/layout.ts +54 -0
- package/dist/package/src/schema/types.ts +103 -0
- package/dist/package/src/styles.scss +1 -0
- package/dist/package/src/theme/index.ts +108 -0
- package/dist/package/src/theme/palettes.ts +34 -0
- package/dist/package/src/theme/presets.ts +278 -0
- package/dist/package/src/views/card/index.vue +5 -0
- package/dist/package/src/views/dashboard/index.vue +58 -0
- package/dist/package/src/views/designer/index.vue +164 -0
- package/dist/package/src/views/manage/index.vue +276 -0
- package/dist/package/src/views/query/index.vue +593 -0
- package/dist/package/src/views/source/index.vue +214 -0
- package/dist/package/src/views/workbench/index.vue +208 -0
- package/package.json +67 -3
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BI 文案包(纯数据,零依赖):渲染器只用 common.noData/Loading,
|
|
3
|
+
* 设计器(designer-vue)消费 designer.* 与 types.*。
|
|
4
|
+
* 键值取自 go-wind-admin 设计语言口径;改键同步两端包装包。
|
|
5
|
+
*/
|
|
6
|
+
export declare const BI_MESSAGES_ZH: {
|
|
7
|
+
common: {
|
|
8
|
+
noData: string;
|
|
9
|
+
loading: string;
|
|
10
|
+
back: string;
|
|
11
|
+
resetDrill: string;
|
|
12
|
+
exportImage: string;
|
|
13
|
+
fullscreen: string;
|
|
14
|
+
};
|
|
15
|
+
designer: {
|
|
16
|
+
addChart: string;
|
|
17
|
+
addDataset: string;
|
|
18
|
+
undo: string;
|
|
19
|
+
redo: string;
|
|
20
|
+
compact: string;
|
|
21
|
+
import: string;
|
|
22
|
+
exportTemplate: string;
|
|
23
|
+
export: string;
|
|
24
|
+
preview: string;
|
|
25
|
+
edit: string;
|
|
26
|
+
delete: string;
|
|
27
|
+
charts: string;
|
|
28
|
+
datasets: string;
|
|
29
|
+
property: string;
|
|
30
|
+
selectChart: string;
|
|
31
|
+
title: string;
|
|
32
|
+
type: string;
|
|
33
|
+
dataset: string;
|
|
34
|
+
encoding: string;
|
|
35
|
+
dimension: string;
|
|
36
|
+
measure: string;
|
|
37
|
+
series: string;
|
|
38
|
+
position: string;
|
|
39
|
+
size: string;
|
|
40
|
+
datasetName: string;
|
|
41
|
+
datasetType: string;
|
|
42
|
+
rowsJson: string;
|
|
43
|
+
apiParams: string;
|
|
44
|
+
typeStatic: string;
|
|
45
|
+
typeApi: string;
|
|
46
|
+
noDataset: string;
|
|
47
|
+
invalidJson: string;
|
|
48
|
+
save: string;
|
|
49
|
+
cancel: string;
|
|
50
|
+
importFailed: string;
|
|
51
|
+
confirmDeleteChart: string;
|
|
52
|
+
columns: string;
|
|
53
|
+
tabData: string;
|
|
54
|
+
tabStyle: string;
|
|
55
|
+
tabLayout: string;
|
|
56
|
+
duplicate: string;
|
|
57
|
+
paste: string;
|
|
58
|
+
aggregation: string;
|
|
59
|
+
aggNone: string;
|
|
60
|
+
aggSum: string;
|
|
61
|
+
aggAvg: string;
|
|
62
|
+
aggCount: string;
|
|
63
|
+
aggMax: string;
|
|
64
|
+
aggMin: string;
|
|
65
|
+
measures: string;
|
|
66
|
+
sortLabel: string;
|
|
67
|
+
sortByDim: string;
|
|
68
|
+
sortByMeasure: string;
|
|
69
|
+
asc: string;
|
|
70
|
+
desc: string;
|
|
71
|
+
topN: string;
|
|
72
|
+
filters: string;
|
|
73
|
+
addFilter: string;
|
|
74
|
+
filterField: string;
|
|
75
|
+
opEq: string;
|
|
76
|
+
opNe: string;
|
|
77
|
+
opGt: string;
|
|
78
|
+
opGte: string;
|
|
79
|
+
opLt: string;
|
|
80
|
+
opLte: string;
|
|
81
|
+
opContains: string;
|
|
82
|
+
opIn: string;
|
|
83
|
+
showLegend: string;
|
|
84
|
+
showLabel: string;
|
|
85
|
+
stack: string;
|
|
86
|
+
dataZoom: string;
|
|
87
|
+
palette: string;
|
|
88
|
+
paletteDefault: string;
|
|
89
|
+
paletteOcean: string;
|
|
90
|
+
paletteSunset: string;
|
|
91
|
+
paletteForest: string;
|
|
92
|
+
paletteMono: string;
|
|
93
|
+
numberFormat: string;
|
|
94
|
+
decimals: string;
|
|
95
|
+
thousand: string;
|
|
96
|
+
prefix: string;
|
|
97
|
+
suffix: string;
|
|
98
|
+
typeNumber: string;
|
|
99
|
+
typeString: string;
|
|
100
|
+
typeDate: string;
|
|
101
|
+
drillPath: string;
|
|
102
|
+
addDrillLevel: string;
|
|
103
|
+
linkage: string;
|
|
104
|
+
linkageTip: string;
|
|
105
|
+
templates: string;
|
|
106
|
+
themePreset: string;
|
|
107
|
+
themeAuto: string;
|
|
108
|
+
};
|
|
109
|
+
types: {
|
|
110
|
+
bar: string;
|
|
111
|
+
line: string;
|
|
112
|
+
area: string;
|
|
113
|
+
pie: string;
|
|
114
|
+
donut: string;
|
|
115
|
+
scatter: string;
|
|
116
|
+
radar: string;
|
|
117
|
+
gauge: string;
|
|
118
|
+
pivot: string;
|
|
119
|
+
graph: string;
|
|
120
|
+
funnel: string;
|
|
121
|
+
treemap: string;
|
|
122
|
+
sunburst: string;
|
|
123
|
+
sankey: string;
|
|
124
|
+
heatmap: string;
|
|
125
|
+
};
|
|
126
|
+
};
|
|
127
|
+
export declare const BI_MESSAGES_EN: {
|
|
128
|
+
common: {
|
|
129
|
+
noData: string;
|
|
130
|
+
loading: string;
|
|
131
|
+
back: string;
|
|
132
|
+
resetDrill: string;
|
|
133
|
+
exportImage: string;
|
|
134
|
+
fullscreen: string;
|
|
135
|
+
};
|
|
136
|
+
designer: {
|
|
137
|
+
addChart: string;
|
|
138
|
+
addDataset: string;
|
|
139
|
+
undo: string;
|
|
140
|
+
redo: string;
|
|
141
|
+
compact: string;
|
|
142
|
+
import: string;
|
|
143
|
+
exportTemplate: string;
|
|
144
|
+
export: string;
|
|
145
|
+
preview: string;
|
|
146
|
+
edit: string;
|
|
147
|
+
delete: string;
|
|
148
|
+
charts: string;
|
|
149
|
+
datasets: string;
|
|
150
|
+
property: string;
|
|
151
|
+
selectChart: string;
|
|
152
|
+
title: string;
|
|
153
|
+
type: string;
|
|
154
|
+
dataset: string;
|
|
155
|
+
encoding: string;
|
|
156
|
+
dimension: string;
|
|
157
|
+
measure: string;
|
|
158
|
+
series: string;
|
|
159
|
+
position: string;
|
|
160
|
+
size: string;
|
|
161
|
+
datasetName: string;
|
|
162
|
+
datasetType: string;
|
|
163
|
+
rowsJson: string;
|
|
164
|
+
apiParams: string;
|
|
165
|
+
typeStatic: string;
|
|
166
|
+
typeApi: string;
|
|
167
|
+
noDataset: string;
|
|
168
|
+
invalidJson: string;
|
|
169
|
+
save: string;
|
|
170
|
+
cancel: string;
|
|
171
|
+
importFailed: string;
|
|
172
|
+
confirmDeleteChart: string;
|
|
173
|
+
columns: string;
|
|
174
|
+
tabData: string;
|
|
175
|
+
tabStyle: string;
|
|
176
|
+
tabLayout: string;
|
|
177
|
+
duplicate: string;
|
|
178
|
+
paste: string;
|
|
179
|
+
aggregation: string;
|
|
180
|
+
aggNone: string;
|
|
181
|
+
aggSum: string;
|
|
182
|
+
aggAvg: string;
|
|
183
|
+
aggCount: string;
|
|
184
|
+
aggMax: string;
|
|
185
|
+
aggMin: string;
|
|
186
|
+
measures: string;
|
|
187
|
+
sortLabel: string;
|
|
188
|
+
sortByDim: string;
|
|
189
|
+
sortByMeasure: string;
|
|
190
|
+
asc: string;
|
|
191
|
+
desc: string;
|
|
192
|
+
topN: string;
|
|
193
|
+
filters: string;
|
|
194
|
+
addFilter: string;
|
|
195
|
+
filterField: string;
|
|
196
|
+
opEq: string;
|
|
197
|
+
opNe: string;
|
|
198
|
+
opGt: string;
|
|
199
|
+
opGte: string;
|
|
200
|
+
opLt: string;
|
|
201
|
+
opLte: string;
|
|
202
|
+
opContains: string;
|
|
203
|
+
opIn: string;
|
|
204
|
+
showLegend: string;
|
|
205
|
+
showLabel: string;
|
|
206
|
+
stack: string;
|
|
207
|
+
dataZoom: string;
|
|
208
|
+
palette: string;
|
|
209
|
+
paletteDefault: string;
|
|
210
|
+
paletteOcean: string;
|
|
211
|
+
paletteSunset: string;
|
|
212
|
+
paletteForest: string;
|
|
213
|
+
paletteMono: string;
|
|
214
|
+
numberFormat: string;
|
|
215
|
+
decimals: string;
|
|
216
|
+
thousand: string;
|
|
217
|
+
prefix: string;
|
|
218
|
+
suffix: string;
|
|
219
|
+
typeNumber: string;
|
|
220
|
+
typeString: string;
|
|
221
|
+
typeDate: string;
|
|
222
|
+
drillPath: string;
|
|
223
|
+
addDrillLevel: string;
|
|
224
|
+
linkage: string;
|
|
225
|
+
linkageTip: string;
|
|
226
|
+
templates: string;
|
|
227
|
+
themePreset: string;
|
|
228
|
+
themeAuto: string;
|
|
229
|
+
};
|
|
230
|
+
types: {
|
|
231
|
+
bar: string;
|
|
232
|
+
line: string;
|
|
233
|
+
area: string;
|
|
234
|
+
pie: string;
|
|
235
|
+
donut: string;
|
|
236
|
+
scatter: string;
|
|
237
|
+
radar: string;
|
|
238
|
+
gauge: string;
|
|
239
|
+
pivot: string;
|
|
240
|
+
graph: string;
|
|
241
|
+
funnel: string;
|
|
242
|
+
treemap: string;
|
|
243
|
+
sunburst: string;
|
|
244
|
+
sankey: string;
|
|
245
|
+
heatmap: string;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BI 文案包(纯数据,零依赖):渲染器只用 common.noData/Loading,
|
|
3
|
+
* 设计器(designer-vue)消费 designer.* 与 types.*。
|
|
4
|
+
* 键值取自 go-wind-admin 设计语言口径;改键同步两端包装包。
|
|
5
|
+
*/
|
|
6
|
+
export const BI_MESSAGES_ZH = {
|
|
7
|
+
common: {
|
|
8
|
+
noData: "暂无数据",
|
|
9
|
+
loading: "加载中…",
|
|
10
|
+
back: "返回上一层",
|
|
11
|
+
resetDrill: "重置下钻",
|
|
12
|
+
exportImage: "导出图片",
|
|
13
|
+
fullscreen: "全屏",
|
|
14
|
+
},
|
|
15
|
+
designer: {
|
|
16
|
+
addChart: "新增图表",
|
|
17
|
+
addDataset: "新增数据集",
|
|
18
|
+
undo: "撤销",
|
|
19
|
+
redo: "重做",
|
|
20
|
+
compact: "整理布局",
|
|
21
|
+
import: "导入",
|
|
22
|
+
exportTemplate: "导出模板",
|
|
23
|
+
export: "导出",
|
|
24
|
+
preview: "预览",
|
|
25
|
+
edit: "编辑",
|
|
26
|
+
delete: "删除",
|
|
27
|
+
charts: "图表",
|
|
28
|
+
datasets: "数据集",
|
|
29
|
+
property: "属性",
|
|
30
|
+
selectChart: "点击画布中的图表进行编辑",
|
|
31
|
+
title: "标题",
|
|
32
|
+
type: "图型",
|
|
33
|
+
dataset: "数据集",
|
|
34
|
+
encoding: "视觉映射",
|
|
35
|
+
dimension: "维度",
|
|
36
|
+
measure: "度量",
|
|
37
|
+
series: "系列拆分",
|
|
38
|
+
position: "位置 (x / y)",
|
|
39
|
+
size: "大小 (宽 × 高)",
|
|
40
|
+
datasetName: "数据集名称",
|
|
41
|
+
datasetType: "类型",
|
|
42
|
+
rowsJson: "行数据 (JSON 数组)",
|
|
43
|
+
apiParams: "API 参数 (JSON)",
|
|
44
|
+
typeStatic: "静态数据",
|
|
45
|
+
typeApi: "API 取数",
|
|
46
|
+
noDataset: "请先创建数据集",
|
|
47
|
+
invalidJson: "JSON 格式错误",
|
|
48
|
+
save: "保存",
|
|
49
|
+
cancel: "取消",
|
|
50
|
+
importFailed: "导入失败",
|
|
51
|
+
confirmDeleteChart: "确定删除该图表吗?",
|
|
52
|
+
columns: "列",
|
|
53
|
+
tabData: "数据",
|
|
54
|
+
tabStyle: "样式",
|
|
55
|
+
tabLayout: "布局",
|
|
56
|
+
duplicate: "复制",
|
|
57
|
+
paste: "粘贴",
|
|
58
|
+
aggregation: "聚合方式",
|
|
59
|
+
aggNone: "不聚合",
|
|
60
|
+
aggSum: "求和",
|
|
61
|
+
aggAvg: "平均",
|
|
62
|
+
aggCount: "计数",
|
|
63
|
+
aggMax: "最大",
|
|
64
|
+
aggMin: "最小",
|
|
65
|
+
measures: "多度量(宽表)",
|
|
66
|
+
sortLabel: "排序",
|
|
67
|
+
sortByDim: "按维度",
|
|
68
|
+
sortByMeasure: "按度量",
|
|
69
|
+
asc: "升序",
|
|
70
|
+
desc: "降序",
|
|
71
|
+
topN: "取前 N 项",
|
|
72
|
+
filters: "过滤器",
|
|
73
|
+
addFilter: "+ 添加条件",
|
|
74
|
+
filterField: "字段",
|
|
75
|
+
opEq: "等于",
|
|
76
|
+
opNe: "不等于",
|
|
77
|
+
opGt: "大于",
|
|
78
|
+
opGte: "大于等于",
|
|
79
|
+
opLt: "小于",
|
|
80
|
+
opLte: "小于等于",
|
|
81
|
+
opContains: "包含",
|
|
82
|
+
opIn: "属于(逗号分隔)",
|
|
83
|
+
showLegend: "显示图例",
|
|
84
|
+
showLabel: "数值标签",
|
|
85
|
+
stack: "堆叠",
|
|
86
|
+
dataZoom: "数据缩放",
|
|
87
|
+
palette: "色盘",
|
|
88
|
+
paletteDefault: "默认",
|
|
89
|
+
paletteOcean: "海洋",
|
|
90
|
+
paletteSunset: "夕照",
|
|
91
|
+
paletteForest: "森林",
|
|
92
|
+
paletteMono: "墨阶",
|
|
93
|
+
numberFormat: "数字格式",
|
|
94
|
+
decimals: "小数位",
|
|
95
|
+
thousand: "千分位",
|
|
96
|
+
prefix: "前缀",
|
|
97
|
+
suffix: "后缀",
|
|
98
|
+
typeNumber: "数值",
|
|
99
|
+
typeString: "文本",
|
|
100
|
+
typeDate: "日期",
|
|
101
|
+
drillPath: "下钻路径",
|
|
102
|
+
addDrillLevel: "+ 添加下钻层级",
|
|
103
|
+
linkage: "跨图联动",
|
|
104
|
+
linkageTip: "开启后,点击图表以维度值过滤同数据集的其它图表",
|
|
105
|
+
templates: "模板",
|
|
106
|
+
themePreset: "仪表盘主题",
|
|
107
|
+
themeAuto: "跟随宿主亮暗",
|
|
108
|
+
},
|
|
109
|
+
types: {
|
|
110
|
+
bar: "柱状图",
|
|
111
|
+
line: "折线图",
|
|
112
|
+
area: "面积图",
|
|
113
|
+
pie: "饼图",
|
|
114
|
+
donut: "环形图",
|
|
115
|
+
scatter: "散点图",
|
|
116
|
+
radar: "雷达图",
|
|
117
|
+
gauge: "仪表图",
|
|
118
|
+
pivot: "透视表",
|
|
119
|
+
graph: "关系图",
|
|
120
|
+
funnel: "漏斗图",
|
|
121
|
+
treemap: "矩形树图",
|
|
122
|
+
sunburst: "旭日图",
|
|
123
|
+
sankey: "桑基图",
|
|
124
|
+
heatmap: "热力图",
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
export const BI_MESSAGES_EN = {
|
|
128
|
+
common: {
|
|
129
|
+
noData: "No data",
|
|
130
|
+
loading: "Loading…",
|
|
131
|
+
back: "Back",
|
|
132
|
+
resetDrill: "Reset drill",
|
|
133
|
+
exportImage: "Export PNG",
|
|
134
|
+
fullscreen: "Fullscreen",
|
|
135
|
+
},
|
|
136
|
+
designer: {
|
|
137
|
+
addChart: "Add Chart",
|
|
138
|
+
addDataset: "Add Dataset",
|
|
139
|
+
undo: "Undo",
|
|
140
|
+
redo: "Redo",
|
|
141
|
+
compact: "Tidy Layout",
|
|
142
|
+
import: "Import",
|
|
143
|
+
exportTemplate: "Export template",
|
|
144
|
+
export: "Export",
|
|
145
|
+
preview: "Preview",
|
|
146
|
+
edit: "Edit",
|
|
147
|
+
delete: "Delete",
|
|
148
|
+
charts: "Charts",
|
|
149
|
+
datasets: "Datasets",
|
|
150
|
+
property: "Properties",
|
|
151
|
+
selectChart: "Click a chart on the canvas to edit",
|
|
152
|
+
title: "Title",
|
|
153
|
+
type: "Type",
|
|
154
|
+
dataset: "Dataset",
|
|
155
|
+
encoding: "Encoding",
|
|
156
|
+
dimension: "Dimension",
|
|
157
|
+
measure: "Measure",
|
|
158
|
+
series: "Series",
|
|
159
|
+
position: "Position (x / y)",
|
|
160
|
+
size: "Size (W × H)",
|
|
161
|
+
datasetName: "Dataset name",
|
|
162
|
+
datasetType: "Type",
|
|
163
|
+
rowsJson: "Rows (JSON array)",
|
|
164
|
+
apiParams: "API params (JSON)",
|
|
165
|
+
typeStatic: "Static",
|
|
166
|
+
typeApi: "API",
|
|
167
|
+
noDataset: "Create a dataset first",
|
|
168
|
+
invalidJson: "Invalid JSON",
|
|
169
|
+
save: "Save",
|
|
170
|
+
cancel: "Cancel",
|
|
171
|
+
importFailed: "Import failed",
|
|
172
|
+
confirmDeleteChart: "Delete this chart?",
|
|
173
|
+
columns: "columns",
|
|
174
|
+
tabData: "Data",
|
|
175
|
+
tabStyle: "Style",
|
|
176
|
+
tabLayout: "Layout",
|
|
177
|
+
duplicate: "Duplicate",
|
|
178
|
+
paste: "Paste",
|
|
179
|
+
aggregation: "Aggregation",
|
|
180
|
+
aggNone: "None",
|
|
181
|
+
aggSum: "Sum",
|
|
182
|
+
aggAvg: "Average",
|
|
183
|
+
aggCount: "Count",
|
|
184
|
+
aggMax: "Max",
|
|
185
|
+
aggMin: "Min",
|
|
186
|
+
measures: "Multi-measure (wide)",
|
|
187
|
+
sortLabel: "Sort",
|
|
188
|
+
sortByDim: "By dimension",
|
|
189
|
+
sortByMeasure: "By measure",
|
|
190
|
+
asc: "Ascending",
|
|
191
|
+
desc: "Descending",
|
|
192
|
+
topN: "Top N",
|
|
193
|
+
filters: "Filters",
|
|
194
|
+
addFilter: "+ Add condition",
|
|
195
|
+
filterField: "Field",
|
|
196
|
+
opEq: "equals",
|
|
197
|
+
opNe: "not equals",
|
|
198
|
+
opGt: "greater than",
|
|
199
|
+
opGte: "≥",
|
|
200
|
+
opLt: "less than",
|
|
201
|
+
opLte: "≤",
|
|
202
|
+
opContains: "contains",
|
|
203
|
+
opIn: "in (comma separated)",
|
|
204
|
+
showLegend: "Show legend",
|
|
205
|
+
showLabel: "Data labels",
|
|
206
|
+
stack: "Stack",
|
|
207
|
+
dataZoom: "Data zoom",
|
|
208
|
+
palette: "Palette",
|
|
209
|
+
paletteDefault: "Default",
|
|
210
|
+
paletteOcean: "Ocean",
|
|
211
|
+
paletteSunset: "Sunset",
|
|
212
|
+
paletteForest: "Forest",
|
|
213
|
+
paletteMono: "Mono",
|
|
214
|
+
numberFormat: "Number format",
|
|
215
|
+
decimals: "Decimals",
|
|
216
|
+
thousand: "Thousands separator",
|
|
217
|
+
prefix: "Prefix",
|
|
218
|
+
suffix: "Suffix",
|
|
219
|
+
typeNumber: "Number",
|
|
220
|
+
typeString: "Text",
|
|
221
|
+
typeDate: "Date",
|
|
222
|
+
drillPath: "Drill path",
|
|
223
|
+
addDrillLevel: "+ Add drill level",
|
|
224
|
+
linkage: "Cross-filter",
|
|
225
|
+
linkageTip: "Clicking a chart filters sibling charts on the same dataset",
|
|
226
|
+
templates: "Templates",
|
|
227
|
+
themePreset: "Dashboard theme",
|
|
228
|
+
themeAuto: "Follow host",
|
|
229
|
+
},
|
|
230
|
+
types: {
|
|
231
|
+
bar: "Bar",
|
|
232
|
+
line: "Line",
|
|
233
|
+
area: "Area",
|
|
234
|
+
pie: "Pie",
|
|
235
|
+
donut: "Donut",
|
|
236
|
+
scatter: "Scatter",
|
|
237
|
+
radar: "Radar",
|
|
238
|
+
gauge: "Gauge",
|
|
239
|
+
pivot: "Pivot table",
|
|
240
|
+
graph: "Graph",
|
|
241
|
+
funnel: "Funnel",
|
|
242
|
+
treemap: "Treemap",
|
|
243
|
+
sunburst: "Sunburst",
|
|
244
|
+
sankey: "Sankey",
|
|
245
|
+
heatmap: "Heatmap",
|
|
246
|
+
},
|
|
247
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { BiCard, BiWorkbench } from "./rpc/bi/admin/v1/bi_card";
|
|
2
|
+
import type { BiQueryResult, BiQuerySpec } from "./rpc/bi/admin/v1/bi_query";
|
|
3
|
+
/** 补齐 HTTP JSON 省略的查询集合字段,保留服务端返回的过滤、排序与时间范围。 */
|
|
4
|
+
export declare function normalizeBiQuerySpec(query: BiQuerySpec): BiQuerySpec;
|
|
5
|
+
/** 将无数据查询的省略字段统一为可渲染的空结果。 */
|
|
6
|
+
export declare function normalizeBiQueryResult(result: BiQueryResult): BiQueryResult;
|
|
7
|
+
/** 在卡片 API 边界补齐查询配置,页面不再重复处理缺省集合。 */
|
|
8
|
+
export declare function normalizeBiCard(card: BiCard): BiCard;
|
|
9
|
+
/** 新账号和清空后的工作台使用相同的空集合结构。 */
|
|
10
|
+
export declare function normalizeBiWorkbench(workbench: BiWorkbench): BiWorkbench;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** 补齐 HTTP JSON 省略的查询集合字段,保留服务端返回的过滤、排序与时间范围。 */
|
|
2
|
+
export function normalizeBiQuerySpec(query) {
|
|
3
|
+
return {
|
|
4
|
+
...query,
|
|
5
|
+
dimensions: query.dimensions ?? [],
|
|
6
|
+
measures: query.measures ?? [],
|
|
7
|
+
filters: (query.filters ?? []).map(filter => ({ ...filter, values: filter.values ?? [] })),
|
|
8
|
+
orders: query.orders ?? []
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
/** 将无数据查询的省略字段统一为可渲染的空结果。 */
|
|
12
|
+
export function normalizeBiQueryResult(result) {
|
|
13
|
+
return {
|
|
14
|
+
...result,
|
|
15
|
+
columns: result.columns ?? [],
|
|
16
|
+
rows: (result.rows ?? []).map(row => ({ values: row.values ?? [] })),
|
|
17
|
+
truncated: result.truncated ?? false,
|
|
18
|
+
elapsed_ms: result.elapsed_ms ?? 0,
|
|
19
|
+
query_record_id: result.query_record_id ?? 0
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** 在卡片 API 边界补齐查询配置,页面不再重复处理缺省集合。 */
|
|
23
|
+
export function normalizeBiCard(card) {
|
|
24
|
+
return { ...card, query: card.query ? normalizeBiQuerySpec(card.query) : undefined };
|
|
25
|
+
}
|
|
26
|
+
/** 新账号和清空后的工作台使用相同的空集合结构。 */
|
|
27
|
+
export function normalizeBiWorkbench(workbench) {
|
|
28
|
+
return {
|
|
29
|
+
dashboard_ids: workbench.dashboard_ids ?? [],
|
|
30
|
+
favorite_ids: workbench.favorite_ids ?? [],
|
|
31
|
+
dashboards: workbench.dashboards ?? []
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue 3 BI 仪表盘:BiDashboard 只读渲染器 + BiDesigner 画布设计器。
|
|
3
|
+
* 数据查询与卡片配置由服务端提供,设计器仅调整卡片布局。
|
|
4
|
+
*/
|
|
5
|
+
import "./styles.scss";
|
|
6
|
+
export { default as BiDashboard } from "./components/BiDashboard.vue";
|
|
7
|
+
export { default as BiDesigner } from "./components/BiDesigner.vue";
|
|
8
|
+
export { default as BiChart } from "./components/BiChart.vue";
|
|
9
|
+
export { provideBiEnv, useBiEnv, useBiTheme, useBiI18n } from "./env";
|
|
10
|
+
export type { BiEnv } from "./env";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vue 3 BI 仪表盘:BiDashboard 只读渲染器 + BiDesigner 画布设计器。
|
|
3
|
+
* 数据查询与卡片配置由服务端提供,设计器仅调整卡片布局。
|
|
4
|
+
*/
|
|
5
|
+
import "./styles.scss";
|
|
6
|
+
export { default as BiDashboard } from "./components/BiDashboard.vue";
|
|
7
|
+
export { default as BiDesigner } from "./components/BiDesigner.vue";
|
|
8
|
+
export { default as BiChart } from "./components/BiChart.vue";
|
|
9
|
+
// 环境注入(主题跟随 / resolvers / 项目 i18n)
|
|
10
|
+
export { provideBiEnv, useBiEnv, useBiTheme, useBiI18n } from "./env";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { BiDashboard } from "./rpc/bi/admin/v1/bi_dashboard";
|
|
2
|
+
import type { BiChartEncoding, BiChartStyle, BiChartSchema, BiRow } from "./schema/types";
|
|
3
|
+
import type { BiCard } from "./rpc/bi/admin/v1/bi_card";
|
|
4
|
+
import type { BiQueryResult, BiSourceDescriptor } from "./rpc/bi/admin/v1/bi_query";
|
|
5
|
+
/** 将卡片查询结果映射到现有图表引擎,保留分组及全部所选指标。 */
|
|
6
|
+
export declare function buildCardChart(card: BiCard, result: BiQueryResult): {
|
|
7
|
+
chart: BiChartSchema;
|
|
8
|
+
rows: BiRow[];
|
|
9
|
+
metrics: Array<{
|
|
10
|
+
code: string;
|
|
11
|
+
name: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}>;
|
|
14
|
+
metricOnly: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** 数据卡片统一保存字段映射与受控样式。 */
|
|
17
|
+
export interface CardChartConfig {
|
|
18
|
+
encoding: BiChartEncoding;
|
|
19
|
+
style: Pick<BiChartStyle, "showLabel" | "showLegend" | "stack" | "dataZoom" | "palette">;
|
|
20
|
+
}
|
|
21
|
+
/** 从服务端配置读取图表字段,预览卡片允许使用默认映射。 */
|
|
22
|
+
export declare function parseCardChart(card: Pick<BiCard, "chart_json">): CardChartConfig;
|
|
23
|
+
/** 仅在卡片明确指定时间字段或只有一个可过滤日期分组时开放周期切换。 */
|
|
24
|
+
export declare function supportsCardPeriod(card: BiCard, source?: BiSourceDescriptor): boolean;
|
|
25
|
+
/** 计算刷新等待时间,86400对应浏览器本地时区的下一次02:00。 */
|
|
26
|
+
export declare function cardRefreshDelay(seconds: number, now?: Date): number;
|
|
27
|
+
/** 按当前四种界面语言的分组习惯显示数字字符串,不转换浮点数或丢弃小数位。 */
|
|
28
|
+
export declare function formatCardMetric(value: string): string;
|
|
29
|
+
/** 保持工作台入口顺序,忽略已删除或撤销权限的仪表盘。 */
|
|
30
|
+
export declare function orderWorkbenchDashboards(ids: number[], dashboards: BiDashboard[]): BiDashboard[];
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** 将卡片查询结果映射到现有图表引擎,保留分组及全部所选指标。 */
|
|
2
|
+
export function buildCardChart(card, result) {
|
|
3
|
+
const config = parseCardChart(card);
|
|
4
|
+
const numericFields = result.columns.filter(column => column.type === "number");
|
|
5
|
+
const measure = config.encoding.measure ||
|
|
6
|
+
(card.chart_type === "scatter" ? numericFields[1]?.code : undefined) ||
|
|
7
|
+
card.query?.measures[0]?.code ||
|
|
8
|
+
result.columns.find(column => column.type === "number")?.code ||
|
|
9
|
+
result.columns[0]?.code ||
|
|
10
|
+
"";
|
|
11
|
+
const dimension = config.encoding.dimension ||
|
|
12
|
+
(card.chart_type === "scatter" ? numericFields[0]?.code : undefined) ||
|
|
13
|
+
(card.query ? card.query.dimensions[0] : result.columns.find(column => column.code !== measure)?.code);
|
|
14
|
+
const rows = result.rows.map(row => Object.fromEntries(result.columns.map((column, index) => [column.code, row.values[index] ?? ""])));
|
|
15
|
+
const measures = config.encoding.measures?.length
|
|
16
|
+
? config.encoding.measures
|
|
17
|
+
: card.query?.measures.length
|
|
18
|
+
? card.query.measures.map(item => item.code)
|
|
19
|
+
: [measure];
|
|
20
|
+
return {
|
|
21
|
+
chart: {
|
|
22
|
+
id: `card_${card.id}`,
|
|
23
|
+
datasetId: `card_${card.id}`,
|
|
24
|
+
type: card.chart_type,
|
|
25
|
+
encoding: {
|
|
26
|
+
dimension,
|
|
27
|
+
measure,
|
|
28
|
+
measures: ["bar", "line", "area"].includes(card.chart_type) && measures.length > 1 ? measures : undefined,
|
|
29
|
+
series: card.chart_type === "scatter" ? undefined : card.query?.dimensions[1],
|
|
30
|
+
...config.encoding
|
|
31
|
+
},
|
|
32
|
+
aggregation: "none",
|
|
33
|
+
style: {
|
|
34
|
+
showLabel: false,
|
|
35
|
+
showLegend: measures.length > 1 || card.chart_type === "pie" || card.chart_type === "donut",
|
|
36
|
+
...config.style
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
rows,
|
|
40
|
+
metrics: measures.map(code => ({
|
|
41
|
+
code,
|
|
42
|
+
name: result.columns.find(column => column.code === code)?.name || code,
|
|
43
|
+
value: String(rows[0]?.[code] ?? "—")
|
|
44
|
+
})),
|
|
45
|
+
metricOnly: card.chart_type === "metric"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/** 从服务端配置读取图表字段,预览卡片允许使用默认映射。 */
|
|
49
|
+
export function parseCardChart(card) {
|
|
50
|
+
return card.chart_json
|
|
51
|
+
? JSON.parse(card.chart_json)
|
|
52
|
+
: { encoding: {}, style: { showLegend: true, showLabel: false } };
|
|
53
|
+
}
|
|
54
|
+
/** 仅在卡片明确指定时间字段或只有一个可过滤日期分组时开放周期切换。 */
|
|
55
|
+
export function supportsCardPeriod(card, source) {
|
|
56
|
+
const fields = source?.dimensions.filter(dimension => dimension.type === "date" &&
|
|
57
|
+
dimension.filterable &&
|
|
58
|
+
(card.query?.time_range
|
|
59
|
+
? dimension.code === card.query.time_range.field
|
|
60
|
+
: card.query?.dimensions.includes(dimension.code))) ?? [];
|
|
61
|
+
return fields.length === 1;
|
|
62
|
+
}
|
|
63
|
+
/** 计算刷新等待时间,86400对应浏览器本地时区的下一次02:00。 */
|
|
64
|
+
export function cardRefreshDelay(seconds, now = new Date()) {
|
|
65
|
+
if (seconds !== 86400)
|
|
66
|
+
return seconds * 1000;
|
|
67
|
+
const next = new Date(now.getTime());
|
|
68
|
+
next.setHours(2, 0, 0, 0);
|
|
69
|
+
if (next.getTime() <= now.getTime())
|
|
70
|
+
next.setDate(next.getDate() + 1);
|
|
71
|
+
return next.getTime() - now.getTime();
|
|
72
|
+
}
|
|
73
|
+
/** 按当前四种界面语言的分组习惯显示数字字符串,不转换浮点数或丢弃小数位。 */
|
|
74
|
+
export function formatCardMetric(value) {
|
|
75
|
+
if (!/^[+-]?\d+(?:\.\d+)?$/.test(value))
|
|
76
|
+
return value;
|
|
77
|
+
const [integer, fraction] = value.split(".");
|
|
78
|
+
return integer.replace(/\B(?=(\d{3})+(?!\d))/g, ",") + (fraction === undefined ? "" : "." + fraction);
|
|
79
|
+
}
|
|
80
|
+
/** 保持工作台入口顺序,忽略已删除或撤销权限的仪表盘。 */
|
|
81
|
+
export function orderWorkbenchDashboards(ids, dashboards) {
|
|
82
|
+
const byID = new Map(dashboards.map(item => [item.id, item]));
|
|
83
|
+
return ids.flatMap(id => {
|
|
84
|
+
const item = byID.get(id);
|
|
85
|
+
return item ? [item] : [];
|
|
86
|
+
});
|
|
87
|
+
}
|