ronds-metadata 1.0.36 → 1.0.39
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.
- package/README.md +25 -25
- package/es/comps/JsonEdit/index.js +4 -3
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.d.ts +6 -0
- package/es/comps/MetadataEditV2/components/MetaFieldsEdit.js +237 -0
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.d.ts +12 -0
- package/es/comps/MetadataEditV2/components/MetaPropsEdit.js +367 -0
- package/es/comps/MetadataEditV2/constant/index.d.ts +24 -0
- package/es/comps/MetadataEditV2/constant/index.js +69 -0
- package/es/comps/MetadataEditV2/hooks/index.d.ts +4 -0
- package/es/comps/MetadataEditV2/hooks/index.js +46 -0
- package/es/comps/MetadataEditV2/index.css +11 -0
- package/es/comps/MetadataEditV2/index.d.ts +25 -0
- package/es/comps/MetadataEditV2/index.js +303 -0
- package/es/comps/MetadataEditV2/type.d.ts +20 -0
- package/es/framework/http/cache.js +3 -2
- package/es/framework/http/index.js +2 -2
- package/es/framework/metadata/index.js +2 -2
- package/es/framework/metadata/types.d.ts +87 -87
- package/es/index.d.ts +1 -0
- package/es/index.js +3 -2
- package/package.json +72 -73
@@ -0,0 +1,303 @@
|
|
1
|
+
import "antd/es/drawer/style";
|
2
|
+
import _Drawer from "antd/es/drawer";
|
3
|
+
import "antd/es/button/style";
|
4
|
+
import _Button from "antd/es/button";
|
5
|
+
import "antd/es/select/style";
|
6
|
+
import _Select from "antd/es/select";
|
7
|
+
import "antd/es/input/style";
|
8
|
+
import _Input from "antd/es/input";
|
9
|
+
import "antd/es/message/style";
|
10
|
+
import _message from "antd/es/message";
|
11
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
12
|
+
import "antd/es/form/style";
|
13
|
+
import _Form from "antd/es/form";
|
14
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
15
|
+
import React from 'react';
|
16
|
+
import "./index.css";
|
17
|
+
import MetaFieldsEdit from './components/MetaFieldsEdit';
|
18
|
+
import MetaPropsEdit from './components/MetaPropsEdit';
|
19
|
+
import { OUTERMOST_TYPES_OPTIONS } from './constant';
|
20
|
+
|
21
|
+
var MetadataEditV2 = function MetadataEditV2(props) {
|
22
|
+
var initialValues = props.initialValues,
|
23
|
+
isNameDisabled = props.isNameDisabled,
|
24
|
+
metadataTag = props.metadataTag,
|
25
|
+
onFinish = props.onFinish,
|
26
|
+
onNewRefClick = props.onNewRefClick;
|
27
|
+
|
28
|
+
var _Form$useForm = _Form.useForm(),
|
29
|
+
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
30
|
+
form = _Form$useForm2[0];
|
31
|
+
|
32
|
+
var _React$useState = React.useState('object'),
|
33
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
34
|
+
outerType = _React$useState2[0],
|
35
|
+
setOutType = _React$useState2[1];
|
36
|
+
|
37
|
+
var _React$useState3 = React.useState({
|
38
|
+
id: '',
|
39
|
+
type: 'object'
|
40
|
+
}),
|
41
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
42
|
+
metaSchema = _React$useState4[0],
|
43
|
+
setMetaSchema = _React$useState4[1];
|
44
|
+
|
45
|
+
var metaSchemaRef = React.useRef({
|
46
|
+
id: '',
|
47
|
+
type: 'object'
|
48
|
+
});
|
49
|
+
var firstLoadRef = React.useRef(true);
|
50
|
+
|
51
|
+
var _React$useState5 = React.useState(false),
|
52
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
53
|
+
isFields = _React$useState6[0],
|
54
|
+
setIsFields = _React$useState6[1];
|
55
|
+
|
56
|
+
var _React$useState7 = React.useState({}),
|
57
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
58
|
+
fields = _React$useState8[0],
|
59
|
+
setFields = _React$useState8[1];
|
60
|
+
|
61
|
+
var _React$useState9 = React.useState({}),
|
62
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
63
|
+
curFields = _React$useState10[0],
|
64
|
+
setCurFields = _React$useState10[1];
|
65
|
+
|
66
|
+
React.useEffect(function () {
|
67
|
+
form.setFieldsValue({
|
68
|
+
id: 'Test'
|
69
|
+
});
|
70
|
+
form.setFieldsValue({
|
71
|
+
type: 'object'
|
72
|
+
});
|
73
|
+
}, [form]);
|
74
|
+
React.useEffect(function () {
|
75
|
+
if (initialValues && firstLoadRef.current) {
|
76
|
+
form.setFieldsValue(_objectSpread({}, initialValues));
|
77
|
+
setMetaSchema(_objectSpread({}, initialValues));
|
78
|
+
metaSchemaRef.current = initialValues;
|
79
|
+
processFileds(initialValues);
|
80
|
+
firstLoadRef.current = false;
|
81
|
+
}
|
82
|
+
}, [form, initialValues]);
|
83
|
+
|
84
|
+
var onMyFinish = function onMyFinish(values) {
|
85
|
+
debugger; // console.log('values:', values, JSON.stringify(values));
|
86
|
+
// console.log('values:', values);
|
87
|
+
|
88
|
+
var _metaSchema = metaSchemaRef.current;
|
89
|
+
_metaSchema.id = values.id;
|
90
|
+
_metaSchema.type = values.type;
|
91
|
+
|
92
|
+
if (values === null || values === void 0 ? void 0 : values.properties) {
|
93
|
+
_metaSchema.properties = values.properties;
|
94
|
+
|
95
|
+
var _loop = function _loop(i) {
|
96
|
+
var ele = _metaSchema.properties[i];
|
97
|
+
var curFields = fields[_metaSchema.properties[i].id];
|
98
|
+
|
99
|
+
if (curFields) {
|
100
|
+
_metaSchema.properties[i].fields = curFields;
|
101
|
+
}
|
102
|
+
|
103
|
+
var propKeys = Object.keys(ele);
|
104
|
+
var needOptKeys = ['name', 'code', 'desc'];
|
105
|
+
|
106
|
+
if (ele.fields) {
|
107
|
+
propKeys.forEach(function (propKey) {
|
108
|
+
if (needOptKeys.indexOf(propKey) > -1) {
|
109
|
+
ele.fields.forEach(function (field, index) {
|
110
|
+
if (index === 0) {
|
111
|
+
if (propKey === 'name') {
|
112
|
+
field.value[propKey] = ele[propKey];
|
113
|
+
field.value.label = ele[propKey];
|
114
|
+
} else {
|
115
|
+
field.value[propKey] = ele[propKey];
|
116
|
+
}
|
117
|
+
}
|
118
|
+
});
|
119
|
+
delete ele[propKey];
|
120
|
+
}
|
121
|
+
});
|
122
|
+
} else {
|
123
|
+
ele.fields = [{
|
124
|
+
type: 'ref',
|
125
|
+
refId: 'Rule.Form',
|
126
|
+
id: 'Rule.Form',
|
127
|
+
value: {
|
128
|
+
label: '',
|
129
|
+
name: '',
|
130
|
+
code: '',
|
131
|
+
desc: ''
|
132
|
+
}
|
133
|
+
}];
|
134
|
+
propKeys.forEach(function (propKey) {
|
135
|
+
if (needOptKeys.indexOf(propKey) > -1) {
|
136
|
+
ele.fields.forEach(function (field, index) {
|
137
|
+
if (index === 0) {
|
138
|
+
if (propKey === 'name') {
|
139
|
+
field.value[propKey] = ele[propKey];
|
140
|
+
field.value.label = ele[propKey];
|
141
|
+
} else {
|
142
|
+
field.value[propKey] = ele[propKey];
|
143
|
+
}
|
144
|
+
}
|
145
|
+
});
|
146
|
+
delete ele[propKey];
|
147
|
+
}
|
148
|
+
});
|
149
|
+
}
|
150
|
+
};
|
151
|
+
|
152
|
+
for (var i = 0; i < _metaSchema.properties.length; i++) {
|
153
|
+
_loop(i);
|
154
|
+
}
|
155
|
+
}
|
156
|
+
|
157
|
+
if (fields[values.id]) {
|
158
|
+
_metaSchema.fields = fields[values.id];
|
159
|
+
}
|
160
|
+
|
161
|
+
setMetaSchema(_objectSpread({}, _metaSchema));
|
162
|
+
metaSchemaRef.current = _metaSchema;
|
163
|
+
onFinish && onFinish(JSON.stringify(_metaSchema));
|
164
|
+
};
|
165
|
+
|
166
|
+
var onAddFields = function onAddFields(index) {
|
167
|
+
// debugger;
|
168
|
+
if (index === -1) {
|
169
|
+
var _id = form.getFieldValue('id');
|
170
|
+
|
171
|
+
if (_id) {
|
172
|
+
setIsFields(true);
|
173
|
+
setCurFields({
|
174
|
+
id: _id
|
175
|
+
});
|
176
|
+
} else {
|
177
|
+
_message.warn('请填写元数据名称');
|
178
|
+
}
|
179
|
+
|
180
|
+
return;
|
181
|
+
} // console.log('========1========', form.getFieldValue('properties'));
|
182
|
+
|
183
|
+
|
184
|
+
var _properties_from = form.getFieldValue('properties') || [];
|
185
|
+
|
186
|
+
var _properties_ref = metaSchemaRef.current.properties || [];
|
187
|
+
|
188
|
+
var _properties = _properties_from.length <= _properties_ref.length ? _properties_ref : _properties_from; // console.log('properties', _properties);
|
189
|
+
|
190
|
+
|
191
|
+
var _curFields = _properties[index];
|
192
|
+
|
193
|
+
if (_curFields && _curFields.id) {
|
194
|
+
setIsFields(true);
|
195
|
+
var idx = ((metaSchema === null || metaSchema === void 0 ? void 0 : metaSchema.fields) || []).findIndex(function (v) {
|
196
|
+
return v.id === _curFields.id;
|
197
|
+
});
|
198
|
+
|
199
|
+
if ((metaSchema === null || metaSchema === void 0 ? void 0 : metaSchema.fields) && idx >= 0) {
|
200
|
+
setCurFields(_objectSpread({}, metaSchema === null || metaSchema === void 0 ? void 0 : metaSchema.fields[idx]));
|
201
|
+
} else {
|
202
|
+
// console.log('_curFields', _curFields);
|
203
|
+
setCurFields(_objectSpread({}, _curFields));
|
204
|
+
}
|
205
|
+
} else {
|
206
|
+
_message.warn('请填写属性名称');
|
207
|
+
}
|
208
|
+
};
|
209
|
+
|
210
|
+
var onFieldsChange = function onFieldsChange(values) {
|
211
|
+
// debugger;
|
212
|
+
// console.log('onFieldsChange', values, curFields);
|
213
|
+
var _fields = fields;
|
214
|
+
_fields[curFields.id] = values;
|
215
|
+
setFields(_objectSpread({}, _fields));
|
216
|
+
setIsFields(false);
|
217
|
+
};
|
218
|
+
|
219
|
+
var onOuterTypeChange = function onOuterTypeChange(value) {
|
220
|
+
setOutType(value);
|
221
|
+
};
|
222
|
+
|
223
|
+
var processFileds = function processFileds(schema) {
|
224
|
+
debugger;
|
225
|
+
var _properties = schema.properties;
|
226
|
+
var _fields = fields;
|
227
|
+
|
228
|
+
if (_properties) {
|
229
|
+
for (var i = 0; i < _properties.length; i++) {
|
230
|
+
if (_properties[i].fields) {
|
231
|
+
_fields[_properties[i].id] = _properties[i].fields;
|
232
|
+
}
|
233
|
+
}
|
234
|
+
}
|
235
|
+
|
236
|
+
if (schema.fields) {
|
237
|
+
_fields[schema.id] = schema.fields;
|
238
|
+
}
|
239
|
+
|
240
|
+
setFields(_objectSpread({}, _fields));
|
241
|
+
};
|
242
|
+
|
243
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(_Form, {
|
244
|
+
className: "metadata-edit",
|
245
|
+
initialValues: initialValues,
|
246
|
+
form: form,
|
247
|
+
name: "control-hooks",
|
248
|
+
onFinish: onMyFinish
|
249
|
+
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
250
|
+
label: "\u540D\u79F0",
|
251
|
+
name: "id",
|
252
|
+
style: {
|
253
|
+
marginBottom: '15px'
|
254
|
+
},
|
255
|
+
rules: [{
|
256
|
+
required: true
|
257
|
+
}]
|
258
|
+
}, /*#__PURE__*/React.createElement(_Input, {
|
259
|
+
disabled: isNameDisabled
|
260
|
+
})), /*#__PURE__*/React.createElement(_Form.Item, {
|
261
|
+
label: "\u7C7B\u578B",
|
262
|
+
name: "type",
|
263
|
+
style: {
|
264
|
+
marginBottom: '15px'
|
265
|
+
},
|
266
|
+
rules: [{
|
267
|
+
required: true
|
268
|
+
}]
|
269
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
270
|
+
options: OUTERMOST_TYPES_OPTIONS,
|
271
|
+
onChange: onOuterTypeChange
|
272
|
+
})), outerType === 'object' && /*#__PURE__*/React.createElement(MetaPropsEdit, {
|
273
|
+
form: form,
|
274
|
+
metadataTag: metadataTag,
|
275
|
+
name: "properties",
|
276
|
+
onAddFields: onAddFields,
|
277
|
+
onNewRefClick: onNewRefClick
|
278
|
+
}), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
|
279
|
+
type: "primary",
|
280
|
+
block: true,
|
281
|
+
htmlType: "submit"
|
282
|
+
}, "\u786E\u5B9A"))), /*#__PURE__*/React.createElement(_Drawer, {
|
283
|
+
title: (curFields === null || curFields === void 0 ? void 0 : curFields.id) || 'fields',
|
284
|
+
width: 450,
|
285
|
+
bodyStyle: {
|
286
|
+
padding: 0
|
287
|
+
},
|
288
|
+
placement: "right",
|
289
|
+
onClose: function onClose() {
|
290
|
+
setIsFields(false);
|
291
|
+
},
|
292
|
+
mask: false,
|
293
|
+
push: false,
|
294
|
+
visible: isFields,
|
295
|
+
destroyOnClose: true
|
296
|
+
}, /*#__PURE__*/React.createElement(MetaFieldsEdit, {
|
297
|
+
key: curFields === null || curFields === void 0 ? void 0 : curFields.id,
|
298
|
+
defaultValues: fields[curFields.id],
|
299
|
+
onChange: onFieldsChange
|
300
|
+
})));
|
301
|
+
};
|
302
|
+
|
303
|
+
export default MetadataEditV2;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export interface IMetaFileds {
|
2
|
+
id: string;
|
3
|
+
type: 'object';
|
4
|
+
properties: any[];
|
5
|
+
value: any;
|
6
|
+
}
|
7
|
+
|
8
|
+
export type ITypeStatus = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array';
|
9
|
+
|
10
|
+
export type IMetaProperty = {
|
11
|
+
/**
|
12
|
+
* 属性的名称
|
13
|
+
*/
|
14
|
+
id: string;
|
15
|
+
/**
|
16
|
+
* 类型
|
17
|
+
*/
|
18
|
+
type: string;
|
19
|
+
enum?: any[];
|
20
|
+
};
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
2
3
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
3
4
|
import { cloneDeep } from 'lodash';
|
4
5
|
/**
|
@@ -7,7 +8,7 @@ import { cloneDeep } from 'lodash';
|
|
7
8
|
* @class httpCache
|
8
9
|
*/
|
9
10
|
|
10
|
-
var HttpCache = function HttpCache() {
|
11
|
+
var HttpCache = /*#__PURE__*/_createClass(function HttpCache() {
|
11
12
|
var _this = this;
|
12
13
|
|
13
14
|
_classCallCheck(this, HttpCache);
|
@@ -131,7 +132,7 @@ var HttpCache = function HttpCache() {
|
|
131
132
|
});
|
132
133
|
}
|
133
134
|
};
|
134
|
-
};
|
135
|
+
});
|
135
136
|
|
136
137
|
window.rondsGraphCache = window.rondsGraphCache ? window.rondsGraphCache : new HttpCache();
|
137
138
|
export default window.rondsGraphCache;
|
@@ -64,7 +64,7 @@ httpClient.defaults.timeout = defaultOptions.timeout;
|
|
64
64
|
* @template T
|
65
65
|
*/
|
66
66
|
|
67
|
-
export var BaseResData = function BaseResData(data, successed) {
|
67
|
+
export var BaseResData = /*#__PURE__*/_createClass(function BaseResData(data, successed) {
|
68
68
|
var msg = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
69
69
|
var status = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 200;
|
70
70
|
var errData = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;
|
@@ -94,7 +94,7 @@ export var BaseResData = function BaseResData(data, successed) {
|
|
94
94
|
if (this.successed === false) {
|
95
95
|
this.data = undefined;
|
96
96
|
}
|
97
|
-
}; //数据转换拦截器
|
97
|
+
}); //数据转换拦截器
|
98
98
|
|
99
99
|
httpClient.interceptors.response.use(function (response) {
|
100
100
|
//正常数据
|
@@ -47,12 +47,12 @@ export var Enum = /*#__PURE__*/function () {
|
|
47
47
|
|
48
48
|
return Enum;
|
49
49
|
}();
|
50
|
-
export var Array = function Array(items) {
|
50
|
+
export var Array = /*#__PURE__*/_createClass(function Array(items) {
|
51
51
|
_classCallCheck(this, Array);
|
52
52
|
|
53
53
|
this.items = void 0;
|
54
54
|
this.items = items;
|
55
|
-
};
|
55
|
+
});
|
56
56
|
export var MetaObject = /*#__PURE__*/function () {
|
57
57
|
function MetaObject() {
|
58
58
|
_classCallCheck(this, MetaObject);
|
@@ -1,87 +1,87 @@
|
|
1
|
-
export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
|
2
|
-
|
3
|
-
export type IMetaData = {
|
4
|
-
/**
|
5
|
-
* 类名称/属性名称
|
6
|
-
*/
|
7
|
-
id: string;
|
8
|
-
/**
|
9
|
-
* 类型
|
10
|
-
*/
|
11
|
-
type: IMetaType;
|
12
|
-
/**
|
13
|
-
* 属性
|
14
|
-
*/
|
15
|
-
properties?: IMetaProperties[];
|
16
|
-
|
17
|
-
/**
|
18
|
-
* 引用id
|
19
|
-
*/
|
20
|
-
refId?: string;
|
21
|
-
/**
|
22
|
-
* 静态的变量
|
23
|
-
*/
|
24
|
-
fields?: IMetaFileds[];
|
25
|
-
};
|
26
|
-
|
27
|
-
export type IMetaProperties = {
|
28
|
-
/**
|
29
|
-
* 类规则名称
|
30
|
-
*/
|
31
|
-
id: string;
|
32
|
-
|
33
|
-
/**
|
34
|
-
* 类型
|
35
|
-
*/
|
36
|
-
type: IMetaType;
|
37
|
-
|
38
|
-
/**
|
39
|
-
* 引用id
|
40
|
-
*/
|
41
|
-
refId?: string;
|
42
|
-
/**
|
43
|
-
* 静态的变量
|
44
|
-
*/
|
45
|
-
fields?: IMetaFileds[];
|
46
|
-
/**
|
47
|
-
* 枚举值
|
48
|
-
*/
|
49
|
-
enum?: { value: string }[];
|
50
|
-
/**
|
51
|
-
* 数组类型
|
52
|
-
*/
|
53
|
-
items?: { type: IMetaType; refId?: string };
|
54
|
-
};
|
55
|
-
|
56
|
-
export type IMetaFileds = {
|
57
|
-
/**
|
58
|
-
* 规则名称
|
59
|
-
*/
|
60
|
-
id: string;
|
61
|
-
|
62
|
-
/**
|
63
|
-
* 类型
|
64
|
-
*/
|
65
|
-
type: IMetaType;
|
66
|
-
|
67
|
-
/**
|
68
|
-
* 引用id
|
69
|
-
*/
|
70
|
-
refId?: string;
|
71
|
-
|
72
|
-
/**
|
73
|
-
* 规则值
|
74
|
-
*/
|
75
|
-
value: any;
|
76
|
-
};
|
77
|
-
|
78
|
-
export interface IAPI {
|
79
|
-
// 获取元数据列表
|
80
|
-
GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
|
81
|
-
// 通过元数据Id获取元数据详情
|
82
|
-
GetMetadataDetailById(metadataId: string): Promise<any>;
|
83
|
-
// 新增元数据
|
84
|
-
SaveMetadata(data: any, metadataTag: string): Promise<any>;
|
85
|
-
// 获取元数据的值
|
86
|
-
GetMetadataObjList(data: any): Promise<any[]>;
|
87
|
-
}
|
1
|
+
export type IMetaType = 'object' | 'ref' | 'bool' | 'number' | 'text' | 'enum' | 'array' | string;
|
2
|
+
|
3
|
+
export type IMetaData = {
|
4
|
+
/**
|
5
|
+
* 类名称/属性名称
|
6
|
+
*/
|
7
|
+
id: string;
|
8
|
+
/**
|
9
|
+
* 类型
|
10
|
+
*/
|
11
|
+
type: IMetaType;
|
12
|
+
/**
|
13
|
+
* 属性
|
14
|
+
*/
|
15
|
+
properties?: IMetaProperties[];
|
16
|
+
|
17
|
+
/**
|
18
|
+
* 引用id
|
19
|
+
*/
|
20
|
+
refId?: string;
|
21
|
+
/**
|
22
|
+
* 静态的变量
|
23
|
+
*/
|
24
|
+
fields?: IMetaFileds[];
|
25
|
+
};
|
26
|
+
|
27
|
+
export type IMetaProperties = {
|
28
|
+
/**
|
29
|
+
* 类规则名称
|
30
|
+
*/
|
31
|
+
id: string;
|
32
|
+
|
33
|
+
/**
|
34
|
+
* 类型
|
35
|
+
*/
|
36
|
+
type: IMetaType;
|
37
|
+
|
38
|
+
/**
|
39
|
+
* 引用id
|
40
|
+
*/
|
41
|
+
refId?: string;
|
42
|
+
/**
|
43
|
+
* 静态的变量
|
44
|
+
*/
|
45
|
+
fields?: IMetaFileds[];
|
46
|
+
/**
|
47
|
+
* 枚举值
|
48
|
+
*/
|
49
|
+
enum?: { value: string }[];
|
50
|
+
/**
|
51
|
+
* 数组类型
|
52
|
+
*/
|
53
|
+
items?: { type: IMetaType; refId?: string };
|
54
|
+
};
|
55
|
+
|
56
|
+
export type IMetaFileds = {
|
57
|
+
/**
|
58
|
+
* 规则名称
|
59
|
+
*/
|
60
|
+
id: string;
|
61
|
+
|
62
|
+
/**
|
63
|
+
* 类型
|
64
|
+
*/
|
65
|
+
type: IMetaType;
|
66
|
+
|
67
|
+
/**
|
68
|
+
* 引用id
|
69
|
+
*/
|
70
|
+
refId?: string;
|
71
|
+
|
72
|
+
/**
|
73
|
+
* 规则值
|
74
|
+
*/
|
75
|
+
value: any;
|
76
|
+
};
|
77
|
+
|
78
|
+
export interface IAPI {
|
79
|
+
// 获取元数据列表
|
80
|
+
GetMetadataList(keyWords?: string[]): Promise<{ id: string; name: string; schema: string }[]>;
|
81
|
+
// 通过元数据Id获取元数据详情
|
82
|
+
GetMetadataDetailById(metadataId: string): Promise<any>;
|
83
|
+
// 新增元数据
|
84
|
+
SaveMetadata(data: any, metadataTag: string): Promise<any>;
|
85
|
+
// 获取元数据的值
|
86
|
+
GetMetadataObjList(data: any): Promise<any[]>;
|
87
|
+
}
|
package/es/index.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
export { default as MetadataEdit } from './comps/MetadataEdit';
|
2
|
+
export { default as MetadataEditV2 } from './comps/MetadataEditV2';
|
2
3
|
export { default as MetadataForm } from './comps/MetadataForm';
|
3
4
|
export { default as JsonView } from './comps/JsonView';
|
4
5
|
export { default as JsonEdit } from './comps/JsonEdit';
|
package/es/index.js
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
/*
|
2
2
|
* @Author:wangxian
|
3
3
|
* @Date: 2021-09-18 14:15:04
|
4
|
-
* @LastEditTime:
|
5
|
-
* @LastEditors:
|
4
|
+
* @LastEditTime: 2022-03-03 17:12:29
|
5
|
+
* @LastEditors: Please set LastEditors
|
6
6
|
* @FilePath: \ronds.metadata\src\index.ts
|
7
7
|
*/
|
8
8
|
export { default as MetadataEdit } from './comps/MetadataEdit';
|
9
|
+
export { default as MetadataEditV2 } from './comps/MetadataEditV2';
|
9
10
|
export { default as MetadataForm } from './comps/MetadataForm';
|
10
11
|
export { default as JsonView } from './comps/JsonView';
|
11
12
|
export { default as JsonEdit } from './comps/JsonEdit';
|