ronds-metadata 1.0.10 → 1.0.12

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/es/api/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export default class Api implements IAPI {
5
5
  * @param keyWords
6
6
  * @returns
7
7
  */
8
- GetMetadataList(keyWords?: string): Promise<any>;
8
+ GetMetadataList(keyWords?: string[]): Promise<any>;
9
9
  /**
10
10
  * 通过元数据Id获取元数据详情
11
11
  * @param metadataId
package/es/api/index.js CHANGED
@@ -20,20 +20,31 @@ var Api = /*#__PURE__*/function () {
20
20
  */
21
21
  function () {
22
22
  var _GetMetadataList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(keyWords) {
23
- var url, res;
23
+ var param, url, res;
24
24
  return _regeneratorRuntime.wrap(function _callee$(_context) {
25
25
  while (1) {
26
26
  switch (_context.prev = _context.next) {
27
27
  case 0:
28
- url = "/metadata?module=".concat(keyWords || '');
29
- _context.next = 3;
30
- return http.get(url);
28
+ param = {
29
+ filter: {
30
+ name: '',
31
+ tags: keyWords
32
+ },
33
+ order: [],
34
+ pagination: {
35
+ page: 1,
36
+ size: 30
37
+ }
38
+ };
39
+ url = "/metadata/list";
40
+ _context.next = 4;
41
+ return http.post(url, param);
31
42
 
32
- case 3:
43
+ case 4:
33
44
  res = _context.sent;
34
45
  return _context.abrupt("return", res.data);
35
46
 
36
- case 5:
47
+ case 6:
37
48
  case "end":
38
49
  return _context.stop();
39
50
  }
@@ -96,9 +107,10 @@ var Api = /*#__PURE__*/function () {
96
107
  switch (_context3.prev = _context3.next) {
97
108
  case 0:
98
109
  param = {
99
- value: JSON.stringify([data]),
110
+ schema: JSON.stringify([data]),
100
111
  name: data.id,
101
- module: metadataTag
112
+ tags: [metadataTag],
113
+ permission: 'public'
102
114
  };
103
115
  url = "/metadata";
104
116
  _context3.next = 4;
@@ -179,7 +179,8 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
179
179
  },
180
180
  onChange: function onChange(value) {
181
181
  var _refIds = refIds;
182
- _refIds[index] = value;
182
+ _refIds[index] = value; // form.setFieldsValue({ id: value });
183
+
183
184
  setRefIds(_objectSpread({}, _refIds));
184
185
  },
185
186
  options: metaType || []
@@ -201,7 +201,8 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
201
201
  borderRadius: '5px',
202
202
  padding: '10px',
203
203
  marginBottom: '10px',
204
- display: 'flex'
204
+ display: 'flex',
205
+ alignItems: 'center'
205
206
  }
206
207
  }, /*#__PURE__*/React.createElement(_Form.Item, _extends({}, field, {
207
208
  label: "Array",
@@ -228,7 +229,36 @@ var MetaPropsEdit = function MetaPropsEdit(props) {
228
229
  width: '180px'
229
230
  },
230
231
  options: metaType || []
231
- }))));
232
+ })), /*#__PURE__*/React.createElement("div", {
233
+ style: {
234
+ padding: '0 10px'
235
+ }
236
+ }, /*#__PURE__*/React.createElement(_Tooltip, {
237
+ title: "\u6DFB\u52A0\u5F15\u7528\u7C7B\u578B"
238
+ }, /*#__PURE__*/React.createElement(_Button, {
239
+ shape: "circle",
240
+ size: "small",
241
+ type: "primary",
242
+ onClick: function onClick() {
243
+ onNewRefClick && onNewRefClick();
244
+ },
245
+ icon: /*#__PURE__*/React.createElement(PlusOutlined, null)
246
+ })), /*#__PURE__*/React.createElement(_Tooltip, {
247
+ title: "\u5237\u65B0"
248
+ }, /*#__PURE__*/React.createElement(_Button, {
249
+ shape: "circle",
250
+ size: "small",
251
+ style: {
252
+ marginLeft: '10px'
253
+ },
254
+ onClick: function onClick() {
255
+ setRefresh(false);
256
+ setTimeout(function () {
257
+ setRefresh(true);
258
+ }, 100);
259
+ },
260
+ icon: /*#__PURE__*/React.createElement(ReloadOutlined, null)
261
+ })))));
232
262
 
