ronds-metadata 1.3.83 → 1.3.85
Sign up to get free protection for your applications and to get access to all the features.
- package/es/comps/CodeEdit/index.d.ts +1 -0
- package/es/comps/CodeEdit/index.js +3 -2
- package/es/comps/MetadataForm/DataCell/Input.js +8 -4
- package/es/comps/MetadataForm/DataCell/business/config.d.ts +0 -1
- package/es/comps/MetadataForm/DataCell/business/config.js +1 -1
- package/es/comps/MetadataForm/DataCell/business/index.js +2 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.d.ts +1 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Cassandra.js +10 -5
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.d.ts +1 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/Kafka.js +8 -4
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.d.ts +1 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/PostgreSQL.js +12 -6
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.d.ts +1 -0
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/SqlServer.js +12 -6
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/index.js +35 -11
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.d.ts +1 -0
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.js +13 -17
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.d.ts +1 -0
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +33 -12
- package/es/config.js +1 -0
- package/package.json +1 -1
@@ -19,7 +19,8 @@ var CodeEdit = function CodeEdit(props) {
|
|
19
19
|
theme = _props$theme === void 0 ? 'light' : _props$theme,
|
20
20
|
_props$mode = props.mode,
|
21
21
|
mode = _props$mode === void 0 ? 'javascript' : _props$mode,
|
22
|
-
onChange = props.onChange
|
22
|
+
onChange = props.onChange,
|
23
|
+
readOnly = props.readOnly;
|
23
24
|
var editorRef = React.useRef(null);
|
24
25
|
var firstLoadRef = React.useRef(true);
|
25
26
|
var monaco = useMonaco();
|
@@ -131,7 +132,7 @@ var CodeEdit = function CodeEdit(props) {
|
|
131
132
|
editorRef.current = editor;
|
132
133
|
},
|
133
134
|
options: {
|
134
|
-
readOnly:
|
135
|
+
readOnly: readOnly,
|
135
136
|
automaticLayout: true,
|
136
137
|
wordWrap: 'on',
|
137
138
|
quickSuggestions: true,
|
@@ -133,7 +133,7 @@ function Index(props) {
|
|
133
133
|
}, _callee);
|
134
134
|
})), [extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.autoComplete]);
|
135
135
|
var processInputType = function processInputType(_type) {
|
136
|
-
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5, _extraInfo$disabled6, _extraInfo$disabled7, _extraInfo$disabled8, _extraInfo$disabled9, _extraInfo$addonAfter2, _extraInfo$addonAfter3, _extraInfo$addonAfter4, _extraInfo$addonAfter5, _extraInfo$
|
136
|
+
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5, _extraInfo$disabled6, _extraInfo$disabled7, _extraInfo$disabled8, _extraInfo$disabled9, _extraInfo$disabled10, _extraInfo$disabled11, _extraInfo$addonAfter2, _extraInfo$addonAfter3, _extraInfo$addonAfter4, _extraInfo$addonAfter5, _extraInfo$disabled12;
|
137
137
|
switch (_type) {
|
138
138
|
case 'autoComplete':
|
139
139
|
return /*#__PURE__*/React.createElement(_AutoComplete, {
|
@@ -210,9 +210,13 @@ function Index(props) {
|
|
210
210
|
disabled: (_extraInfo$disabled9 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled9 !== void 0 ? _extraInfo$disabled9 : disabled
|
211
211
|
});
|
212
212
|
case 'sparkSqlTable':
|
213
|
-
return /*#__PURE__*/React.createElement(SparkSqlTable, extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.sparkSqlTable
|
213
|
+
return /*#__PURE__*/React.createElement(SparkSqlTable, _extends({}, extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.sparkSqlTable, {
|
214
|
+
disabled: (_extraInfo$disabled10 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled10 !== void 0 ? _extraInfo$disabled10 : disabled
|
215
|
+
}));
|
214
216
|
case 'mapTable':
|
215
|
-
return /*#__PURE__*/React.createElement(MapTable, extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.mapTable
|
217
|
+
return /*#__PURE__*/React.createElement(MapTable, _extends({}, extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.mapTable, {
|
218
|
+
disabled: (_extraInfo$disabled11 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled11 !== void 0 ? _extraInfo$disabled11 : disabled
|
219
|
+
}));
|
216
220
|
default:
|
217
221
|
return /*#__PURE__*/React.createElement(_Input, {
|
218
222
|
addonAfter: ((_extraInfo$addonAfter2 = extraInfo.addonAfter) === null || _extraInfo$addonAfter2 === void 0 ? void 0 : _extraInfo$addonAfter2.key) ? /*#__PURE__*/React.createElement(_Form.Item, {
|
@@ -227,7 +231,7 @@ function Index(props) {
|
|
227
231
|
}))) : undefined,
|
228
232
|
showCount: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.showCount,
|
229
233
|
maxLength: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.maxLength,
|
230
|
-
disabled: (_extraInfo$
|
234
|
+
disabled: (_extraInfo$disabled12 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled12 !== void 0 ? _extraInfo$disabled12 : disabled,
|
231
235
|
placeholder: tr(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder),
|
232
236
|
title: tr(valueTitle),
|
233
237
|
allowClear: true
|
@@ -18,7 +18,7 @@ var BusinessForm = function BusinessForm(props) {
|
|
18
18
|
if (value) {
|
19
19
|
formRef.current.setFieldsValue(_objectSpread({}, value));
|
20
20
|
}
|
21
|
-
}, []);
|
21
|
+
}, [value]);
|
22
22
|
var triggerChange = function triggerChange(changedValue) {
|
23
23
|
valueRef.current = _objectSpread(_objectSpread({}, valueRef.current), changedValue);
|
24
24
|
onChange && onChange(valueRef.current);
|
@@ -27,6 +27,7 @@ var BusinessForm = function BusinessForm(props) {
|
|
27
27
|
triggerChange(values);
|
28
28
|
};
|
29
29
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(MetadataForm, {
|
30
|
+
disabled: disabled,
|
30
31
|
schema: schema,
|
31
32
|
getFormInstance: function getFormInstance(form) {
|
32
33
|
formRef.current = form;
|
@@ -20,7 +20,8 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
20
20
|
onChange = props.onChange,
|
21
21
|
wrapperCol = props.wrapperCol,
|
22
22
|
labelCol = props.labelCol,
|
23
|
-
initialValue = props.initialValue
|
23
|
+
initialValue = props.initialValue,
|
24
|
+
disabled = props.disabled;
|
24
25
|
var _React$useState = React.useState(),
|
25
26
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
26
27
|
keySpace = _React$useState2[0],
|
@@ -78,7 +79,8 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
78
79
|
allowClear: true,
|
79
80
|
value: keySpace,
|
80
81
|
options: keySpaceOpts,
|
81
|
-
onChange: onKeySpaceChange
|
82
|
+
onChange: onKeySpaceChange,
|
83
|
+
disabled: disabled
|
82
84
|
})), /*#__PURE__*/React.createElement(_Col, {
|
83
85
|
span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
|
84
86
|
flex: labelCol
|
@@ -108,7 +110,8 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
108
110
|
onChange: onDataTableChange,
|
109
111
|
style: {
|
110
112
|
width: 'calc(100% - 32px)'
|
111
|
-
}
|
113
|
+
},
|
114
|
+
disabled: disabled
|
112
115
|
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
113
116
|
title: tr('手动建表'),
|
114
117
|
style: {
|
@@ -116,13 +119,15 @@ var CassandraDatasource = function CassandraDatasource(props) {
|
|
116
119
|
}
|
117
120
|
}, /*#__PURE__*/React.createElement(_Button, {
|
118
121
|
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
119
|
-
onClick: onPlusClick
|
122
|
+
onClick: onPlusClick,
|
123
|
+
disabled: disabled
|
120
124
|
}))) : /*#__PURE__*/React.createElement(_Select, {
|
121
125
|
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
126
|
allowClear: true,
|
123
127
|
value: dataTable,
|
124
128
|
options: dataTableOpts,
|
125
|
-
onChange: onDataTableChange
|
129
|
+
onChange: onDataTableChange,
|
130
|
+
disabled: disabled
|
126
131
|
})));
|
127
132
|
};
|
128
133
|
export default CassandraDatasource;
|
@@ -20,7 +20,8 @@ var KafkaDatasource = function KafkaDatasource(props) {
|
|
20
20
|
onChange = props.onChange,
|
21
21
|
wrapperCol = props.wrapperCol,
|
22
22
|
labelCol = props.labelCol,
|
23
|
-
initialValue = props.initialValue
|
23
|
+
initialValue = props.initialValue,
|
24
|
+
disabled = props.disabled;
|
24
25
|
var _React$useState = React.useState(),
|
25
26
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
26
27
|
topic = _React$useState2[0],
|
@@ -71,7 +72,8 @@ var KafkaDatasource = function KafkaDatasource(props) {
|
|
71
72
|
onChange: onTopicChange,
|
72
73
|
style: {
|
73
74
|
width: 'calc(100% - 32px)'
|
74
|
-
}
|
75
|
+
},
|
76
|
+
disabled: disabled
|
75
77
|
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
76
78
|
title: tr('手动建表'),
|
77
79
|
style: {
|
@@ -79,13 +81,15 @@ var KafkaDatasource = function KafkaDatasource(props) {
|
|
79
81
|
}
|
80
82
|
}, /*#__PURE__*/React.createElement(_Button, {
|
81
83
|
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
82
|
-
onClick: onPlusClick
|
84
|
+
onClick: onPlusClick,
|
85
|
+
disabled: disabled
|
83
86
|
}))) : /*#__PURE__*/React.createElement(_Select, {
|
84
87
|
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,
|
85
88
|
value: topic,
|
86
89
|
allowClear: true,
|
87
90
|
options: topicOpts,
|
88
|
-
onChange: onTopicChange
|
91
|
+
onChange: onTopicChange,
|
92
|
+
disabled: disabled
|
89
93
|
})));
|
90
94
|
};
|
91
95
|
export default KafkaDatasource;
|
@@ -25,7 +25,8 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
25
25
|
labelCol = props.labelCol,
|
26
26
|
datasource = props.datasource,
|
27
27
|
onChange = props.onChange,
|
28
|
-
initialValue = props.initialValue
|
28
|
+
initialValue = props.initialValue,
|
29
|
+
disabled = props.disabled;
|
29
30
|
var _React$useState = React.useState(),
|
30
31
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
31
32
|
dataBase = _React$useState2[0],
|
@@ -95,7 +96,8 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
95
96
|
allowClear: true,
|
96
97
|
value: dataBase,
|
97
98
|
options: dataBaseOpts,
|
98
|
-
onChange: onDataBaseChange
|
99
|
+
onChange: onDataBaseChange,
|
100
|
+
disabled: disabled
|
99
101
|
})), /*#__PURE__*/React.createElement(_Col, {
|
100
102
|
span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
|
101
103
|
flex: labelCol
|
@@ -120,7 +122,8 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
120
122
|
allowClear: true,
|
121
123
|
value: schema,
|
122
124
|
options: schemaOpts,
|
123
|
-
onChange: onSchemaChange
|
125
|
+
onChange: onSchemaChange,
|
126
|
+
disabled: disabled
|
124
127
|
})), /*#__PURE__*/React.createElement(_Col, {
|
125
128
|
span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
|
126
129
|
flex: labelCol
|
@@ -150,7 +153,8 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
150
153
|
onChange: onDataTableChange,
|
151
154
|
style: {
|
152
155
|
width: 'calc(100% - 32px)'
|
153
|
-
}
|
156
|
+
},
|
157
|
+
disabled: disabled
|
154
158
|
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
155
159
|
title: tr('手动建表'),
|
156
160
|
style: {
|
@@ -158,13 +162,15 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
|
|
158
162
|
}
|
159
163
|
}, /*#__PURE__*/React.createElement(_Button, {
|
160
164
|
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
161
|
-
onClick: onPlusClick
|
165
|
+
onClick: onPlusClick,
|
166
|
+
disabled: disabled
|
162
167
|
}))) : /*#__PURE__*/React.createElement(_Select, {
|
163
168
|
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,
|
164
169
|
allowClear: true,
|
165
170
|
value: dataTable,
|
166
171
|
options: dataTableOpts,
|
167
|
-
onChange: onDataTableChange
|
172
|
+
onChange: onDataTableChange,
|
173
|
+
disabled: disabled
|
168
174
|
})));
|
169
175
|
};
|
170
176
|
export default PostgreSQLDatasource;
|
@@ -20,7 +20,8 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
20
20
|
wrapperCol = props.wrapperCol,
|
21
21
|
labelCol = props.labelCol,
|
22
22
|
onChange = props.onChange,
|
23
|
-
initialValue = props.initialValue
|
23
|
+
initialValue = props.initialValue,
|
24
|
+
disabled = props.disabled;
|
24
25
|
var _React$useState = React.useState(),
|
25
26
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
26
27
|
dataBase = _React$useState2[0],
|
@@ -90,7 +91,8 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
90
91
|
allowClear: true,
|
91
92
|
value: dataBase,
|
92
93
|
options: dataBaseOpts,
|
93
|
-
onChange: onDataBaseChange
|
94
|
+
onChange: onDataBaseChange,
|
95
|
+
disabled: disabled
|
94
96
|
})), /*#__PURE__*/React.createElement(_Col, {
|
95
97
|
span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
|
96
98
|
flex: labelCol
|
@@ -115,7 +117,8 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
115
117
|
allowClear: true,
|
116
118
|
value: schema,
|
117
119
|
options: schemaOpts,
|
118
|
-
onChange: onSchemaChange
|
120
|
+
onChange: onSchemaChange,
|
121
|
+
disabled: disabled
|
119
122
|
})), /*#__PURE__*/React.createElement(_Col, {
|
120
123
|
span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
|
121
124
|
flex: labelCol
|
@@ -145,7 +148,8 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
145
148
|
onChange: onDataTableChange,
|
146
149
|
style: {
|
147
150
|
width: 'calc(100% - 32px)'
|
148
|
-
}
|
151
|
+
},
|
152
|
+
disabled: disabled
|
149
153
|
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
150
154
|
title: tr('手动建表'),
|
151
155
|
style: {
|
@@ -153,13 +157,15 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
|
|
153
157
|
}
|
154
158
|
}, /*#__PURE__*/React.createElement(_Button, {
|
155
159
|
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
156
|
-
onClick: onPlusClick
|
160
|
+
onClick: onPlusClick,
|
161
|
+
disabled: disabled
|
157
162
|
}))) : /*#__PURE__*/React.createElement(_Select, {
|
158
163
|
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,
|
159
164
|
allowClear: true,
|
160
165
|
value: dataTable,
|
161
166
|
options: dataTableOpts,
|
162
|
-
onChange: onDataTableChange
|
167
|
+
onChange: onDataTableChange,
|
168
|
+
disabled: disabled
|
163
169
|
})));
|
164
170
|
};
|
165
171
|
export default SqlServerDatasource;
|
@@ -64,6 +64,16 @@ var DataSource = function DataSource(props) {
|
|
64
64
|
};
|
65
65
|
});
|
66
66
|
}, [extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource2 = extraInfo.datasource) === null || _extraInfo$datasource2 === void 0 ? void 0 : _extraInfo$datasource2.type]);
|
67
|
+
var resetDatasource = function resetDatasource(value) {
|
68
|
+
var updateValue = _objectSpread({}, valueRef.current);
|
69
|
+
Object.keys(updateValue).forEach(function (key) {
|
70
|
+
if (key !== 'dsType') {
|
71
|
+
updateValue[key] = undefined;
|
72
|
+
}
|
73
|
+
});
|
74
|
+
updateValue.dsType = value;
|
75
|
+
return updateValue;
|
76
|
+
};
|
67
77
|
var triggerChange = function triggerChange(changedValue) {
|
68
78
|
valueRef.current = _objectSpread(_objectSpread({}, valueRef.current), changedValue);
|
69
79
|
onChange && onChange(valueRef.current);
|
@@ -71,10 +81,7 @@ var DataSource = function DataSource(props) {
|
|
71
81
|
var onDatasourceTypeChange = function onDatasourceTypeChange(value) {
|
72
82
|
setDsType(value);
|
73
83
|
setDatasource('');
|
74
|
-
triggerChange({
|
75
|
-
dsType: value,
|
76
|
-
datasource: ''
|
77
|
-
});
|
84
|
+
triggerChange(_objectSpread({}, resetDatasource(value)));
|
78
85
|
};
|
79
86
|
var onDatasourceChange = function onDatasourceChange(value) {
|
80
87
|
setDatasource(value);
|
@@ -113,6 +120,16 @@ var DataSource = function DataSource(props) {
|
|
113
120
|
datasource: value.datasource
|
114
121
|
});
|
115
122
|
}
|
123
|
+
if (value.link) {
|
124
|
+
triggerChange({
|
125
|
+
link: value.link
|
126
|
+
});
|
127
|
+
}
|
128
|
+
if (value.plus) {
|
129
|
+
triggerChange({
|
130
|
+
plus: value.plus
|
131
|
+
});
|
132
|
+
}
|
116
133
|
switch (value === null || value === void 0 ? void 0 : value.dsType) {
|
117
134
|
case 'Kafka':
|
118
135
|
setKafkaInitValue(value);
|
@@ -167,7 +184,8 @@ var DataSource = function DataSource(props) {
|
|
167
184
|
},
|
168
185
|
value: dsType,
|
169
186
|
options: datasourceTypeOpts,
|
170
|
-
onChange: onDatasourceTypeChange
|
187
|
+
onChange: onDatasourceTypeChange,
|
188
|
+
disabled: disabled
|
171
189
|
}), /*#__PURE__*/React.createElement(_Select, {
|
172
190
|
id: 'datasource',
|
173
191
|
style: {
|
@@ -175,7 +193,8 @@ var DataSource = function DataSource(props) {
|
|
175
193
|
},
|
176
194
|
value: datasource,
|
177
195
|
options: datasourceOpts,
|
178
|
-
onChange: onDatasourceChange
|
196
|
+
onChange: onDatasourceChange,
|
197
|
+
disabled: disabled
|
179
198
|
}), /*#__PURE__*/React.createElement(_Tooltip, {
|
180
199
|
title: tr('测试链接'),
|
181
200
|
style: {
|
@@ -183,35 +202,40 @@ var DataSource = function DataSource(props) {
|
|
183
202
|
}
|
184
203
|
}, /*#__PURE__*/React.createElement(_Button, {
|
185
204
|
icon: /*#__PURE__*/React.createElement(LinkOutlined, null),
|
186
|
-
onClick: onLinkClick
|
205
|
+
onClick: onLinkClick,
|
206
|
+
disabled: disabled
|
187
207
|
})))), dsType === 'Kafka' && /*#__PURE__*/React.createElement(KafkaDatasource, {
|
188
208
|
wrapperCol: wrapperCol,
|
189
209
|
labelCol: labelCol,
|
190
210
|
extraInfo: extraInfo,
|
191
211
|
datasource: datasource,
|
192
212
|
onChange: onKafkaChange,
|
193
|
-
initialValue: kafkaInitValue
|
213
|
+
initialValue: kafkaInitValue,
|
214
|
+
disabled: disabled
|
194
215
|
}), dsType === 'PostgreSql' && /*#__PURE__*/React.createElement(PostgreSQLDatasource, {
|
195
216
|
wrapperCol: wrapperCol,
|
196
217
|
labelCol: labelCol,
|
197
218
|
extraInfo: extraInfo,
|
198
219
|
datasource: datasource,
|
199
220
|
onChange: onPgSqlChange,
|
200
|
-
initialValue: postgreSQLInitValue
|
221
|
+
initialValue: postgreSQLInitValue,
|
222
|
+
disabled: disabled
|
201
223
|
}), dsType === 'Cassandra' && /*#__PURE__*/React.createElement(CassandraDatasource, {
|
202
224
|
wrapperCol: wrapperCol,
|
203
225
|
labelCol: labelCol,
|
204
226
|
extraInfo: extraInfo,
|
205
227
|
datasource: datasource,
|
206
228
|
onChange: onCassandraChange,
|
207
|
-
initialValue: cassandraInitValue
|
229
|
+
initialValue: cassandraInitValue,
|
230
|
+
disabled: disabled
|
208
231
|
}), dsType === 'SqlServer' && /*#__PURE__*/React.createElement(SqlServerDatasource, {
|
209
232
|
wrapperCol: wrapperCol,
|
210
233
|
labelCol: labelCol,
|
211
234
|
extraInfo: extraInfo,
|
212
235
|
datasource: datasource,
|
213
236
|
onChange: onSqlServerChange,
|
214
|
-
initialValue: sqlServerInitValue
|
237
|
+
initialValue: sqlServerInitValue,
|
238
|
+
disabled: disabled
|
215
239
|
}))));
|
216
240
|
};
|
217
241
|
export default DataSource;
|
@@ -21,7 +21,8 @@ import { STREAM_EVENT_TYPE } from '../../constants';
|
|
21
21
|
var MapTable = function MapTable(props) {
|
22
22
|
var value = props.value,
|
23
23
|
onChange = props.onChange,
|
24
|
-
extraInfo = props.extraInfo
|
24
|
+
extraInfo = props.extraInfo,
|
25
|
+
disabled = props.disabled;
|
25
26
|
var _React$useState = React.useState([]),
|
26
27
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
27
28
|
tableDataSource = _React$useState2[0],
|
@@ -184,7 +185,8 @@ var MapTable = function MapTable(props) {
|
|
184
185
|
}, /*#__PURE__*/React.createElement(_Select, {
|
185
186
|
onChange: onOutputChange,
|
186
187
|
value: output,
|
187
|
-
options: options
|
188
|
+
options: options,
|
189
|
+
disabled: disabled
|
188
190
|
})), /*#__PURE__*/React.createElement("div", {
|
189
191
|
style: {
|
190
192
|
display: 'flex',
|
@@ -197,7 +199,7 @@ var MapTable = function MapTable(props) {
|
|
197
199
|
width: '40%'
|
198
200
|
}
|
199
201
|
}, /*#__PURE__*/React.createElement(Editable, {
|
200
|
-
readonly:
|
202
|
+
readonly: disabled,
|
201
203
|
type: "single",
|
202
204
|
columns: columnSource,
|
203
205
|
dataSource: tableDataSource,
|
@@ -210,7 +212,7 @@ var MapTable = function MapTable(props) {
|
|
210
212
|
onMove: onSourceMove
|
211
213
|
})), /*#__PURE__*/React.createElement("div", {
|
212
214
|
style: {
|
213
|
-
marginTop: '
|
215
|
+
marginTop: '39px',
|
214
216
|
marginRight: '6px'
|
215
217
|
}
|
216
218
|
}, _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) {
|
@@ -219,8 +221,7 @@ var MapTable = function MapTable(props) {
|
|
219
221
|
style: {
|
220
222
|
marginLeft: '6px',
|
221
223
|
marginRight: '6px',
|
222
|
-
|
223
|
-
lineHeight: '30px'
|
224
|
+
lineHeight: '33px'
|
224
225
|
}
|
225
226
|
}, /*#__PURE__*/React.createElement(_Button, {
|
226
227
|
key: index,
|
@@ -228,14 +229,15 @@ var MapTable = function MapTable(props) {
|
|
228
229
|
icon: disableArray && disableArray[index] ? /*#__PURE__*/React.createElement(ArrowRightOutlined, null) : /*#__PURE__*/React.createElement(CloseCircleFilled, null),
|
229
230
|
onClick: function onClick() {
|
230
231
|
return onBtnClick(index);
|
231
|
-
}
|
232
|
+
},
|
233
|
+
disabled: disabled
|
232
234
|
}));
|
233
235
|
})), /*#__PURE__*/React.createElement("div", {
|
234
236
|
style: {
|
235
237
|
width: '40%'
|
236
238
|
}
|
237
239
|
}, /*#__PURE__*/React.createElement(Editable, {
|
238
|
-
readonly:
|
240
|
+
readonly: disabled,
|
239
241
|
type: "single",
|
240
242
|
columns: columnTarget,
|
241
243
|
dataSource: tableDataTarget,
|
@@ -256,20 +258,14 @@ var columnSource = [{
|
|
256
258
|
}, {
|
257
259
|
title: '类型',
|
258
260
|
dataIndex: 'type',
|
259
|
-
key: 'type'
|
260
|
-
render: function render(val) {
|
261
|
-
return val !== null && val !== void 0 ? val : 'null';
|
262
|
-
}
|
261
|
+
key: 'type'
|
263
262
|
}, {
|
264
263
|
title: '注释',
|
265
264
|
dataIndex: 'label',
|
266
|
-
key: 'label'
|
267
|
-
render: function render(val) {
|
268
|
-
return val !== null && val !== void 0 ? val : 'null';
|
269
|
-
}
|
265
|
+
key: 'label'
|
270
266
|
}];
|
271
267
|
var columnTarget = [{
|
272
|
-
title: '
|
268
|
+
title: '目标表字段',
|
273
269
|
dataIndex: 'name',
|
274
270
|
key: 'name'
|
275
271
|
}, {
|
@@ -22,7 +22,8 @@ import { STREAM_EVENT_TYPE } from '../../constants';
|
|
22
22
|
var SparkSqlTable = function SparkSqlTable(props) {
|
23
23
|
var value = props.value,
|
24
24
|
extraInfo = props.extraInfo,
|
25
|
-
onChange = props.onChange
|
25
|
+
onChange = props.onChange,
|
26
|
+
disabled = props.disabled;
|
26
27
|
var _React$useState = React.useState('orgin'),
|
27
28
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
28
29
|
view = _React$useState2[0],
|
@@ -40,20 +41,35 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
40
41
|
var formContext = React.useContext(MetadataFormContext) || {};
|
41
42
|
useObservable(function (p) {
|
42
43
|
if ((p === null || p === void 0 ? void 0 : p.type) === STREAM_EVENT_TYPE.ON_VALUES_CHANGE) {
|
43
|
-
var _p$payload, _val$datasource, _val$
|
44
|
+
var _p$payload, _val$datasource, _val$datasource5;
|
44
45
|
var val = p === null || p === void 0 ? void 0 : (_p$payload = p.payload) === null || _p$payload === void 0 ? void 0 : _p$payload.val;
|
45
46
|
var _selected;
|
47
|
+
var _array = [];
|
46
48
|
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
|
48
|
-
|
49
|
+
var _val$datasource2;
|
50
|
+
if (!Array.isArray(val === null || val === void 0 ? void 0 : (_val$datasource2 = val.datasource) === null || _val$datasource2 === void 0 ? void 0 : _val$datasource2.topics)) {
|
51
|
+
var _val$datasource3;
|
52
|
+
_array = [val === null || val === void 0 ? void 0 : (_val$datasource3 = val.datasource) === null || _val$datasource3 === void 0 ? void 0 : _val$datasource3.topics];
|
53
|
+
} else {
|
54
|
+
var _val$datasource4;
|
55
|
+
_array = val === null || val === void 0 ? void 0 : (_val$datasource4 = val.datasource) === null || _val$datasource4 === void 0 ? void 0 : _val$datasource4.topics;
|
56
|
+
}
|
57
|
+
_selected = _array.map(function (p) {
|
49
58
|
var _JSON$parse;
|
50
59
|
return (_JSON$parse = JSON.parse(p)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.name;
|
51
60
|
});
|
52
61
|
setSelected(_toConsumableArray(_selected));
|
53
62
|
}
|
54
|
-
if (val === null || val === void 0 ? void 0 : (_val$
|
55
|
-
var _val$
|
56
|
-
|
63
|
+
if (val === null || val === void 0 ? void 0 : (_val$datasource5 = val.datasource) === null || _val$datasource5 === void 0 ? void 0 : _val$datasource5.dt) {
|
64
|
+
var _val$datasource6;
|
65
|
+
if (!Array.isArray(val === null || val === void 0 ? void 0 : (_val$datasource6 = val.datasource) === null || _val$datasource6 === void 0 ? void 0 : _val$datasource6.dt)) {
|
66
|
+
var _val$datasource7;
|
67
|
+
_array = [val === null || val === void 0 ? void 0 : (_val$datasource7 = val.datasource) === null || _val$datasource7 === void 0 ? void 0 : _val$datasource7.dt];
|
68
|
+
} else {
|
69
|
+
var _val$datasource8;
|
70
|
+
_array = val === null || val === void 0 ? void 0 : (_val$datasource8 = val.datasource) === null || _val$datasource8 === void 0 ? void 0 : _val$datasource8.dt;
|
71
|
+
}
|
72
|
+
_selected = _array.map(function (p) {
|
57
73
|
var _JSON$parse2;
|
58
74
|
return (_JSON$parse2 = JSON.parse(p)) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2.name;
|
59
75
|
});
|
@@ -161,7 +177,8 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
161
177
|
marginRight: '8px'
|
162
178
|
},
|
163
179
|
value: view,
|
164
|
-
onChange: onViewChange
|
180
|
+
onChange: onViewChange,
|
181
|
+
disabled: true
|
165
182
|
})), /*#__PURE__*/React.createElement("span", {
|
166
183
|
style: {
|
167
184
|
display: 'flex',
|
@@ -217,7 +234,8 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
217
234
|
value: item.alias,
|
218
235
|
onChange: function onChange(val) {
|
219
236
|
onListChange(val.target.value, idx, 'alias');
|
220
|
-
}
|
237
|
+
},
|
238
|
+
disabled: disabled
|
221
239
|
})), /*#__PURE__*/React.createElement("span", null, tr('输出视图'), ' ', /*#__PURE__*/React.createElement(_Input, {
|
222
240
|
style: {
|
223
241
|
width: '160px',
|
@@ -227,7 +245,8 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
227
245
|
value: item.outputView,
|
228
246
|
onChange: function onChange(val) {
|
229
247
|
return onListChange(val.target.value, idx, 'outputView');
|
230
|
-
}
|
248
|
+
},
|
249
|
+
disabled: disabled
|
231
250
|
}))), /*#__PURE__*/React.createElement("div", {
|
232
251
|
style: {
|
233
252
|
padding: '4px',
|
@@ -241,7 +260,8 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
241
260
|
theme: ((_getConfig = getConfig()) === null || _getConfig === void 0 ? void 0 : _getConfig.theme) === 'normal' ? 'light' : 'vs-dark',
|
242
261
|
onChange: function onChange(val) {
|
243
262
|
return onListChange(val, idx, 'sqlEdit');
|
244
|
-
}
|
263
|
+
},
|
264
|
+
readOnly: disabled
|
245
265
|
}))), /*#__PURE__*/React.createElement(MinusCircleOutlined, {
|
246
266
|
style: {
|
247
267
|
marginLeft: 'auto'
|
@@ -253,7 +273,8 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
253
273
|
}), /*#__PURE__*/React.createElement(_Button, {
|
254
274
|
type: "dashed",
|
255
275
|
onClick: handleAddItem,
|
256
|
-
icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
|
276
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
277
|
+
disabled: disabled
|
257
278
|
}, tr('添加SQL语句')))))));
|
258
279
|
};
|
259
280
|
export default SparkSqlTable;
|
package/es/config.js
CHANGED