@liujitcn/kratos-admin-bi 0.0.0-stage → 0.1.6
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,157 @@
|
|
|
1
|
+
/** BI 数据源目录查询条件。 */
|
|
2
|
+
export interface ListBiSourcesRequest {
|
|
3
|
+
}
|
|
4
|
+
/** BI 数据源目录响应。 */
|
|
5
|
+
export interface ListBiSourcesResponse {
|
|
6
|
+
/** 当前用户可用的数据源 */
|
|
7
|
+
sources: BiSourceDescriptor[];
|
|
8
|
+
}
|
|
9
|
+
/** BI 数据源描述。 */
|
|
10
|
+
export interface BiSourceDescriptor {
|
|
11
|
+
/** 数据源编码 */
|
|
12
|
+
code: string;
|
|
13
|
+
/** 数据源名称 */
|
|
14
|
+
name: string;
|
|
15
|
+
/** 数据源说明 */
|
|
16
|
+
description: string;
|
|
17
|
+
/** 数据源语义版本 */
|
|
18
|
+
version: number;
|
|
19
|
+
/** 可用维度 */
|
|
20
|
+
dimensions: BiFieldDescriptor[];
|
|
21
|
+
/** 可用指标 */
|
|
22
|
+
measures: BiMeasureDescriptor[];
|
|
23
|
+
/** 最大结果行数 */
|
|
24
|
+
max_rows: number;
|
|
25
|
+
}
|
|
26
|
+
/** BI 字段描述。 */
|
|
27
|
+
export interface BiFieldDescriptor {
|
|
28
|
+
/** 字段编码 */
|
|
29
|
+
code: string;
|
|
30
|
+
/** 字段名称 */
|
|
31
|
+
name: string;
|
|
32
|
+
/** 字段类型 */
|
|
33
|
+
type: string;
|
|
34
|
+
/** 是否允许过滤 */
|
|
35
|
+
filterable: boolean;
|
|
36
|
+
}
|
|
37
|
+
/** BI 指标描述。 */
|
|
38
|
+
export interface BiMeasureDescriptor {
|
|
39
|
+
/** 指标编码 */
|
|
40
|
+
code: string;
|
|
41
|
+
/** 指标名称 */
|
|
42
|
+
name: string;
|
|
43
|
+
/** 指标类型 */
|
|
44
|
+
type: string;
|
|
45
|
+
/** 允许的聚合函数 */
|
|
46
|
+
aggregations: string[];
|
|
47
|
+
}
|
|
48
|
+
/** BI 查询预览请求。 */
|
|
49
|
+
export interface PreviewBiQueryRequest {
|
|
50
|
+
/** 语义查询计划 */
|
|
51
|
+
query: BiQuerySpec | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** BI 语义查询计划。 */
|
|
54
|
+
export interface BiQuerySpec {
|
|
55
|
+
/** 数据源编码 */
|
|
56
|
+
source_code: string;
|
|
57
|
+
/** 分组维度编码 */
|
|
58
|
+
dimensions: string[];
|
|
59
|
+
/** 查询指标 */
|
|
60
|
+
measures: BiMeasureSpec[];
|
|
61
|
+
/** 过滤条件 */
|
|
62
|
+
filters: BiFilterSpec[];
|
|
63
|
+
/** 结果行数上限,默认100 */
|
|
64
|
+
limit: number;
|
|
65
|
+
/** 时间范围 */
|
|
66
|
+
time_range: BiTimeRangeSpec | undefined;
|
|
67
|
+
/** 结果排序规则 */
|
|
68
|
+
orders: BiOrderSpec[];
|
|
69
|
+
}
|
|
70
|
+
/** BI 时间范围。 */
|
|
71
|
+
export interface BiTimeRangeSpec {
|
|
72
|
+
/** 时间维度编码 */
|
|
73
|
+
field: string;
|
|
74
|
+
/** 范围起点 */
|
|
75
|
+
start: string;
|
|
76
|
+
/** 范围终点 */
|
|
77
|
+
end: string;
|
|
78
|
+
}
|
|
79
|
+
/** BI 结果排序规则。 */
|
|
80
|
+
export interface BiOrderSpec {
|
|
81
|
+
/** 已选择的维度或指标编码 */
|
|
82
|
+
field: string;
|
|
83
|
+
/** 排序方向 */
|
|
84
|
+
direction: string;
|
|
85
|
+
}
|
|
86
|
+
/** BI 指标查询项。 */
|
|
87
|
+
export interface BiMeasureSpec {
|
|
88
|
+
/** 指标编码 */
|
|
89
|
+
code: string;
|
|
90
|
+
/** 聚合函数 */
|
|
91
|
+
aggregation: string;
|
|
92
|
+
}
|
|
93
|
+
/** BI 过滤条件。 */
|
|
94
|
+
export interface BiFilterSpec {
|
|
95
|
+
/** 字段编码 */
|
|
96
|
+
field: string;
|
|
97
|
+
/** 操作符 */
|
|
98
|
+
operator: string;
|
|
99
|
+
/** 过滤值 */
|
|
100
|
+
values: string[];
|
|
101
|
+
}
|
|
102
|
+
/** BI 查询结果。 */
|
|
103
|
+
export interface BiQueryResult {
|
|
104
|
+
/** 结果列 */
|
|
105
|
+
columns: BiResultColumn[];
|
|
106
|
+
/** 结果行 */
|
|
107
|
+
rows: BiResultRow[];
|
|
108
|
+
/** 是否因限制截断 */
|
|
109
|
+
truncated: boolean;
|
|
110
|
+
/** 查询耗时毫秒 */
|
|
111
|
+
elapsed_ms: number;
|
|
112
|
+
/** 本次成功查询记录ID */
|
|
113
|
+
query_record_id: number;
|
|
114
|
+
}
|
|
115
|
+
/** BI 结果列。 */
|
|
116
|
+
export interface BiResultColumn {
|
|
117
|
+
/** 列编码 */
|
|
118
|
+
code: string;
|
|
119
|
+
/** 列名称 */
|
|
120
|
+
name: string;
|
|
121
|
+
/** 列类型 */
|
|
122
|
+
type: string;
|
|
123
|
+
}
|
|
124
|
+
/** BI 结果行。 */
|
|
125
|
+
export interface BiResultRow {
|
|
126
|
+
/** 按列顺序排列的值 */
|
|
127
|
+
values: string[];
|
|
128
|
+
}
|
|
129
|
+
/** BI 自然语言问数请求。 */
|
|
130
|
+
export interface AskBiQueryRequest {
|
|
131
|
+
/** 自然语言问题 */
|
|
132
|
+
question: string;
|
|
133
|
+
/** 所选供应商ID;留空时使用首个可用模型 */
|
|
134
|
+
provider_id: number;
|
|
135
|
+
/** 所选模型名称 */
|
|
136
|
+
model_name: string;
|
|
137
|
+
}
|
|
138
|
+
/** BI 自然语言问数响应。 */
|
|
139
|
+
export interface AskBiQueryResponse {
|
|
140
|
+
/** 模型生成并校验后的查询计划 */
|
|
141
|
+
query: BiQuerySpec | undefined;
|
|
142
|
+
/** 查询结果 */
|
|
143
|
+
result: BiQueryResult | undefined;
|
|
144
|
+
/** 建议图表类型 */
|
|
145
|
+
chart_type: string;
|
|
146
|
+
/** 建议图表标题 */
|
|
147
|
+
title: string;
|
|
148
|
+
}
|
|
149
|
+
/** BI 语义查询服务。 */
|
|
150
|
+
export interface BiQueryService {
|
|
151
|
+
/** 查询当前用户可用的数据源目录。 */
|
|
152
|
+
ListBiSources(request: ListBiSourcesRequest): Promise<ListBiSourcesResponse>;
|
|
153
|
+
/** 预览一个已经由前端配置的语义查询。 */
|
|
154
|
+
PreviewBiQuery(request: PreviewBiQueryRequest): Promise<BiQueryResult>;
|
|
155
|
+
/** 自然语言生成语义查询并返回预览结果。 */
|
|
156
|
+
AskBiQuery(request: AskBiQueryRequest): Promise<AskBiQueryResponse>;
|
|
157
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { BiQueryResult } from "./bi_query";
|
|
2
|
+
/** 智能问数状态枚举。 */
|
|
3
|
+
export declare enum BiQueryStatus {
|
|
4
|
+
/** BI_QUERY_STATUS_UNSPECIFIED - 未指定智能问数状态。 */
|
|
5
|
+
BI_QUERY_STATUS_UNSPECIFIED = 0,
|
|
6
|
+
/** BI_QUERY_STATUS_SUCCESS - 成功。 */
|
|
7
|
+
BI_QUERY_STATUS_SUCCESS = 1,
|
|
8
|
+
/** BI_QUERY_STATUS_FAILED - 失败。 */
|
|
9
|
+
BI_QUERY_STATUS_FAILED = 2
|
|
10
|
+
}
|
|
11
|
+
/** 智能问数分页查询条件。 */
|
|
12
|
+
export interface PageBiQueryRequest {
|
|
13
|
+
/** 问题内容 */
|
|
14
|
+
question: string;
|
|
15
|
+
/** 问数状态:枚举【BiQueryStatus】 */
|
|
16
|
+
status?: BiQueryStatus | undefined;
|
|
17
|
+
/** 数据源编码 */
|
|
18
|
+
source_code: string;
|
|
19
|
+
/** 当前页码 */
|
|
20
|
+
page_num: number;
|
|
21
|
+
/** 每页行数 */
|
|
22
|
+
page_size: number;
|
|
23
|
+
}
|
|
24
|
+
/** 智能问数分页响应。 */
|
|
25
|
+
export interface PageBiQueryResponse {
|
|
26
|
+
/** 智能问数记录列表 */
|
|
27
|
+
queries: BiQueryRecord[];
|
|
28
|
+
/** 总数 */
|
|
29
|
+
total: number;
|
|
30
|
+
}
|
|
31
|
+
/** 查询智能问数记录请求。 */
|
|
32
|
+
export interface GetBiQueryRequest {
|
|
33
|
+
/** 记录ID */
|
|
34
|
+
id: number;
|
|
35
|
+
}
|
|
36
|
+
/** BI 查询记录。 */
|
|
37
|
+
export interface BiQueryRecord {
|
|
38
|
+
/** 记录ID */
|
|
39
|
+
id: number;
|
|
40
|
+
/** 租户ID */
|
|
41
|
+
tenant_id: number;
|
|
42
|
+
/** 用户ID */
|
|
43
|
+
user_id: number;
|
|
44
|
+
/** 项目ID */
|
|
45
|
+
project_id: number;
|
|
46
|
+
/** 仪表盘ID */
|
|
47
|
+
dashboard_id: number;
|
|
48
|
+
/** 仪表盘版本 */
|
|
49
|
+
dashboard_version: number;
|
|
50
|
+
/** 图表组件ID */
|
|
51
|
+
widget_id: string;
|
|
52
|
+
/** 数据源编码 */
|
|
53
|
+
source_code: string;
|
|
54
|
+
/** 自然语言问题,非问数查询为空 */
|
|
55
|
+
question: string;
|
|
56
|
+
/** 语义查询计划JSON */
|
|
57
|
+
query_json: string;
|
|
58
|
+
/** 查询计划哈希 */
|
|
59
|
+
query_hash: string;
|
|
60
|
+
/** 问数状态:枚举【BiQueryStatus】 */
|
|
61
|
+
status: BiQueryStatus;
|
|
62
|
+
/** 结果行数 */
|
|
63
|
+
row_count: number;
|
|
64
|
+
/** 是否截断:0否,1是 */
|
|
65
|
+
truncated: number;
|
|
66
|
+
/** 查询耗时毫秒,问数包含模型生成耗时 */
|
|
67
|
+
elapsed_ms: number;
|
|
68
|
+
/** 失败原因 */
|
|
69
|
+
error_msg: string;
|
|
70
|
+
/** 创建时间 */
|
|
71
|
+
created_at: string;
|
|
72
|
+
/** 用户账号 */
|
|
73
|
+
user_name: string;
|
|
74
|
+
/** 完整类型化查询结果,仅详情返回 */
|
|
75
|
+
result: BiQueryResult | undefined;
|
|
76
|
+
}
|
|
77
|
+
/** BI 查询记录管理服务。 */
|
|
78
|
+
export interface BiQueryRecordService {
|
|
79
|
+
/** 分页查询当前用户的自然语言问数历史。 */
|
|
80
|
+
PageBiQuery(request: PageBiQueryRequest): Promise<PageBiQueryResponse>;
|
|
81
|
+
/** 查询智能问数记录详情。 */
|
|
82
|
+
GetBiQuery(request: GetBiQueryRequest): Promise<BiQueryRecord>;
|
|
83
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.
|
|
2
|
+
// versions:
|
|
3
|
+
// protoc-gen-ts_proto v2.12.1
|
|
4
|
+
// protoc unknown
|
|
5
|
+
// source: bi/admin/v1/bi_query_record.proto
|
|
6
|
+
/** 智能问数状态枚举。 */
|
|
7
|
+
export var BiQueryStatus;
|
|
8
|
+
(function (BiQueryStatus) {
|
|
9
|
+
/** BI_QUERY_STATUS_UNSPECIFIED - 未指定智能问数状态。 */
|
|
10
|
+
BiQueryStatus[BiQueryStatus["BI_QUERY_STATUS_UNSPECIFIED"] = 0] = "BI_QUERY_STATUS_UNSPECIFIED";
|
|
11
|
+
/** BI_QUERY_STATUS_SUCCESS - 成功。 */
|
|
12
|
+
BiQueryStatus[BiQueryStatus["BI_QUERY_STATUS_SUCCESS"] = 1] = "BI_QUERY_STATUS_SUCCESS";
|
|
13
|
+
/** BI_QUERY_STATUS_FAILED - 失败。 */
|
|
14
|
+
BiQueryStatus[BiQueryStatus["BI_QUERY_STATUS_FAILED"] = 2] = "BI_QUERY_STATUS_FAILED";
|
|
15
|
+
})(BiQueryStatus || (BiQueryStatus = {}));
|
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import type { SecretCrypto } from "../../../common/v1/types";
|
|
2
|
+
/** BI 数据源分页查询条件。 */
|
|
3
|
+
export interface PageBiSourceRequest {
|
|
4
|
+
/** 数据源编码 */
|
|
5
|
+
code: string;
|
|
6
|
+
/** 数据源名称 */
|
|
7
|
+
name: string;
|
|
8
|
+
/** 服务端数据库客户端名称 */
|
|
9
|
+
source_name: string;
|
|
10
|
+
/** 状态:1启用,2禁用 */
|
|
11
|
+
status?: number | undefined;
|
|
12
|
+
/** 页码 */
|
|
13
|
+
page_num: number;
|
|
14
|
+
/** 每页数量 */
|
|
15
|
+
page_size: number;
|
|
16
|
+
}
|
|
17
|
+
/** BI 数据源分页响应。 */
|
|
18
|
+
export interface PageBiSourceResponse {
|
|
19
|
+
/** 数据源配置列表 */
|
|
20
|
+
sources: BiSource[];
|
|
21
|
+
/** 总数 */
|
|
22
|
+
total: number;
|
|
23
|
+
}
|
|
24
|
+
/** 查询 BI 数据源请求。 */
|
|
25
|
+
export interface GetBiSourceRequest {
|
|
26
|
+
/** 数据源ID */
|
|
27
|
+
id: number;
|
|
28
|
+
}
|
|
29
|
+
/** 创建 BI 数据源请求。 */
|
|
30
|
+
export interface CreateBiSourceRequest {
|
|
31
|
+
/** 数据源配置 */
|
|
32
|
+
source: BiSourceForm | undefined;
|
|
33
|
+
}
|
|
34
|
+
/** 更新 BI 数据源请求。 */
|
|
35
|
+
export interface UpdateBiSourceRequest {
|
|
36
|
+
/** 数据源配置 */
|
|
37
|
+
source: BiSourceForm | undefined;
|
|
38
|
+
}
|
|
39
|
+
/** 删除 BI 数据源请求。 */
|
|
40
|
+
export interface DeleteBiSourceRequest {
|
|
41
|
+
/** 数据源ID */
|
|
42
|
+
id: number;
|
|
43
|
+
}
|
|
44
|
+
/** 删除 BI 数据源响应。 */
|
|
45
|
+
export interface DeleteBiSourceResponse {
|
|
46
|
+
}
|
|
47
|
+
/** 修改 BI 数据源状态请求。 */
|
|
48
|
+
export interface SetBiSourceStatusRequest {
|
|
49
|
+
/** 数据源ID */
|
|
50
|
+
id: number;
|
|
51
|
+
/** 状态:1启用,2禁用 */
|
|
52
|
+
status: number;
|
|
53
|
+
}
|
|
54
|
+
/** 查询服务端数据库客户端请求。 */
|
|
55
|
+
export interface OptionBiSourceDatabaseRequest {
|
|
56
|
+
}
|
|
57
|
+
/** 查询服务端数据库客户端响应。 */
|
|
58
|
+
export interface OptionBiSourceDatabaseResponse {
|
|
59
|
+
/** 服务端数据库客户端列表 */
|
|
60
|
+
databases: BiSourceDatabase[];
|
|
61
|
+
}
|
|
62
|
+
/** 服务端数据库客户端选项。 */
|
|
63
|
+
export interface BiSourceDatabase {
|
|
64
|
+
/** 客户端名称 */
|
|
65
|
+
name: string;
|
|
66
|
+
/** 数据库驱动 */
|
|
67
|
+
driver: string;
|
|
68
|
+
}
|
|
69
|
+
/** 测试 BI 数据源请求。 */
|
|
70
|
+
export interface TestBiSourceRequest {
|
|
71
|
+
/** 待测试数据源 */
|
|
72
|
+
source: BiSourceForm | undefined;
|
|
73
|
+
}
|
|
74
|
+
/** 测试 BI 数据源响应。 */
|
|
75
|
+
export interface TestBiSourceResponse {
|
|
76
|
+
/** 是否可访问 */
|
|
77
|
+
success: boolean;
|
|
78
|
+
/** 测试结果说明 */
|
|
79
|
+
message: string;
|
|
80
|
+
}
|
|
81
|
+
/** 查询数据源数据库表结构的请求。 */
|
|
82
|
+
export interface ListBiSourceTablesRequest {
|
|
83
|
+
/** 数据源ID */
|
|
84
|
+
id: number;
|
|
85
|
+
}
|
|
86
|
+
/** 数据库表字段的结构信息。 */
|
|
87
|
+
export interface BiSourceSchemaColumn {
|
|
88
|
+
/** 字段名称 */
|
|
89
|
+
name: string;
|
|
90
|
+
/** 数据库字段类型 */
|
|
91
|
+
data_type: string;
|
|
92
|
+
/** 是否允许为空 */
|
|
93
|
+
nullable: boolean;
|
|
94
|
+
/** 是否为主键 */
|
|
95
|
+
primary_key: boolean;
|
|
96
|
+
/** 是否有单列唯一约束 */
|
|
97
|
+
unique: boolean;
|
|
98
|
+
/** 字段注释 */
|
|
99
|
+
comment: string;
|
|
100
|
+
}
|
|
101
|
+
/** 数据库中的表或视图结构。 */
|
|
102
|
+
export interface BiSourceSchemaTable {
|
|
103
|
+
/** 表结构标识 */
|
|
104
|
+
key: string;
|
|
105
|
+
/** 数据库Schema */
|
|
106
|
+
schema_name: string;
|
|
107
|
+
/** 表或视图名称 */
|
|
108
|
+
name: string;
|
|
109
|
+
/** 表类型 */
|
|
110
|
+
table_type: string;
|
|
111
|
+
/** 字段列表 */
|
|
112
|
+
columns: BiSourceSchemaColumn[];
|
|
113
|
+
/** 表或视图注释 */
|
|
114
|
+
comment: string;
|
|
115
|
+
}
|
|
116
|
+
/** 查询数据源表结构的响应。 */
|
|
117
|
+
export interface ListBiSourceTablesResponse {
|
|
118
|
+
/** 数据库表结构 */
|
|
119
|
+
tables: BiSourceSchemaTable[];
|
|
120
|
+
}
|
|
121
|
+
/** 保存数据源语义模型的请求。 */
|
|
122
|
+
export interface SaveBiSourceModelRequest {
|
|
123
|
+
/** 数据源ID */
|
|
124
|
+
id: number;
|
|
125
|
+
/** 数据源语义模型 */
|
|
126
|
+
model: BiSourceModel | undefined;
|
|
127
|
+
}
|
|
128
|
+
/** 数据源可用的表、关联关系和业务语义。 */
|
|
129
|
+
export interface BiSourceModel {
|
|
130
|
+
/** 事实表标识 */
|
|
131
|
+
base_table: string;
|
|
132
|
+
/** 选中的表结构 */
|
|
133
|
+
tables: BiSourceModelTable[];
|
|
134
|
+
/** 表关联关系 */
|
|
135
|
+
relations: BiSourceRelation[];
|
|
136
|
+
/** 语义维度 */
|
|
137
|
+
dimensions: BiSourceDimension[];
|
|
138
|
+
/** 语义指标 */
|
|
139
|
+
measures: BiSourceMeasure[];
|
|
140
|
+
}
|
|
141
|
+
/** 语义模型中的表节点。 */
|
|
142
|
+
export interface BiSourceModelTable {
|
|
143
|
+
/** 表结构标识 */
|
|
144
|
+
key: string;
|
|
145
|
+
/** 租户隔离字段,为空表示连接级隔离或共享表 */
|
|
146
|
+
tenant_column: string;
|
|
147
|
+
/** 画布横坐标 */
|
|
148
|
+
x: number;
|
|
149
|
+
/** 画布纵坐标 */
|
|
150
|
+
y: number;
|
|
151
|
+
}
|
|
152
|
+
/** 两张表之间经过确认的多对一关系。 */
|
|
153
|
+
export interface BiSourceRelation {
|
|
154
|
+
/** 已连接表标识 */
|
|
155
|
+
left_table: string;
|
|
156
|
+
/** 已连接表字段 */
|
|
157
|
+
left_column: string;
|
|
158
|
+
/** 维度表标识 */
|
|
159
|
+
right_table: string;
|
|
160
|
+
/** 维度表唯一字段 */
|
|
161
|
+
right_column: string;
|
|
162
|
+
/** 连接类型 */
|
|
163
|
+
join_type: string;
|
|
164
|
+
}
|
|
165
|
+
/** 数据源语义维度。 */
|
|
166
|
+
export interface BiSourceDimension {
|
|
167
|
+
/** 语义编码 */
|
|
168
|
+
code: string;
|
|
169
|
+
/** 展示名称 */
|
|
170
|
+
name: string;
|
|
171
|
+
/** BI字段类型 */
|
|
172
|
+
type: string;
|
|
173
|
+
/** 所属表标识 */
|
|
174
|
+
table: string;
|
|
175
|
+
/** 数据库字段 */
|
|
176
|
+
column: string;
|
|
177
|
+
/** 是否允许过滤 */
|
|
178
|
+
filterable: boolean;
|
|
179
|
+
}
|
|
180
|
+
/** 数据源语义指标。 */
|
|
181
|
+
export interface BiSourceMeasure {
|
|
182
|
+
/** 语义编码 */
|
|
183
|
+
code: string;
|
|
184
|
+
/** 展示名称 */
|
|
185
|
+
name: string;
|
|
186
|
+
/** BI字段类型 */
|
|
187
|
+
type: string;
|
|
188
|
+
/** 所属表标识 */
|
|
189
|
+
table: string;
|
|
190
|
+
/** 数据库字段 */
|
|
191
|
+
column: string;
|
|
192
|
+
/** 允许的聚合函数 */
|
|
193
|
+
aggregations: string[];
|
|
194
|
+
}
|
|
195
|
+
/** BI 数据源配置表单。 */
|
|
196
|
+
export interface BiSourceForm {
|
|
197
|
+
/** 数据源ID */
|
|
198
|
+
id: number;
|
|
199
|
+
/** 数据源编码 */
|
|
200
|
+
code: string;
|
|
201
|
+
/** 数据源名称 */
|
|
202
|
+
name: string;
|
|
203
|
+
/** 数据源说明 */
|
|
204
|
+
description: string;
|
|
205
|
+
/** 服务端数据库客户端名称 */
|
|
206
|
+
source_name: string;
|
|
207
|
+
/** 数据库驱动 */
|
|
208
|
+
driver: string;
|
|
209
|
+
/** 数据库主机 */
|
|
210
|
+
host: string;
|
|
211
|
+
/** 数据库端口 */
|
|
212
|
+
port: number;
|
|
213
|
+
/** 数据库名称 */
|
|
214
|
+
database_name: string;
|
|
215
|
+
/** 数据库用户名 */
|
|
216
|
+
username: string;
|
|
217
|
+
/** 数据库密码密文 */
|
|
218
|
+
password: SecretCrypto | undefined;
|
|
219
|
+
/** PostgreSQL SSL模式 */
|
|
220
|
+
ssl_mode: string;
|
|
221
|
+
/** 数据库 Schema */
|
|
222
|
+
schema_name: string;
|
|
223
|
+
/** 最大结果行数 */
|
|
224
|
+
max_rows: number;
|
|
225
|
+
/** 状态:1启用,2禁用 */
|
|
226
|
+
status: number;
|
|
227
|
+
}
|
|
228
|
+
/** BI 数据源配置。 */
|
|
229
|
+
export interface BiSource {
|
|
230
|
+
/** 数据源ID */
|
|
231
|
+
id: number;
|
|
232
|
+
/** 租户ID */
|
|
233
|
+
tenant_id: number;
|
|
234
|
+
/** 数据源编码 */
|
|
235
|
+
code: string;
|
|
236
|
+
/** 数据源名称 */
|
|
237
|
+
name: string;
|
|
238
|
+
/** 数据源说明 */
|
|
239
|
+
description: string;
|
|
240
|
+
/** 服务端数据库客户端名称 */
|
|
241
|
+
source_name: string;
|
|
242
|
+
/** 数据库驱动 */
|
|
243
|
+
driver: string;
|
|
244
|
+
/** 数据库主机 */
|
|
245
|
+
host: string;
|
|
246
|
+
/** 数据库端口 */
|
|
247
|
+
port: number;
|
|
248
|
+
/** 数据库名称 */
|
|
249
|
+
database_name: string;
|
|
250
|
+
/** 数据库用户名 */
|
|
251
|
+
username: string;
|
|
252
|
+
/** 是否已保存数据库密码 */
|
|
253
|
+
password_configured: boolean;
|
|
254
|
+
/** PostgreSQL SSL模式 */
|
|
255
|
+
ssl_mode: string;
|
|
256
|
+
/** 数据库 Schema */
|
|
257
|
+
schema_name: string;
|
|
258
|
+
/** 数据库表或视图名称 */
|
|
259
|
+
table_name: string;
|
|
260
|
+
/** 租户列 */
|
|
261
|
+
tenant_column: string;
|
|
262
|
+
/** 维度和指标语义配置 JSON */
|
|
263
|
+
schema_json: string;
|
|
264
|
+
/** 状态:1启用,2禁用 */
|
|
265
|
+
status: number;
|
|
266
|
+
/** 语义版本 */
|
|
267
|
+
version: number;
|
|
268
|
+
/** 最大结果行数 */
|
|
269
|
+
max_rows: number;
|
|
270
|
+
/** 创建时间 */
|
|
271
|
+
created_at: string;
|
|
272
|
+
/** 更新时间 */
|
|
273
|
+
updated_at: string;
|
|
274
|
+
/** 是否已配置语义模型 */
|
|
275
|
+
model_configured: boolean;
|
|
276
|
+
/** 模型选中的表数量 */
|
|
277
|
+
table_count: number;
|
|
278
|
+
}
|
|
279
|
+
/** BI 数据源配置管理服务。 */
|
|
280
|
+
export interface BiSourceService {
|
|
281
|
+
/** 分页查询当前租户的数据源配置。 */
|
|
282
|
+
PageBiSource(request: PageBiSourceRequest): Promise<PageBiSourceResponse>;
|
|
283
|
+
/** 查询数据源配置详情。 */
|
|
284
|
+
GetBiSource(request: GetBiSourceRequest): Promise<BiSource>;
|
|
285
|
+
/** 创建数据源配置。 */
|
|
286
|
+
CreateBiSource(request: CreateBiSourceRequest): Promise<BiSource>;
|
|
287
|
+
/** 更新数据源配置。 */
|
|
288
|
+
UpdateBiSource(request: UpdateBiSourceRequest): Promise<BiSource>;
|
|
289
|
+
/** 删除数据源配置。 */
|
|
290
|
+
DeleteBiSource(request: DeleteBiSourceRequest): Promise<DeleteBiSourceResponse>;
|
|
291
|
+
/** 修改数据源启用状态。 */
|
|
292
|
+
SetBiSourceStatus(request: SetBiSourceStatusRequest): Promise<BiSource>;
|
|
293
|
+
/** 查询服务端已配置的数据库客户端选项。 */
|
|
294
|
+
OptionBiSourceDatabase(request: OptionBiSourceDatabaseRequest): Promise<OptionBiSourceDatabaseResponse>;
|
|
295
|
+
/** 测试数据源连接是否可访问。 */
|
|
296
|
+
TestBiSource(request: TestBiSourceRequest): Promise<TestBiSourceResponse>;
|
|
297
|
+
/** 发现已保存数据源中的表、字段和唯一键。 */
|
|
298
|
+
ListBiSourceTables(request: ListBiSourceTablesRequest): Promise<ListBiSourceTablesResponse>;
|
|
299
|
+
/** 保存经过校验的多表语义模型。 */
|
|
300
|
+
SaveBiSourceModel(request: SaveBiSourceModelRequest): Promise<BiSource>;
|
|
301
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/** double 类型数组包装消息。 */
|
|
2
|
+
export interface DoubleValues {
|
|
3
|
+
/** 值列表。 */
|
|
4
|
+
value: number[];
|
|
5
|
+
}
|
|
6
|
+
/** float 类型数组包装消息。 */
|
|
7
|
+
export interface FloatValues {
|
|
8
|
+
/** 值列表。 */
|
|
9
|
+
value: number[];
|
|
10
|
+
}
|
|
11
|
+
/** int64 类型数组包装消息。 */
|
|
12
|
+
export interface Int64Values {
|
|
13
|
+
/** 值列表。 */
|
|
14
|
+
value: number[];
|
|
15
|
+
}
|
|
16
|
+
/** uint64 类型数组包装消息。 */
|
|
17
|
+
export interface UInt64Values {
|
|
18
|
+
/** 值列表。 */
|
|
19
|
+
value: number[];
|
|
20
|
+
}
|
|
21
|
+
/** int32 类型数组包装消息。 */
|
|
22
|
+
export interface Int32Values {
|
|
23
|
+
/** 值列表。 */
|
|
24
|
+
value: number[];
|
|
25
|
+
}
|
|
26
|
+
/** uint32 类型数组包装消息。 */
|
|
27
|
+
export interface UInt32Values {
|
|
28
|
+
/** 值列表。 */
|
|
29
|
+
value: number[];
|
|
30
|
+
}
|
|
31
|
+
/** bool 类型数组包装消息。 */
|
|
32
|
+
export interface BoolValues {
|
|
33
|
+
/** 值列表。 */
|
|
34
|
+
value: boolean[];
|
|
35
|
+
}
|
|
36
|
+
/** string 类型数组包装消息。 */
|
|
37
|
+
export interface StringValues {
|
|
38
|
+
/** 值列表。 */
|
|
39
|
+
value: string[];
|
|
40
|
+
}
|
|
41
|
+
/** bytes 类型数组包装消息。 */
|
|
42
|
+
export interface BytesValues {
|
|
43
|
+
/** 值列表。 */
|
|
44
|
+
value: Uint8Array[];
|
|
45
|
+
}
|
|
46
|
+
/** 敏感字段密文,密码与各类密钥字段统一使用。 */
|
|
47
|
+
export interface SecretCrypto {
|
|
48
|
+
/** 临时密钥ID */
|
|
49
|
+
key_id: string;
|
|
50
|
+
/** 随机值 */
|
|
51
|
+
nonce: string;
|
|
52
|
+
/** 加密算法 */
|
|
53
|
+
algorithm: string;
|
|
54
|
+
/** 加密后的对称密钥 */
|
|
55
|
+
encrypted_key: string;
|
|
56
|
+
/** 初始化向量 */
|
|
57
|
+
iv: string;
|
|
58
|
+
/** 传输时为密文,服务端解密后回填明文 */
|
|
59
|
+
text: string;
|
|
60
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** 流式放置只修改栅格坐标,浅拷贝卡片以支持响应式查询快照。 */
|
|
2
|
+
export function flowPlace(charts, columns) {
|
|
3
|
+
if (!Number.isInteger(columns) ||
|
|
4
|
+
columns < 1 ||
|
|
5
|
+
charts.some(item => !Number.isInteger(item.w) ||
|
|
6
|
+
!Number.isInteger(item.h) ||
|
|
7
|
+
(item.w ?? 6) < 1 ||
|
|
8
|
+
(item.w ?? 6) > columns ||
|
|
9
|
+
(item.h ?? 4) < 1))
|
|
10
|
+
throw new Error("卡片栅格尺寸无效");
|
|
11
|
+
const placed = charts.map(item => ({ ...item }));
|
|
12
|
+
const occupied = new Set();
|
|
13
|
+
const mark = (c) => {
|
|
14
|
+
const w = c.w ?? 6;
|
|
15
|
+
const h = c.h ?? 4;
|
|
16
|
+
for (let dx = 0; dx < w; dx++) {
|
|
17
|
+
for (let dy = 0; dy < h; dy++)
|
|
18
|
+
occupied.add(`${(c.x ?? 0) + dx},${(c.y ?? 0) + dy}`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
placed.forEach(c => {
|
|
22
|
+
if (c.x !== undefined && c.y !== undefined) {
|
|
23
|
+
mark(c);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
for (const c of placed) {
|
|
27
|
+
if (c.x !== undefined && c.y !== undefined)
|
|
28
|
+
continue;
|
|
29
|
+
const w = c.w ?? 6;
|
|
30
|
+
const h = c.h ?? 4;
|
|
31
|
+
let found = false;
|
|
32
|
+
for (let y = 0; !found; y++) {
|
|
33
|
+
for (let x = 0; x + w <= columns; x++) {
|
|
34
|
+
let free = true;
|
|
35
|
+
for (let dx = 0; dx < w && free; dx++) {
|
|
36
|
+
for (let dy = 0; dy < h && free; dy++) {
|
|
37
|
+
if (occupied.has(`${x + dx},${y + dy}`))
|
|
38
|
+
free = false;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (free) {
|
|
42
|
+
c.x = x;
|
|
43
|
+
c.y = y;
|
|
44
|
+
mark(c);
|
|
45
|
+
found = true;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return placed;
|
|
52
|
+
}
|