ronds-metadata 1.3.80 → 1.3.82
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/es/api/index.js +1 -1
- package/es/comps/MetadataForm/DataCell/business/config.d.ts +31 -2
- package/es/comps/MetadataForm/DataCell/business/config.js +30 -3
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.js +17 -5
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.js +33 -2
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.js +33 -2
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.js +33 -2
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/index.js +7 -2
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.js +9 -2
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +27 -14
- package/package.json +1 -1
package/es/api/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
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.
|
|
13
|
+
var token = 'Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkMyMTJFMjI1NTcwNjRDQTE3M0U2NjkxRjM4QzFDOEEyIiwidHlwIjoiYXQrand0In0.eyJuYmYiOjE3MjQ0OTg5MjcsImV4cCI6MTcyNDc1ODEyNywiaXNzIjoiaHR0cDovL2ZhYmlvOjk5OTkvc3VwZXJjYXJlY29yZSIsImF1ZCI6ImVwbSIsImNsaWVudF9pZCI6ImVwbSIsInN1YiI6IjNhMTIxZDJiLWYwZDUtZDQ3OC0xN2Q3LWQwODEwZDgzZDViMSIsImF1dGhfdGltZSI6MTcyNDQ5ODkyNiwiaWRwIjoibG9jYWwiLCJuYW1lIjoicGhtIiwiZW1haWwiOiJwaG1AYWJwLmlvIiwicm9sZSI6WyJhZG1pbiIsInBobV9hZG1pbiJdLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9naXZlbm5hbWUiOiJwaG3ov5Dnu7TotKblj7ciLCJwaG9uZV9udW1iZXIiOiIxMzYwMDAwMDAwMCIsInBob25lX251bWJlcl92ZXJpZmllZCI6IlRydWUiLCJlbWFpbF92ZXJpZmllZCI6IlRydWUiLCJpYXQiOjE3MjQ0OTg5MjcsInNjb3BlIjpbImFkZHJlc3MiLCJlbWFpbCIsImVwbSIsIm9wZW5pZCIsInBob25lIiwicHJvZmlsZSIsInJvbGUiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIl19.PSiq8OLUndIOZq4kmZcFafJSE6T7J010sttx-b2uTWkhBEh2mV0H_MPujH6iyTjWk1D6bZPdWoE7TjEcKnenZzW28_eWuzNHbCWe0O0aw4XPTX57ibxvxrX0aFUvniMyfepZn88MSP3uQvzY4T3QnrQiK_Io2pV6w9NCsG-GJicboqBnb4pFwXHEVADTmyhyc7iowc_p9FNrlgGswU8VZPgIk3caUYiso_NCql3zuUX6JcTNFxip_6pkrt8PX4Da4BTHJCMcyssUDp_E9WEud50EDMnvXBqOydc6txXIwfFCRwtePK5WjAFHNGSDjhmH2-iGzyUC7fOIjXgWb2_pyw';
|
|
14
14
|
addInterceptor(function (httpClient) {
|
|
15
15
|
httpClient.interceptors.request.use(function (_config) {
|
|
16
16
|
if (!_config.headers) {
|
|
@@ -105,6 +105,7 @@ export declare const BusinessSchema: {
|
|
|
105
105
|
common: {
|
|
106
106
|
id: string;
|
|
107
107
|
label: string;
|
|
108
|
+
require: boolean;
|
|
108
109
|
depend: {
|
|
109
110
|
show: string;
|
|
110
111
|
};
|
|
@@ -116,6 +117,28 @@ export declare const BusinessSchema: {
|
|
|
116
117
|
}[];
|
|
117
118
|
enum?: undefined;
|
|
118
119
|
items?: undefined;
|
|
120
|
+
} | {
|
|
121
|
+
id: string;
|
|
122
|
+
type: string;
|
|
123
|
+
fields: {
|
|
124
|
+
id: string;
|
|
125
|
+
type: string;
|
|
126
|
+
refId: string;
|
|
127
|
+
value: {
|
|
128
|
+
common: {
|
|
129
|
+
id: string;
|
|
130
|
+
label: string;
|
|
131
|
+
colSpan: number;
|
|
132
|
+
disabled: boolean;
|
|
133
|
+
depend: {
|
|
134
|
+
show: string;
|
|
135
|
+
};
|
|
136
|
+
};
|
|
137
|
+
text: {};
|
|
138
|
+
};
|
|
139
|
+
}[];
|
|
140
|
+
enum?: undefined;
|
|
141
|
+
items?: undefined;
|
|
119
142
|
} | {
|
|
120
143
|
id: string;
|
|
121
144
|
type: string;
|
|
@@ -223,8 +246,14 @@ export declare const BusinessSchema: {
|
|
|
223
246
|
type: string;
|
|
224
247
|
datasource: {
|
|
225
248
|
type: string[];
|
|
226
|
-
|
|
227
|
-
|
|
249
|
+
cassandra: {
|
|
250
|
+
isPlusTable: boolean;
|
|
251
|
+
};
|
|
252
|
+
postgreSql: {
|
|
253
|
+
isPlusTable: boolean;
|
|
254
|
+
};
|
|
255
|
+
sqlServer: {
|
|
256
|
+
isPlusTable: boolean;
|
|
228
257
|
};
|
|
229
258
|
};
|
|
230
259
|
};
|
|
@@ -86,7 +86,7 @@ var ETL_SOURCE_SCHEMA = [{
|
|
|
86
86
|
refId: 'com.ronds.schema.default.Rule.Form',
|
|
87
87
|
value: {
|
|
88
88
|
common: {
|
|
89
|
-
label: '
|
|
89
|
+
label: '批处理大小',
|
|
90
90
|
require: true,
|
|
91
91
|
labelSpan: 4,
|
|
92
92
|
depend: {
|
|
@@ -126,6 +126,7 @@ var ETL_SOURCE_SCHEMA = [{
|
|
|
126
126
|
common: {
|
|
127
127
|
id: 'filepath',
|
|
128
128
|
label: '文件上传',
|
|
129
|
+
require: true,
|
|
129
130
|
depend: {
|
|
130
131
|
show: 'datasource.dsType=="Minio"'
|
|
131
132
|
}
|
|
@@ -135,6 +136,26 @@ var ETL_SOURCE_SCHEMA = [{
|
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
138
|
}]
|
|
139
|
+
}, {
|
|
140
|
+
id: 'filepathValue',
|
|
141
|
+
type: 'text',
|
|
142
|
+
fields: [{
|
|
143
|
+
id: 'com.ronds.schema.default.Rule.Form',
|
|
144
|
+
type: 'ref',
|
|
145
|
+
refId: 'com.ronds.schema.default.Rule.Form',
|
|
146
|
+
value: {
|
|
147
|
+
common: {
|
|
148
|
+
id: 'filepathValue',
|
|
149
|
+
label: '文件路径',
|
|
150
|
+
colSpan: 2,
|
|
151
|
+
disabled: true,
|
|
152
|
+
depend: {
|
|
153
|
+
show: 'datasource.dsType=="Minio"'
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
text: {}
|
|
157
|
+
}
|
|
158
|
+
}]
|
|
138
159
|
}, {
|
|
139
160
|
id: 'headers',
|
|
140
161
|
type: 'array',
|
|
@@ -256,8 +277,14 @@ var ETL_DIRECTION_SCHEMA = [{
|
|
|
256
277
|
type: 'datasource',
|
|
257
278
|
datasource: {
|
|
258
279
|
type: ['Cassandra', 'PostgreSql', 'Minio', 'SqlServer'],
|
|
259
|
-
|
|
260
|
-
|
|
280
|
+
cassandra: {
|
|
281
|
+
isPlusTable: true
|
|
282
|
+
},
|
|
283
|
+
postgreSql: {
|
|
284
|
+
isPlusTable: true
|
|
285
|
+
},
|
|
286
|
+
sqlServer: {
|
|
287
|
+
isPlusTable: true
|
|
261
288
|
}
|
|
262
289
|
}
|
|
263
290
|
}
|
|
@@ -14,7 +14,7 @@ import React from 'react';
|
|
|
14
14
|
import { useGetDatasource } from './hooks';
|
|
15
15
|
import { PlusOutlined } from '@ant-design/icons';
|
|
16
16
|
var CassandraDatasource = function CassandraDatasource(props) {
|
|
17
|
-
var _extraInfo$datasource, _extraInfo$datasource2, _extraInfo$datasource3, _extraInfo$datasource4;
|
|
17
|
+
var _extraInfo$datasource, _extraInfo$datasource2, _extraInfo$datasource3, _extraInfo$datasource4, _extraInfo$datasource5, _extraInfo$datasource6, _extraInfo$datasource7, _extraInfo$datasource8;
|
|
18
18
|
var extraInfo = props.extraInfo,
|
|
19
19
|
datasource = props.datasource,
|
|
20
20
|
onChange = props.onChange,
|
|
@@ -43,6 +43,11 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
|
43
43
|
dt: value
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
|
+
var onPlusClick = function onPlusClick() {
|
|
47
|
+
onChange && onChange({
|
|
48
|
+
plus: true
|
|
49
|
+
});
|
|
50
|
+
};
|
|
46
51
|
React.useEffect(function () {
|
|
47
52
|
if (initialValue) {
|
|
48
53
|
onKeySpaceChange(initialValue.keyspace);
|
|
@@ -93,10 +98,10 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
|
93
98
|
style: {
|
|
94
99
|
paddingBottom: '8px'
|
|
95
100
|
}
|
|
96
|
-
}, /*#__PURE__*/React.createElement(_Input.Group, {
|
|
101
|
+
}, (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource3 = extraInfo.datasource) === null || _extraInfo$datasource3 === void 0 ? void 0 : (_extraInfo$datasource4 = _extraInfo$datasource3.cassandra) === null || _extraInfo$datasource4 === void 0 ? void 0 : _extraInfo$datasource4.isPlusTable) ? /*#__PURE__*/React.createElement(_Input.Group, {
|
|
97
102
|
compact: true
|
|
98
103
|
}, /*#__PURE__*/React.createElement(_Select, {
|
|
99
|
-
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$
|
|
104
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource5 = extraInfo.datasource) === null || _extraInfo$datasource5 === void 0 ? void 0 : (_extraInfo$datasource6 = _extraInfo$datasource5.cassandra) === null || _extraInfo$datasource6 === void 0 ? void 0 : _extraInfo$datasource6.isMutiple) ? 'multiple' : undefined,
|
|
100
105
|
allowClear: true,
|
|
101
106
|
value: dataTable,
|
|
102
107
|
options: dataTableOpts,
|
|
@@ -110,7 +115,14 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
|
110
115
|
width: '32px'
|
|
111
116
|
}
|
|
112
117
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
113
|
-
icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
|
|
114
|
-
|
|
118
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
119
|
+
onClick: onPlusClick
|
|
120
|
+
}))) : /*#__PURE__*/React.createElement(_Select, {
|
|
121
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource7 = extraInfo.datasource) === null || _extraInfo$datasource7 === void 0 ? void 0 : (_extraInfo$datasource8 = _extraInfo$datasource7.cassandra) === null || _extraInfo$datasource8 === void 0 ? void 0 : _extraInfo$datasource8.isMutiple) ? 'multiple' : undefined,
|
|
122
|
+
allowClear: true,
|
|
123
|
+
value: dataTable,
|
|
124
|
+
options: dataTableOpts,
|
|
125
|
+
onChange: onDataTableChange
|
|
126
|
+
})));
|
|
115
127
|
};
|
|
116
128
|
export default CassandraDatasource;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import "antd/es/tooltip/style";
|
|
4
|
+
import _Tooltip from "antd/es/tooltip";
|
|
5
|
+
import "antd/es/button/style";
|
|
6
|
+
import _Button from "antd/es/button";
|
|
1
7
|
import "antd/es/select/style";
|
|
2
8
|
import _Select from "antd/es/select";
|
|
3
9
|
import "antd/es/col/style";
|
|
@@ -5,9 +11,10 @@ import _Col from "antd/es/col";
|
|
|
5
11
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
6
12
|
import { tr } from '../../../../../framework/locale';
|
|
7
13
|
import { useGetDatasource } from './hooks';
|
|
14
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
8
15
|
import React from 'react';
|
|
9
16
|
var KafkaDatasource = function KafkaDatasource(props) {
|
|
10
|
-
var _extraInfo$datasource, _extraInfo$datasource2;
|
|
17
|
+
var _extraInfo$datasource, _extraInfo$datasource2, _extraInfo$datasource3, _extraInfo$datasource4, _extraInfo$datasource5, _extraInfo$datasource6;
|
|
11
18
|
var extraInfo = props.extraInfo,
|
|
12
19
|
datasource = props.datasource,
|
|
13
20
|
onChange = props.onChange,
|
|
@@ -25,6 +32,11 @@ var KafkaDatasource = function KafkaDatasource(props) {
|
|
|
25
32
|
topics: value
|
|
26
33
|
});
|
|
27
34
|
};
|
|
35
|
+
var onPlusClick = function onPlusClick() {
|
|
36
|
+
onChange && onChange({
|
|
37
|
+
plus: true
|
|
38
|
+
});
|
|
39
|
+
};
|
|
28
40
|
React.useEffect(function () {
|
|
29
41
|
if (initialValue) {
|
|
30
42
|
onTopicChange(initialValue.topics);
|
|
@@ -49,8 +61,27 @@ var KafkaDatasource = function KafkaDatasource(props) {
|
|
|
49
61
|
style: {
|
|
50
62
|
paddingBottom: '8px'
|
|
51
63
|
}
|
|
64
|
+
}, (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource = extraInfo.datasource) === null || _extraInfo$datasource === void 0 ? void 0 : (_extraInfo$datasource2 = _extraInfo$datasource.kafka) === null || _extraInfo$datasource2 === void 0 ? void 0 : _extraInfo$datasource2.isPlusTable) ? /*#__PURE__*/React.createElement(_Input.Group, {
|
|
65
|
+
compact: true
|
|
52
66
|
}, /*#__PURE__*/React.createElement(_Select, {
|
|
53
|
-
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$
|
|
67
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource3 = extraInfo.datasource) === null || _extraInfo$datasource3 === void 0 ? void 0 : (_extraInfo$datasource4 = _extraInfo$datasource3.kafka) === null || _extraInfo$datasource4 === void 0 ? void 0 : _extraInfo$datasource4.isMutiple) ? 'multiple' : undefined,
|
|
68
|
+
value: topic,
|
|
69
|
+
allowClear: true,
|
|
70
|
+
options: topicOpts,
|
|
71
|
+
onChange: onTopicChange,
|
|
72
|
+
style: {
|
|
73
|
+
width: 'calc(100% - 32px)'
|
|
74
|
+
}
|
|
75
|
+
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
|
76
|
+
title: tr('手动建表'),
|
|
77
|
+
style: {
|
|
78
|
+
width: '32px'
|
|
79
|
+
}
|
|
80
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
81
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
82
|
+
onClick: onPlusClick
|
|
83
|
+
}))) : /*#__PURE__*/React.createElement(_Select, {
|
|
84
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource5 = extraInfo.datasource) === null || _extraInfo$datasource5 === void 0 ? void 0 : (_extraInfo$datasource6 = _extraInfo$datasource5.kafka) === null || _extraInfo$datasource6 === void 0 ? void 0 : _extraInfo$datasource6.isMutiple) ? 'multiple' : undefined,
|
|
54
85
|
value: topic,
|
|
55
86
|
allowClear: true,
|
|
56
87
|
options: topicOpts,
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import "antd/es/tooltip/style";
|
|
4
|
+
import _Tooltip from "antd/es/tooltip";
|
|
5
|
+
import "antd/es/button/style";
|
|
6
|
+
import _Button from "antd/es/button";
|
|
1
7
|
import "antd/es/select/style";
|
|
2
8
|
import _Select from "antd/es/select";
|
|
3
9
|
import "antd/es/col/style";
|
|
@@ -10,9 +16,10 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
10
16
|
*/
|
|
11
17
|
import { tr } from '../../../../../framework/locale';
|
|
12
18
|
import { useGetDatasource } from './hooks';
|
|
19
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
13
20
|
import React from 'react';
|
|
14
21
|
var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
15
|
-
var _extraInfo$datasource, _extraInfo$datasource2, _extraInfo$datasource3, _extraInfo$datasource4, _extraInfo$datasource5, _extraInfo$datasource6;
|
|
22
|
+
var _extraInfo$datasource, _extraInfo$datasource2, _extraInfo$datasource3, _extraInfo$datasource4, _extraInfo$datasource5, _extraInfo$datasource6, _extraInfo$datasource7, _extraInfo$datasource8, _extraInfo$datasource9, _extraInfo$datasource10;
|
|
16
23
|
var extraInfo = props.extraInfo,
|
|
17
24
|
wrapperCol = props.wrapperCol,
|
|
18
25
|
labelCol = props.labelCol,
|
|
@@ -52,6 +59,11 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
|
52
59
|
dt: value
|
|
53
60
|
});
|
|
54
61
|
};
|
|
62
|
+
var onPlusClick = function onPlusClick() {
|
|
63
|
+
onChange && onChange({
|
|
64
|
+
plus: true
|
|
65
|
+
});
|
|
66
|
+
};
|
|
55
67
|
React.useEffect(function () {
|
|
56
68
|
if (initialValue) {
|
|
57
69
|
onDataBaseChange(initialValue.db);
|
|
@@ -128,8 +140,27 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
|
128
140
|
style: {
|
|
129
141
|
paddingBottom: '8px'
|
|
130
142
|
}
|
|
143
|
+
}, (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource5 = extraInfo.datasource) === null || _extraInfo$datasource5 === void 0 ? void 0 : (_extraInfo$datasource6 = _extraInfo$datasource5.postgreSql) === null || _extraInfo$datasource6 === void 0 ? void 0 : _extraInfo$datasource6.isPlusTable) ? /*#__PURE__*/React.createElement(_Input.Group, {
|
|
144
|
+
compact: true
|
|
131
145
|
}, /*#__PURE__*/React.createElement(_Select, {
|
|
132
|
-
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$
|
|
146
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource7 = extraInfo.datasource) === null || _extraInfo$datasource7 === void 0 ? void 0 : (_extraInfo$datasource8 = _extraInfo$datasource7.postgreSql) === null || _extraInfo$datasource8 === void 0 ? void 0 : _extraInfo$datasource8.isMutiple) ? 'multiple' : undefined,
|
|
147
|
+
allowClear: true,
|
|
148
|
+
value: dataTable,
|
|
149
|
+
options: dataTableOpts,
|
|
150
|
+
onChange: onDataTableChange,
|
|
151
|
+
style: {
|
|
152
|
+
width: 'calc(100% - 32px)'
|
|
153
|
+
}
|
|
154
|
+
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
|
155
|
+
title: tr('手动建表'),
|
|
156
|
+
style: {
|
|
157
|
+
width: '32px'
|
|
158
|
+
}
|
|
159
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
160
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
161
|
+
onClick: onPlusClick
|
|
162
|
+
}))) : /*#__PURE__*/React.createElement(_Select, {
|
|
163
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource9 = extraInfo.datasource) === null || _extraInfo$datasource9 === void 0 ? void 0 : (_extraInfo$datasource10 = _extraInfo$datasource9.postgreSql) === null || _extraInfo$datasource10 === void 0 ? void 0 : _extraInfo$datasource10.isMutiple) ? 'multiple' : undefined,
|
|
133
164
|
allowClear: true,
|
|
134
165
|
value: dataTable,
|
|
135
166
|
options: dataTableOpts,
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import "antd/es/input/style";
|
|
2
|
+
import _Input from "antd/es/input";
|
|
3
|
+
import "antd/es/tooltip/style";
|
|
4
|
+
import _Tooltip from "antd/es/tooltip";
|
|
5
|
+
import "antd/es/button/style";
|
|
6
|
+
import _Button from "antd/es/button";
|
|
1
7
|
import "antd/es/select/style";
|
|
2
8
|
import _Select from "antd/es/select";
|
|
3
9
|
import "antd/es/col/style";
|
|
4
10
|
import _Col from "antd/es/col";
|
|
5
11
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
|
+
import { PlusOutlined } from '@ant-design/icons';
|
|
6
13
|
import { tr } from '../../../../../framework/locale';
|
|
7
14
|
import { useGetDatasource } from './hooks';
|
|
8
15
|
import React from 'react';
|
|
9
16
|
var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
10
|
-
var _extraInfo$datasource, _extraInfo$datasource2, _extraInfo$datasource3, _extraInfo$datasource4, _extraInfo$datasource5, _extraInfo$datasource6;
|
|
17
|
+
var _extraInfo$datasource, _extraInfo$datasource2, _extraInfo$datasource3, _extraInfo$datasource4, _extraInfo$datasource5, _extraInfo$datasource6, _extraInfo$datasource7, _extraInfo$datasource8, _extraInfo$datasource9, _extraInfo$datasource10;
|
|
11
18
|
var extraInfo = props.extraInfo,
|
|
12
19
|
datasource = props.datasource,
|
|
13
20
|
wrapperCol = props.wrapperCol,
|
|
@@ -47,6 +54,11 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
|
47
54
|
dt: value
|
|
48
55
|
});
|
|
49
56
|
};
|
|
57
|
+
var onPlusClick = function onPlusClick() {
|
|
58
|
+
onChange && onChange({
|
|
59
|
+
plus: true
|
|
60
|
+
});
|
|
61
|
+
};
|
|
50
62
|
React.useEffect(function () {
|
|
51
63
|
if (initialValue) {
|
|
52
64
|
onDataBaseChange(initialValue.db);
|
|
@@ -123,8 +135,27 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
|
123
135
|
style: {
|
|
124
136
|
paddingBottom: '8px'
|
|
125
137
|
}
|
|
138
|
+
}, (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource5 = extraInfo.datasource) === null || _extraInfo$datasource5 === void 0 ? void 0 : (_extraInfo$datasource6 = _extraInfo$datasource5.sqlServer) === null || _extraInfo$datasource6 === void 0 ? void 0 : _extraInfo$datasource6.isPlusTable) ? /*#__PURE__*/React.createElement(_Input.Group, {
|
|
139
|
+
compact: true
|
|
126
140
|
}, /*#__PURE__*/React.createElement(_Select, {
|
|
127
|
-
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$
|
|
141
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource7 = extraInfo.datasource) === null || _extraInfo$datasource7 === void 0 ? void 0 : (_extraInfo$datasource8 = _extraInfo$datasource7.sqlServer) === null || _extraInfo$datasource8 === void 0 ? void 0 : _extraInfo$datasource8.isMutiple) ? 'multiple' : undefined,
|
|
142
|
+
allowClear: true,
|
|
143
|
+
value: dataTable,
|
|
144
|
+
options: dataTableOpts,
|
|
145
|
+
onChange: onDataTableChange,
|
|
146
|
+
style: {
|
|
147
|
+
width: 'calc(100% - 32px)'
|
|
148
|
+
}
|
|
149
|
+
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
|
150
|
+
title: tr('手动建表'),
|
|
151
|
+
style: {
|
|
152
|
+
width: '32px'
|
|
153
|
+
}
|
|
154
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
155
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
156
|
+
onClick: onPlusClick
|
|
157
|
+
}))) : /*#__PURE__*/React.createElement(_Select, {
|
|
158
|
+
mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource9 = extraInfo.datasource) === null || _extraInfo$datasource9 === void 0 ? void 0 : (_extraInfo$datasource10 = _extraInfo$datasource9.sqlServer) === null || _extraInfo$datasource10 === void 0 ? void 0 : _extraInfo$datasource10.isMutiple) ? 'multiple' : undefined,
|
|
128
159
|
allowClear: true,
|
|
129
160
|
value: dataTable,
|
|
130
161
|
options: dataTableOpts,
|
|
@@ -94,9 +94,13 @@ var DataSource = function DataSource(props) {
|
|
|
94
94
|
var onSqlServerChange = function onSqlServerChange(value) {
|
|
95
95
|
triggerChange(_objectSpread({}, value));
|
|
96
96
|
};
|
|
97
|
+
var onLinkClick = function onLinkClick() {
|
|
98
|
+
triggerChange({
|
|
99
|
+
link: true
|
|
100
|
+
});
|
|
101
|
+
};
|
|
97
102
|
React.useEffect(function () {
|
|
98
103
|
if (value) {
|
|
99
|
-
debugger;
|
|
100
104
|
if (value.dsType) {
|
|
101
105
|
setDsType(value.dsType);
|
|
102
106
|
triggerChange({
|
|
@@ -178,7 +182,8 @@ var DataSource = function DataSource(props) {
|
|
|
178
182
|
width: '32px'
|
|
179
183
|
}
|
|
180
184
|
}, /*#__PURE__*/React.createElement(_Button, {
|
|
181
|
-
icon: /*#__PURE__*/React.createElement(LinkOutlined, null)
|
|
185
|
+
icon: /*#__PURE__*/React.createElement(LinkOutlined, null),
|
|
186
|
+
onClick: onLinkClick
|
|
182
187
|
})))), dsType === 'Kafka' && /*#__PURE__*/React.createElement(KafkaDatasource, {
|
|
183
188
|
wrapperCol: wrapperCol,
|
|
184
189
|
labelCol: labelCol,
|
|
@@ -16,6 +16,8 @@ import React from 'react';
|
|
|
16
16
|
import Editable from '../../../../comps/Editable';
|
|
17
17
|
import { MetadataFormContext } from '../../interface';
|
|
18
18
|
import { useGetLabelCol, useGetWrapperCol } from './Datasource/hooks';
|
|
19
|
+
import useObservable from '@/framework/rxjs-hooks/useObservable';
|
|
20
|
+
import { STREAM_EVENT_TYPE } from '../../constants';
|
|
19
21
|
var MapTable = function MapTable(props) {
|
|
20
22
|
var value = props.value,
|
|
21
23
|
onChange = props.onChange,
|
|
@@ -52,6 +54,10 @@ var MapTable = function MapTable(props) {
|
|
|
52
54
|
form = _React$useContext.form;
|
|
53
55
|
var labelCol = useGetLabelCol(extraInfo);
|
|
54
56
|
var wrapperCol = useGetWrapperCol(extraInfo);
|
|
57
|
+
var formContext = React.useContext(MetadataFormContext) || {};
|
|
58
|
+
useObservable(function (p) {
|
|
59
|
+
if ((p === null || p === void 0 ? void 0 : p.type) === STREAM_EVENT_TYPE.ON_VALUES_CHANGE) {}
|
|
60
|
+
}, [formContext === null || formContext === void 0 ? void 0 : formContext.stream$]);
|
|
55
61
|
var triggerChange = function triggerChange(changedValue) {
|
|
56
62
|
onChange && onChange(_objectSpread({
|
|
57
63
|
mapping: mapping,
|
|
@@ -186,7 +192,7 @@ var MapTable = function MapTable(props) {
|
|
|
186
192
|
height: '100%',
|
|
187
193
|
marginTop: '2px'
|
|
188
194
|
}
|
|
189
|
-
},
|
|
195
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
190
196
|
style: {
|
|
191
197
|
width: '40%'
|
|
192
198
|
}
|
|
@@ -204,7 +210,8 @@ var MapTable = function MapTable(props) {
|
|
|
204
210
|
onMove: onSourceMove
|
|
205
211
|
})), /*#__PURE__*/React.createElement("div", {
|
|
206
212
|
style: {
|
|
207
|
-
marginTop: '40px'
|
|
213
|
+
marginTop: '40px',
|
|
214
|
+
marginRight: '6px'
|
|
208
215
|
}
|
|
209
216
|
}, _toConsumableArray(Array(Math.min(tableDataSource === null || tableDataSource === void 0 ? void 0 : tableDataSource.length, tableDataTarget === null || tableDataTarget === void 0 ? void 0 : tableDataTarget.length))).map(function (_, index) {
|
|
210
217
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -16,6 +16,9 @@ import { useGetWrapperCol } from './Datasource/hooks';
|
|
|
16
16
|
import CodeEdit from '../../../../comps/CodeEdit';
|
|
17
17
|
import { getConfig } from '../../../../config';
|
|
18
18
|
import { modifyComment } from '../../utils';
|
|
19
|
+
import { MetadataFormContext } from '../../interface';
|
|
20
|
+
import useObservable from '@/framework/rxjs-hooks/useObservable';
|
|
21
|
+
import { STREAM_EVENT_TYPE } from '../../constants';
|
|
19
22
|
var SparkSqlTable = function SparkSqlTable(props) {
|
|
20
23
|
var value = props.value,
|
|
21
24
|
extraInfo = props.extraInfo,
|
|
@@ -34,6 +37,30 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
34
37
|
setList = _React$useState6[1];
|
|
35
38
|
var listRef = React.useRef([]);
|
|
36
39
|
var wrapperCol = useGetWrapperCol(extraInfo);
|
|
40
|
+
var formContext = React.useContext(MetadataFormContext) || {};
|
|
41
|
+
useObservable(function (p) {
|
|
42
|
+
if ((p === null || p === void 0 ? void 0 : p.type) === STREAM_EVENT_TYPE.ON_VALUES_CHANGE) {
|
|
43
|
+
var _p$payload, _val$datasource, _val$datasource3;
|
|
44
|
+
var val = p === null || p === void 0 ? void 0 : (_p$payload = p.payload) === null || _p$payload === void 0 ? void 0 : _p$payload.val;
|
|
45
|
+
var _selected;
|
|
46
|
+
if (val === null || val === void 0 ? void 0 : (_val$datasource = val.datasource) === null || _val$datasource === void 0 ? void 0 : _val$datasource.topics) {
|
|
47
|
+
var _val$datasource2, _val$datasource2$topi;
|
|
48
|
+
_selected = val === null || val === void 0 ? void 0 : (_val$datasource2 = val.datasource) === null || _val$datasource2 === void 0 ? void 0 : (_val$datasource2$topi = _val$datasource2.topics) === null || _val$datasource2$topi === void 0 ? void 0 : _val$datasource2$topi.map(function (p) {
|
|
49
|
+
var _JSON$parse;
|
|
50
|
+
return (_JSON$parse = JSON.parse(p)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.name;
|
|
51
|
+
});
|
|
52
|
+
setSelected(_toConsumableArray(_selected));
|
|
53
|
+
}
|
|
54
|
+
if (val === null || val === void 0 ? void 0 : (_val$datasource3 = val.datasource) === null || _val$datasource3 === void 0 ? void 0 : _val$datasource3.dt) {
|
|
55
|
+
var _val$datasource4, _val$datasource4$dt;
|
|
56
|
+
_selected = val === null || val === void 0 ? void 0 : (_val$datasource4 = val.datasource) === null || _val$datasource4 === void 0 ? void 0 : (_val$datasource4$dt = _val$datasource4.dt) === null || _val$datasource4$dt === void 0 ? void 0 : _val$datasource4$dt.map(function (p) {
|
|
57
|
+
var _JSON$parse2;
|
|
58
|
+
return (_JSON$parse2 = JSON.parse(p)) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2.name;
|
|
59
|
+
});
|
|
60
|
+
setSelected(_toConsumableArray(_selected));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, [formContext === null || formContext === void 0 ? void 0 : formContext.stream$]);
|
|
37
64
|
var handleAddItem = function handleAddItem() {
|
|
38
65
|
var item = {
|
|
39
66
|
alias: "tbl".concat(listRef.current.length + 1),
|
|
@@ -60,7 +87,6 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
60
87
|
var triggerChange = function triggerChange(changedValue) {
|
|
61
88
|
onChange && onChange(_objectSpread({
|
|
62
89
|
view: view,
|
|
63
|
-
selected: selected,
|
|
64
90
|
list: list
|
|
65
91
|
}, changedValue));
|
|
66
92
|
};
|
|
@@ -70,12 +96,6 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
70
96
|
view: v.target.value
|
|
71
97
|
});
|
|
72
98
|
};
|
|
73
|
-
var onSelectedChange = function onSelectedChange(v) {
|
|
74
|
-
setSelected(v.target.value);
|
|
75
|
-
triggerChange({
|
|
76
|
-
selected: v.target.value
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
99
|
var onListChange = function onListChange(v, index, key) {
|
|
80
100
|
var _list = listRef.current;
|
|
81
101
|
if (key === 'alias' || key === 'outputView') {
|
|
@@ -96,12 +116,6 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
96
116
|
view: value.view
|
|
97
117
|
});
|
|
98
118
|
}
|
|
99
|
-
if (value.selected) {
|
|
100
|
-
setSelected(value.selected);
|
|
101
|
-
triggerChange({
|
|
102
|
-
selected: value.selected
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
119
|
if (value.list) {
|
|
106
120
|
setList(value.list);
|
|
107
121
|
listRef.current = value.list;
|
|
@@ -164,7 +178,6 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
164
178
|
},
|
|
165
179
|
addonAfter: /*#__PURE__*/React.createElement(EyeOutlined, null),
|
|
166
180
|
value: p,
|
|
167
|
-
onChange: onSelectedChange,
|
|
168
181
|
disabled: true
|
|
169
182
|
});
|
|
170
183
|
}))), /*#__PURE__*/React.createElement("div", {
|