ronds-metadata 1.3.68 → 1.3.70
Sign up to get free protection for your applications and to get access to all the features.
- package/es/api/index.js +1 -1
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.d.ts +0 -3
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.js +59 -33
- package/es/comps/MetadataForm/DataCell/plugin/SourceConfig.js +1 -1
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +3 -2
- 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.eyJuYmYiOjE3MjM4NzU4OTksImV4cCI6MTcyNDEzNTA5OSwiaXNzIjoiaHR0cDovL2ZhYmlvOjk5OTkvc3VwZXJjYXJlY29yZSIsImF1ZCI6ImVwbSIsImNsaWVudF9pZCI6ImVwbSIsInN1YiI6IjNhMTIxZDJiLWYwZDUtZDQ3OC0xN2Q3LWQwODEwZDgzZDViMSIsImF1dGhfdGltZSI6MTcyMzg3NTg5OSwiaWRwIjoibG9jYWwiLCJuYW1lIjoicGhtIiwiZW1haWwiOiJwaG1AYWJwLmlvIiwicm9sZSI6WyJhZG1pbiIsInBobV9hZG1pbiJdLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9naXZlbm5hbWUiOiJwaG3ov5Dnu7TotKblj7ciLCJwaG9uZV9udW1iZXIiOiIxMzYwMDAwMDAwMCIsInBob25lX251bWJlcl92ZXJpZmllZCI6IlRydWUiLCJlbWFpbF92ZXJpZmllZCI6IlRydWUiLCJpYXQiOjE3MjM4NzU4OTksInNjb3BlIjpbImFkZHJlc3MiLCJlbWFpbCIsImVwbSIsIm9wZW5pZCIsInBob25lIiwicHJvZmlsZSIsInJvbGUiLCJvZmZsaW5lX2FjY2VzcyJdLCJhbXIiOlsicHdkIl19.OK10CQsLVqkRSPEnpQKH_mJU9PbVug0ok4rb6C9EaG2g3-j6GvRhx4_4uPpbE3Y2vBRetkITUh3yccFeoh8kROKUJtr_9HT-W-jULSjfwZN9yd_GJFV1rL3fGEpoUZUqeUEoCvKifgB-8A_N_IN-utk5jzyD-gpKo9jUZySpPsd7JBzA_G_DGV-5vO-lXUJsBySDxt0S3NplnX1A17Pqoxh0ihLL1tlJ-mblSaX8lqWVrEbgBEjpU7Do1siSrZN_zaSBMLneCRkExQULwIWHq0z1agAxhO60YlSdTl78KfF9B_rgQFtkW8a6BZNOvyCwix95lDeedZj-uF2uym84Fg';
|
14
14
|
addInterceptor(function (httpClient) {
|
15
15
|
httpClient.interceptors.request.use(function (_config) {
|
16
16
|
if (!_config.headers) {
|
@@ -1,7 +1,5 @@
|
|
1
1
|
import "antd/es/checkbox/style";
|
2
2
|
import _Checkbox from "antd/es/checkbox";
|
3
|
-
import "antd/es/table/style";
|
4
|
-
import _Table from "antd/es/table";
|
5
3
|
import "antd/es/button/style";
|
6
4
|
import _Button from "antd/es/button";
|
7
5
|
import "antd/es/select/style";
|
@@ -12,33 +10,45 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
10
|
import { CloseCircleFilled, ArrowRightOutlined } from '@ant-design/icons';
|
13
11
|
import React from 'react';
|
14
12
|
import Editable from '../../../../comps/Editable';
|
13
|
+
import { MetadataFormContext } from '../../interface';
|
15
14
|
var MapTable = function MapTable(props) {
|
16
|
-
var
|
17
|
-
dataTarget = props.dataTarget,
|
18
|
-
options = props.options,
|
19
|
-
value = props.value,
|
15
|
+
var value = props.value,
|
20
16
|
onChange = props.onChange;
|
21
|
-
var _React$useState = React.useState(
|
17
|
+
var _React$useState = React.useState([]),
|
22
18
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
23
19
|
tableDataSource = _React$useState2[0],
|
24
20
|
setTableDataSource = _React$useState2[1];
|
25
|
-
var _React$useState3 = React.useState(),
|
21
|
+
var _React$useState3 = React.useState([]),
|
26
22
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
27
|
-
|
28
|
-
|
29
|
-
var _React$useState5 = React.useState(),
|
23
|
+
tableDataTarget = _React$useState4[0],
|
24
|
+
setTableDataTarget = _React$useState4[1];
|
25
|
+
var _React$useState5 = React.useState([]),
|
30
26
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
31
|
-
|
32
|
-
|
27
|
+
options = _React$useState6[0],
|
28
|
+
setOptions = _React$useState6[1];
|
33
29
|
var _React$useState7 = React.useState(),
|
34
30
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
35
|
-
|
36
|
-
|
37
|
-
var
|
31
|
+
mapping = _React$useState8[0],
|
32
|
+
setMapping = _React$useState8[1];
|
33
|
+
var _React$useState9 = React.useState(),
|
34
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
35
|
+
output = _React$useState10[0],
|
36
|
+
setOutput = _React$useState10[1];
|
37
|
+
var _React$useState11 = React.useState(),
|
38
|
+
_React$useState12 = _slicedToArray(_React$useState11, 2),
|
39
|
+
disableArray = _React$useState12[0],
|
40
|
+
setDisableArray = _React$useState12[1];
|
41
|
+
var sourceEditableStreamRef = React.useRef();
|
42
|
+
var targetEditableStreamRef = React.useRef();
|
43
|
+
var _React$useContext = React.useContext(MetadataFormContext),
|
44
|
+
form = _React$useContext.form;
|
38
45
|
var triggerChange = function triggerChange(changedValue) {
|
39
46
|
onChange && onChange(_objectSpread({
|
40
47
|
mapping: mapping,
|
41
|
-
output: output
|
48
|
+
output: output,
|
49
|
+
options: options,
|
50
|
+
dataSource: tableDataSource,
|
51
|
+
dataTarget: tableDataTarget
|
42
52
|
}, changedValue));
|
43
53
|
};
|
44
54
|
var onBtnClick = function onBtnClick(index) {
|
@@ -52,12 +62,18 @@ var MapTable = function MapTable(props) {
|
|
52
62
|
output: value
|
53
63
|
});
|
54
64
|
};
|
55
|
-
var
|
65
|
+
var onSourceMove = function onSourceMove(data) {
|
56
66
|
var newDataSource = _toConsumableArray(tableDataSource);
|
57
67
|
var removedElement = newDataSource.splice(data === null || data === void 0 ? void 0 : data.dragIndex, 1)[0];
|
58
68
|
newDataSource.splice(data === null || data === void 0 ? void 0 : data.hoverIndex, 0, removedElement);
|
59
69
|
setTableDataSource(newDataSource);
|
60
70
|
};
|
71
|
+
var onTargetMove = function onTargetMove(data) {
|
72
|
+
var newDataTarget = _toConsumableArray(tableDataTarget);
|
73
|
+
var removedElement = newDataTarget.splice(data === null || data === void 0 ? void 0 : data.dragIndex, 1)[0];
|
74
|
+
newDataTarget.splice(data === null || data === void 0 ? void 0 : data.hoverIndex, 0, removedElement);
|
75
|
+
setTableDataTarget(newDataTarget);
|
76
|
+
};
|
61
77
|
React.useEffect(function () {
|
62
78
|
if (value) {
|
63
79
|
if (value[mapping]) {
|
@@ -66,22 +82,22 @@ var MapTable = function MapTable(props) {
|
|
66
82
|
}
|
67
83
|
}, [value]);
|
68
84
|
React.useEffect(function () {
|
69
|
-
setDisableArray(new Array(Math.min(tableDataSource === null || tableDataSource === void 0 ? void 0 : tableDataSource.length,
|
85
|
+
setDisableArray(new Array(Math.min(tableDataSource === null || tableDataSource === void 0 ? void 0 : tableDataSource.length, tableDataTarget === null || tableDataTarget === void 0 ? void 0 : tableDataTarget.length)).fill(true));
|
70
86
|
}, []);
|
71
87
|
React.useEffect(function () {
|
72
88
|
if (disableArray) {
|
73
89
|
var _mapping = [];
|
74
90
|
disableArray.forEach(function (_, idx) {
|
75
91
|
if (disableArray[idx]) {
|
76
|
-
var _tableDataSource$idx, _tableDataSource$idx2,
|
92
|
+
var _tableDataSource$idx, _tableDataSource$idx2, _tableDataTarget$idx, _tableDataTarget$idx2;
|
77
93
|
_mapping.push({
|
78
94
|
src: {
|
79
95
|
name: (_tableDataSource$idx = tableDataSource[idx]) === null || _tableDataSource$idx === void 0 ? void 0 : _tableDataSource$idx.name,
|
80
96
|
dataType: (_tableDataSource$idx2 = tableDataSource[idx]) === null || _tableDataSource$idx2 === void 0 ? void 0 : _tableDataSource$idx2.type
|
81
97
|
},
|
82
98
|
dst: {
|
83
|
-
name: (
|
84
|
-
dataType: (
|
99
|
+
name: (_tableDataTarget$idx = tableDataTarget[idx]) === null || _tableDataTarget$idx === void 0 ? void 0 : _tableDataTarget$idx.name,
|
100
|
+
dataType: (_tableDataTarget$idx2 = tableDataTarget[idx]) === null || _tableDataTarget$idx2 === void 0 ? void 0 : _tableDataTarget$idx2.type
|
85
101
|
}
|
86
102
|
});
|
87
103
|
}
|
@@ -92,6 +108,12 @@ var MapTable = function MapTable(props) {
|
|
92
108
|
});
|
93
109
|
}
|
94
110
|
}, [disableArray]);
|
111
|
+
React.useEffect(function () {
|
112
|
+
var values = form.getFieldsValue().mapTable;
|
113
|
+
values.dataSource && setTableDataSource(values.dataSource);
|
114
|
+
values.dataTarget && setTableDataTarget(values.dataTarget);
|
115
|
+
values.options && setOptions(values.options);
|
116
|
+
}, [form]);
|
95
117
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
96
118
|
style: {
|
97
119
|
width: '100%',
|
@@ -102,7 +124,6 @@ var MapTable = function MapTable(props) {
|
|
102
124
|
marginBottom: '10px'
|
103
125
|
}
|
104
126
|
}, /*#__PURE__*/React.createElement(_Select, {
|
105
|
-
defaultValue: "a1",
|
106
127
|
onChange: onOutputChange,
|
107
128
|
value: output,
|
108
129
|
style: {
|
@@ -127,15 +148,15 @@ var MapTable = function MapTable(props) {
|
|
127
148
|
onRowConfirm: function onRowConfirm() {},
|
128
149
|
onRowDelete: function onRowDelete() {},
|
129
150
|
getStreamInstance: function getStreamInstance(stream) {
|
130
|
-
return
|
151
|
+
return sourceEditableStreamRef.current = stream;
|
131
152
|
},
|
132
153
|
onRowClick: function onRowClick(record) {},
|
133
|
-
onMove:
|
154
|
+
onMove: onSourceMove
|
134
155
|
})), /*#__PURE__*/React.createElement("div", {
|
135
156
|
style: {
|
136
157
|
marginTop: '40px'
|
137
158
|
}
|
138
|
-
}, _toConsumableArray(Array(Math.min(tableDataSource === null || tableDataSource === void 0 ? void 0 : tableDataSource.length,
|
159
|
+
}, _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) {
|
139
160
|
return /*#__PURE__*/React.createElement("div", {
|
140
161
|
key: index,
|
141
162
|
style: {
|
@@ -155,13 +176,18 @@ var MapTable = function MapTable(props) {
|
|
155
176
|
style: {
|
156
177
|
width: '40%'
|
157
178
|
}
|
158
|
-
}, /*#__PURE__*/React.createElement(
|
159
|
-
|
160
|
-
|
161
|
-
columns:
|
162
|
-
dataSource:
|
163
|
-
|
164
|
-
|
179
|
+
}, /*#__PURE__*/React.createElement(Editable, {
|
180
|
+
readonly: true,
|
181
|
+
type: "single",
|
182
|
+
columns: columnSource,
|
183
|
+
dataSource: tableDataTarget,
|
184
|
+
onRowConfirm: function onRowConfirm() {},
|
185
|
+
onRowDelete: function onRowDelete() {},
|
186
|
+
getStreamInstance: function getStreamInstance(stream) {
|
187
|
+
return targetEditableStreamRef.current = stream;
|
188
|
+
},
|
189
|
+
onRowClick: function onRowClick(record) {},
|
190
|
+
onMove: onTargetMove
|
165
191
|
})))));
|
166
192
|
};
|
167
193
|
export default MapTable;
|
@@ -330,7 +330,7 @@ var SourceConfig = function SourceConfig(props) {
|
|
330
330
|
body: '{"type":"Kafka","level":2}',
|
331
331
|
value: 'name',
|
332
332
|
watch: 'defaultSource',
|
333
|
-
key: '
|
333
|
+
key: 'dfSourceId',
|
334
334
|
url: '/dataset-web/source/cascade/data/v2'
|
335
335
|
};
|
336
336
|
var _React$useState29 = React.useState(),
|
@@ -143,6 +143,7 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
143
143
|
overflowY: 'auto'
|
144
144
|
}
|
145
145
|
}, list.map(function (item, idx) {
|
146
|
+
var _item$alias;
|
146
147
|
return /*#__PURE__*/React.createElement("div", {
|
147
148
|
key: idx,
|
148
149
|
style: {
|
@@ -174,7 +175,7 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
174
175
|
marginLeft: '5px',
|
175
176
|
marginRight: '8px'
|
176
177
|
},
|
177
|
-
value: "tbl".concat(idx + 1),
|
178
|
+
value: (_item$alias = item.alias) !== null && _item$alias !== void 0 ? _item$alias : "tbl".concat(idx + 1),
|
178
179
|
onChange: function onChange(val) {
|
179
180
|
return onListChange(val, idx, 'alias');
|
180
181
|
}
|
@@ -194,7 +195,7 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
194
195
|
overflowY: 'auto'
|
195
196
|
}
|
196
197
|
}, /*#__PURE__*/React.createElement(SqlEdit, {
|
197
|
-
value: "
|
198
|
+
value: "/*+".concat(item.alias ? "name(".concat(item.alias, ")") : "name(tbl".concat(idx + 1, ")"), " ").concat(item.outputView ? "output(".concat(item.outputView, ")") : '', "*/"),
|
198
199
|
theme: 'neo',
|
199
200
|
isLineNumbers: false,
|
200
201
|
extraDico: extraDico,
|