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.
Files changed (244) hide show
  1. package/README.md +25 -25
  2. package/es/api/index.d.ts +11 -1
  3. package/es/api/index.js +202 -47
  4. package/es/comps/Chart/bar/index.d.ts +8 -0
  5. package/es/comps/Chart/bar/index.js +136 -0
  6. package/es/comps/Chart/constants.d.ts +7 -0
  7. package/es/comps/Chart/constants.js +8 -0
  8. package/es/comps/Chart/index.d.ts +9 -0
  9. package/es/comps/Chart/index.js +31 -0
  10. package/es/comps/Chart/line/index.d.ts +8 -0
  11. package/es/comps/Chart/line/index.js +163 -0
  12. package/es/comps/Chart/pie/index.d.ts +8 -0
  13. package/es/comps/Chart/pie/index.js +67 -0
  14. package/es/comps/Chart/type.d.ts +19 -0
  15. package/es/comps/Chart/type.js +1 -0
  16. package/es/comps/Chart/utils.d.ts +1 -0
  17. package/es/comps/Chart/utils.js +19 -0
  18. package/es/comps/CodeEdit/index.d.ts +5 -2
  19. package/es/comps/CodeEdit/index.js +42 -91
  20. package/es/comps/CodeEdit/index.less +6 -6
  21. package/es/comps/CodeEdit/utils.d.ts +2 -0
  22. package/es/comps/CodeEdit/utils.js +173 -0
  23. package/es/comps/CodeEditor/config.d.ts +27 -0
  24. package/es/comps/CodeEditor/config.js +64 -0
  25. package/es/comps/CodeEditor/index.d.ts +42 -0
  26. package/es/comps/CodeEditor/index.js +320 -0
  27. package/es/comps/CodeEditor/index.less +3 -0
  28. package/es/comps/CodeEditor/suggestions/constants/cassandra.d.ts +7 -0
  29. package/es/comps/CodeEditor/suggestions/constants/cassandra.js +6 -0
  30. package/es/comps/CodeEditor/suggestions/constants/clickhouse.d.ts +7 -0
  31. package/es/comps/CodeEditor/suggestions/constants/clickhouse.js +6 -0
  32. package/es/comps/CodeEditor/suggestions/constants/dm.d.ts +7 -0
  33. package/es/comps/CodeEditor/suggestions/constants/dm.js +6 -0
  34. package/es/comps/CodeEditor/suggestions/constants/index.d.ts +33 -0
  35. package/es/comps/CodeEditor/suggestions/constants/index.js +19 -0
  36. package/es/comps/CodeEditor/suggestions/constants/pgsql.d.ts +7 -0
  37. package/es/comps/CodeEditor/suggestions/constants/pgsql.js +6 -0
  38. package/es/comps/CodeEditor/suggestions/constants/redis.d.ts +7 -0
  39. package/es/comps/CodeEditor/suggestions/constants/redis.js +6 -0
  40. package/es/comps/CodeEditor/suggestions/constants/sqlserver.d.ts +7 -0
  41. package/es/comps/CodeEditor/suggestions/constants/sqlserver.js +6 -0
  42. package/es/comps/CodeEditor/suggestions/register/database.d.ts +8 -0
  43. package/es/comps/CodeEditor/suggestions/register/database.js +61 -0
  44. package/es/comps/CodeEditor/suggestions/register/field.d.ts +10 -0
  45. package/es/comps/CodeEditor/suggestions/register/field.js +144 -0
  46. package/es/comps/CodeEditor/suggestions/register/index.d.ts +7 -0
  47. package/es/comps/CodeEditor/suggestions/register/index.js +7 -0
  48. package/es/comps/CodeEditor/suggestions/register/keyword.d.ts +6 -0
  49. package/es/comps/CodeEditor/suggestions/register/keyword.js +79 -0
  50. package/es/comps/CodeEditor/suggestions/register/prompt.d.ts +5 -0
  51. package/es/comps/CodeEditor/suggestions/register/prompt.js +40 -0
  52. package/es/comps/CodeEditor/suggestions/register/schema.d.ts +7 -0
  53. package/es/comps/CodeEditor/suggestions/register/schema.js +85 -0
  54. package/es/comps/CodeEditor/suggestions/register/table.d.ts +14 -0
  55. package/es/comps/CodeEditor/suggestions/register/table.js +173 -0
  56. package/es/comps/CodeEditor/utils.d.ts +13 -0
  57. package/es/comps/CodeEditor/utils.js +69 -0
  58. package/es/comps/DataMine/Line.js +0 -1
  59. package/es/comps/DraggableDiv/index.d.ts +9 -0
  60. package/es/comps/DraggableDiv/index.js +139 -0
  61. package/es/comps/DraggableDiv/index.less +45 -0
  62. package/es/comps/DynamicPorts/comps/ContextMenu.less +8 -8
  63. package/es/comps/DynamicPorts/comps/DragNode.js +1 -1
  64. package/es/comps/DynamicPorts/comps/GraphHandler/index.less +39 -39
  65. package/es/comps/DynamicPorts/comps/NodeElementAlgo.d.ts +6 -0
  66. package/es/comps/DynamicPorts/comps/NodeElementAlgo.js +76 -0
  67. package/es/comps/DynamicPorts/comps/NodeElementConfig.d.ts +6 -0
  68. package/es/comps/DynamicPorts/comps/NodeElementConfig.js +73 -0
  69. package/es/comps/DynamicPorts/comps/NodeElementRead.d.ts +6 -0
  70. package/es/comps/DynamicPorts/comps/NodeElementRead.js +76 -0
  71. package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.less +5 -5
  72. package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.less +40 -40
  73. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +1 -1
  74. package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.less +42 -42
  75. package/es/comps/DynamicPorts/comps/shape/connector.js +12 -2
  76. package/es/comps/DynamicPorts/comps/shape/edge.d.ts +2 -0
  77. package/es/comps/DynamicPorts/comps/shape/edge.js +30 -3
  78. package/es/comps/DynamicPorts/comps/shape/edge.less +8 -8
  79. package/es/comps/DynamicPorts/comps/shape/node.d.ts +15 -0
  80. package/es/comps/DynamicPorts/comps/shape/node.js +293 -5
  81. package/es/comps/DynamicPorts/constant/index.d.ts +2 -0
  82. package/es/comps/DynamicPorts/constant/index.js +3 -1
  83. package/es/comps/DynamicPorts/graph.d.ts +2 -2
  84. package/es/comps/DynamicPorts/graph.js +63 -38
  85. package/es/comps/DynamicPorts/index.d.ts +1 -1
  86. package/es/comps/DynamicPorts/index.js +1 -1
  87. package/es/comps/DynamicPorts/index.less +304 -3
  88. package/es/comps/DynamicPorts/interface.d.ts +7 -0
  89. package/es/comps/DynamicPorts/interface.js +1 -1
  90. package/es/comps/DynamicPorts/utils.d.ts +4 -0
  91. package/es/comps/DynamicPorts/utils.js +13 -2
  92. package/es/comps/Editable/DataCell/ButtonCell.js +28 -2
  93. package/es/comps/Editable/comps/EditableAction.d.ts +1 -0
  94. package/es/comps/Editable/comps/EditableAction.js +2 -1
  95. package/es/comps/Editable/comps/EditableRow.js +3 -2
  96. package/es/comps/Editable/comps/Texty.js +1 -2
  97. package/es/comps/Editable/comps/Texty.less +43 -43
  98. package/es/comps/Editable/comps/index.less +38 -38
  99. package/es/comps/Editable/index.d.ts +19 -0
  100. package/es/comps/Editable/index.js +15 -6
  101. package/es/comps/Editable/index.less +97 -97
  102. package/es/comps/Editable/interface.d.ts +1 -0
  103. package/es/comps/FileView/index.js +2 -2
  104. package/es/comps/FormGenerator/comps/Canvas/Preview.js +2 -1
  105. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/CassandraDs.d.ts +3 -0
  106. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/CassandraDs.js +258 -0
  107. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/KafkaDs.d.ts +3 -0
  108. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/KafkaDs.js +203 -0
  109. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/MinioDs.d.ts +3 -0
  110. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/MinioDs.js +203 -0
  111. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/PostgreSqlDs.d.ts +3 -0
  112. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/PostgreSqlDs.js +313 -0
  113. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/RedisDs.d.ts +3 -0
  114. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/datasource/RedisDs.js +203 -0
  115. package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +11 -1
  116. package/es/comps/FormGenerator/comps/Canvas/core/index.less +53 -0
  117. package/es/comps/FormGenerator/comps/Canvas/index.js +1 -1
  118. package/es/comps/FormGenerator/comps/Sidebar/index.js +3 -2
  119. package/es/comps/FormGenerator/comps/Sidebar/index.less +21 -21
  120. package/es/comps/FormGenerator/index.less +20 -20
  121. package/es/comps/FormGenerator/settings/index.d.ts +131 -8
  122. package/es/comps/FormGenerator/settings/index.js +41 -1
  123. package/es/comps/FormGenerator/settings/ruleConfig.d.ts +49 -0
  124. package/es/comps/FormGenerator/settings/ruleConfig.js +49 -0
  125. package/es/comps/FormGenerator/transformer.js +33 -7
  126. package/es/comps/JsonEdit/index.js +0 -1
  127. package/es/comps/JsonEdit/index.less +64 -64
  128. package/es/comps/JsonView/index.less +41 -41
  129. package/es/comps/MdEdit/index.less +6 -6
  130. package/es/comps/MdEditPro/index.less +166 -166
  131. package/es/comps/MdNavbar/index.less +1 -1
  132. package/es/comps/MdView/index.less +3 -3
  133. package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +5 -5
  134. package/es/comps/MetadataEdit/constant/index.js +0 -2
  135. package/es/comps/MetadataEdit/index.js +3 -3
  136. package/es/comps/MetadataEdit/index.less +10 -10
  137. package/es/comps/MetadataEdit/type.d.ts +20 -20
  138. package/es/comps/MetadataForm/DataCell/Array.js +14 -2
  139. package/es/comps/MetadataForm/DataCell/Input.js +65 -8
  140. package/es/comps/MetadataForm/DataCell/Ref.js +6 -6
  141. package/es/comps/MetadataForm/DataCell/Select.js +72 -31
  142. package/es/comps/MetadataForm/DataCell/business/config.d.ts +32 -36
  143. package/es/comps/MetadataForm/DataCell/business/config.js +74 -67
  144. package/es/comps/MetadataForm/DataCell/business/index.js +44 -1
  145. package/es/comps/MetadataForm/DataCell/layout/TableArray.js +7 -7
  146. package/es/comps/MetadataForm/DataCell/plugin/ButtonSelect.d.ts +12 -0
  147. package/es/comps/MetadataForm/DataCell/plugin/ButtonSelect.js +68 -0
  148. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.d.ts +9 -1
  149. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.js +163 -90
  150. package/es/comps/MetadataForm/DataCell/plugin/Datasource/DataLake.d.ts +20 -0
  151. package/es/comps/MetadataForm/DataCell/plugin/Datasource/DataLake.js +255 -0
  152. package/es/comps/MetadataForm/DataCell/plugin/Datasource/DatasourceType.d.ts +17 -0
  153. package/es/comps/MetadataForm/DataCell/plugin/Datasource/DatasourceType.js +133 -0
  154. package/es/comps/MetadataForm/DataCell/plugin/Datasource/ExtraAttr.d.ts +10 -0
  155. package/es/comps/MetadataForm/DataCell/plugin/Datasource/ExtraAttr.js +65 -0
  156. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.d.ts +11 -1
  157. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.js +146 -60
  158. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Minio.d.ts +18 -0
  159. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Minio.js +92 -0
  160. package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.d.ts +13 -3
  161. package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.js +206 -124
  162. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Redis.d.ts +18 -0
  163. package/es/comps/MetadataForm/DataCell/plugin/Datasource/Redis.js +92 -0
  164. package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.d.ts +10 -1
  165. package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.js +207 -122
  166. package/es/comps/MetadataForm/DataCell/plugin/Datasource/hooks.d.ts +2 -1
  167. package/es/comps/MetadataForm/DataCell/plugin/Datasource/hooks.js +39 -16
  168. package/es/comps/MetadataForm/DataCell/plugin/Datasource/index.js +359 -164
  169. package/es/comps/MetadataForm/DataCell/plugin/MappingTable.d.ts +12 -0
  170. package/es/comps/MetadataForm/DataCell/plugin/MappingTable.js +289 -0
  171. package/es/comps/MetadataForm/DataCell/plugin/RefreshSelect.js +17 -15
  172. package/es/comps/MetadataForm/DataCell/plugin/RunFrequency.d.ts +7 -0
  173. package/es/comps/MetadataForm/DataCell/plugin/RunFrequency.js +395 -0
  174. package/es/comps/MetadataForm/DataCell/plugin/RunStopSetting.d.ts +7 -0
  175. package/es/comps/MetadataForm/DataCell/plugin/RunStopSetting.js +238 -0
  176. package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.d.ts +4 -1
  177. package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +94 -81
  178. package/es/comps/MetadataForm/HOC/index.js +4 -4
  179. package/es/comps/MetadataForm/HOC/index.less +17 -6
  180. package/es/comps/MetadataForm/constants.d.ts +4 -0
  181. package/es/comps/MetadataForm/constants.js +6 -2
  182. package/es/comps/MetadataForm/hooks/index.js +5 -5
  183. package/es/comps/MetadataForm/index.d.ts +12 -0
  184. package/es/comps/MetadataForm/index.js +59 -3
  185. package/es/comps/MetadataForm/index.less +32 -29
  186. package/es/comps/MetadataForm/interface.d.ts +6 -0
  187. package/es/comps/MetadataForm/interface.js +2 -1
  188. package/es/comps/MetadataForm/utils.d.ts +2 -0
  189. package/es/comps/MetadataForm/utils.js +45 -9
  190. package/es/comps/Split/index.less +29 -29
  191. package/es/comps/VideoPlayer/index.d.ts +3 -0
  192. package/es/comps/VideoPlayer/index.js +14 -0
  193. package/es/comps/VideoPlayer/index.less +9 -0
  194. package/es/framework/canvas/EventBus.d.ts +21 -0
  195. package/es/framework/canvas/EventBus.js +66 -0
  196. package/es/framework/canvas/ImageLoadPool.d.ts +24 -0
  197. package/es/framework/canvas/ImageLoadPool.js +197 -0
  198. package/es/framework/canvas/index.d.ts +409 -0
  199. package/es/framework/canvas/index.js +2639 -0
  200. package/es/framework/canvas/shape/Circle.d.ts +7 -0
  201. package/es/framework/canvas/shape/Circle.js +35 -0
  202. package/es/framework/canvas/shape/Dot.d.ts +7 -0
  203. package/es/framework/canvas/shape/Dot.js +30 -0
  204. package/es/framework/canvas/shape/Grid.d.ts +12 -0
  205. package/es/framework/canvas/shape/Grid.js +82 -0
  206. package/es/framework/canvas/shape/Line.d.ts +6 -0
  207. package/es/framework/canvas/shape/Line.js +29 -0
  208. package/es/framework/canvas/shape/Polygon.d.ts +6 -0
  209. package/es/framework/canvas/shape/Polygon.js +24 -0
  210. package/es/framework/canvas/shape/Rect.d.ts +6 -0
  211. package/es/framework/canvas/shape/Rect.js +37 -0
  212. package/es/framework/canvas/shape/Shape.d.ts +42 -0
  213. package/es/framework/canvas/shape/Shape.js +49 -0
  214. package/es/framework/canvas/type.d.ts +17 -0
  215. package/es/framework/canvas/type.js +1 -0
  216. package/es/framework/graph/index.js +4 -4
  217. package/es/framework/graph/index.less +15 -15
  218. package/es/framework/http/index.js +8 -8
  219. package/es/framework/http/msgpack5/lib/helpers.js +0 -1
  220. package/es/framework/jsonQl/index.js +22 -22
  221. package/es/framework/libs/iconfont/iconfont.css +171 -3
  222. package/es/framework/libs/iconfont/iconfont.json +294 -0
  223. package/es/framework/libs/iconfont/iconfont.ttf +0 -0
  224. package/es/framework/libs/iconfont/iconfont.woff +0 -0
  225. package/es/framework/libs/iconfont/iconfont.woff2 +0 -0
  226. package/es/framework/libs/jquery.min.js +5 -5
  227. package/es/framework/metadata/MetadataService.d.ts +7 -0
  228. package/es/framework/metadata/MetadataService.js +124 -29
  229. package/es/framework/metadata/types.d.ts +14 -1
  230. package/es/framework/proto/index.d.ts +18 -0
  231. package/es/framework/proto/index.js +85 -1
  232. package/es/framework/rxjs-hooks/useMemoReplaySubject.d.ts +3 -0
  233. package/es/framework/rxjs-hooks/useMemoReplaySubject.js +49 -0
  234. package/es/framework/wave/index.d.ts +217 -0
  235. package/es/framework/wave/index.js +1448 -0
  236. package/es/framework/wave/type.d.ts +143 -0
  237. package/es/framework/wave/type.js +1 -0
  238. package/es/index.d.ts +10 -1
  239. package/es/index.js +13 -2
  240. package/es/theme.less +2 -0
  241. package/es/utils.js +1 -1
  242. package/package.json +122 -117
  243. package/es/comps/MetadataForm/DataCell/plugin/MapTable.d.ts +0 -8
  244. 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
