ronds-metadata 1.0.27 → 1.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,7 +16,7 @@ import React from 'react';
|
|
16
16
|
import { MinusCircleOutlined, PlusOutlined, ReloadOutlined } from '@ant-design/icons';
|
17
17
|
import { ARRAY_TYPES_OPTIONS, BASIC_TYPES_OPTIONS, NUMBER_FORMAT_OPTIONS } from '../constant';
|
18
18
|
import { useMetaType } from '../hooks';
|
19
|
-
import { guid } from '
|
19
|
+
import { guid } from '../../../utils';
|
20
20
|
|
21
21
|
var MetaPropsEdit = function MetaPropsEdit(props) {
|
22
22
|
var form = props.form,
|
@@ -106,6 +106,8 @@ var MetadataEdit = function MetadataEdit(props) {
|
|
106
106
|
};
|
107
107
|
|
108
108
|
var onAddFields = function onAddFields(index) {
|
109
|
+
debugger;
|
110
|
+
|
109
111
|
if (index === -1) {
|
110
112
|
var _id = form.getFieldValue('id');
|
111
113
|
|
@@ -121,7 +123,12 @@ var MetadataEdit = function MetadataEdit(props) {
|
|
121
123
|
return;
|
122
124
|
}
|
123
125
|
|
124
|
-
var
|
126
|
+
var _properties_from = form.getFieldValue('properties') || [];
|
127
|
+
|
128
|
+
var _properties_ref = metaSchemaRef.current.properties || [];
|
129
|
+
|
130
|
+
var _properties = _properties_from.length <= _properties_ref.length ? _properties_ref : _properties_from;
|
131
|
+
|
125
132
|
var _curFields = _properties[index];
|
126
133
|
|
127
134
|
if (_curFields && _curFields.id) {
|
@@ -21,12 +21,12 @@ function Index(props) {
|
|
21
21
|
var _extraInfo$disabled, _extraInfo$disabled2;
|
22
22
|
|
23
23
|
var id = props.id,
|
24
|
-
idx = props.idx,
|
25
24
|
refId = props.refId,
|
26
25
|
disabled = props.disabled,
|
27
26
|
isRefForm = props.isRefForm,
|
28
27
|
initEnumValue = props.initEnumValue,
|
29
|
-
field = props.field
|
28
|
+
field = props.field,
|
29
|
+
name = props.name;
|
30
30
|
var formContext = React.useContext(MetadataFormContext) || {};
|
31
31
|
var extraInfo = useGetExtraInfo(formContext.fields, id, formContext.form);
|
32
32
|
|
@@ -105,7 +105,7 @@ function Index(props) {
|
|
105
105
|
disabled: disabled,
|
106
106
|
isRefForm: true,
|
107
107
|
isShowTypeInfo: formContext.isShowTypeInfo,
|
108
|
-
pName: [id],
|
108
|
+
pName: name || [id],
|
109
109
|
field: field ? field : undefined,
|
110
110
|
isObj: true,
|
111
111
|
initEnumValue: initEnumValue
|
@@ -129,18 +129,7 @@ function Index(props) {
|
|
129
129
|
}
|
130
130
|
});
|
131
131
|
}
|
132
|
-
}, [refId]);
|
133
|
-
// if (formContext.initialValues) {
|
134
|
-
// const _myFormValues = formContext.initialValues;
|
135
|
-
// console.log('idx===============', idx, id, _myFormValues);
|
136
|
-
// let myValue: any = _myFormValues[id];
|
137
|
-
// if (!myValue) return;
|
138
|
-
// if ((idx || idx === 0) && myValue?.length > 0) {
|
139
|
-
// myValue = myValue[idx];
|
140
|
-
// }
|
141
|
-
// }
|
142
|
-
// }, [formContext.initialValues, id, idx, onSearch]);
|
143
|
-
|
132
|
+
}, [refId]);
|
144
133
|
React.useEffect(function () {
|
145
134
|
if (refId) {
|
146
135
|
var arr = refId.split(':');
|