233
263
  case 'enum':
234
264
  return /*#__PURE__*/React.createElement("div", {
@@ -12,16 +12,21 @@ export var useMetaType = function useMetaType(tag) {
12
12
  React.useEffect(function () {
13
13
  if (isFresh) {
14
14
  var service = new MetadataService();
15
- service.GetMetadataList(tag).then(function (res) {
15
+
16
+ var _tag = tag ? [tag] : [];
17
+
18
+ service.GetMetadataList(_tag).then(function (res) {
16
19
  var _metaType = [];
17
20
 
18
- for (var i = 0; i < res.length; i++) {
19
- var obj = {
20
- label: res[i].name,
21
- value: res[i].id
22
- };
21
+ if (res) {
22
+ for (var i = 0; i < res.length; i++) {
23
+ var obj = {
24
+ label: res[i].name,
25
+ value: res[i].id
26
+ };
23
27
 
24
- _metaType.push(obj);
28
+ _metaType.push(obj);
29
+ }
25
30
  }
26
31
 
27
32
  setMetaType([].concat(_metaType));
@@ -1,5 +1,9 @@
1
1
  import './index.less';
2
2
  interface IMetadataEditProps {
3
+ /**
4
+ * 默认元数据最外层的名称无法编辑
5
+ */
6
+ isNameDisabled?: boolean;
3
7
  /**
4
8
  * 元数据的标签,根据这个标签在元数据库里检索元数据
5
9
  */
@@ -20,6 +20,7 @@ import { OUTERMOST_TYPES_OPTIONS } from './constant';
20
20
 
21
21
  var MetadataEdit = function MetadataEdit(props) {
22
22
  var initialValues = props.initialValues,
23
+ isNameDisabled = props.isNameDisabled,
23
24
  metadataTag = props.metadataTag,
24
25
  onFinish = props.onFinish,
25
26
  onNewRefClick = props.onNewRefClick;
@@ -137,7 +138,9 @@ var MetadataEdit = function MetadataEdit(props) {
137
138
  rules: [{
138
139
  required: true
139
140
  }]
140
- }, /*#__PURE__*/React.createElement(_Input, null)), /*#__PURE__*/React.createElement(_Form.Item, {
141
+ }, /*#__PURE__*/React.createElement(_Input, {
142
+ disabled: isNameDisabled
143
+ })), /*#__PURE__*/React.createElement(_Form.Item, {
141
144
  label: "\u7C7B\u578B",
142
145
  name: "type",
143
146
  style: {
@@ -12,7 +12,6 @@ import { getDataCell } from '../utils';
12
12
 
13
13
  function Index(props) {
14
14
  var id = props.id,
15
- require = props.require,
16
15
  items = props.items,
17
16
  isRefForm = props.isRefForm,
18
17
  disabled = props.disabled;
@@ -38,7 +37,7 @@ function Index(props) {
38
37
  }, /*#__PURE__*/React.createElement("div", {
39
38
  className: "ant-form-item-label mt-1"
40
39
  }, /*#__PURE__*/React.createElement("label", {
41
- className: "".concat(require && 'ant-form-item-required')
40
+ className: "".concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require) && 'ant-form-item-required')
42
41
  }, extraInfo.label || id)), formContext.isShowTypeInfo && /*#__PURE__*/React.createElement("div", {
43
42
  style: {
44
43
  padding: '0 6px',
@@ -17,7 +17,6 @@ var TextArea = _Input.TextArea;
17
17
 
18
18
  function Index(props) {
19
19
  var id = props.id,
20
- require = props.require,
21
20
  isRefForm = props.isRefForm,
22
21
  disabled = props.disabled,
23
22
  field = props.field,
@@ -96,7 +95,7 @@ function Index(props) {
96
95
  name: [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
97
96
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
98
97
  rules: [{
99
- required: require
98
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
100
99
  }],
101
100
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
102
101
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -107,7 +106,7 @@ function Index(props) {
107
106
  label: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id,
108
107
  name: name,
109
108
  rules: [{
110
- required: require
109
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
111
110
  }],
112
111
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
113
112
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -119,7 +118,7 @@ function Index(props) {
119
118
  name: [field === null || field === void 0 ? void 0 : field.name],
120
119
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
121
120
  rules: [{
122
- required: require
121
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
123
122
  }],
124
123
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
125
124
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -14,7 +14,6 @@ function Index(props) {
14
14
  var id = props.id,
15
15
  name = props.name,
16
16
  isRefForm = props.isRefForm,
17
- require = props.require,
18
17
  disabled = props.disabled,
19
18
  field = props.field,
20
19
  isObj = props.isObj;
@@ -34,7 +33,7 @@ function Index(props) {
34
33
  label: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id,
35
34
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
36
35
  rules: [{
37
- required: require
36
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
38
37
  }],
39
38
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
40
39
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -48,7 +47,7 @@ function Index(props) {
48
47
  label: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id,
49
48
  name: name,
50
49
  rules: [{
51
- required: require
50
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
52
51
  }],
53
52
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
54
53
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -63,7 +62,7 @@ function Index(props) {
63
62
  name: [field === null || field === void 0 ? void 0 : field.name],
64
63
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
65
64
  rules: [{
66
- required: require
65
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
67
66
  }],
68
67
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
69
68
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -22,7 +22,6 @@ function Index(props) {
22
22
 
23
23
  var id = props.id,
24
24
  idx = props.idx,
25
- require = props.require,
26
25
  refId = props.refId,
27
26
  disabled = props.disabled,
28
27
  isRefForm = props.isRefForm,
@@ -101,14 +100,17 @@ function Index(props) {
101
100
  var server = new MetadataService();
102
101
  server.GetMetadataDetailById(refId).then(function (res) {
103
102
  var provider = new JsonMetadataProvider();
104
- var mySchema = JSON.parse(res.value);
105
- provider.add_types(mySchema);
106
- var FormCls = provider.get_type(mySchema[0].id);
107
- var formCls = new FormCls();
108
- var _fields = formCls.__type__.__fields__;
109
- refFieldsRef.current = _fields;
110
- setRefFields(_objectSpread({}, _fields));
111
- setSchema(_toConsumableArray(mySchema));
103
+
104
+ if (res === null || res === void 0 ? void 0 : res.schema) {
105
+ var mySchema = JSON.parse(res.schema);
106
+ provider.add_types(mySchema);
107
+ var FormCls = provider.get_type(mySchema[0].id);
108
+ var formCls = new FormCls();
109
+ var _fields = formCls.__type__.__fields__;
110
+ refFieldsRef.current = _fields;
111
+ setRefFields(_objectSpread({}, _fields));
112
+ setSchema(_toConsumableArray(mySchema));
113
+ }
112
114
  });
113
115
  }
114
116
  }, [refId]);
@@ -150,7 +152,7 @@ function Index(props) {
150
152
  textAlign: 'left'
151
153
  }
152
154
  }, /*#__PURE__*/React.createElement("label", {
153
- className: "".concat(require && 'ant-form-item-required')
155
+ className: "".concat((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require) && 'ant-form-item-required')
154
156
  }, extraInfo.label || id)), /*#__PURE__*/React.createElement("div", {
155
157
  style: {
156
158
  padding: '10px',
@@ -184,7 +186,7 @@ function Index(props) {
184
186
  label: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id,
185
187
  name: id,
186
188
  rules: [{
187
- required: require
189
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
188
190
  }],
189
191
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
190
192
  tooltip: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip) || help
@@ -212,7 +214,7 @@ function Index(props) {
212
214
  name: [field === null || field === void 0 ? void 0 : field.name],
213
215
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
214
216
  rules: [{
215
- required: require
217
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
216
218
  }],
217
219
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
218
220
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -14,7 +14,6 @@ function Index(props) {
14
14
  var id = props.id,
15
15
  name = props.name,
16
16
  isRefForm = props.isRefForm,
17
- require = props.require,
18
17
  disabled = props.disabled,
19
18
  field = props.field,
20
19
  isObj = props.isObj;
@@ -50,7 +49,7 @@ function Index(props) {
50
49
  name: [field === null || field === void 0 ? void 0 : field.name].concat(_toConsumableArray(name)),
51
50
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
52
51
  rules: [{
53
- required: require
52
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
54
53
  }],
55
54
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
56
55
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -67,7 +66,7 @@ function Index(props) {
67
66
  label: (extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.label) || id,
68
67
  name: name,
69
68
  rules: [{
70
- required: require
69
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
71
70
  }],
72
71
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
73
72
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -85,7 +84,7 @@ function Index(props) {
85
84
  name: [field === null || field === void 0 ? void 0 : field.name],
86
85
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
87
86
  rules: [{
88
- required: require
87
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
89
88
  }],
90
89
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
91
90
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -14,7 +14,6 @@ function Index(props) {
14
14
  var id = props.id,
15
15
  name = props.name,
16
16
  isRefForm = props.isRefForm,
17
- require = props.require,
18
17
  disabled = props.disabled,
19
18
  field = props.field,
20
19
  isObj = props.isObj;
@@ -35,7 +34,7 @@ function Index(props) {
35
34
  valuePropName: "checked",
36
35
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
37
36
  rules: [{
38
- required: require
37
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
39
38
  }],
40
39
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
41
40
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -51,7 +50,7 @@ function Index(props) {
51
50
  name: name,
52
51
  valuePropName: "checked",
53
52
  rules: [{
54
- required: require
53
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
55
54
  }],
56
55
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
57
56
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -68,7 +67,7 @@ function Index(props) {
68
67
  valuePropName: "checked",
69
68
  fieldKey: [field === null || field === void 0 ? void 0 : field.fieldKey],
70
69
  rules: [{
71
- required: require
70
+ required: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.require
72
71
  }],
73
72
  help: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.help,
74
73
  tooltip: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.tooltip
@@ -55,7 +55,7 @@ var MetadataForm = function MetadataForm(props) {
55
55
  if (refId) {
56
56
  var server = new MetadataService();
57
57
  server.GetMetadataDetailById(refId).then(function (res) {
58
- var _schema = JSON.parse(res.value);
58
+ var _schema = JSON.parse(res.schema);
59
59
 
60
60
  setMySchema(_toConsumableArray(_schema));
61
61
  });
@@ -25,7 +25,7 @@ export declare class HttpHelper {
25
25
  private interceptorInit;
26
26
  private _http;
27
27
  constructor(client?: AxiosInstance);
28
- get<T = any>(url: string, params?: any, options?: HttpOption): Promise<BaseResData<T>>;
28
+ get<T = any>(url: string, data?: any, params?: any, options?: HttpOption): Promise<BaseResData<T>>;
29
29
  post<T = any>(url: string, data?: any, params?: any, options?: HttpOption): Promise<BaseResData<T>>;
30
30
  put<T = any>(url: string, data?: any, params?: any, options?: HttpOption): Promise<BaseResData<T>>;
31
31
  delete<T = any>(url: string, params?: any, options?: HttpOption): Promise<BaseResData<T>>;
@@ -223,10 +223,11 @@ export var HttpHelper = /*#__PURE__*/function () {
223
223
 
224
224
  _createClass(HttpHelper, [{
225
225
  key: "get",
226
- value: function get(url, params, options) {
226
+ value: function get(url, data, params, options) {
227
227
  return this.fetch(url, _objectSpread({
228
228
  params: params,
229
- method: 'get'
229
+ method: 'get',
230
+ data: data
230
231
  }, options));
231
232
  }
232
233
  }, {
@@ -4,7 +4,7 @@ export declare class MetadataService {
4
4
  api: IAPI;
5
5
  constructor(api?: IAPI);
6
6
  /** 获取元数据列表 */
7
- GetMetadataList(keyWords?: string): Promise<{
7
+ GetMetadataList(keyWords?: string[]): Promise<{
8
8
  id: string;
9
9
  name: string;
10
10
  schema: string;
@@ -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(metadataId): 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(metadataId): Promise<any[]>;
87
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "public": true,
3
3
  "name": "ronds-metadata",
4
- "version": "1.0.10",
4
+ "version": "1.0.12",
5
5
  "scripts": {
6
6
  "start": "dumi dev",
7
7
  "docs:build": "dumi build",