ronds-metadata 1.3.77 → 1.3.79

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import 'monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js';
3
+ import './index.less';
3
4
  interface ICodeEditProps {
4
5
  value?: string;
5
6
  theme?: 'light' | 'vs-dark';
@@ -4,12 +4,13 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  /*
5
5
  * @Author: wangxian
6
6
  * @Date: 2023-09-08 10:02:20
7
- * @LastEditTime: 2023-09-08 18:47:50
7
+ * @LastEditTime: 2024-08-22 16:37:50
8
8
  */
9
9
  import Editor, { useMonaco } from '@monaco-editor/react';
10
10
  import React from 'react';
11
11
  // 引入所需的语言库
12
12
  import 'monaco-editor/esm/vs/basic-languages/pgsql/pgsql.contribution.js';
13
+ import './index.less';
13
14
  var CodeEdit = function CodeEdit(props) {
14
15
  var value = props.value,
15
16
  width = props.width,
@@ -20,6 +21,7 @@ var CodeEdit = function CodeEdit(props) {
20
21
  mode = _props$mode === void 0 ? 'javascript' : _props$mode,
21
22
  onChange = props.onChange;
22
23
  var editorRef = React.useRef(null);
24
+ var firstLoadRef = React.useRef(true);
23
25
  var monaco = useMonaco();
24
26
  var initSuggestion = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
25
27
  var l, _yield$import, conf, language;
@@ -40,13 +42,6 @@ var CodeEdit = function CodeEdit(props) {
40
42
  language = _yield$import.language;
41
43
  l = language;
42
44
  case 8:
43
- if (mode === 'python') {
44
- l = {
45
- keywords: ['signal'],
46
- operators: ['add'],
47
- builtinFunctions: ['alarm', 'plot']
48
- };
49
- }
50
45
  monaco.languages.registerCompletionItemProvider(mode, {
51
46
  provideCompletionItems: function provideCompletionItems(model, position) {
52
47
  var _l, _l2, _l3;
@@ -89,43 +84,46 @@ var CodeEdit = function CodeEdit(props) {
89
84
  },
90
85
  triggerCharacters: ['$', '.', '=', ':'] // 触发提示的字符 可以定义多个
91
86
  });
92
- case 10:
87
+ case 9:
93
88
  case "end":
94
89
  return _context.stop();
95
90
  }
96
91
  }, _callee);
97
92
  })), [monaco]);
98
- var initHighlight = React.useCallback(function () {
99
- monaco.languages.setMonarchTokensProvider(mode, {
100
- ignoreCase: true,
101
- tokenizer: {
102
- root: [[/plot/, {
103
- token: 'keyword'
104
- }], [/alarm/, {
105
- token: 'keyword'
106
- }], [/add/, {
107
- token: 'keyword'
108
- }], [/signal/, {
109
- token: 'string.escape'
110
- }]]
111
- }
112
- });
113
- }, [monaco]);
93
+ // const initHighlight = React.useCallback(() => {
94
+ // monaco.languages.setMonarchTokensProvider(mode, {
95
+ // ignoreCase: true,
96
+ // tokenizer: {
97
+ // root: [
98
+ // [/plot/, { token: 'keyword' }],
99
+ // [/alarm/, { token: 'keyword' }],
100
+ // [/add/, { token: 'keyword' }],
101
+ // [/signal/, { token: 'string.escape' }],
102
+ // ],
103
+ // },
104
+ // });
105
+ // }, [monaco]);
114
106
  React.useEffect(function () {
115
- if (monaco) {
116
- initHighlight();
107
+ if (monaco && firstLoadRef.current) {
108
+ firstLoadRef.current = false;
109
+ // initHighlight();
117
110
  initSuggestion();
118
111
  }
119
112
  }, [monaco, value, initSuggestion]);
113
+ React.useEffect(function () {
114
+ if (value) {}
115
+ }, [value]);
120
116
  var onEditorChange = function onEditorChange(data) {
121
- initHighlight();
117
+ // initHighlight();
122
118
  onChange && onChange(data);
123
119
  };
124
120
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Editor, {
121
+ className: "my-code-editor",
125
122
  width: width || '100%',
126
123
  height: height || '100%',
127
124
  theme: theme,
128
125
  defaultLanguage: mode,
126
+ value: value,
129
127
  defaultValue: value
130
128
  // beforeMount={onEditorWillMount}
131
129
  ,
@@ -135,7 +133,9 @@ var CodeEdit = function CodeEdit(props) {
135
133
  options: {
136
134
  readOnly: false,
137
135
  automaticLayout: true,
138
- wordWrap: 'on'
136
+ wordWrap: 'on',
137
+ quickSuggestions: true,
138
+ renderWhitespace: 'all'
139
139
  },
140
140
  onChange: onEditorChange
141
141
  }));
