ronds-metadata 1.3.75 → 1.3.77
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/comps/MetadataForm/DataCell/business/config.d.ts +0 -2
- package/es/comps/MetadataForm/DataCell/business/config.js +1 -3
- package/es/comps/MetadataForm/DataCell/business/index.js +7 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.js +1 -2
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/index.js +9 -3
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.js +25 -20
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +12 -9
- package/package.json +1 -1
|
@@ -153,7 +153,6 @@ export declare const BusinessSchema: {
|
|
|
153
153
|
common: {
|
|
154
154
|
label: string;
|
|
155
155
|
colSpan: number;
|
|
156
|
-
labelSpan: number;
|
|
157
156
|
require: boolean;
|
|
158
157
|
};
|
|
159
158
|
'common-en-US': {};
|
|
@@ -262,7 +261,6 @@ export declare const BusinessSchema: {
|
|
|
262
261
|
common: {
|
|
263
262
|
label: string;
|
|
264
263
|
colSpan: number;
|
|
265
|
-
labelSpan: number;
|
|
266
264
|
};
|
|
267
265
|
'common-en-US': {};
|
|
268
266
|
text: {
|
|
@@ -171,7 +171,6 @@ var ETL_SOURCE_SCHEMA = [{
|
|
|
171
171
|
common: {
|
|
172
172
|
label: 'Spark Sql',
|
|
173
173
|
colSpan: 2,
|
|
174
|
-
labelSpan: 4,
|
|
175
174
|
require: true
|
|
176
175
|
},
|
|
177
176
|
'common-en-US': {},
|
|
@@ -294,8 +293,7 @@ var ETL_DIRECTION_SCHEMA = [{
|
|
|
294
293
|
value: {
|
|
295
294
|
common: {
|
|
296
295
|
label: '字段映射',
|
|
297
|
-
colSpan: 2
|
|
298
|
-
labelSpan: 4
|
|
296
|
+
colSpan: 2
|
|
299
297
|
},
|
|
300
298
|
'common-en-US': {},
|
|
301
299
|
text: {
|
|
@@ -8,11 +8,17 @@ var BusinessForm = function BusinessForm(props) {
|
|
|
8
8
|
disabled = props.disabled,
|
|
9
9
|
value = props.value,
|
|
10
10
|
onChange = props.onChange;
|
|
11
|
+
var formRef = React.useRef();
|
|
11
12
|
var schema = React.useMemo(function () {
|
|
12
13
|
var _extraInfo$bussiness;
|
|
13
14
|
return BusinessSchema[extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$bussiness = extraInfo.bussiness) === null || _extraInfo$bussiness === void 0 ? void 0 : _extraInfo$bussiness.type];
|
|
14
15
|
}, [extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$bussiness2 = extraInfo.bussiness) === null || _extraInfo$bussiness2 === void 0 ? void 0 : _extraInfo$bussiness2.type]);
|
|
15
16
|
var valueRef = React.useRef({});
|
|
17
|
+
React.useEffect(function () {
|
|
18
|
+
if (value) {
|
|
19
|
+
formRef.current.setFieldsValue(_objectSpread({}, value));
|
|
20
|
+
}
|
|
21
|
+
}, [value]);
|
|
16
22
|
var triggerChange = function triggerChange(changedValue) {
|
|
17
23
|
valueRef.current = _objectSpread(_objectSpread({}, valueRef.current), changedValue);
|
|
18
24
|
onChange && onChange(valueRef.current);
|
|
@@ -23,7 +29,7 @@ var BusinessForm = function BusinessForm(props) {
|
|
|
23
29
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MetadataForm, {
|
|
24
30
|
schema: schema,
|
|
25
31
|
getFormInstance: function getFormInstance(form) {
|
|
26
|
-
|
|
32
|
+
formRef.current = form;
|
|
27
33
|
},
|
|
28
34
|
onValuesChange: onValuesChange
|
|
29
35
|
}));
|
|
@@ -9,7 +9,7 @@ import _Select from "antd/es/select";
|
|
|
9
9
|
import "antd/es/col/style";
|
|
10
10
|
import _Col from "antd/es/col";
|
|
11
11
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
12
|
-
import { tr } from '
|
|
12
|
+
import { tr } from '../../../../../framework/locale';
|
|
13
13
|
import React from 'react';
|
|
14
14
|
import { useGetDatasource } from './hooks';
|
|
15
15
|
import { PlusOutlined } from '@ant-design/icons';
|
|
@@ -27,7 +27,6 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
|
27
27
|
var keySpaceOpts = useGetDatasource('Cassandra', 2, datasource);
|
|
28
28
|
var dataTableOpts = useGetDatasource('Cassandra', 3, datasource, keySpace ? JSON.parse(keySpace).name : undefined);
|
|
29
29
|
var onKeySpaceChange = function onKeySpaceChange(value) {
|
|
30
|
-
debugger;
|
|
31
30
|
setKeySpace(value);
|
|
32
31
|
onChange && onChange({
|
|
33
32
|
keyspace: value
|
|
@@ -56,7 +56,8 @@ var DataSource = function DataSource(props) {
|
|
|
56
56
|
setDsType(value);
|
|
57
57
|
setDatasource('');
|
|
58
58
|
triggerChange({
|
|
59
|
-
dsType: value
|
|
59
|
+
dsType: value,
|
|
60
|
+
datasource: ''
|
|
60
61
|
});
|
|
61
62
|
};
|
|
62
63
|
var onDatasourceChange = function onDatasourceChange(value) {
|
|
@@ -68,10 +69,15 @@ var DataSource = function DataSource(props) {
|
|
|
68
69
|
var onKafkaChange = function onKafkaChange(value) {
|
|
69
70
|
triggerChange(_objectSpread({}, value));
|
|
70
71
|
};
|
|
71
|
-
var onPgSqlChange = function onPgSqlChange(value) {
|
|
72
|
+
var onPgSqlChange = function onPgSqlChange(value) {
|
|
73
|
+
triggerChange(_objectSpread({}, value));
|
|
74
|
+
};
|
|
72
75
|
var onCassandraChange = function onCassandraChange(value) {
|
|
73
76
|
triggerChange(_objectSpread({}, value));
|
|
74
77
|
};
|
|
78
|
+
var onSqlServerChange = function onSqlServerChange(value) {
|
|
79
|
+
triggerChange(_objectSpread({}, value));
|
|
80
|
+
};
|
|
75
81
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
76
82
|
style: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.borderHidden) ? {
|
|
77
83
|
padding: '10px 10px 10px 10px',
|
|
@@ -149,7 +155,7 @@ var DataSource = function DataSource(props) {
|
|
|
149
155
|
labelCol: labelCol,
|
|
150
156
|
extraInfo: extraInfo,
|
|
151
157
|
datasource: datasource,
|
|
152
|
-
onChange:
|
|
158
|
+
onChange: onSqlServerChange
|
|
153
159
|
}))));
|
|
154
160
|
};
|
|
155
161
|
export default DataSource;
|
|
@@ -2,10 +2,10 @@ import "antd/es/checkbox/style";
|
|
|
2
2
|
import _Checkbox from "antd/es/checkbox";
|
|
3
3
|
import "antd/es/row/style";
|
|
4
4
|
import _Row from "antd/es/row";
|
|
5
|
-
import "antd/es/col/style";
|
|
6
|
-
import _Col from "antd/es/col";
|
|
7
5
|
import "antd/es/button/style";
|
|
8
6
|
import _Button from "antd/es/button";
|
|
7
|
+
import "antd/es/col/style";
|
|
8
|
+
import _Col from "antd/es/col";
|
|
9
9
|
import "antd/es/select/style";
|
|
10
10
|
import _Select from "antd/es/select";
|
|
11
11
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
@@ -15,7 +15,7 @@ import { CloseCircleFilled, ArrowRightOutlined } from '@ant-design/icons';
|
|
|
15
15
|
import React from 'react';
|
|
16
16
|
import Editable from '../../../../comps/Editable';
|
|
17
17
|
import { MetadataFormContext } from '../../interface';
|
|
18
|
-
import { useGetLabelCol } from './Datasource/hooks';
|
|
18
|
+
import { useGetLabelCol, useGetWrapperCol } from './Datasource/hooks';
|
|
19
19
|
var MapTable = function MapTable(props) {
|
|
20
20
|
var value = props.value,
|
|
21
21
|
onChange = props.onChange,
|
|
@@ -28,6 +28,8 @@ var MapTable = function MapTable(props) {
|
|
|
28
28
|
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
29
29
|
tableDataTarget = _React$useState4[0],
|
|
30
30
|
setTableDataTarget = _React$useState4[1];
|
|
31
|
+
var tableDataSourceRef = React.useRef([]);
|
|
32
|
+
var tableDataTargetRef = React.useRef([]);
|
|
31
33
|
var _React$useState5 = React.useState([]),
|
|
32
34
|
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
33
35
|
options = _React$useState6[0],
|
|
@@ -49,6 +51,7 @@ var MapTable = function MapTable(props) {
|
|
|
49
51
|
var _React$useContext = React.useContext(MetadataFormContext),
|
|
50
52
|
form = _React$useContext.form;
|
|
51
53
|
var labelCol = useGetLabelCol(extraInfo);
|
|
54
|
+
var wrapperCol = useGetWrapperCol(extraInfo);
|
|
52
55
|
var triggerChange = function triggerChange(changedValue) {
|
|
53
56
|
onChange && onChange(_objectSpread({
|
|
54
57
|
mapping: mapping,
|
|
@@ -74,12 +77,14 @@ var MapTable = function MapTable(props) {
|
|
|
74
77
|
var removedElement = newDataSource.splice(data === null || data === void 0 ? void 0 : data.dragIndex, 1)[0];
|
|
75
78
|
newDataSource.splice(data === null || data === void 0 ? void 0 : data.hoverIndex, 0, removedElement);
|
|
76
79
|
setTableDataSource(newDataSource);
|
|
80
|
+
tableDataSourceRef.current = newDataSource;
|
|
77
81
|
};
|
|
78
82
|
var onTargetMove = function onTargetMove(data) {
|
|
79
83
|
var newDataTarget = _toConsumableArray(tableDataTarget);
|
|
80
84
|
var removedElement = newDataTarget.splice(data === null || data === void 0 ? void 0 : data.dragIndex, 1)[0];
|
|
81
85
|
newDataTarget.splice(data === null || data === void 0 ? void 0 : data.hoverIndex, 0, removedElement);
|
|
82
86
|
setTableDataTarget(newDataTarget);
|
|
87
|
+
tableDataTargetRef.current = newDataTarget;
|
|
83
88
|
};
|
|
84
89
|
React.useEffect(function () {
|
|
85
90
|
if (value) {
|
|
@@ -114,44 +119,44 @@ var MapTable = function MapTable(props) {
|
|
|
114
119
|
}, [disableArray]);
|
|
115
120
|
React.useEffect(function () {
|
|
116
121
|
var values = form.getFieldsValue().mapTable;
|
|
117
|
-
|
|
118
|
-
(
|
|
122
|
+
debugger;
|
|
123
|
+
if (tableDataSourceRef.current.length !== 0) {
|
|
124
|
+
setTableDataSource(tableDataSourceRef.current);
|
|
125
|
+
} else {
|
|
126
|
+
(values === null || values === void 0 ? void 0 : values.dataSource) && setTableDataSource(values.dataSource);
|
|
127
|
+
}
|
|
128
|
+
if (tableDataTargetRef.current.length !== 0) {
|
|
129
|
+
setTableDataTarget(tableDataTargetRef.current);
|
|
130
|
+
} else {
|
|
131
|
+
(values === null || values === void 0 ? void 0 : values.dataTarget) && setTableDataTarget(values.dataTarget);
|
|
132
|
+
}
|
|
119
133
|
(values === null || values === void 0 ? void 0 : values.options) && setOptions(values.options);
|
|
120
134
|
if (!disableArray && (values === null || values === void 0 ? void 0 : values.dataSource) && (values === null || values === void 0 ? void 0 : values.dataTarget)) {
|
|
121
135
|
var _values$dataSource, _values$dataTarget;
|
|
122
136
|
var valueArray = new Array(Math.min((_values$dataSource = values.dataSource) === null || _values$dataSource === void 0 ? void 0 : _values$dataSource.length, (_values$dataTarget = values.dataTarget) === null || _values$dataTarget === void 0 ? void 0 : _values$dataTarget.length)).fill(true);
|
|
123
137
|
setDisableArray(valueArray);
|
|
124
138
|
}
|
|
125
|
-
}, [form.getFieldsValue()]);
|
|
139
|
+
}, [form.getFieldsValue(), disableArray]);
|
|
126
140
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Row, {
|
|
127
141
|
className: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.borderHidden) && 'ant-form-item',
|
|
128
142
|
style: {
|
|
129
143
|
alignItems: 'center'
|
|
130
144
|
}
|
|
131
145
|
}, /*#__PURE__*/React.createElement(_Col, {
|
|
132
|
-
|
|
133
|
-
flex: labelCol
|
|
134
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
146
|
+
flex: wrapperCol,
|
|
135
147
|
style: {
|
|
136
|
-
|
|
137
|
-
height: '100%'
|
|
138
|
-
}
|
|
139
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
140
|
-
style: {
|
|
141
|
-
marginBottom: '10px'
|
|
148
|
+
paddingBottom: '8px'
|
|
142
149
|
}
|
|
143
150
|
}, /*#__PURE__*/React.createElement(_Select, {
|
|
144
151
|
onChange: onOutputChange,
|
|
145
152
|
value: output,
|
|
146
|
-
style: {
|
|
147
|
-
width: 150
|
|
148
|
-
},
|
|
149
153
|
options: options
|
|
150
154
|
})), /*#__PURE__*/React.createElement("div", {
|
|
151
155
|
style: {
|
|
152
156
|
display: 'flex',
|
|
153
157
|
width: '100%',
|
|
154
|
-
height: '100%'
|
|
158
|
+
height: '100%',
|
|
159
|
+
marginTop: '2px'
|
|
155
160
|
}
|
|
156
161
|
}, (tableDataSource === null || tableDataSource === void 0 ? void 0 : tableDataSource.length) > 0 && (tableDataTarget === null || tableDataTarget === void 0 ? void 0 : tableDataTarget.length) > 0 && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
157
162
|
style: {
|
|
@@ -205,7 +210,7 @@ var MapTable = function MapTable(props) {
|
|
|
205
210
|
},
|
|
206
211
|
onRowClick: function onRowClick(record) {},
|
|
207
212
|
onMove: onTargetMove
|
|
208
|
-
}))))))
|
|
213
|
+
}))))));
|
|
209
214
|
};
|
|
210
215
|
export default MapTable;
|
|
211
216
|
var columnSource = [{
|
|
@@ -14,7 +14,7 @@ import React from 'react';
|
|
|
14
14
|
import { EyeOutlined, MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
|
15
15
|
import Split from '../../../Split';
|
|
16
16
|
import SqlEdit from '../../../JsonEdit';
|
|
17
|
-
import { useGetLabelCol } from './Datasource/hooks';
|
|
17
|
+
import { useGetLabelCol, useGetWrapperCol } from './Datasource/hooks';
|
|
18
18
|
var SparkSqlTable = function SparkSqlTable(props) {
|
|
19
19
|
var extraDico = props.extraDico,
|
|
20
20
|
value = props.value,
|
|
@@ -33,6 +33,7 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
33
33
|
list = _React$useState6[0],
|
|
34
34
|
setList = _React$useState6[1];
|
|
35
35
|
var labelCol = useGetLabelCol(extraInfo);
|
|
36
|
+
var wrapperCol = useGetWrapperCol(extraInfo);
|
|
36
37
|
var handleAddItem = function handleAddItem() {
|
|
37
38
|
var _list = [].concat(_toConsumableArray(list), [{
|
|
38
39
|
alias: undefined,
|
|
@@ -99,14 +100,15 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
99
100
|
alignItems: 'center'
|
|
100
101
|
}
|
|
101
102
|
}, /*#__PURE__*/React.createElement(_Col, {
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
flex: wrapperCol,
|
|
104
|
+
style: {
|
|
105
|
+
paddingBottom: '8px'
|
|
106
|
+
}
|
|
104
107
|
}, /*#__PURE__*/React.createElement("div", {
|
|
105
108
|
style: {
|
|
106
|
-
border: '2px solid
|
|
109
|
+
border: '2px solid var(--ronds-metadata-color-border-1)',
|
|
107
110
|
height: '500px',
|
|
108
|
-
|
|
109
|
-
width: '1135px'
|
|
111
|
+
width: '100%'
|
|
110
112
|
}
|
|
111
113
|
}, /*#__PURE__*/React.createElement(Split, {
|
|
112
114
|
gutterSize: 2,
|
|
@@ -157,7 +159,8 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
157
159
|
style: {
|
|
158
160
|
padding: '8px',
|
|
159
161
|
height: '100%',
|
|
160
|
-
overflowY: 'auto'
|
|
162
|
+
overflowY: 'auto',
|
|
163
|
+
width: '100%'
|
|
161
164
|
}
|
|
162
165
|
}, list.map(function (item, idx) {
|
|
163
166
|
var _item$alias;
|
|
@@ -171,8 +174,8 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
|
171
174
|
}
|
|
172
175
|
}, /*#__PURE__*/React.createElement("div", {
|
|
173
176
|
style: {
|
|
174
|
-
border: '1px solid
|
|
175
|
-
width: '
|
|
177
|
+
border: '1px solid var(--ronds-metadata-color-border-1)',
|
|
178
|
+
width: '100%'
|
|
176
179
|
}
|
|
177
180
|
}, /*#__PURE__*/React.createElement(Split, {
|
|
178
181
|
gutterSize: 1,
|