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.
@@ -129,7 +129,6 @@ export declare const BusinessSchema: {
129
129
  id: string;
130
130
  label: string;
131
131
  colSpan: number;
132
- disabled: boolean;
133
132
  depend: {
134
133
  show: string;
135
134
  };
@@ -148,7 +148,7 @@ var ETL_SOURCE_SCHEMA = [{
148
148
  id: 'filepathValue',
149
149
  label: '文件路径',
150
150
  colSpan: 2,
151
- disabled: true,
151
+ // disabled: true,
152
152
  depend: {
153
153
  show: 'datasource.dsType=="Minio"'
154
154
  }
@@ -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);
@@ -269,7 +269,7 @@ var columnSource = [{
269
269
  }
270
270
  }];
271
271
  var columnTarget = [{
272
- title: '来源表字段',
272
+ title: '目标表字段',
273
273
  dataIndex: 'name',
274
274
  key: 'name'
275
275
  }, {
@@ -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$datasource3;
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, _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) {
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$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) {
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
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.3.83",
4
+ "version": "1.3.84",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",