@@ -0,0 +1,6 @@
1
+ .my-code-editor {
2
+ .suggest-widget {
3
+ position: absolute !important;
4
+ z-index: 1000 !important; /* 确保它在最顶层 */
5
+ }
6
+ }
@@ -198,7 +198,7 @@ var ETL_SOURCE_SCHEMA = [{
198
198
  id: 'headers_ref',
199
199
  type: 'object',
200
200
  properties: [{
201
- id: 'input_fc05',
201
+ id: 'sheetname',
202
202
  type: 'text',
203
203
  fields: [{
204
204
  id: 'com.ronds.schema.default.Rule.Form',
@@ -214,7 +214,7 @@ var ETL_SOURCE_SCHEMA = [{
214
214
  }
215
215
  }]
216
216
  }, {
217
- id: 'input_ae91',
217
+ id: 'header',
218
218
  type: 'number',
219
219
  fields: [{
220
220
  id: 'com.ronds.schema.default.Rule.Form',
@@ -5,6 +5,7 @@ interface ICassandraDatasourceProps {
5
5
  wrapperCol: string;
6
6
  labelCol: string;
7
7
  onChange?: any;
8
+ initialValue?: any;
8
9
  }
9
10
  declare const CassandraDatasource: (props: ICassandraDatasourceProps) => React.JSX.Element;
10
11
  export default CassandraDatasource;
@@ -19,11 +19,16 @@ var CassandraDatasource = function CassandraDatasource(props) {
19
19
  datasource = props.datasource,
20
20
  onChange = props.onChange,
21
21
  wrapperCol = props.wrapperCol,
22
- labelCol = props.labelCol;
22
+ labelCol = props.labelCol,
23
+ initialValue = props.initialValue;
23
24
  var _React$useState = React.useState(),
24
25
  _React$useState2 = _slicedToArray(_React$useState, 2),
25
26
  keySpace = _React$useState2[0],
26
27
  setKeySpace = _React$useState2[1];
28
+ var _React$useState3 = React.useState(),
29
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
30
+ dataTable = _React$useState4[0],
31
+ setDataTable = _React$useState4[1];
27
32
  var keySpaceOpts = useGetDatasource('Cassandra', 2, datasource);
28
33
  var dataTableOpts = useGetDatasource('Cassandra', 3, datasource, keySpace ? JSON.parse(keySpace).name : undefined);
29
34
  var onKeySpaceChange = function onKeySpaceChange(value) {
@@ -33,10 +38,17 @@ var CassandraDatasource = function CassandraDatasource(props) {
33
38
  });
34
39
  };
35
40
  var onDataTableChange = function onDataTableChange(value) {
41
+ setDataTable(value);
36
42
  onChange && onChange({
37
43
  dt: value
38
44
  });
39
45
  };
46
+ React.useEffect(function () {
47
+ if (initialValue) {
48
+ onKeySpaceChange(initialValue.keyspace);
49
+ onDataTableChange(initialValue.dt);
50
+ }
51
+ }, [initialValue]);
40
52
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Col, {
41
53
  span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
42
54
  flex: labelCol
@@ -59,6 +71,7 @@ var CassandraDatasource = function CassandraDatasource(props) {
59
71
  }, /*#__PURE__*/React.createElement(_Select, {
60
72
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource = extraInfo.datasource) === null || _extraInfo$datasource === void 0 ? void 0 : (_extraInfo$datasource2 = _extraInfo$datasource.cassandra) === null || _extraInfo$datasource2 === void 0 ? void 0 : _extraInfo$datasource2.isMutiple) ? 'multiple' : undefined,
61
73
  allowClear: true,
74
+ value: keySpace,
62
75
  options: keySpaceOpts,
63
76
  onChange: onKeySpaceChange
64
77
  })), /*#__PURE__*/React.createElement(_Col, {
@@ -85,6 +98,7 @@ var CassandraDatasource = function CassandraDatasource(props) {
85
98
  }, /*#__PURE__*/React.createElement(_Select, {
86
99
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource3 = extraInfo.datasource) === null || _extraInfo$datasource3 === void 0 ? void 0 : (_extraInfo$datasource4 = _extraInfo$datasource3.cassandra) === null || _extraInfo$datasource4 === void 0 ? void 0 : _extraInfo$datasource4.isMutiple) ? 'multiple' : undefined,
87
100
  allowClear: true,
101
+ value: dataTable,
88
102
  options: dataTableOpts,
89
103
  onChange: onDataTableChange,
90
104
  style: {
@@ -1,9 +1,11 @@
1
+ import React from 'react';
1
2
  interface IKafkaDatasourceProps {
2
3
  extraInfo?: any;
3
4
  datasource?: any;
4
5
  wrapperCol: string;
5
6
  labelCol: string;
6
7
  onChange?: any;
8
+ initialValue?: any;
7
9
  }
8
- declare const KafkaDatasource: (props: IKafkaDatasourceProps) => import("react").JSX.Element;
10
+ declare const KafkaDatasource: (props: IKafkaDatasourceProps) => React.JSX.Element;
9
11
  export default KafkaDatasource;
@@ -2,22 +2,34 @@ import "antd/es/select/style";
2
2
  import _Select from "antd/es/select";
3
3
  import "antd/es/col/style";
4
4
  import _Col from "antd/es/col";
5
- import React from "react";
5
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
6
6
  import { tr } from '../../../../../framework/locale';
7
7
  import { useGetDatasource } from './hooks';
8
+ import React from 'react';
8
9
  var KafkaDatasource = function KafkaDatasource(props) {
9
10
  var _extraInfo$datasource, _extraInfo$datasource2;
10
11
  var extraInfo = props.extraInfo,
11
12
  datasource = props.datasource,
12
13
  onChange = props.onChange,
13
14
  wrapperCol = props.wrapperCol,
14
- labelCol = props.labelCol;
15
+ labelCol = props.labelCol,
16
+ initialValue = props.initialValue;
17
+ var _React$useState = React.useState(),
18
+ _React$useState2 = _slicedToArray(_React$useState, 2),
19
+ topic = _React$useState2[0],
20
+ setTopic = _React$useState2[1];
15
21
  var topicOpts = useGetDatasource('Kafka', 2, datasource);
16
22
  var onTopicChange = function onTopicChange(value) {
23
+ setTopic(value);
17
24
  onChange && onChange({
18
25
  topics: value
19
26
  });
20
27
  };
28
+ React.useEffect(function () {
29
+ if (initialValue) {
30
+ onTopicChange(initialValue.topics);
31
+ }
32
+ }, [initialValue]);
21
33
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Col, {
22
34
  span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
23
35
  flex: labelCol
@@ -39,6 +51,7 @@ var KafkaDatasource = function KafkaDatasource(props) {
39
51
  }
40
52
  }, /*#__PURE__*/React.createElement(_Select, {
41
53
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource = extraInfo.datasource) === null || _extraInfo$datasource === void 0 ? void 0 : (_extraInfo$datasource2 = _extraInfo$datasource.kafka) === null || _extraInfo$datasource2 === void 0 ? void 0 : _extraInfo$datasource2.isMutiple) ? 'multiple' : undefined,
54
+ value: topic,
42
55
  allowClear: true,
43
56
  options: topicOpts,
44
57
  onChange: onTopicChange
@@ -5,6 +5,7 @@ interface IPostgreSQLDatasourceProps {
5
5
  labelCol: string;
6
6
  datasource?: any;
7
7
  onChange?: any;
8
+ initialValue?: any;
8
9
  }
9
10
  declare const PostgreSQLDatasource: (props: IPostgreSQLDatasourceProps) => React.JSX.Element;
10
11
  export default PostgreSQLDatasource;
@@ -17,7 +17,8 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
17
17
  wrapperCol = props.wrapperCol,
18
18
  labelCol = props.labelCol,
19
19
  datasource = props.datasource,
20
- onChange = props.onChange;
20
+ onChange = props.onChange,
21
+ initialValue = props.initialValue;
21
22
  var _React$useState = React.useState(),
22
23
  _React$useState2 = _slicedToArray(_React$useState, 2),
23
24
  dataBase = _React$useState2[0],
@@ -26,6 +27,10 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
26
27
  _React$useState4 = _slicedToArray(_React$useState3, 2),
27
28
  schema = _React$useState4[0],
28
29
  setSchema = _React$useState4[1];
30
+ var _React$useState5 = React.useState(),
31
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
32
+ dataTable = _React$useState6[0],
33
+ setDataTable = _React$useState6[1];
29
34
  var dataBaseOpts = useGetDatasource('PostgreSql', 2, datasource);
30
35
  var schemaOpts = useGetDatasource('PostgreSql', 3, datasource, dataBase ? JSON.parse(dataBase).name : undefined);
31
36
  var dataTableOpts = useGetDatasource('PostgreSql', 4, datasource, dataBase ? JSON.parse(dataBase).name : undefined, schema ? JSON.parse(schema).name : undefined);
@@ -42,10 +47,18 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
42
47
  });
43
48
  };
44
49
  var onDataTableChange = function onDataTableChange(value) {
50
+ setDataTable(value);
45
51
  onChange && onChange({
46
52
  dt: value
47
53
  });
48
54
  };
55
+ React.useEffect(function () {
56
+ if (initialValue) {
57
+ onDataBaseChange(initialValue.db);
58
+ onSchemaChange(initialValue.schema);
59
+ onDataTableChange(initialValue.dt);
60
+ }
61
+ }, [initialValue]);
49
62
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Col, {
50
63
  span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
51
64
  flex: labelCol
@@ -68,6 +81,7 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
68
81
  }, /*#__PURE__*/React.createElement(_Select, {
69
82
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource = extraInfo.datasource) === null || _extraInfo$datasource === void 0 ? void 0 : (_extraInfo$datasource2 = _extraInfo$datasource.postgreSql) === null || _extraInfo$datasource2 === void 0 ? void 0 : _extraInfo$datasource2.isMutiple) ? 'multiple' : undefined,
70
83
  allowClear: true,
84
+ value: dataBase,
71
85
  options: dataBaseOpts,
72
86
  onChange: onDataBaseChange
73
87
  })), /*#__PURE__*/React.createElement(_Col, {
@@ -92,6 +106,7 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
92
106
  }, /*#__PURE__*/React.createElement(_Select, {
93
107
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource3 = extraInfo.datasource) === null || _extraInfo$datasource3 === void 0 ? void 0 : (_extraInfo$datasource4 = _extraInfo$datasource3.postgreSql) === null || _extraInfo$datasource4 === void 0 ? void 0 : _extraInfo$datasource4.isMutiple) ? 'multiple' : undefined,
94
108
  allowClear: true,
109
+ value: schema,
95
110
  options: schemaOpts,
96
111
  onChange: onSchemaChange
97
112
  })), /*#__PURE__*/React.createElement(_Col, {
@@ -116,6 +131,7 @@ var PostgreSQLDatasource = function PostgreSQLDatasource(props) {
116
131
  }, /*#__PURE__*/React.createElement(_Select, {
117
132
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource5 = extraInfo.datasource) === null || _extraInfo$datasource5 === void 0 ? void 0 : (_extraInfo$datasource6 = _extraInfo$datasource5.postgreSql) === null || _extraInfo$datasource6 === void 0 ? void 0 : _extraInfo$datasource6.isMutiple) ? 'multiple' : undefined,
118
133
  allowClear: true,
134
+ value: dataTable,
119
135
  options: dataTableOpts,
120
136
  onChange: onDataTableChange
121
137
  })));