- getKafkaInfo(): Promise<any>;
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: 2024-08-20 11:46:17
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 eyJhbGciOiJSUzI1NiIsImtpZCI6IkMyMTJFMjI1NTcwNjRDQTE3M0U2NjkxRjM4QzFDOEEyIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MjQyMDkyNzMsImV4cCI6MTcyNDQ2ODQ3MywiaXNzIjoiaHR0cDovL2ZhYmlvOjk5OTkvc3VwZXJjYXJlY29yZSIsImF1ZCI6ImVwbSIsImNsaWVudF9pZCI6ImVwbSIsInN1YiI6IjNhMTIxZDJiLWYwZDUtZDQ3OC0xN2Q3LWQwODEwZDgzZDViMSIsImF1dGhfdGltZSI6MTcyNDIwOTI3MiwiaWRwIjoibG9jYWwiLCJuYW1lIjoicGhtIiwiZW1haWwiOiJwaG1AYWJwLmlvIiwicm9sZSI6WyJhZG1pbiIsInBobV9hZG1pbiJdLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9naXZlbm5hbWUiOiJwaG3ov5Dnu7TotKblj7ciLCJwaG9uZV9udW1iZXIiOiIxMzYwMDAwMDAwMCIsInBob25lX251bWJlcl92ZXJpZmllZCI6IlRydWUiLCJlbWFpbF92ZXJpZmllZCI6IlRydWUiLCJpYXQiOjE3MjQyMDkyNzMsInNjb3BlIjpbImFkZHJlc3MiLCJlbWFpbCIsImVwbSIsIm9wZW5pZCIsInBob25lIiwicHJvZmlsZSIsInJvbGUiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIl19.t-AeiGQDr2N4PgLGHI6HRjwhTlSAt7TjtDVQgMBCVJgf31L9lKzuiakfXukTNzeXz0qHTeJOBmJL8Q-Lhlz_Khd-pr4fsaBP6qI8NWcLan1hZPWgms5mbsJukLOIvUVWxZGxJ501yxdQLJIZPwX6CfvXzCWfIeF8SQJ8c4d_zXWrpdJBHfmX8vl4Ut7hOX5IC9Sn79uoe-0-96aI8Ltv07iHdTAJSH3Y4svh_jwEt34-oBmT3daZ0iWvfuNx0QFYGiW6lN-kALIbnEOpphA3mHtwtUpB2RtG6BGCTJZGraT-7Fmboks34y6C1ApJzO221x4-_VZGa5hwwvZttkxzlw';
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( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(keyWords) {
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( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(metadataId) {
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( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(data, metadataTag) {
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( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4(data) {
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( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(url, method, body) {
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( /*#__PURE__*/_regeneratorRuntime.mark(function _callee6(data) {
257
+ var _GetGraphStatus = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(data) {
203
258
  var nodes, _execInfo, i, obj;
204
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
205
- while (1) switch (_context6.prev = _context6.next) {
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 _context6.abrupt("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 _context6.stop();
280
+ return _context8.stop();
226
281
  }
227
- }, _callee6);
282
+ }, _callee8);
228
283
  }));
229
- function GetGraphStatus(_x9) {
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( /*#__PURE__*/_regeneratorRuntime.mark(function _callee7(data) {
238
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
239
- while (1) switch (_context7.prev = _context7.next) {
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 _context7.abrupt("return", {
297
+ return _context9.abrupt("return", {
243
298
  success: true
244
299
  });
245
300
  case 2:
246
301
  case "end":
247
- return _context7.stop();
302
+ return _context9.stop();
248
303
  }
249
- }, _callee7);
304
+ }, _callee9);
250
305
  }));
251
- function StopGraphRun(_x10) {
306
+ function StopGraphRun(_x11) {
252
307
  return _StopGraphRun.apply(this, arguments);
253
308
  }
254
309
  return StopGraphRun;
255
310
  }() // 通过扩展规则获取枚举类型的值
256
311
  }, {
257
- key: "getKafkaInfo",
312
+ key: "getAllFieldFromTable",
258
313
  value: function () {
259
- var _getKafkaInfo = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8() {
260
- var url, res;
261
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
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
- url = '/wx/dataset-web/source/kafka/queue:Kafka:24-kafka:raw.TraitData/message/byte';
265
- _context8.next = 3;
266
- return http.post(encodeURI(url), {}, {}, {
267
- responseType: 'arraybuffer',
268
- headers: {
269
- 'Content-Type': 'application/protobuf'
270
- }
271
- });
272
- case 3:
273
- res = _context8.sent;
274
- return _context8.abrupt("return", res.successed ? res.data : []);
275
- case 5:
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 _context8.stop();
366
+ return _context0.stop();
278
367
  }
279
- }, _callee8);
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 getKafkaInfo() {
282
- return _getKafkaInfo.apply(this, arguments);
436
+ function getSubdirFromNs(_x14) {
437
+ return _getSubdirFromNs.apply(this, arguments);
283
438
  }
284
- return getKafkaInfo;
439
+ return getSubdirFromNs;
285
440
  }()
286
441
  }]);
287
442
  return Api;
@@ -0,0 +1,8 @@
1
+ import { IChartConfig, IChartData } from '../type';
2
+ interface IColumnChartProps {
3
+ data: IChartData[];
4
+ config?: IChartConfig;
5
+ theme?: string;
6
+ }
7
+ declare const ColumnChart: (props: IColumnChartProps) => JSX.Element;
8
+ export default ColumnChart;
@@ -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,7 @@
1
+ export declare enum ChartType {
2
+ LINE = "line",
3
+ BAR = "bar",
4
+ PIE = "pie",
5
+ AREA = "area",
6
+ DOT = "dot"
7
+ }
@@ -0,0 +1,8 @@
1
+ export var ChartType;
2
+ (function (ChartType) {
3
+ ChartType["LINE"] = "line";
4
+ ChartType["BAR"] = "bar";
5
+ ChartType["PIE"] = "pie";
6
+ ChartType["AREA"] = "area";
7
+ ChartType["DOT"] = "dot";
8
+ })(ChartType || (ChartType = {}));
@@ -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;
@@ -0,0 +1,8 @@
1
+ import { IChartConfig, IChartData } from '../type';
2
+ interface ILineChartProps {
3
+ data: IChartData[];
4
+ config?: IChartConfig;
5
+ theme?: string;
6
+ }
7
+ declare const LineChart: (props: ILineChartProps) => JSX.Element;
8
+ export default LineChart;