ronds-metadata 1.2.10 → 1.2.12
Sign up to get free protection for your applications and to get access to all the features.
- package/es/api/index.js +249 -0
- package/es/comps/DynamicPorts/comps/ContextMenu.js +44 -0
- package/es/comps/DynamicPorts/comps/DragNode.js +55 -0
- package/es/comps/DynamicPorts/comps/GraphHandler/index.js +51 -0
- package/es/comps/DynamicPorts/comps/NodeElement.js +30 -0
- package/es/comps/DynamicPorts/comps/contextMenu/EdgeContextMenu/index.js +42 -0
- package/es/comps/DynamicPorts/comps/contextMenu/GraphContextMenu/index.js +40 -0
- package/es/comps/DynamicPorts/comps/contextMenu/NodeContextMenu/index.js +55 -0
- package/es/comps/DynamicPorts/comps/shape/connector.js +19 -0
- package/es/comps/DynamicPorts/comps/shape/edge.js +91 -0
- package/es/comps/DynamicPorts/comps/shape/node.js +190 -0
- package/es/comps/DynamicPorts/constant/index.js +19 -0
- package/es/comps/DynamicPorts/graph.js +697 -0
- package/es/comps/DynamicPorts/index.js +143 -0
- package/es/comps/DynamicPorts/interface.js +6 -0
- package/es/comps/DynamicPorts/utils.js +127 -0
- package/es/comps/Editable/DataCell/ButtonCell.js +45 -0
- package/es/comps/Editable/DataCell/ColorPicker.js +33 -0
- package/es/comps/Editable/DataCell/Input.js +54 -0
- package/es/comps/Editable/DataCell/Number.js +44 -0
- package/es/comps/Editable/DataCell/Select.js +48 -0
- package/es/comps/Editable/DataCell/Switch.js +33 -0
- package/es/comps/Editable/comps/EditableAction.js +110 -0
- package/es/comps/Editable/comps/EditableCell.js +108 -0
- package/es/comps/Editable/comps/EditableHeardCell.js +172 -0
- package/es/comps/Editable/comps/EditableRow.js +118 -0
- package/es/comps/Editable/comps/Texty.js +277 -0
- package/es/comps/Editable/index.js +386 -0
- package/es/comps/Editable/interface.js +8 -0
- package/es/comps/Editable/utils.js +46 -0
- package/es/comps/FileView/index.js +198 -0
- package/es/comps/FormGenerator/Provider.js +8 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Checkbox.js +69 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Color.js +17 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Date.js +16 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Input.js +17 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/List.js +50 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/MutiSelect.js +55 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Number.js +14 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Obj.js +50 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Password.js +17 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Radio.js +69 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Select.js +55 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Switch.js +13 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Table.js +50 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/TextArea.js +14 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/Cell/Upload.js +27 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/HOC/index.js +261 -0
- package/es/comps/FormGenerator/comps/Canvas/core/RenderField/index.js +62 -0
- package/es/comps/FormGenerator/comps/Canvas/core/index.js +315 -0
- package/es/comps/FormGenerator/comps/Canvas/index.js +120 -0
- package/es/comps/FormGenerator/comps/Settings/index.js +150 -0
- package/es/comps/FormGenerator/comps/Sidebar/Elements.js +48 -0
- package/es/comps/FormGenerator/comps/Sidebar/index.js +37 -0
- package/es/comps/FormGenerator/index.js +68 -0
- package/es/comps/FormGenerator/settings/index.js +367 -0
- package/es/comps/FormGenerator/settings/ruleConfig.js +557 -0
- package/es/comps/FormGenerator/transformer.js +300 -0
- package/es/comps/Icons/index.js +23 -0
- package/es/comps/JsonEdit/constant/index.js +87 -0
- package/es/comps/JsonEdit/index.js +221 -0
- package/es/comps/JsonView/index.js +109 -0
- package/es/comps/MdEdit/index.js +41 -0
- package/es/comps/MdNavbar/index.js +180 -0
- package/es/comps/MdNavbar/utils.js +34 -0
- package/es/comps/MdView/index.js +70 -0
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +419 -0
- package/es/comps/MetadataEdit/components/MetaPropsEdit.js +368 -0
- package/es/comps/MetadataEdit/constant/index.js +69 -0
- package/es/comps/MetadataEdit/hooks/index.js +43 -0
- package/es/comps/MetadataEdit/index.js +255 -0
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +237 -0
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +367 -0
- package/es/comps/MetadataEditV2/constant/index.js +69 -0
- package/es/comps/MetadataEditV2/hooks/index.js +43 -0
- package/es/comps/MetadataEditV2/index.js +298 -0
- package/es/comps/MetadataForm/DataCell/Array.js +148 -0
- package/es/comps/MetadataForm/DataCell/Input.js +199 -0
- package/es/comps/MetadataForm/DataCell/Number.js +131 -0
- package/es/comps/MetadataForm/DataCell/Ref.js +326 -0
- package/es/comps/MetadataForm/DataCell/Select.js +558 -0
- package/es/comps/MetadataForm/DataCell/Switch.js +116 -0
- package/es/comps/MetadataForm/DataCell/layout/TableArray.js +359 -0
- package/es/comps/MetadataForm/HOC/index.js +126 -0
- package/es/comps/MetadataForm/constants.js +11 -0
- package/es/comps/MetadataForm/hooks/index.js +139 -0
- package/es/comps/MetadataForm/index.js +268 -0
- package/es/comps/MetadataForm/interface.d.ts +2 -1
- package/es/comps/MetadataForm/interface.js +8 -0
- package/es/comps/MetadataForm/utils.js +112 -0
- package/es/comps/locales/en-US.js +24 -0
- package/es/comps/locales/index.js +8 -0
- package/es/comps/locales/zh-CN.js +24 -0
- package/es/config.js +50 -0
- package/es/framework/graph/index.js +515 -0
- package/es/framework/hooks/use-async-memo.js +32 -0
- package/es/framework/hooks/use-sync-scroll.js +106 -0
- package/es/framework/http/cache.js +137 -0
- package/es/framework/http/cancel.js +44 -0
- package/es/framework/http/index.js +392 -0
- package/es/framework/http/msgpack.js +34 -0
- package/es/framework/http/msgpack5/index.js +84 -0
- package/es/framework/http/msgpack5/lib/codecs/DateCodec.js +71 -0
- package/es/framework/http/msgpack5/lib/decoder.js +287 -0
- package/es/framework/http/msgpack5/lib/encoder.js +252 -0
- package/es/framework/http/msgpack5/lib/helpers.js +23 -0
- package/es/framework/http/msgpack5/lib/streams.js +93 -0
- package/es/framework/http/types.js +1 -0
- package/es/framework/libs/jquery.min.js +4022 -0
- package/es/framework/locale/dil8/di18n.js +132 -0
- package/es/framework/locale/dil8/index.js +3 -0
- package/es/framework/locale/dil8/translate.js +76 -0
- package/es/framework/locale/dil8/util.js +17 -0
- package/es/framework/locale/index.js +26 -0
- package/es/framework/metadata/MetadataService.js +169 -0
- package/es/framework/metadata/index.js +384 -0
- package/es/framework/rxjs-hooks/useMemoSubject.js +16 -0
- package/es/framework/rxjs-hooks/useObservable.js +22 -0
- package/es/framework/rxjs-hooks/useObservableState.js +45 -0
- package/es/index.js +27 -0
- package/es/utils.js +138 -0
- package/package.json +1 -1
@@ -0,0 +1,419 @@
|
|
1
|
+
import "antd/es/button/style";
|
2
|
+
import _Button from "antd/es/button";
|
3
|
+
import "antd/es/switch/style";
|
4
|
+
import _Switch from "antd/es/switch";
|
5
|
+
import "antd/es/input-number/style";
|
6
|
+
import _InputNumber from "antd/es/input-number";
|
7
|
+
import "antd/es/select/style";
|
8
|
+
import _Select from "antd/es/select";
|
9
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
10
|
+
import "antd/es/input/style";
|
11
|
+
import _Input from "antd/es/input";
|
12
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
13
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
14
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
15
|
+
import "antd/es/form/style";
|
16
|
+
import _Form from "antd/es/form";
|
17
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
18
|
+
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
19
|
+
import React from 'react';
|
20
|
+
import { RULE_TYPES_OPTIONS } from '../constant';
|
21
|
+
import { useMetaType } from '../hooks';
|
22
|
+
import MetadataForm from '../../MetadataForm';
|
23
|
+
import { MetadataService } from '../../../framework/metadata/MetadataService';
|
24
|
+
|
25
|
+
var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
26
|
+
var type = props.type,
|
27
|
+
defaultValues = props.defaultValues,
|
28
|
+
onChange = props.onChange;
|
29
|
+
|
30
|
+
var _Form$useForm = _Form.useForm(),
|
31
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
32
|
+
form = _Form$useForm2[0];
|
33
|
+
|
34
|
+
var _React$useState = React.useState({}),
|
35
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
36
|
+
ruleTypes = _React$useState2[0],
|
37
|
+
setRuleTypes = _React$useState2[1];
|
38
|
+
|
39
|
+
var _React$useState3 = React.useState({}),
|
40
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
41
|
+
refIds = _React$useState4[0],
|
42
|
+
setRefIds = _React$useState4[1];
|
43
|
+
|
44
|
+
var _React$useState5 = React.useState({}),
|
45
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
46
|
+
refSchema = _React$useState6[0],
|
47
|
+
setRefSchema = _React$useState6[1];
|
48
|
+
|
49
|
+
var _React$useState7 = React.useState({}),
|
50
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
51
|
+
refValues = _React$useState8[0],
|
52
|
+
setRefValues = _React$useState8[1];
|
53
|
+
|
54
|
+
var metaType = useMetaType('扩展规则');
|
55
|
+
|
56
|
+
var processSpecialRuleData = /*#__PURE__*/function () {
|
57
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_refId, idx) {
|
58
|
+
var server, res, _schema, _properties, _refSchema;
|
59
|
+
|
60
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
61
|
+
while (1) {
|
62
|
+
switch (_context.prev = _context.next) {
|
63
|
+
case 0:
|
64
|
+
server = new MetadataService();
|
65
|
+
_context.next = 3;
|
66
|
+
return server.GetMetadataDetailById(_refId);
|
67
|
+
|
68
|
+
case 3:
|
69
|
+
res = _context.sent;
|
70
|
+
_schema = JSON.parse(res.schema);
|
71
|
+
_properties = _schema[0].properties;
|
72
|
+
|
73
|
+
if (_refId === 'com.ronds.schema.default.Rule.Form') {
|
74
|
+
_properties = _properties.filter(function (it) {
|
75
|
+
return it.id === 'common' || it.id === 'common-en-US' || it.id === type;
|
76
|
+
});
|
77
|
+
}
|
78
|
+
|
79
|
+
_schema[0].properties = _properties;
|
80
|
+
_refSchema = refSchema;
|
81
|
+
_refSchema[idx] = _schema;
|
82
|
+
setRefSchema(_objectSpread({}, _refSchema));
|
83
|
+
|
84
|
+
case 11:
|
85
|
+
case "end":
|
86
|
+
return _context.stop();
|
87
|
+
}
|
88
|
+
}
|
89
|
+
}, _callee);
|
90
|
+
}));
|
91
|
+
|
92
|
+
return function processSpecialRuleData(_x, _x2) {
|
93
|
+
return _ref.apply(this, arguments);
|
94
|
+
};
|
95
|
+
}();
|
96
|
+
|
97
|
+
var onRefSelectChange = React.useCallback( /*#__PURE__*/function () {
|
98
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(value, index) {
|
99
|
+
var _refIds, _refSchema, newData;
|
100
|
+
|
101
|
+
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
102
|
+
while (1) {
|
103
|
+
switch (_context2.prev = _context2.next) {
|
104
|
+
case 0:
|
105
|
+
_refIds = refIds;
|
106
|
+
|
107
|
+
if (!(value && value.indexOf('Rule.Form') > -1)) {
|
108
|
+
_context2.next = 6;
|
109
|
+
break;
|
110
|
+
}
|
111
|
+
|
112
|
+
_context2.next = 4;
|
113
|
+
return processSpecialRuleData(value, index);
|
114
|
+
|
115
|
+
case 4:
|
116
|
+
_context2.next = 9;
|
117
|
+
break;
|
118
|
+
|
119
|
+
case 6:
|
120
|
+
_refSchema = refSchema;
|
121
|
+
_refSchema[index] = undefined;
|
122
|
+
setRefSchema(_objectSpread({}, _refSchema));
|
123
|
+
|
124
|
+
case 9:
|
125
|
+
_refIds[index] = value;
|
126
|
+
setRefIds(_objectSpread({}, _refIds));
|
127
|
+
newData = form.getFieldValue('fields');
|
128
|
+
newData[index].id = value;
|
129
|
+
form.setFieldsValue({
|
130
|
+
fields: newData
|
131
|
+
});
|
132
|
+
|
133
|
+
case 14:
|
134
|
+
case "end":
|
135
|
+
return _context2.stop();
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}, _callee2);
|
139
|
+
}));
|
140
|
+
|
141
|
+
return function (_x3, _x4) {
|
142
|
+
return _ref2.apply(this, arguments);
|
143
|
+
};
|
144
|
+
}(), [form]);
|
145
|
+
var processInitRule = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
|
146
|
+
var _defaultValues, _refIds, _ruleTypes;
|
147
|
+
|
148
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context3) {
|
149
|
+
while (1) {
|
150
|
+
switch (_context3.prev = _context3.next) {
|
151
|
+
case 0:
|
152
|
+
_defaultValues = [{
|
153
|
+
id: 'Rule.Form',
|
154
|
+
refId: 'com.ronds.schema.default.Rule.Form',
|
155
|
+
type: 'ref',
|
156
|
+
value: {}
|
157
|
+
}];
|
158
|
+
_refIds = refIds;
|
159
|
+
_ruleTypes = ruleTypes;
|
160
|
+
|
161
|
+
if (!(_defaultValues[0].refId.indexOf('Rule.Form') > -1)) {
|
162
|
+
_context3.next = 6;
|
163
|
+
break;
|
164
|
+
}
|
165
|
+
|
166
|
+
_context3.next = 6;
|
167
|
+
return processSpecialRuleData(_defaultValues[0].refId, 0);
|
168
|
+
|
169
|
+
case 6:
|
170
|
+
_refIds[0] = _defaultValues[0].refId;
|
171
|
+
setRefIds(_objectSpread({}, _refIds));
|
172
|
+
_ruleTypes[0] = 'ref';
|
173
|
+
setRuleTypes(_objectSpread({}, _ruleTypes));
|
174
|
+
form.setFieldsValue({
|
175
|
+
fields: _defaultValues
|
176
|
+
});
|
177
|
+
|
178
|
+
case 11:
|
179
|
+
case "end":
|
180
|
+
return _context3.stop();
|
181
|
+
}
|
182
|
+
}
|
183
|
+
}, _callee3);
|
184
|
+
})), [form]);
|
185
|
+
var processDefaultValues = React.useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
|
186
|
+
var _ruleTypes, _refIds, i;
|
187
|
+
|
188
|
+
return _regeneratorRuntime.wrap(function _callee4$(_context4) {
|
189
|
+
while (1) {
|
190
|
+
switch (_context4.prev = _context4.next) {
|
191
|
+
case 0:
|
192
|
+
if (!defaultValues) {
|
193
|
+
_context4.next = 17;
|
194
|
+
break;
|
195
|
+
}
|
196
|
+
|
197
|
+
_ruleTypes = ruleTypes;
|
198
|
+
_refIds = refIds;
|
199
|
+
form.setFieldsValue({
|
200
|
+
fields: defaultValues
|
201
|
+
});
|
202
|
+
i = 0;
|
203
|
+
|
204
|
+
case 5:
|
205
|
+
if (!(i < defaultValues.length)) {
|
206
|
+
_context4.next = 15;
|
207
|
+
break;
|
208
|
+
}
|
209
|
+
|
210
|
+
_ruleTypes[i] = defaultValues[i].type;
|
211
|
+
|
212
|
+
if (!(defaultValues[i].type === 'ref')) {
|
213
|
+
_context4.next = 12;
|
214
|
+
break;
|
215
|
+
}
|
216
|
+
|
217
|
+
if (!(defaultValues[i].refId.indexOf('Rule.Form') > -1)) {
|
218
|
+
_context4.next = 11;
|
219
|
+
break;
|
220
|
+
}
|
221
|
+
|
222
|
+
_context4.next = 11;
|
223
|
+
return processSpecialRuleData(defaultValues[i].refId, i);
|
224
|
+
|
225
|
+
case 11:
|
226
|
+
_refIds[i] = defaultValues[i].refId;
|
227
|
+
|
228
|
+
case 12:
|
229
|
+
i++;
|
230
|
+
_context4.next = 5;
|
231
|
+
break;
|
232
|
+
|
233
|
+
case 15:
|
234
|
+
setRefIds(_objectSpread({}, _refIds));
|
235
|
+
setRuleTypes(_objectSpread({}, _ruleTypes));
|
236
|
+
|
237
|
+
case 17:
|
238
|
+
case "end":
|
239
|
+
return _context4.stop();
|
240
|
+
}
|
241
|
+
}
|
242
|
+
}, _callee4);
|
243
|
+
})), [form]);
|
244
|
+
React.useEffect(function () {
|
245
|
+
if (defaultValues) {
|
246
|
+
processDefaultValues();
|
247
|
+
} else {
|
248
|
+
processInitRule();
|
249
|
+
}
|
250
|
+
}, [defaultValues, processInitRule, processDefaultValues]);
|
251
|
+
|
252
|
+
var onFinish = function onFinish(values) {
|
253
|
+
var _fields = values.fields;
|
254
|
+
|
255
|
+
for (var i = 0; i < _fields.length; i++) {
|
256
|
+
if (_fields[i].type === 'ref') {
|
257
|
+
_fields[i].value = refValues[i] || _fields[i].value;
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
onChange && onChange(_fields);
|
262
|
+
};
|
263
|
+
|
264
|
+
var onRefRulesValuesChange = function onRefRulesValuesChange(values, idx) {
|
265
|
+
var _refValues = refValues;
|
266
|
+
_refValues[idx] = _refValues[idx] ? _objectSpread(_objectSpread({}, _refValues[idx]), values) : _objectSpread({}, values);
|
267
|
+
setRefValues(_objectSpread({}, _refValues));
|
268
|
+
};
|
269
|
+
|
270
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form, {
|
271
|
+
className: "metadata-edit",
|
272
|
+
style: {
|
273
|
+
position: 'relative'
|
274
|
+
},
|
275
|
+
form: form,
|
276
|
+
name: "control-hooks",
|
277
|
+
onFinish: onFinish
|
278
|
+
}, /*#__PURE__*/React.createElement("div", {
|
279
|
+
style: {
|
280
|
+
padding: '10px'
|
281
|
+
}
|
282
|
+
}, /*#__PURE__*/React.createElement(_Form.List, {
|
283
|
+
name: "fields"
|
284
|
+
}, function (fields, _ref5) {
|
285
|
+
var add = _ref5.add,
|
286
|
+
remove = _ref5.remove;
|
287
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, fields.map(function (field, index) {
|
288
|
+
var _defaultValues$index;
|
289
|
+
|
290
|
+
return /*#__PURE__*/React.createElement("div", {
|
291
|
+
key: "".concat(field.key)
|
292
|
+
}, /*#__PURE__*/React.createElement("div", {
|
293
|
+
style: {
|
294
|
+
display: 'flex',
|
295
|
+
alignItems: 'flex-start'
|
296
|
+
}
|
297
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, _extends({
|
298
|
+
className: "pr-10"
|
299
|
+
}, field, {
|
300
|
+
label: "\u89C4\u5219\u540D\u79F0",
|
301
|
+
name: [field.name, 'id'],
|
302
|
+
fieldKey: [field.fieldKey, 'id'],
|
303
|
+
rules: [{
|
304
|
+
required: true
|
305
|
+
}]
|
306
|
+
}), /*#__PURE__*/React.createElement(_Input, null)), /*#__PURE__*/React.createElement(_Form.Item, _extends({
|
307
|
+
className: "pr-10"
|
308
|
+
}, field, {
|
309
|
+
label: "\u89C4\u5219\u7C7B\u578B",
|
310
|
+
name: [field.name, 'type'],
|
311
|
+
fieldKey: [field.fieldKey, 'type'],
|
312
|
+
rules: [{
|
313
|
+
required: true
|
314
|
+
}]
|
315
|
+
}), /*#__PURE__*/React.createElement(_Select, {
|
316
|
+
style: {
|
317
|
+
width: '120px'
|
318
|
+
},
|
319
|
+
onChange: function onChange(value) {
|
320
|
+
var _ruleTypes = ruleTypes;
|
321
|
+
_ruleTypes[index] = value;
|
322
|
+
setRuleTypes(_objectSpread({}, _ruleTypes));
|
323
|
+
},
|
324
|
+
options: RULE_TYPES_OPTIONS,
|
325
|
+
getPopupContainer: function getPopupContainer(triggerNode) {
|
326
|
+
return triggerNode.parentNode;
|
327
|
+
}
|
328
|
+
})), ruleTypes[index] === 'text' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
|
329
|
+
label: "\u89C4\u5219\u503C",
|
330
|
+
name: [field.name, 'value'],
|
331
|
+
fieldKey: [field.fieldKey, 'value'],
|
332
|
+
rules: [{
|
333
|
+
required: true
|
334
|
+
}]
|
335
|
+
}), /*#__PURE__*/React.createElement(_Input, {
|
336
|
+
style: {
|
337
|
+
width: '120px'
|
338
|
+
}
|
339
|
+
})), ruleTypes[index] === 'number' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
|
340
|
+
label: "\u89C4\u5219\u503C",
|
341
|
+
name: [field.name, 'value'],
|
342
|
+
fieldKey: [field.fieldKey, 'value'],
|
343
|
+
rules: [{
|
344
|
+
required: true
|
345
|
+
}]
|
346
|
+
}), /*#__PURE__*/React.createElement(_InputNumber, {
|
347
|
+
style: {
|
348
|
+
width: '120px'
|
349
|
+
}
|
350
|
+
})), ruleTypes[index] === 'bool' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
|
351
|
+
label: "\u89C4\u5219\u503C",
|
352
|
+
name: [field.name, 'value'],
|
353
|
+
fieldKey: [field.fieldKey, 'value'],
|
354
|
+
rules: [{
|
355
|
+
required: true
|
356
|
+
}]
|
357
|
+
}), /*#__PURE__*/React.createElement(_Switch, null)), ruleTypes[index] === 'ref' && /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
|
358
|
+
label: "Ref",
|
359
|
+
name: [field.name, 'refId'],
|
360
|
+
fieldKey: [field.fieldKey, 'refId'],
|
361
|
+
rules: [{
|
362
|
+
required: true
|
363
|
+
}]
|
364
|
+
}), /*#__PURE__*/React.createElement(_Select, {
|
365
|
+
showSearch: true,
|
366
|
+
style: {
|
367
|
+
width: '120px'
|
368
|
+
},
|
369
|
+
onChange: function onChange(value) {
|
370
|
+
onRefSelectChange(value, index);
|
371
|
+
},
|
372
|
+
options: metaType || [],
|
373
|
+
filterOption: function filterOption(input, option) {
|
374
|
+
return (option === null || option === void 0 ? void 0 : option.label.indexOf(input)) >= 0;
|
375
|
+
},
|
376
|
+
getPopupContainer: function getPopupContainer(triggerNode) {
|
377
|
+
return triggerNode.parentNode;
|
378
|
+
},
|
379
|
+
allowClear: true
|
380
|
+
})), /*#__PURE__*/React.createElement("div", {
|
381
|
+
style: {
|
382
|
+
lineHeight: '88px',
|
383
|
+
paddingLeft: '15px'
|
384
|
+
}
|
385
|
+
}, /*#__PURE__*/React.createElement(MinusCircleOutlined, {
|
386
|
+
onClick: function onClick() {
|
387
|
+
return remove(field.name);
|
388
|
+
}
|
389
|
+
}))), (refIds[index] || refSchema[index]) && /*#__PURE__*/React.createElement("div", {
|
390
|
+
style: {
|
391
|
+
border: '1px solid var(--ronds-metadata-color-border-1)',
|
392
|
+
padding: '10px',
|
393
|
+
marginBottom: '10px'
|
394
|
+
}
|
395
|
+
}, /*#__PURE__*/React.createElement(MetadataForm, {
|
396
|
+
initialValues: defaultValues && defaultValues.length > 0 && ((_defaultValues$index = defaultValues[index]) === null || _defaultValues$index === void 0 ? void 0 : _defaultValues$index.value),
|
397
|
+
refId: refIds[index],
|
398
|
+
isFoldForm: true,
|
399
|
+
schema: refSchema[index],
|
400
|
+
onValuesChange: function onValuesChange(values, allValues) {
|
401
|
+
onRefRulesValuesChange(allValues, index);
|
402
|
+
}
|
403
|
+
})));
|
404
|
+
}), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
|
405
|
+
type: "dashed",
|
406
|
+
onClick: function onClick() {
|
407
|
+
return add();
|
408
|
+
},
|
409
|
+
block: true,
|
410
|
+
icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
|
411
|
+
}, "\u6DFB\u52A0\u6269\u5C55\u89C4\u5219")));
|
412
|
+
}), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
|
413
|
+
type: "primary",
|
414
|
+
block: true,
|
415
|
+
htmlType: "submit"
|
416
|
+
}, "\u786E\u5B9A")))));
|
417
|
+
};
|
418
|
+
|
419
|
+
export default MetaFieldsEdit;
|