@@ -5,6 +5,7 @@ interface ISqlServerDatasourceProps {
5
5
  wrapperCol: string;
6
6
  labelCol: string;
7
7
  onChange?: any;
8
+ initialValue?: any;
8
9
  }
9
10
  declare const SqlServerDatasource: (props: ISqlServerDatasourceProps) => React.JSX.Element;
10
11
  export default SqlServerDatasource;
@@ -12,7 +12,8 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
12
12
  datasource = props.datasource,
13
13
  wrapperCol = props.wrapperCol,
14
14
  labelCol = props.labelCol,
15
- onChange = props.onChange;
15
+ onChange = props.onChange,
16
+ initialValue = props.initialValue;
16
17
  var _React$useState = React.useState(),
17
18
  _React$useState2 = _slicedToArray(_React$useState, 2),
18
19
  dataBase = _React$useState2[0],
@@ -21,6 +22,10 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
21
22
  _React$useState4 = _slicedToArray(_React$useState3, 2),
22
23
  schema = _React$useState4[0],
23
24
  setSchema = _React$useState4[1];
25
+ var _React$useState5 = React.useState(),
26
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
27
+ dataTable = _React$useState6[0],
28
+ setDataTable = _React$useState6[1];
24
29
  var dataBaseOpts = useGetDatasource('SqlServer', 2, datasource);
