ronds-metadata 1.0.24 → 1.0.25
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.
@@ -33,6 +33,11 @@ function Index(props) {
|
|
33
33
|
color = _React$useState2[0],
|
34
34
|
setColor = _React$useState2[1];
|
35
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
|
+
|
36
41
|
React.useEffect(function () {
|
37
42
|
if ((extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.type) === 'colorPicker') {
|
38
43
|
setColor(formContext.form.getFieldValue(id));
|
@@ -87,7 +92,6 @@ function Index(props) {
|
|
87
92
|
case 'datePicker':
|
88
93
|
return /*#__PURE__*/React.createElement(_DatePicker, {
|
89
94
|
showTime: true,
|
90
|
-
format: "YYYY-MM-DD HH:mm:ss",
|
91
95
|
disabled: (_extraInfo$disabled4 = extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.disabled) !== null && _extraInfo$disabled4 !== void 0 ? _extraInfo$disabled4 : disabled,
|
92
96
|
placeholder: extraInfo === null || extraInfo === void 0 ? void 0 : extraInfo.placeholder
|
93
97
|
});
|
@@ -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 });
|