ronds-metadata 1.3.83 → 1.3.84
Sign up to get free protection for your applications and to get access to all the features.
- 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 +1 -1
- package/es/comps/MetadataForm/DataCell/plugin/Datasource/index.js +11 -4
- package/es/comps/MetadataForm/DataCell/plugin/MapTable.js +1 -1
- package/es/comps/MetadataForm/DataCell/plugin/SparkSqlTable.js +21 -6
- package/package.json +1 -1
@@ -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);
|
@@ -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);
|
@@ -40,20 +40,35 @@ var SparkSqlTable = function SparkSqlTable(props) {
|
|
40
40
|
var formContext = React.useContext(MetadataFormContext) || {};
|
41
41
|
useObservable(function (p) {
|
42
42
|
if ((p === null || p === void 0 ? void 0 : p.type) === STREAM_EVENT_TYPE.ON_VALUES_CHANGE) {
|
43
|
-
var _p$payload, _val$datasource, _val$
|
43
|
+
var _p$payload, _val$datasource, _val$datasource5;
|
44
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
45
|
var _selected;
|
46
|
+
var _array = [];
|
46
47
|
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
|
-
|
48
|
+
var _val$datasource2;
|
49
|
+
if (!Array.isArray(val === null || val === void 0 ? void 0 : (_val$datasource2 = val.datasource) === null || _val$datasource2 === void 0 ? void 0 : _val$datasource2.topics)) {
|
50
|
+
var _val$datasource3;
|
51
|
+
_array = [val === null || val === void 0 ? void 0 : (_val$datasource3 = val.datasource) === null || _val$datasource3 === void 0 ? void 0 : _val$datasource3.topics];
|
52
|
+
} else {
|
53
|
+
var _val$datasource4;
|
54
|
+
_array = val === null || val === void 0 ? void 0 : (_val$datasource4 = val.datasource) === null || _val$datasource4 === void 0 ? void 0 : _val$datasource4.topics;
|
55
|
+
}
|
56
|
+
_selected = _array.map(function (p) {
|
49
57
|
var _JSON$parse;
|
50
58
|
return (_JSON$parse = JSON.parse(p)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.name;
|
51
59
|
});
|
52
60
|
setSelected(_toConsumableArray(_selected));
|
53
61
|
}
|
54
|
-
if (val === null || val === void 0 ? void 0 : (_val$
|
55
|
-
var _val$
|
56
|
-
|
62
|
+
if (val === null || val === void 0 ? void 0 : (_val$datasource5 = val.datasource) === null || _val$datasource5 === void 0 ? void 0 : _val$datasource5.dt) {
|
63
|
+
var _val$datasource6;
|
64
|
+
if (!Array.isArray(val === null || val === void 0 ? void 0 : (_val$datasource6 = val.datasource) === null || _val$datasource6 === void 0 ? void 0 : _val$datasource6.dt)) {
|
65
|
+
var _val$datasource7;
|
66
|
+
_array = [val === null || val === void 0 ? void 0 : (_val$datasource7 = val.datasource) === null || _val$datasource7 === void 0 ? void 0 : _val$datasource7.dt];
|
67
|
+
} else {
|
68
|
+
var _val$datasource8;
|
69
|
+
_array = val === null || val === void 0 ? void 0 : (_val$datasource8 = val.datasource) === null || _val$datasource8 === void 0 ? void 0 : _val$datasource8.dt;
|
70
|
+
}
|
71
|
+
_selected = _array.map(function (p) {
|
57
72
|
var _JSON$parse2;
|
58
73
|
return (_JSON$parse2 = JSON.parse(p)) === null || _JSON$parse2 === void 0 ? void 0 : _JSON$parse2.name;
|
59
74
|
});
|