25
30
  var schemaOpts = useGetDatasource('SqlServer', 3, datasource, dataBase ? JSON.parse(dataBase).name : undefined);
26
31
  var dataTableOpts = useGetDatasource('SqlServer', 4, datasource, dataBase ? JSON.parse(dataBase).name : undefined, schema ? JSON.parse(schema).name : undefined);
@@ -37,10 +42,18 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
37
42
  });
38
43
  };
39
44
  var onDataTableChange = function onDataTableChange(value) {
45
+ setDataTable(value);
40
46
  onChange && onChange({
41
47
  dt: value
42
48
  });
43
49
  };
50
+ React.useEffect(function () {
51
+ if (initialValue) {
52
+ onDataBaseChange(initialValue.db);
53
+ onSchemaChange(initialValue.schema);
54
+ onDataTableChange(initialValue.dt);
55
+ }
56
+ }, [initialValue]);
44
57
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Col, {
45
58
  span: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.labelSpan) && (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.layout) === 'vertical' && 24,
46
59
  flex: labelCol
@@ -63,6 +76,7 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
63
76
  }, /*#__PURE__*/React.createElement(_Select, {
64
77
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource = extraInfo.datasource) === null || _extraInfo$datasource === void 0 ? void 0 : (_extraInfo$datasource2 = _extraInfo$datasource.sqlServer) === null || _extraInfo$datasource2 === void 0 ? void 0 : _extraInfo$datasource2.isMutiple) ? 'multiple' : undefined,
65
78
  allowClear: true,
