ronds-metadata 1.3.66 → 1.3.67

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,6 @@
1
1
  import React from 'react';
2
2
  interface IMapTableProps {
3
- columnSource: any;
4
3
  dataSource: any;
5
- columnTarget: any;
6
4
  dataTarget: any;
7
5
  options: any;
8
6
  value?: any;
@@ -1,3 +1,5 @@
1
+ import "antd/es/checkbox/style";
2
+ import _Checkbox from "antd/es/checkbox";
1
3
  import "antd/es/table/style";
2
4
  import _Table from "antd/es/table";
3
5
  import "antd/es/button/style";
@@ -11,9 +13,7 @@ import { CloseCircleFilled, ArrowRightOutlined } from '@ant-design/icons';
11
13
  import React from 'react';
12
14
  import Editable from '../../../../comps/Editable';
13
15
  var MapTable = function MapTable(props) {
14
- var columnSource = props.columnSource,
15
- dataSource = props.dataSource,
16
- columnTarget = props.columnTarget,
16
+ var dataSource = props.dataSource,
17
17
  dataTarget = props.dataTarget,
18
18
  options = props.options,
19
19
  value = props.value,
@@ -24,8 +24,12 @@ var MapTable = function MapTable(props) {
24
24
  setMapping = _React$useState2[1];
25
25
  var _React$useState3 = React.useState(),
26
26
  _React$useState4 = _slicedToArray(_React$useState3, 2),
27
- disableArray = _React$useState4[0],
28
- setDisableArray = _React$useState4[1];
27
+ output = _React$useState4[0],
28
+ setOutput = _React$useState4[1];
29
+ var _React$useState5 = React.useState(),
30
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
31
+ disableArray = _React$useState6[0],
32
+ setDisableArray = _React$useState6[1];
29
33
  var editableStreamRef = React.useRef();
30
34
  var triggerChange = function triggerChange(changedValue) {
31
35
  onChange && onChange(_objectSpread({
@@ -37,6 +41,12 @@ var MapTable = function MapTable(props) {
37
41
  _disableArray[index] = !_disableArray[index];
38
42
  setDisableArray(_disableArray);
39
43
  };
44
+ var onOutputChange = function onOutputChange(value) {
45
+ setOutput(value);
46
+ triggerChange({
47
+ output: value
48
+ });
49
+ };
40
50
  React.useEffect(function () {
41
51
  if (value) {
42
52
  if (value[mapping]) {
@@ -45,21 +55,22 @@ var MapTable = function MapTable(props) {
45
55
  }
46
56
  }, [value]);
47
57
  React.useEffect(function () {
48
- setDisableArray(new Array(Math.min(dataSource.length, dataTarget.length)).fill(true));
58
+ setDisableArray(new Array(Math.min(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, dataTarget === null || dataTarget === void 0 ? void 0 : dataTarget.length)).fill(true));
49
59
  }, []);
50
60
  React.useEffect(function () {
51
61
  if (disableArray) {
52
62
  var _mapping = [];
53
63
  disableArray.forEach(function (_, idx) {
54
64
  if (disableArray[idx]) {
65
+ var _dataSource$idx, _dataSource$idx2, _dataTarget$idx, _dataTarget$idx2;
55
66
  _mapping.push({
56
67
  source: {
57
- name: dataSource[idx].source,
58
- dataType: dataSource[idx].type
68
+ name: (_dataSource$idx = dataSource[idx]) === null || _dataSource$idx === void 0 ? void 0 : _dataSource$idx.source,
69
+ dataType: (_dataSource$idx2 = dataSource[idx]) === null || _dataSource$idx2 === void 0 ? void 0 : _dataSource$idx2.type
59
70
  },
60
71
  target: {
61
- name: dataTarget[idx].source,
62
- dataType: dataTarget[idx].type
72
+ name: (_dataTarget$idx = dataTarget[idx]) === null || _dataTarget$idx === void 0 ? void 0 : _dataTarget$idx.source,
73
+ dataType: (_dataTarget$idx2 = dataTarget[idx]) === null || _dataTarget$idx2 === void 0 ? void 0 : _dataTarget$idx2.type
63
74
  }
64
75
  });
65
76
  }
@@ -81,7 +92,8 @@ var MapTable = function MapTable(props) {
81
92
  }
82
93
  }, /*#__PURE__*/React.createElement(_Select, {
83
94
  defaultValue: "a1",
84
- onChange: function onChange() {},
95
+ onChange: onOutputChange,
96
+ value: output,
85
97
  style: {
86
98
  width: 150
87
99
  },
@@ -97,6 +109,7 @@ var MapTable = function MapTable(props) {
97
109
  width: '40%'
98
110
  }
99
111
  }, /*#__PURE__*/React.createElement(Editable, {
112
+ readonly: true,
100
113
  type: "single",
101
114
  columns: columnSource,
102
115
  dataSource: dataSource,
@@ -111,7 +124,7 @@ var MapTable = function MapTable(props) {
111
124
  style: {
112
125
  marginTop: '40px'
113
126
  }
114
- }, _toConsumableArray(Array(Math.min(dataSource.length, dataTarget.length))).map(function (_, index) {
127
+ }, _toConsumableArray(Array(Math.min(dataSource === null || dataSource === void 0 ? void 0 : dataSource.length, dataTarget === null || dataTarget === void 0 ? void 0 : dataTarget.length))).map(function (_, index) {
115
128
  return /*#__PURE__*/React.createElement("div", {
116
129
  key: index,
117
130
  style: {
@@ -140,4 +153,48 @@ var MapTable = function MapTable(props) {
140
153
  size: "small"
141
154
  })))));
142
155
  };
143
- export default MapTable;
156
+ export default MapTable;
157
+ var columnSource = [{
158
+ title: '来源表字段',
159
+ dataIndex: 'name',
160
+ key: 'name'
161
+ }, {
162
+ title: '类型',
163
+ dataIndex: 'type',
164
+ key: 'type'
165
+ }, {
166
+ title: '注释',
167
+ dataIndex: 'label',
168
+ key: 'label'
169
+ }];
170
+ var columnTarget = [{
171
+ title: '来源表字段',
172
+ dataIndex: 'name',
173
+ key: 'name'
174
+ }, {
175
+ title: '类型',
176
+ dataIndex: 'type',
177
+ key: 'type'
178
+ }, {
179
+ title: '注释',
180
+ dataIndex: 'label',
181
+ key: 'label'
182
+ }, {
183
+ title: '主键',
184
+ dataIndex: 'key',
185
+ key: 'key',
186
+ render: function render(val) {
187
+ return /*#__PURE__*/React.createElement(_Checkbox, {
188
+ checked: val
189
+ });
190
+ }
191
+ }, {
192
+ title: '非空',
193
+ dataIndex: 'require',
194
+ key: 'require',
195
+ render: function render(val) {
196
+ return /*#__PURE__*/React.createElement(_Checkbox, {
197
+ checked: val
198
+ });
199
+ }
200
+ }];
@@ -355,7 +355,7 @@ var SourceConfig = function SourceConfig(props) {
355
355
  body: '{"type":"Cassandra","level":3}',
356
356
  value: 'name',
357
357
  watch: 'defaultSource,keyspace',
358
- key: 'name',
358
+ key: 'dfSourceId',
359
359
  url: '/dataset-web/source/cascade/data/v2'
360
360
  };
361
361
  var _React$useState33 = React.useState(),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.3.66",
4
+ "version": "1.3.67",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",