ronds-metadata 1.0.22 → 1.0.26
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.js +3 -3
- package/es/comps/MetadataEdit/components/MetaFieldsEdit.js +2 -2
- package/es/comps/MetadataForm/DataCell/Input.js +16 -2
- package/es/comps/MetadataForm/hooks/index.js +16 -0
- package/es/config.js +1 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +8 -0
- package/package.json +1 -1
package/es/api/index.js
CHANGED
@@ -36,7 +36,7 @@ var Api = /*#__PURE__*/function () {
|
|
36
36
|
size: 30
|
37
37
|
}
|
38
38
|
};
|
39
|
-
url = "/metadata/list";
|
39
|
+
url = "/metamgt-web/metadata/list";
|
40
40
|
_context.next = 4;
|
41
41
|
return http.post(url, param);
|
42
42
|
|
@@ -73,7 +73,7 @@ var Api = /*#__PURE__*/function () {
|
|
73
73
|
while (1) {
|
74
74
|
switch (_context2.prev = _context2.next) {
|
75
75
|
case 0:
|
76
|
-
url = "/metadata/".concat(metadataId);
|
76
|
+
url = "/metamgt-web/metadata/".concat(metadataId);
|
77
77
|
_context2.next = 3;
|
78
78
|
return http.get(url);
|
79
79
|
|
@@ -112,7 +112,7 @@ var Api = /*#__PURE__*/function () {
|
|
112
112
|
tags: [metadataTag],
|
113
113
|
permission: 'public'
|
114
114
|
};
|
115
|
-
url = "/metadata";
|
115
|
+
url = "/metamgt-web/metadata/add";
|
116
116
|
_context3.next = 4;
|
117
117
|
return http.post(url, param);
|
118
118
|
|
@@ -206,8 +206,8 @@ var MetaFieldsEdit = function MetaFieldsEdit(props) {
|
|
206
206
|
}, /*#__PURE__*/React.createElement(MetadataForm, {
|
207
207
|
initialValues: defaultValues && defaultValues.length > 0 && ((_defaultValues$index = defaultValues[index]) === null || _defaultValues$index === void 0 ? void 0 : _defaultValues$index.value),
|
208
208
|
refId: refIds[index],
|
209
|
-
onValuesChange: function onValuesChange(values) {
|
210
|
-
onRefRulesValuesChange(
|
209
|
+
onValuesChange: function onValuesChange(values, allValues) {
|
210
|
+
onRefRulesValuesChange(allValues, index);
|
211
211
|
}
|
212
212
|
})));
|
213
213
|
}), /*#__PURE__*/React.createElement(_Form.Item, null, /*#__PURE__*/React.createElement(_Button, {
|
@@ -2,6 +2,8 @@ import "antd/es/form/style";
|
|
2
2
|
import _Form from "antd/es/form";
|
3
3
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
4
4
|
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
5
|
+
import "antd/es/date-picker/style";
|
6
|
+
import _DatePicker from "antd/es/date-picker";
|
5
7
|
import "antd/es/popover/style";
|
6
8
|
import _Popover from "antd/es/popover";
|
7
9
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
@@ -31,6 +33,11 @@ function Index(props) {
|
|
31
33
|
color = _React$useState2[0],
|
32
34
|
setColor = _React$useState2[1];
|
33
35
|
|
36
|
+
var _React$useState3 = React.useState(null),
|
37
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
38
|
+
date = _React$useState4[0],
|
39
|
+
setDate = _React$useState4[1];
|
40
|
+
|
34
41
|
React.useEffect(function () {
|
35
42
|
if ((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.type) === 'colorPicker') {
|
36
43
|
setColor(formContext.form.getFieldValue(id));
|
@@ -48,7 +55,7 @@ function Index(props) {
|
|
48
55
|
});
|
49
56
|
|
50
57
|
var processInputType = function processInputType(_type) {
|
51
|
-
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4;
|
58
|
+
var _extraInfo$disabled, _extraInfo$disabled2, _extraInfo$disabled3, _extraInfo$disabled4, _extraInfo$disabled5;
|
52
59
|
|
53
60
|
switch (_type) {
|
54
61
|
case 'password':
|
@@ -82,9 +89,16 @@ function Index(props) {
|
|
82
89
|
content: colorPicker
|
83
90
|
}, /*#__PURE__*/React.createElement(BgColorsOutlined, null))));
|
84
91
|
|
92
|
+
case 'datePicker':
|
93
|
+
return /*#__PURE__*/React.createElement(_DatePicker, {
|
94
|
+
showTime: true,
|
95
|
+
disabled: (_extraInfo$disabled4 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled4 !== void 0 ? _extraInfo$disabled4 : disabled,
|
96
|
+
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder
|
97
|
+
});
|
98
|
+
|
85
99
|
default:
|
86
100
|
return /*#__PURE__*/React.createElement(_Input, {
|
87
|
-
disabled: (_extraInfo$
|
101
|
+
disabled: (_extraInfo$disabled5 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled5 !== void 0 ? _extraInfo$disabled5 : disabled,
|
88
102
|
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder,
|
89
103
|
allowClear: true
|
90
104
|
});
|
@@ -1,5 +1,16 @@
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2
3
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
4
|
+
|
5
|
+
/*
|
6
|
+
* @Author: your name
|
7
|
+
* @Date: 2021-09-18 14:15:04
|
8
|
+
* @LastEditTime: 2021-12-03 16:00:13
|
9
|
+
* @LastEditors: Please set LastEditors
|
10
|
+
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
11
|
+
* @FilePath: \ronds.metadata\src\comps\MetadataForm\hooks\index.tsx
|
12
|
+
*/
|
13
|
+
import moment from 'moment';
|
3
14
|
import React from 'react';
|
4
15
|
export var useGetExtraInfo = function useGetExtraInfo(fields, id, form) {
|
5
16
|
var _React$useState = React.useState({}),
|
@@ -17,6 +28,11 @@ export var useGetExtraInfo = function useGetExtraInfo(fields, id, form) {
|
|
17
28
|
|
18
29
|
for (var k in extraInfo) {
|
19
30
|
_extraInfo[k] = extraInfo[k];
|
31
|
+
}
|
32
|
+
|
33
|
+
// 时间格式转化
|
34
|
+
if (_extraInfo.type === 'datePicker' && form.getFieldValue(id)) {
|
35
|
+
form.setFieldsValue(_defineProperty({}, id, moment(form.getFieldValue(id), 'YYYY-MM-DD HH:mm:ss')));
|
20
36
|
} // 暂时注释加载默认值
|
21
37
|
// if (_extraInfo?.defaultValue) {
|
22
38
|
// form.setFieldsValue({ [id]: _extraInfo?.defaultValue });
|
package/es/config.js
CHANGED
package/es/index.d.ts
CHANGED
@@ -3,4 +3,5 @@ export { default as MetadataForm } from './comps/MetadataForm';
|
|
3
3
|
export { default as JsonView } from './comps/JsonView';
|
4
4
|
export { default as JsonEdit } from './comps/JsonEdit';
|
5
5
|
export * from './framework/metadata/index';
|
6
|
+
export { default as http, addInterceptor } from './framework/http/index';
|
6
7
|
export { registerMetadataAPI } from './framework/metadata/MetadataService';
|
package/es/index.js
CHANGED
@@ -1,6 +1,14 @@
|
|
1
|
+
/*
|
2
|
+
* @Author:wangxian
|
3
|
+
* @Date: 2021-09-18 14:15:04
|
4
|
+
* @LastEditTime: 2021-12-14 09:08:16
|
5
|
+
* @LastEditors: wangxain
|
6
|
+
* @FilePath: \ronds.metadata\src\index.ts
|
7
|
+
*/
|
1
8
|
export { default as MetadataEdit } from './comps/MetadataEdit';
|
2
9
|
export { default as MetadataForm } from './comps/MetadataForm';
|
3
10
|
export { default as JsonView } from './comps/JsonView';
|
4
11
|
export { default as JsonEdit } from './comps/JsonEdit';
|
5
12
|
export * from './framework/metadata/index';
|
13
|
+
export { default as http, addInterceptor } from './framework/http/index';
|
6
14
|
export { registerMetadataAPI } from './framework/metadata/MetadataService';
|