79
+ value: dataBase,
66
80
  options: dataBaseOpts,
67
81
  onChange: onDataBaseChange
68
82
  })), /*#__PURE__*/React.createElement(_Col, {
@@ -87,6 +101,7 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
87
101
  }, /*#__PURE__*/React.createElement(_Select, {
88
102
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource3 = extraInfo.datasource) === null || _extraInfo$datasource3 === void 0 ? void 0 : (_extraInfo$datasource4 = _extraInfo$datasource3.sqlServer) === null || _extraInfo$datasource4 === void 0 ? void 0 : _extraInfo$datasource4.isMutiple) ? 'multiple' : undefined,
89
103
  allowClear: true,
104
+ value: schema,
90
105
  options: schemaOpts,
91
106
  onChange: onSchemaChange
92
107
  })), /*#__PURE__*/React.createElement(_Col, {
@@ -111,6 +126,7 @@ var SqlServerDatasource = function SqlServerDatasource(props) {
111
126
  }, /*#__PURE__*/React.createElement(_Select, {
112
127
  mode: (extraInfo === null || extraInfo === void 0 ? void 0 : (_extraInfo$datasource5 = extraInfo.datasource) === null || _extraInfo$datasource5 === void 0 ? void 0 : (_extraInfo$datasource6 = _extraInfo$datasource5.sqlServer) === null || _extraInfo$datasource6 === void 0 ? void 0 : _extraInfo$datasource6.isMutiple) ? 'multiple' : undefined,
113
128
  allowClear: true,
129
+ value: dataTable,
114
130
  options: dataTableOpts,
115
131
  onChange: onDataTableChange
116
132
  })));
