ronds-metadata 1.3.90 → 1.3.91
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 +25 -25
- package/es/api/index.d.ts +11 -1
- package/es/api/index.js +202 -47
- package/es/comps/Chart/bar/index.d.ts +8 -0
- package/es/comps/Chart/bar/index.js +136 -0
- package/es/comps/Chart/constants.d.ts +7 -0
- package/es/comps/Chart/constants.js +8 -0
- package/es/comps/Chart/index.d.ts +9 -0
- package/es/comps/Chart/index.js +31 -0
- package/es/comps/Chart/line/index.d.ts +8 -0
- package/es/comps/Chart/line/index.js +163 -0
- package/es/comps/Chart/pie/index.d.ts +8 -0
- package/es/comps/Chart/pie/index.js +67 -0
- package/es/comps/Chart/type.d.ts +19 -0
- package/es/comps/Chart/type.js +1 -0
- package/es/comps/Chart/utils.d.ts +1 -0
- package/es/comps/Chart/utils.js +19 -0
- package/es/comps/CodeEdit/index.d.ts +5 -2
- package/es/comps/CodeEdit/index.js +42 -91
- package/es/comps/CodeEdit/index.less +6 -6
- package/es/comps/CodeEdit/utils.d.ts +2 -0
- package/es/comps/CodeEdit/utils.js +173 -0
- package/es/comps/CodeEditor/config.d.ts +27 -0
- package/es/comps/CodeEditor/config.js +64 -0
- package/es/comps/CodeEditor/index.d.ts +42 -0
- package/es/comps/CodeEditor/index.js +320 -0
- package/es/comps/CodeEditor/index.less +3 -0
- package/es/comps/CodeEditor/suggestions/constants/cassandra.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/cassandra.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/clickhouse.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/clickhouse.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/dm.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/dm.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/index.d.ts +33 -0
- package/es/comps/CodeEditor/suggestions/constants/index.js +19 -0
- package/es/comps/CodeEditor/suggestions/constants/pgsql.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/pgsql.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/redis.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/redis.js +6 -0
- package/es/comps/CodeEditor/suggestions/constants/sqlserver.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/constants/sqlserver.js +6 -0
- package/es/comps/CodeEditor/suggestions/register/database.d.ts +8 -0
- package/es/comps/CodeEditor/suggestions/register/database.js +61 -0
- package/es/comps/CodeEditor/suggestions/register/field.d.ts +10 -0
- package/es/comps/CodeEditor/suggestions/register/field.js +144 -0
- package/es/comps/CodeEditor/suggestions/register/index.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/register/index.js +7 -0
- package/es/comps/CodeEditor/suggestions/register/keyword.d.ts +6 -0
- package/es/comps/CodeEditor/suggestions/register/keyword.js +79 -0
- package/es/comps/CodeEditor/suggestions/register/prompt.d.ts +5 -0
- package/es/comps/CodeEditor/suggestions/register/prompt.js +40 -0
- package/es/comps/CodeEditor/suggestions/register/schema.d.ts +7 -0
- package/es/comps/CodeEditor/suggestions/register/schema.js +85 -0
- package/es/comps/CodeEditor/suggestions/register/table.d.ts +14 -0
- package/es/comps/CodeEditor/suggestions/register/table.js +173 -0
- package/es/comps/CodeEditor/utils.d.ts +13 -0
- package/es/comps/CodeEditor/utils.js +69 -0
- package/es/comps/DataMine/Line.js +0 -1
- package/es/comps/DraggableDiv/index.d.ts +9 -0
- package/es/comps/DraggableDiv/index.js +139 -0
- package/es/comps/DraggableDiv/index.less +45 -0
- package/es/comps/DynamicPorts/comps/ContextMenu.less +8 -8
- package/es/comps/DynamicPorts/comps/DragNode.js +1 -1
- package/es/comps/DynamicPorts/comps/GraphHandler/index.less +39 -39
- package/es/comps/DynamicPorts/comps/NodeElementAlgo.d.ts +6 -0
- package/es/comps/DynamicPorts/comps/NodeElementAlgo.js +76 -0
- package/es/comps/DynamicPorts/comps/NodeElementConfig.d.ts +6 -0
- package/es/comps/DynamicPorts/comps/NodeElementConfig.js +73 -0
- package/es/comps/DynamicPorts/comps/NodeElementRead.d.ts +6 -0
- package/es/comps/DynamicPorts/comps/NodeElementRead.js +76 -0
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.less +5 -5
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.less +40 -40
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +1 -1
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.less +42 -42
- package/es/comps/DynamicPorts/comps/shape/connector.js +12 -2
- package/es/comps/DynamicPorts/comps/shape/edge.d.ts +2 -0
- package/es/comps/DynamicPorts/comps/shape/edge.js +30 -3
- package/es/comps/DynamicPorts/comps/shape/edge.less +8 -8
- package/es/comps/DynamicPorts/comps/shape/node.d.ts +15 -0
- package/es/comps/DynamicPorts/comps/shape/node.js +293 -5
- package/es/comps/DynamicPorts/constant/index.d.ts +2 -0
- package/es/comps/DynamicPorts/constant/index.js +3 -1
- package/es/comps/DynamicPorts/graph.d.ts +2 -2
- package/es/comps/DynamicPorts/graph.js +63 -38
- package/es/comps/DynamicPorts/index.d.ts +1 -1
- package/es/comps/DynamicPorts/index.js +1 -1
- package/es/comps/DynamicPorts/index.less +304 -3
- package/es/comps/DynamicPorts/interface.d.ts +7 -0
- package/es/comps/DynamicPorts/interface.js +1 -1
- package/es/comps/DynamicPorts/utils.d.ts +4 -0
- package/es/comps/DynamicPorts/utils.js +13 -2
- package/es/comps/Editable/DataCell/ButtonCell.js +28 -2
- package/es/comps/Editable/comps/EditableAction.d.ts +1 -0
- package/es/comps/Editable/comps/EditableAction.js +2 -1
- package/es/comps/Editable/comps/EditableRow.js +3 -2
- package/es/comps/Editable/comps/Texty.js +1 -2
- package/es/comps/Editable/comps/Texty.less +43 -43
- package/es/comps/Editable/comps/index.less +38 -38
- package/es/comps/Editable/index.d.ts +19 -0
- package/es/comps/Editable/index.js +15 -6
- package/es/comps/Editable/index.less +97 -97
- package/es/comps/Editable/interface.d.ts +1 -0
- package/es/comps/FileView/index.js +2 -2
- package/es/comps/FormGenerator/comps/Canvas/Preview.js +2 -1
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/CassandraDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/CassandraDs.js +258 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/KafkaDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/KafkaDs.js +203 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/MinioDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/MinioDs.js +203 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/PostgreSqlDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/PostgreSqlDs.js +313 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/RedisDs.d.ts +3 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/RedisDs.js +203 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +11 -1
- package/es/comps/FormGenerator/comps/Canvas/core/index.less +53 -0
- package/es/comps/FormGenerator/comps/Canvas/index.js +1 -1
- package/es/comps/FormGenerator/comps/Sidebar/index.js +3 -2
- package/es/comps/FormGenerator/comps/Sidebar/index.less +21 -21
- package/es/comps/FormGenerator/index.less +20 -20
- package/es/comps/FormGenerator/settings/index.d.ts +131 -8
- package/es/comps/FormGenerator/settings/index.js +41 -1
- package/es/comps/FormGenerator/settings/ruleConfig.d.ts +49 -0
- package/es/comps/FormGenerator/settings/ruleConfig.js +49 -0
- package/es/comps/FormGenerator/transformer.js +33 -7
- package/es/comps/JsonEdit/index.js +0 -1
- package/es/comps/JsonEdit/index.less +64 -64
- package/es/comps/JsonView/index.less +41 -41
- package/es/comps/MdEdit/index.less +6 -6
- package/es/comps/MdEditPro/index.less +166 -166
- package/es/comps/MdNavbar/index.less +1 -1
- package/es/comps/MdView/index.less +3 -3
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +5 -5
- package/es/comps/MetadataEdit/constant/index.js +0 -2
- package/es/comps/MetadataEdit/index.js +3 -3
- package/es/comps/MetadataEdit/index.less +10 -10
- package/es/comps/MetadataEdit/type.d.ts +20 -20
- package/es/comps/MetadataForm/DataCell/Array.js +14 -2
- package/es/comps/MetadataForm/DataCell/Input.js +65 -8
- package/es/comps/MetadataForm/DataCell/Ref.js +6 -6
- package/es/comps/MetadataForm/DataCell/Select.js +72 -31
- package/es/comps/MetadataForm/DataCell/business/config.d.ts +32 -36
- package/es/comps/MetadataForm/DataCell/business/config.js +74 -67
- package/es/comps/MetadataForm/DataCell/business/index.js +44 -1
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +7 -7
- package/es/comps/MetadataForm/DataCell/plugin/ButtonSelect.d.ts +12 -0
- package/es/comps/MetadataForm/DataCell/plugin/ButtonSelect.js +68 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.d.ts +9 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.js +163 -90
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DataLake.d.ts +20 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DataLake.js +255 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DatasourceType.d.ts +17 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/DatasourceType.js +133 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/ExtraAttr.d.ts +10 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/ExtraAttr.js +65 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.d.ts +11 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.js +146 -60
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Minio.d.ts +18 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Minio.js +92 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.d.ts +13 -3
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.js +206 -124
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Redis.d.ts +18 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Redis.js +92 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.d.ts +10 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.js +207 -122
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/hooks.d.ts +2 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/hooks.js +39 -16
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/index.js +359 -164
- package/es/comps/MetadataForm/DataCell/plugin/MappingTable.d.ts +12 -0
- package/es/comps/MetadataForm/DataCell/plugin/MappingTable.js +289 -0
- package/es/comps/MetadataForm/DataCell/plugin/RefreshSelect.js +17 -15
- package/es/comps/MetadataForm/DataCell/plugin/RunFrequency.d.ts +7 -0
- package/es/comps/MetadataForm/DataCell/plugin/RunFrequency.js +395 -0
- package/es/comps/MetadataForm/DataCell/plugin/RunStopSetting.d.ts +7 -0
- package/es/comps/MetadataForm/DataCell/plugin/RunStopSetting.js +238 -0
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.d.ts +4 -1
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +94 -81
- package/es/comps/MetadataForm/HOC/index.js +4 -4
- package/es/comps/MetadataForm/HOC/index.less +17 -6
- package/es/comps/MetadataForm/constants.d.ts +4 -0
- package/es/comps/MetadataForm/constants.js +6 -2
- package/es/comps/MetadataForm/hooks/index.js +5 -5
- package/es/comps/MetadataForm/index.d.ts +12 -0
- package/es/comps/MetadataForm/index.js +59 -3
- package/es/comps/MetadataForm/index.less +32 -29
- package/es/comps/MetadataForm/interface.d.ts +6 -0
- package/es/comps/MetadataForm/interface.js +2 -1
- package/es/comps/MetadataForm/utils.d.ts +2 -0
- package/es/comps/MetadataForm/utils.js +45 -9
- package/es/comps/Split/index.less +29 -29
- package/es/comps/VideoPlayer/index.d.ts +3 -0
- package/es/comps/VideoPlayer/index.js +14 -0
- package/es/comps/VideoPlayer/index.less +9 -0
- package/es/framework/canvas/EventBus.d.ts +21 -0
- package/es/framework/canvas/EventBus.js +66 -0
- package/es/framework/canvas/ImageLoadPool.d.ts +24 -0
- package/es/framework/canvas/ImageLoadPool.js +197 -0
- package/es/framework/canvas/index.d.ts +409 -0
- package/es/framework/canvas/index.js +2639 -0
- package/es/framework/canvas/shape/Circle.d.ts +7 -0
- package/es/framework/canvas/shape/Circle.js +35 -0
- package/es/framework/canvas/shape/Dot.d.ts +7 -0
- package/es/framework/canvas/shape/Dot.js +30 -0
- package/es/framework/canvas/shape/Grid.d.ts +12 -0
- package/es/framework/canvas/shape/Grid.js +82 -0
- package/es/framework/canvas/shape/Line.d.ts +6 -0
- package/es/framework/canvas/shape/Line.js +29 -0
- package/es/framework/canvas/shape/Polygon.d.ts +6 -0
- package/es/framework/canvas/shape/Polygon.js +24 -0
- package/es/framework/canvas/shape/Rect.d.ts +6 -0
- package/es/framework/canvas/shape/Rect.js +37 -0
- package/es/framework/canvas/shape/Shape.d.ts +42 -0
- package/es/framework/canvas/shape/Shape.js +49 -0
- package/es/framework/canvas/type.d.ts +17 -0
- package/es/framework/canvas/type.js +1 -0
- package/es/framework/graph/index.js +4 -4
- package/es/framework/graph/index.less +15 -15
- package/es/framework/http/index.js +8 -8
- package/es/framework/http/msgpack5/lib/helpers.js +0 -1
- package/es/framework/jsonQl/index.js +22 -22
- package/es/framework/libs/iconfont/iconfont.css +171 -3
- package/es/framework/libs/iconfont/iconfont.json +294 -0
- package/es/framework/libs/iconfont/iconfont.ttf +0 -0
- package/es/framework/libs/iconfont/iconfont.woff +0 -0
- package/es/framework/libs/iconfont/iconfont.woff2 +0 -0
- package/es/framework/libs/jquery.min.js +5 -5
- package/es/framework/metadata/MetadataService.d.ts +7 -0
- package/es/framework/metadata/MetadataService.js +124 -29
- package/es/framework/metadata/types.d.ts +14 -1
- package/es/framework/proto/index.d.ts +18 -0
- package/es/framework/proto/index.js +85 -1
- package/es/framework/rxjs-hooks/useMemoReplaySubject.d.ts +3 -0
- package/es/framework/rxjs-hooks/useMemoReplaySubject.js +49 -0
- package/es/framework/wave/index.d.ts +217 -0
- package/es/framework/wave/index.js +1448 -0
- package/es/framework/wave/type.d.ts +143 -0
- package/es/framework/wave/type.js +1 -0
- package/es/index.d.ts +10 -1
- package/es/index.js +13 -2
- package/es/theme.less +2 -0
- package/es/utils.js +1 -1
- package/package.json +122 -117
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.d.ts +0 -8
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.js +0 -306
package/README.md
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
# ronds-metadata
|
|
2
|
-
|
|
3
|
-
# 使用前准备
|
|
4
|
-
|
|
5
|
-
在使用之前,推荐学习[容知的元数据规则](http://172.16.0.8:5000/oo/r/634418027609242111)
|
|
6
|
-
|
|
7
|
-
# 安装及使用
|
|
8
|
-
|
|
9
|
-
## 安装
|
|
10
|
-
|
|
11
|
-
```
|
|
12
|
-
yarn add ronds-metadata
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## 使用
|
|
16
|
-
|
|
17
|
-
### 引入所需组件
|
|
18
|
-
|
|
19
|
-
在代码中 import 需要的组件并按照文档说明使用
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
import { MetadataFrom, MetadataEdit, JsonView, JsonEdit } from 'ronds-metadata';
|
|
23
|
-
|
|
24
|
-
import { JsonMetadataProvider } from 'ronds-metadata/es/framework/metadata/index';
|
|
25
|
-
```
|
|
1
|
+
# ronds-metadata
|
|
2
|
+
|
|
3
|
+
# 使用前准备
|
|
4
|
+
|
|
5
|
+
在使用之前,推荐学习[容知的元数据规则](http://172.16.0.8:5000/oo/r/634418027609242111)
|
|
6
|
+
|
|
7
|
+
# 安装及使用
|
|
8
|
+
|
|
9
|
+
## 安装
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
yarn add ronds-metadata
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## 使用
|
|
16
|
+
|
|
17
|
+
### 引入所需组件
|
|
18
|
+
|
|
19
|
+
在代码中 import 需要的组件并按照文档说明使用
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
import { MetadataFrom, MetadataEdit, JsonView, JsonEdit } from 'ronds-metadata';
|
|
23
|
+
|
|
24
|
+
import { JsonMetadataProvider } from 'ronds-metadata/es/framework/metadata/index';
|
|
25
|
+
```
|
package/es/api/index.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export default class Api implements IAPI {
|
|
|
16
16
|
SaveMetadata(data: any, metadataTag: string): Promise<any>;
|
|
17
17
|
GetMetadataObjList(data: any): Promise<any>;
|
|
18
18
|
GetEnumDataByUrl(url: string, method: 'get' | 'post', body?: any): Promise<any>;
|
|
19
|
+
GetTableColumn(namespace: string, sql: string): Promise<any>;
|
|
20
|
+
GetPbMetaData(data: any): Promise<any>;
|
|
19
21
|
GetGraphStatus(data: any): Promise<{
|
|
20
22
|
data: {
|
|
21
23
|
statusList: any[];
|
|
@@ -25,5 +27,13 @@ export default class Api implements IAPI {
|
|
|
25
27
|
StopGraphRun(data: any): Promise<{
|
|
26
28
|
success: boolean;
|
|
27
29
|
}>;
|
|
28
|
-
|
|
30
|
+
getAllFieldFromTable(data: any): Promise<{
|
|
31
|
+
name: string;
|
|
32
|
+
belong: string;
|
|
33
|
+
}[]>;
|
|
34
|
+
getAllTableFromSchema(data: any): Promise<{
|
|
35
|
+
name: string;
|
|
36
|
+
belong: string;
|
|
37
|
+
}[]>;
|
|
38
|
+
getSubdirFromNs(namespace: string): Promise<void>;
|
|
29
39
|
}
|
package/es/api/index.js
CHANGED
|
@@ -5,12 +5,12 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
5
5
|
/*
|
|
6
6
|
* @Author:wangxian
|
|
7
7
|
* @Date: 2021-09-18 14:15:04
|
|
8
|
-
* @LastEditTime:
|
|
8
|
+
* @LastEditTime: 2026-04-13 11:32:41
|
|
9
9
|
*/
|
|
10
10
|
import { guid, md5 } from '../utils';
|
|
11
11
|
import { addInterceptor, HttpHelper } from '../framework/http';
|
|
12
12
|
var http = new HttpHelper();
|
|
13
|
-
var token = 'Bearer
|
|
13
|
+
var token = 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IjM5MjczQkE4OTczNkVFQUFFMjk5QTcwQTEzREFGRkUxIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3NzYwNDcyMDYsImV4cCI6MTc3NjMwNjQwNiwiaXNzIjoiaHR0cDovL2ZhYmlvOjk5OTkvc3VwZXJjYXJlY29yZSIsImF1ZCI6ImVwbSIsImNsaWVudF9pZCI6ImVwbSIsInN1YiI6IjNhMTIxZDJiLWYwZDUtZDQ3OC0xN2Q3LWQwODEwZDgzZDViMSIsImF1dGhfdGltZSI6MTc3NjA0NzIwNiwiaWRwIjoibG9jYWwiLCJuYW1lIjoicGhtIiwiZW1haWwiOiJwaG1AYWJwLmlvIiwicm9sZSI6WyJhZG1pbiIsInBobV9hZG1pbiJdLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9naXZlbm5hbWUiOiJwaG3ov5Dnu7TotKblj7ciLCJwaG9uZV9udW1iZXIiOiIxMzYwMDAwMDAwMCIsInBob25lX251bWJlcl92ZXJpZmllZCI6IlRydWUiLCJlbWFpbF92ZXJpZmllZCI6IlRydWUiLCJpYXQiOjE3NzYwNDcyMDYsInNjb3BlIjpbImFkZHJlc3MiLCJlbWFpbCIsImVwbSIsIm9wZW5pZCIsInBob25lIiwicHJvZmlsZSIsInJvbGUiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIl19.tp5VbexSKzxpdqzW2YTcDtFuGPicGUBvDM8S6xClfvFzPfvYylNvq6QiEDSUk27Qo0L7mY-vaYPB8WRcnaX0kMPX9OKjLyPqyxZcQ9fiRM4IazM4S-Vawxu80B3v0Y-pWPwcW_YEDUIoq9t_5tqpLkm0WdGA2mRmTq99mvrpjy8EQ5Q0IWzSyhs7JDN2k-zm9DajOO-2JSbQanqvimeaMFiu1ubSQRmZ139u0IhZr4AlKncHB53qE-NOHWvc4xZWjXsGyHQRc0sc9KN0hIpGmYQCrrNF_Q_TfJk29S1FJW4WA5DKvJPneQ9QR7ujbulsgC_ZpLZzrikb-7lxfZn9EQ';
|
|
14
14
|
addInterceptor(function (httpClient) {
|
|
15
15
|
httpClient.interceptors.request.use(function (_config) {
|
|
16
16
|
if (!_config.headers) {
|
|
@@ -35,14 +35,14 @@ var Api = /*#__PURE__*/function () {
|
|
|
35
35
|
}
|
|
36
36
|
_createClass(Api, [{
|
|
37
37
|
key: "GetMetadataList",
|
|
38
|
-
value:
|
|
38
|
+
value: (
|
|
39
39
|
/**
|
|
40
40
|
* 获取元数据列表
|
|
41
41
|
* @param keyWords
|
|
42
42
|
* @returns
|
|
43
43
|
*/
|
|
44
44
|
function () {
|
|
45
|
-
var _GetMetadataList = _asyncToGenerator(
|
|
45
|
+
var _GetMetadataList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(keyWords) {
|
|
46
46
|
var _res$data;
|
|
47
47
|
var param, url, res;
|
|
48
48
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -81,10 +81,11 @@ var Api = /*#__PURE__*/function () {
|
|
|
81
81
|
* @param metadataId
|
|
82
82
|
* @returns
|
|
83
83
|
*/
|
|
84
|
+
)
|
|
84
85
|
}, {
|
|
85
86
|
key: "GetMetadataDetailById",
|
|
86
|
-
value: function () {
|
|
87
|
-
var _GetMetadataDetailById = _asyncToGenerator(
|
|
87
|
+
value: (function () {
|
|
88
|
+
var _GetMetadataDetailById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(metadataId) {
|
|
88
89
|
var url, res;
|
|
89
90
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
90
91
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -105,11 +106,11 @@ var Api = /*#__PURE__*/function () {
|
|
|
105
106
|
return _GetMetadataDetailById.apply(this, arguments);
|
|
106
107
|
}
|
|
107
108
|
return GetMetadataDetailById;
|
|
108
|
-
}() /** 添加元数据 */
|
|
109
|
+
}() /** 添加元数据 */)
|
|
109
110
|
}, {
|
|
110
111
|
key: "SaveMetadata",
|
|
111
|
-
value: function () {
|
|
112
|
-
var _SaveMetadata = _asyncToGenerator(
|
|
112
|
+
value: (function () {
|
|
113
|
+
var _SaveMetadata = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data, metadataTag) {
|
|
113
114
|
var param, url, res;
|
|
114
115
|
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
|
115
116
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -137,10 +138,11 @@ var Api = /*#__PURE__*/function () {
|
|
|
137
138
|
}
|
|
138
139
|
return SaveMetadata;
|
|
139
140
|
}() // 获取元数据的值
|
|
141
|
+
)
|
|
140
142
|
}, {
|
|
141
143
|
key: "GetMetadataObjList",
|
|
142
144
|
value: function () {
|
|
143
|
-
var _GetMetadataObjList = _asyncToGenerator(
|
|
145
|
+
var _GetMetadataObjList = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
|
|
144
146
|
var url, res;
|
|
145
147
|
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
|
146
148
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -165,7 +167,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
165
167
|
}, {
|
|
166
168
|
key: "GetEnumDataByUrl",
|
|
167
169
|
value: function () {
|
|
168
|
-
var _GetEnumDataByUrl = _asyncToGenerator(
|
|
170
|
+
var _GetEnumDataByUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url, method, body) {
|
|
169
171
|
var res, _res;
|
|
170
172
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
171
173
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -195,14 +197,67 @@ var Api = /*#__PURE__*/function () {
|
|
|
195
197
|
return _GetEnumDataByUrl.apply(this, arguments);
|
|
196
198
|
}
|
|
197
199
|
return GetEnumDataByUrl;
|
|
200
|
+
}() // 获取表字段定义
|
|
201
|
+
}, {
|
|
202
|
+
key: "GetTableColumn",
|
|
203
|
+
value: function () {
|
|
204
|
+
var _GetTableColumn = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(namespace, sql) {
|
|
205
|
+
var url, res;
|
|
206
|
+
return _regeneratorRuntime.wrap(function _callee6$(_context6) {
|
|
207
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
208
|
+
case 0:
|
|
209
|
+
url = "/dataset-web/source/columns";
|
|
210
|
+
_context6.next = 3;
|
|
211
|
+
return http.post(url, {
|
|
212
|
+
namespace: namespace,
|
|
213
|
+
sql: sql && Buffer.from(sql).toString('base64')
|
|
214
|
+
});
|
|
215
|
+
case 3:
|
|
216
|
+
res = _context6.sent;
|
|
217
|
+
return _context6.abrupt("return", res.data);
|
|
218
|
+
case 5:
|
|
219
|
+
case "end":
|
|
220
|
+
return _context6.stop();
|
|
221
|
+
}
|
|
222
|
+
}, _callee6);
|
|
223
|
+
}));
|
|
224
|
+
function GetTableColumn(_x9, _x0) {
|
|
225
|
+
return _GetTableColumn.apply(this, arguments);
|
|
226
|
+
}
|
|
227
|
+
return GetTableColumn;
|
|
228
|
+
}() // 获取Kafka的pb信息
|
|
229
|
+
}, {
|
|
230
|
+
key: "GetPbMetaData",
|
|
231
|
+
value: function () {
|
|
232
|
+
var _GetPbMetaData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
|
|
233
|
+
var url, res;
|
|
234
|
+
return _regeneratorRuntime.wrap(function _callee7$(_context7) {
|
|
235
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
236
|
+
case 0:
|
|
237
|
+
url = "/dataset-web/source/kafka/protobuf/info";
|
|
238
|
+
_context7.next = 3;
|
|
239
|
+
return http.post(url, data);
|
|
240
|
+
case 3:
|
|
241
|
+
res = _context7.sent;
|
|
242
|
+
return _context7.abrupt("return", res.data);
|
|
243
|
+
case 5:
|
|
244
|
+
case "end":
|
|
245
|
+
return _context7.stop();
|
|
246
|
+
}
|
|
247
|
+
}, _callee7);
|
|
248
|
+
}));
|
|
249
|
+
function GetPbMetaData(_x1) {
|
|
250
|
+
return _GetPbMetaData.apply(this, arguments);
|
|
251
|
+
}
|
|
252
|
+
return GetPbMetaData;
|
|
198
253
|
}() // 获取元数据的值
|
|
199
254
|
}, {
|
|
200
255
|
key: "GetGraphStatus",
|
|
201
256
|
value: function () {
|
|
202
|
-
var _GetGraphStatus = _asyncToGenerator(
|
|
257
|
+
var _GetGraphStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
|
|
203
258
|
var nodes, _execInfo, i, obj;
|
|
204
|
-
return _regeneratorRuntime.wrap(function
|
|
205
|
-
while (1) switch (
|
|
259
|
+
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
260
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
206
261
|
case 0:
|
|
207
262
|
idx++;
|
|
208
263
|
nodes = data.nodes;
|
|
@@ -214,7 +269,7 @@ var Api = /*#__PURE__*/function () {
|
|
|
214
269
|
};
|
|
215
270
|
_execInfo.push(obj);
|
|
216
271
|
}
|
|
217
|
-
return
|
|
272
|
+
return _context8.abrupt("return", {
|
|
218
273
|
data: {
|
|
219
274
|
statusList: _execInfo,
|
|
220
275
|
status: idx === 2 ? 0 : 1
|
|
@@ -222,11 +277,11 @@ var Api = /*#__PURE__*/function () {
|
|
|
222
277
|
});
|
|
223
278
|
case 5:
|
|
224
279
|
case "end":
|
|
225
|
-
return
|
|
280
|
+
return _context8.stop();
|
|
226
281
|
}
|
|
227
|
-
},
|
|
282
|
+
}, _callee8);
|
|
228
283
|
}));
|
|
229
|
-
function GetGraphStatus(
|
|
284
|
+
function GetGraphStatus(_x10) {
|
|
230
285
|
return _GetGraphStatus.apply(this, arguments);
|
|
231
286
|
}
|
|
232
287
|
return GetGraphStatus;
|
|
@@ -234,54 +289,154 @@ var Api = /*#__PURE__*/function () {
|
|
|
234
289
|
}, {
|
|
235
290
|
key: "StopGraphRun",
|
|
236
291
|
value: function () {
|
|
237
|
-
var _StopGraphRun = _asyncToGenerator(
|
|
238
|
-
return _regeneratorRuntime.wrap(function
|
|
239
|
-
while (1) switch (
|
|
292
|
+
var _StopGraphRun = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(data) {
|
|
293
|
+
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
294
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
240
295
|
case 0:
|
|
241
296
|
idx = 0;
|
|
242
|
-
return
|
|
297
|
+
return _context9.abrupt("return", {
|
|
243
298
|
success: true
|
|
244
299
|
});
|
|
245
300
|
case 2:
|
|
246
301
|
case "end":
|
|
247
|
-
return
|
|
302
|
+
return _context9.stop();
|
|
248
303
|
}
|
|
249
|
-
},
|
|
304
|
+
}, _callee9);
|
|
250
305
|
}));
|
|
251
|
-
function StopGraphRun(
|
|
306
|
+
function StopGraphRun(_x11) {
|
|
252
307
|
return _StopGraphRun.apply(this, arguments);
|
|
253
308
|
}
|
|
254
309
|
return StopGraphRun;
|
|
255
310
|
}() // 通过扩展规则获取枚举类型的值
|
|
256
311
|
}, {
|
|
257
|
-
key: "
|
|
312
|
+
key: "getAllFieldFromTable",
|
|
258
313
|
value: function () {
|
|
259
|
-
var
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
314
|
+
var _getAllFieldFromTable = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee0(data) {
|
|
315
|
+
return _regeneratorRuntime.wrap(function _callee0$(_context0) {
|
|
316
|
+
while (1) switch (_context0.prev = _context0.next) {
|
|
263
317
|
case 0:
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
318
|
+
if (!(data.tableName === 'bussiness_device_image')) {
|
|
319
|
+
_context0.next = 4;
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
return _context0.abrupt("return", [{
|
|
323
|
+
name: 'id',
|
|
324
|
+
belong: 'bussiness_device_image'
|
|
325
|
+
}, {
|
|
326
|
+
name: 'name',
|
|
327
|
+
belong: 'bussiness_device_image'
|
|
328
|
+
}, {
|
|
329
|
+
name: 'age',
|
|
330
|
+
belong: 'bussiness_device_image'
|
|
331
|
+
}]);
|
|
332
|
+
case 4:
|
|
333
|
+
if (!(data.tableName === 'bussiness_device_screenshot')) {
|
|
334
|
+
_context0.next = 8;
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
return _context0.abrupt("return", [{
|
|
338
|
+
name: 'id',
|
|
339
|
+
belong: 'bussiness_device_screenshot'
|
|
340
|
+
}, {
|
|
341
|
+
name: 'url',
|
|
342
|
+
belong: 'bussiness_device_screenshot'
|
|
343
|
+
}, {
|
|
344
|
+
name: 'image',
|
|
345
|
+
belong: 'bussiness_device_screenshot'
|
|
346
|
+
}]);
|
|
347
|
+
case 8:
|
|
348
|
+
if (!(data.tableName === 'kkk')) {
|
|
349
|
+
_context0.next = 10;
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
return _context0.abrupt("return", [{
|
|
353
|
+
name: 'k1',
|
|
354
|
+
belong: 'kkk'
|
|
355
|
+
}, {
|
|
356
|
+
name: 'k2',
|
|
357
|
+
belong: 'kkk'
|
|
358
|
+
}, {
|
|
359
|
+
name: 'k3',
|
|
360
|
+
belong: 'kkk'
|
|
361
|
+
}]);
|
|
362
|
+
case 10:
|
|
363
|
+
return _context0.abrupt("return", []);
|
|
364
|
+
case 11:
|
|
276
365
|
case "end":
|
|
277
|
-
return
|
|
366
|
+
return _context0.stop();
|
|
278
367
|
}
|
|
279
|
-
},
|
|
368
|
+
}, _callee0);
|
|
369
|
+
}));
|
|
370
|
+
function getAllFieldFromTable(_x12) {
|
|
371
|
+
return _getAllFieldFromTable.apply(this, arguments);
|
|
372
|
+
}
|
|
373
|
+
return getAllFieldFromTable;
|
|
374
|
+
}() // 通过扩展规则获取枚举类型的值
|
|
375
|
+
}, {
|
|
376
|
+
key: "getAllTableFromSchema",
|
|
377
|
+
value: function () {
|
|
378
|
+
var _getAllTableFromSchema = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee1(data) {
|
|
379
|
+
return _regeneratorRuntime.wrap(function _callee1$(_context1) {
|
|
380
|
+
while (1) switch (_context1.prev = _context1.next) {
|
|
381
|
+
case 0:
|
|
382
|
+
if (!(data.schemaName === 'auth')) {
|
|
383
|
+
_context1.next = 4;
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
386
|
+
return _context1.abrupt("return", [{
|
|
387
|
+
name: 'table1',
|
|
388
|
+
belong: 'auth'
|
|
389
|
+
}, {
|
|
390
|
+
name: 'table2',
|
|
391
|
+
belong: 'auth'
|
|
392
|
+
}, {
|
|
393
|
+
name: 'table3',
|
|
394
|
+
belong: 'auth'
|
|
395
|
+
}]);
|
|
396
|
+
case 4:
|
|
397
|
+
if (!(data.schemaName === 'public')) {
|
|
398
|
+
_context1.next = 6;
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
return _context1.abrupt("return", [{
|
|
402
|
+
name: 'table4',
|
|
403
|
+
belong: 'public'
|
|
404
|
+
}, {
|
|
405
|
+
name: 'table5',
|
|
406
|
+
belong: 'public'
|
|
407
|
+
}, {
|
|
408
|
+
name: 'table6',
|
|
409
|
+
belong: 'public'
|
|
410
|
+
}]);
|
|
411
|
+
case 6:
|
|
412
|
+
return _context1.abrupt("return", []);
|
|
413
|
+
case 7:
|
|
414
|
+
case "end":
|
|
415
|
+
return _context1.stop();
|
|
416
|
+
}
|
|
417
|
+
}, _callee1);
|
|
418
|
+
}));
|
|
419
|
+
function getAllTableFromSchema(_x13) {
|
|
420
|
+
return _getAllTableFromSchema.apply(this, arguments);
|
|
421
|
+
}
|
|
422
|
+
return getAllTableFromSchema;
|
|
423
|
+
}()
|
|
424
|
+
}, {
|
|
425
|
+
key: "getSubdirFromNs",
|
|
426
|
+
value: function () {
|
|
427
|
+
var _getSubdirFromNs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(namespace) {
|
|
428
|
+
return _regeneratorRuntime.wrap(function _callee10$(_context10) {
|
|
429
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
430
|
+
case 0:
|
|
431
|
+
case "end":
|
|
432
|
+
return _context10.stop();
|
|
433
|
+
}
|
|
434
|
+
}, _callee10);
|
|
280
435
|
}));
|
|
281
|
-
function
|
|
282
|
-
return
|
|
436
|
+
function getSubdirFromNs(_x14) {
|
|
437
|
+
return _getSubdirFromNs.apply(this, arguments);
|
|
283
438
|
}
|
|
284
|
-
return
|
|
439
|
+
return getSubdirFromNs;
|
|
285
440
|
}()
|
|
286
441
|
}]);
|
|
287
442
|
return Api;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import "antd/es/empty/style";
|
|
2
|
+
import _Empty from "antd/es/empty";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
5
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
|
+
/*
|
|
7
|
+
* @Author: wangxian
|
|
8
|
+
* @Date: 2025-01-23 15:29:54
|
|
9
|
+
* @LastEditTime: 2025-01-23 15:59:19
|
|
10
|
+
*/
|
|
11
|
+
import { Column } from '@antv/g2plot';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { transXYData } from '../utils';
|
|
14
|
+
import { tr } from '../../../framework/locale';
|
|
15
|
+
var ColumnChart = function ColumnChart(props) {
|
|
16
|
+
var data = props.data,
|
|
17
|
+
theme = props.theme,
|
|
18
|
+
config = props.config;
|
|
19
|
+
var _React$useState = React.useState(false),
|
|
20
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
21
|
+
isError = _React$useState2[0],
|
|
22
|
+
setIsError = _React$useState2[1];
|
|
23
|
+
var containerRef = React.useRef();
|
|
24
|
+
var chartRef = React.useRef();
|
|
25
|
+
var renderChart = React.useCallback(function () {
|
|
26
|
+
var _config$xFieldLabel, _config$yFieldLabel;
|
|
27
|
+
var _data = transXYData(data);
|
|
28
|
+
var _ylist = _data.map(function (item) {
|
|
29
|
+
return item.y;
|
|
30
|
+
});
|
|
31
|
+
var min = Math.min.apply(Math, _toConsumableArray(_ylist));
|
|
32
|
+
var max = Math.max.apply(Math, _toConsumableArray(_ylist));
|
|
33
|
+
chartRef.current = new Column(containerRef.current, _objectSpread(_objectSpread({}, config), {}, {
|
|
34
|
+
autoFit: true,
|
|
35
|
+
theme: theme,
|
|
36
|
+
data: [],
|
|
37
|
+
isGroup: !!(config === null || config === void 0 ? void 0 : config.group),
|
|
38
|
+
seriesField: (config === null || config === void 0 ? void 0 : config.group) ? 'name' : undefined,
|
|
39
|
+
padding: 'auto',
|
|
40
|
+
color: (config === null || config === void 0 ? void 0 : config.group) ? undefined : config === null || config === void 0 ? void 0 : config.color,
|
|
41
|
+
legend: config === null || config === void 0 ? void 0 : config.legend,
|
|
42
|
+
xField: 'x',
|
|
43
|
+
yField: 'y',
|
|
44
|
+
meta: {
|
|
45
|
+
y: {
|
|
46
|
+
type: 'linear'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
xAxis: {
|
|
50
|
+
title: (config === null || config === void 0 ? void 0 : config.xFieldName) && {
|
|
51
|
+
text: (_config$xFieldLabel = config === null || config === void 0 ? void 0 : config.xFieldLabel) !== null && _config$xFieldLabel !== void 0 ? _config$xFieldLabel : config === null || config === void 0 ? void 0 : config.xFieldName,
|
|
52
|
+
position: 'center'
|
|
53
|
+
},
|
|
54
|
+
label: {
|
|
55
|
+
autoRotate: true,
|
|
56
|
+
style: {
|
|
57
|
+
textAlign: 'center',
|
|
58
|
+
fontSize: 10
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
yAxis: {
|
|
63
|
+
nice: true,
|
|
64
|
+
min: min,
|
|
65
|
+
max: max,
|
|
66
|
+
title: (config === null || config === void 0 ? void 0 : config.yFieldName) && {
|
|
67
|
+
text: (_config$yFieldLabel = config === null || config === void 0 ? void 0 : config.yFieldLabel) !== null && _config$yFieldLabel !== void 0 ? _config$yFieldLabel : config === null || config === void 0 ? void 0 : config.yFieldName,
|
|
68
|
+
position: 'center'
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
annotations: (config === null || config === void 0 ? void 0 : config.targetValue) && [{
|
|
72
|
+
type: 'line',
|
|
73
|
+
start: ['min', config === null || config === void 0 ? void 0 : config.targetValue],
|
|
74
|
+
end: ['max', config === null || config === void 0 ? void 0 : config.targetValue],
|
|
75
|
+
style: {
|
|
76
|
+
stroke: '#ff4d4f',
|
|
77
|
+
lineWidth: 2,
|
|
78
|
+
lineDash: [4, 4]
|
|
79
|
+
},
|
|
80
|
+
text: {
|
|
81
|
+
content: "\u76EE\u6807\u503C: ".concat(config === null || config === void 0 ? void 0 : config.targetValue),
|
|
82
|
+
position: 'end',
|
|
83
|
+
offsetX: -77,
|
|
84
|
+
style: {
|
|
85
|
+
fill: '#ff4d4f',
|
|
86
|
+
fontSize: 12
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}],
|
|
90
|
+
label: (config === null || config === void 0 ? void 0 : config.isShowValue) && {
|
|
91
|
+
position: 'top',
|
|
92
|
+
layout: [{
|
|
93
|
+
type: 'hide-overlap'
|
|
94
|
+
}],
|
|
95
|
+
style: {
|
|
96
|
+
fill: '#666',
|
|
97
|
+
fontSize: 12
|
|
98
|
+
},
|
|
99
|
+
formatter: function formatter(item) {
|
|
100
|
+
return "".concat(item.y);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}));
|
|
104
|
+
chartRef.current.render();
|
|
105
|
+
}, [data, config]);
|
|
106
|
+
React.useEffect(function () {
|
|
107
|
+
if (containerRef.current) {
|
|
108
|
+
renderChart();
|
|
109
|
+
}
|
|
110
|
+
return function () {
|
|
111
|
+
if (chartRef.current) {
|
|
112
|
+
chartRef.current.destroy();
|
|
113
|
+
chartRef.current = undefined;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
}, [data, config]);
|
|
117
|
+
React.useEffect(function () {
|
|
118
|
+
try {
|
|
119
|
+
var _data = transXYData(data);
|
|
120
|
+
chartRef.current.changeData(_data);
|
|
121
|
+
setIsError(false);
|
|
122
|
+
} catch (error) {
|
|
123
|
+
setIsError(true);
|
|
124
|
+
}
|
|
125
|
+
}, [data]);
|
|
126
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, isError ? /*#__PURE__*/React.createElement(_Empty, {
|
|
127
|
+
description: tr('参数有误')
|
|
128
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
129
|
+
ref: containerRef,
|
|
130
|
+
style: {
|
|
131
|
+
width: '100%',
|
|
132
|
+
height: '100%'
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
};
|
|
136
|
+
export default ColumnChart;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IChartConfig, IChartData, IChartType } from './type';
|
|
2
|
+
interface IChartItemProps {
|
|
3
|
+
type: IChartType;
|
|
4
|
+
config?: IChartConfig;
|
|
5
|
+
data: IChartData[];
|
|
6
|
+
refreshKey?: any;
|
|
7
|
+
}
|
|
8
|
+
declare const ChartItem: (props: IChartItemProps) => JSX.Element;
|
|
9
|
+
export default ChartItem;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import "antd/es/empty/style";
|
|
2
|
+
import _Empty from "antd/es/empty";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import LineChart from './line';
|
|
6
|
+
import ColumnChart from './bar';
|
|
7
|
+
import PieChart from './pie';
|
|
8
|
+
import { tr } from '../../framework/locale';
|
|
9
|
+
import { ChartType } from './constants';
|
|
10
|
+
var ChartItem = function ChartItem(props) {
|
|
11
|
+
var type = props.type,
|
|
12
|
+
config = props.config,
|
|
13
|
+
data = props.data,
|
|
14
|
+
refreshKey = props.refreshKey;
|
|
15
|
+
var componentMap = React.useMemo(function () {
|
|
16
|
+
var _ref;
|
|
17
|
+
return _ref = {}, _defineProperty(_ref, ChartType.LINE, LineChart), _defineProperty(_ref, ChartType.BAR, ColumnChart), _defineProperty(_ref, ChartType.PIE, PieChart), _ref;
|
|
18
|
+
}, []);
|
|
19
|
+
var Component = componentMap[type];
|
|
20
|
+
if (!Component) {
|
|
21
|
+
return /*#__PURE__*/React.createElement(_Empty, {
|
|
22
|
+
description: tr('未知类型图谱')
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return /*#__PURE__*/React.createElement(Component, {
|
|
26
|
+
key: refreshKey,
|
|
27
|
+
config: config,
|
|
28
|
+
data: data
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export default ChartItem;
|