@@ -34,6 +34,22 @@ var DataSource = function DataSource(props) {
34
34
  _React$useState4 = _slicedToArray(_React$useState3, 2),
35
35
  datasource = _React$useState4[0],
36
36
  setDatasource = _React$useState4[1];
37
+ var _React$useState5 = React.useState(),
38
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
39
+ kafkaInitValue = _React$useState6[0],
40
+ setKafkaInitValue = _React$useState6[1];
41
+ var _React$useState7 = React.useState(),
42
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
43
+ postgreSQLInitValue = _React$useState8[0],
44
+ setPostgreSQLInitValue = _React$useState8[1];
45
+ var _React$useState9 = React.useState(),
46
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
47
+ cassandraInitValue = _React$useState10[0],
48
+ setCassandraInitValue = _React$useState10[1];
49
+ var _React$useState11 = React.useState(),
50
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
51
+ sqlServerInitValue = _React$useState12[0],
52
+ setSqlServerInitValue = _React$useState12[1];
37
53
  var valueRef = React.useRef({});
38
54
  var datasourceOpts = useGetDatasource(dsType);
39
55
  var labelCol = useGetLabelCol(extraInfo);
@@ -78,6 +94,30 @@ var DataSource = function DataSource(props) {
78
94
  var onSqlServerChange = function onSqlServerChange(value) {
79
95
  triggerChange(_objectSpread({}, value));
80
96
  };
97
+ React.useEffect(function () {
98
+ if (value) {
99
+ if (value.dsType) {
100
+ setDsType(value.dsType);
101
+ }
102
+ if (value.datasource) {
103
+ setDatasource(value.datasource);
104
+ }
105
+ switch (value === null || value === void 0 ? void 0 : value.dsType) {
106
+ case 'Kafka':
107
+ setKafkaInitValue(value);
108
+ break;
109
+ case 'PostgreSql':
110
+ setPostgreSQLInitValue(value);
111
+ break;
112
+ case 'Cassandra':
113
+ setCassandraInitValue(value);
114
+ break;
115
+ case 'SqlServer':
116
+ setSqlServerInitValue(value);
117
+ break;
118
+ }
119
+ }
120
+ }, [value]);
81
121
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
82
122
  style: !(extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.borderHidden) ? {
83
123
  padding: '10px 10px 10px 10px',
@@ -137,25 +177,29 @@ var DataSource = function DataSource(props) {
137
177
  labelCol: labelCol,
138
178
  extraInfo: extraInfo,
139
179
  datasource: datasource,
140
- onChange: onKafkaChange
180
+ onChange: onKafkaChange,
181
+ initialValue: kafkaInitValue
141
182
  }), dsType === 'PostgreSql' && /*#__PURE__*/React.createElement(PostgreSQLDatasource, {
142
183
  wrapperCol: wrapperCol,
143
184
  labelCol: labelCol,
144
185
  extraInfo: extraInfo,
145
186
  datasource: datasource,
146
- onChange: onPgSqlChange
187
+ onChange: onPgSqlChange,
188
+ initialValue: postgreSQLInitValue
147
189
  }), dsType === 'Cassandra' && /*#__PURE__*/React.createElement(CassandraDatasource, {
148
190
  wrapperCol: wrapperCol,
149
191
  labelCol: labelCol,
150
192
  extraInfo: extraInfo,
151
193
  datasource: datasource,
152
- onChange: onCassandraChange
194
+ onChange: onCassandraChange,
195
+ initialValue: cassandraInitValue
153
196
  }), dsType === 'SqlServer' && /*#__PURE__*/React.createElement(SqlServerDatasource, {
154
197
  wrapperCol: wrapperCol,
155
198
  labelCol: labelCol,
156
199
  extraInfo: extraInfo,
157
200
  datasource: datasource,
158
- onChange: onSqlServerChange
201
+ onChange: onSqlServerChange,
202
+ initialValue: sqlServerInitValue
159
203
  }))));
160
204
  };
161
205
  export default DataSource;
@@ -88,8 +88,20 @@ var MapTable = function MapTable(props) {
88
88
  };
89
89
  React.useEffect(function () {
90
90
  if (value) {
91
- if (value[mapping]) {
92
- setMapping(value[mapping]);
91
+ if (value.mapping) {
92
+ setMapping(value.mapping);
93
+ }
94
+ if (value.output) {
95
+ setOutput(value.output);
96
+ }
97
+ if (value.options) {
98
+ setOptions(value.options);
99
+ }
100
+ if (value.dataSource) {
101
+ setTableDataSource(value.dataSource);
102
+ }
103
+ if (value.dataTarget) {
104
+ setTableDataTarget(value.dataTarget);
93
105
  }
94
106
  }
95
107
  }, [value]);
@@ -119,7 +131,6 @@ var MapTable = function MapTable(props) {
119
131
  }, [disableArray]);
120
132
  React.useEffect(function () {
121
133
  var values = form.getFieldsValue().mapTable;
122
- debugger;
123
134
  if (tableDataSourceRef.current.length !== 0) {
124
135
  setTableDataSource(tableDataSourceRef.current);
125
136
  } else {
@@ -184,7 +195,8 @@ var MapTable = function MapTable(props) {
184
195
  style: {
185
196
  marginLeft: '6px',
186
197
  marginRight: '6px',
187
- marginBottom: '-2px'
198
+ marginBottom: '-2px',
199
+ lineHeight: '30px'
188
200
  }
189
201
  }, /*#__PURE__*/React.createElement(_Button, {
190
202
  key: index,