@hw-component/form 1.2.6 → 1.2.8
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/DialogForm/DrawerForm/index.js +5 -4
- package/es/Select/index.js +8 -6
- package/lib/DialogForm/DrawerForm/index.js +5 -4
- package/lib/Select/index.js +8 -6
- package/package.json +1 -1
- package/src/components/DialogForm/DrawerForm/index.tsx +1 -0
- package/src/components/Select/index.tsx +2 -1
- package/src/pages/DrawerForm/index.tsx +3 -0
- package/src/pages/Form/index.tsx +176 -190
- package/src/pages/Select/index.tsx +1 -0
|
@@ -27,9 +27,9 @@ var DrawerForm = (function (_ref) {
|
|
|
27
27
|
onCancel = _ref.onCancel,
|
|
28
28
|
configData = _ref.configData,
|
|
29
29
|
infoRequest = _ref.infoRequest,
|
|
30
|
-
request = _ref.request
|
|
31
|
-
_ref.afterClose
|
|
32
|
-
|
|
30
|
+
request = _ref.request,
|
|
31
|
+
afterClose = _ref.afterClose,
|
|
32
|
+
dialogForm = _ref.dialogForm,
|
|
33
33
|
_ref$closable = _ref.closable,
|
|
34
34
|
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
35
35
|
initialValues = _ref.initialValues,
|
|
@@ -55,7 +55,8 @@ var DrawerForm = (function (_ref) {
|
|
|
55
55
|
params: params,
|
|
56
56
|
title: title,
|
|
57
57
|
onCancel: onCancel,
|
|
58
|
-
autoClear: autoClear
|
|
58
|
+
autoClear: autoClear,
|
|
59
|
+
afterClose: afterClose
|
|
59
60
|
}),
|
|
60
61
|
modalVisible = _useModifyProps.modalVisible,
|
|
61
62
|
modalFormData = _useModifyProps.modalFormData,
|
package/es/Select/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import _defineProperty from '@babel/runtime-corejs3/helpers/defineProperty';
|
|
|
10
10
|
import _objectWithoutProperties from '@babel/runtime-corejs3/helpers/objectWithoutProperties';
|
|
11
11
|
import 'core-js/modules/es.array.map.js';
|
|
12
12
|
import { jsx } from 'react/jsx-runtime';
|
|
13
|
+
import { createElement } from 'react';
|
|
13
14
|
import { Select } from 'antd';
|
|
14
15
|
import { useFilterOption, useOptionReq } from './hooks/norHooks.js';
|
|
15
16
|
import { useValueChange } from './hooks/changeHooks.js';
|
|
@@ -19,7 +20,8 @@ import Index$2 from './components/AllSelect.js';
|
|
|
19
20
|
import { useMatchConfigProps, useChangeOptions } from '../hooks/index.js';
|
|
20
21
|
import HFormConnect from '../Form/HFormConnect.js';
|
|
21
22
|
|
|
22
|
-
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch"]
|
|
23
|
+
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch"],
|
|
24
|
+
_excluded2 = ["value", "label"];
|
|
23
25
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
24
26
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
27
|
var Option = Select.Option;
|
|
@@ -130,16 +132,16 @@ var Index = function Index(_ref) {
|
|
|
130
132
|
}, props), {}, {
|
|
131
133
|
children: data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
132
134
|
var optionValue = item.value,
|
|
133
|
-
label = item.label
|
|
135
|
+
label = item.label,
|
|
136
|
+
oItem = _objectWithoutProperties(item, _excluded2);
|
|
134
137
|
var result = (filterProvider === null || filterProvider === void 0 ? void 0 : filterProvider(item)) || label;
|
|
135
138
|
var filter = _defineProperty({}, optionFilterProp, result);
|
|
136
|
-
return
|
|
139
|
+
return /*#__PURE__*/createElement(Option, _objectSpread(_objectSpread({}, oItem), {}, {
|
|
137
140
|
value: optionValue,
|
|
141
|
+
key: optionValue,
|
|
138
142
|
label: label,
|
|
139
143
|
mode: mode
|
|
140
|
-
}, filter),
|
|
141
|
-
children: render ? render(item, val) : label
|
|
142
|
-
}), optionValue);
|
|
144
|
+
}, filter), render ? render(item, val) : label);
|
|
143
145
|
})
|
|
144
146
|
}));
|
|
145
147
|
};
|
|
@@ -30,9 +30,9 @@ var DrawerForm = (function (_ref) {
|
|
|
30
30
|
onCancel = _ref.onCancel,
|
|
31
31
|
configData = _ref.configData,
|
|
32
32
|
infoRequest = _ref.infoRequest,
|
|
33
|
-
request = _ref.request
|
|
34
|
-
_ref.afterClose
|
|
35
|
-
|
|
33
|
+
request = _ref.request,
|
|
34
|
+
afterClose = _ref.afterClose,
|
|
35
|
+
dialogForm = _ref.dialogForm,
|
|
36
36
|
_ref$closable = _ref.closable,
|
|
37
37
|
closable = _ref$closable === void 0 ? true : _ref$closable,
|
|
38
38
|
initialValues = _ref.initialValues,
|
|
@@ -58,7 +58,8 @@ var DrawerForm = (function (_ref) {
|
|
|
58
58
|
params: params,
|
|
59
59
|
title: title,
|
|
60
60
|
onCancel: onCancel,
|
|
61
|
-
autoClear: autoClear
|
|
61
|
+
autoClear: autoClear,
|
|
62
|
+
afterClose: afterClose
|
|
62
63
|
}),
|
|
63
64
|
modalVisible = _useModifyProps.modalVisible,
|
|
64
65
|
modalFormData = _useModifyProps.modalFormData,
|
package/lib/Select/index.js
CHANGED
|
@@ -13,6 +13,7 @@ var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
|
|
|
13
13
|
var _objectWithoutProperties = require('@babel/runtime-corejs3/helpers/objectWithoutProperties');
|
|
14
14
|
require('core-js/modules/es.array.map.js');
|
|
15
15
|
var jsxRuntime = require('react/jsx-runtime');
|
|
16
|
+
var React = require('react');
|
|
16
17
|
var antd = require('antd');
|
|
17
18
|
var norHooks = require('./hooks/norHooks.js');
|
|
18
19
|
var changeHooks = require('./hooks/changeHooks.js');
|
|
@@ -22,7 +23,8 @@ var AllSelect = require('./components/AllSelect.js');
|
|
|
22
23
|
var index = require('../hooks/index.js');
|
|
23
24
|
var HFormConnect = require('../Form/HFormConnect.js');
|
|
24
25
|
|
|
25
|
-
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch"]
|
|
26
|
+
var _excluded = ["style", "mode", "options", "modeConfig", "value", "onChange", "fieldNames", "request", "manual", "optionLabelProp", "filterProvider", "optionFilterProp", "serviceSearch", "onSearch", "filterOption", "showSearch", "labelInValue", "noMatchItemRender", "allSelect", "addDispatchListener", "addFormat", "dispatch"],
|
|
27
|
+
_excluded2 = ["value", "label"];
|
|
26
28
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
27
29
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
28
30
|
var Option = antd.Select.Option;
|
|
@@ -133,16 +135,16 @@ var Index = function Index(_ref) {
|
|
|
133
135
|
}, props), {}, {
|
|
134
136
|
children: data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
135
137
|
var optionValue = item.value,
|
|
136
|
-
label = item.label
|
|
138
|
+
label = item.label,
|
|
139
|
+
oItem = _objectWithoutProperties(item, _excluded2);
|
|
137
140
|
var result = (filterProvider === null || filterProvider === void 0 ? void 0 : filterProvider(item)) || label;
|
|
138
141
|
var filter = _defineProperty({}, optionFilterProp, result);
|
|
139
|
-
return
|
|
142
|
+
return /*#__PURE__*/React.createElement(Option, _objectSpread(_objectSpread({}, oItem), {}, {
|
|
140
143
|
value: optionValue,
|
|
144
|
+
key: optionValue,
|
|
141
145
|
label: label,
|
|
142
146
|
mode: mode
|
|
143
|
-
}, filter),
|
|
144
|
-
children: render ? render(item, val) : label
|
|
145
|
-
}), optionValue);
|
|
147
|
+
}, filter), render ? render(item, val) : label);
|
|
146
148
|
})
|
|
147
149
|
}));
|
|
148
150
|
};
|
package/package.json
CHANGED
|
@@ -105,11 +105,12 @@ const Index: React.FC<HSelectProps> = ({
|
|
|
105
105
|
{...props}
|
|
106
106
|
>
|
|
107
107
|
{data?.map((item) => {
|
|
108
|
-
const { value: optionValue, label } = item;
|
|
108
|
+
const { value: optionValue, label ,...oItem} = item;
|
|
109
109
|
const result = filterProvider?.(item) || label;
|
|
110
110
|
const filter = { [optionFilterProp]: result };
|
|
111
111
|
return (
|
|
112
112
|
<Option
|
|
113
|
+
{...oItem}
|
|
113
114
|
value={optionValue}
|
|
114
115
|
key={optionValue}
|
|
115
116
|
label={label}
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -1,203 +1,189 @@
|
|
|
1
1
|
import { HForm, HFormConfigProvider, useHForm } from "../../components";
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {useRequest} from "ahooks";
|
|
5
|
-
import {MediaTypeEnum} from "../../components/Upload/enums";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Button, DatePicker, Form, Input } from "antd";
|
|
6
4
|
|
|
7
|
-
const formData = () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
name:"nameTest"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
label: "测试1",
|
|
16
|
-
type: "select",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: "测试1",
|
|
20
|
-
type: "inputNumber",
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
noStyle: true,
|
|
24
|
-
render: () => {
|
|
25
|
-
return <div>你好a</div>;
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: "时间",
|
|
30
|
-
type: "rangePicker",
|
|
31
|
-
name: "rangePicker",
|
|
32
|
-
itemProps: {
|
|
33
|
-
subProvider: () => {
|
|
34
|
-
console.log("fff");
|
|
5
|
+
const formData = (options) => {
|
|
6
|
+
const op = [
|
|
7
|
+
{
|
|
8
|
+
key: 1,
|
|
9
|
+
value: "是",
|
|
35
10
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
label:(form)=>{
|
|
40
|
-
const nameTest=form.getFieldValue("nameTest")
|
|
41
|
-
return nameTest;
|
|
42
|
-
},
|
|
43
|
-
name: "checkboxGroup",
|
|
44
|
-
type: "checkboxGroup",
|
|
45
|
-
rules: [{ required: true }],
|
|
46
|
-
shouldUpdate:()=>{
|
|
47
|
-
return true;
|
|
48
|
-
},
|
|
49
|
-
helper: "帮助我",
|
|
50
|
-
options: [
|
|
51
|
-
{ value: "选择1", key: "check1" },
|
|
52
|
-
{ value: "选择2", key: "check2" },
|
|
53
|
-
],
|
|
54
|
-
direction: "vertical",
|
|
55
|
-
labelAlign: "topLeft",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
label: "开关",
|
|
59
|
-
name: "switch",
|
|
60
|
-
type: "switch",
|
|
61
|
-
rules: [{ required: true }],
|
|
62
|
-
itemProps: {
|
|
63
|
-
valueMap: {
|
|
64
|
-
open: 1,
|
|
65
|
-
close: 0,
|
|
11
|
+
{
|
|
12
|
+
key: 0,
|
|
13
|
+
value: "否",
|
|
66
14
|
},
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
15
|
+
];
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
label: "测试",
|
|
19
|
+
className: "hdjd",
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
label: "测试1",
|
|
23
|
+
type: "select",
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
label: "测试1",
|
|
27
|
+
type: "inputNumber",
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
noStyle: true,
|
|
31
|
+
render: () => {
|
|
32
|
+
return <div>你好a</div>;
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
label: "时间",
|
|
37
|
+
type: "rangePicker",
|
|
38
|
+
name: "rangePicker",
|
|
39
|
+
itemProps: {
|
|
40
|
+
subProvider: () => {
|
|
41
|
+
return {
|
|
42
|
+
hdj:"fff"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
},
|
|
97
46
|
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
manual:false
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
type: "urlUpload",
|
|
115
|
-
name:"urlUpload",
|
|
116
|
-
label:"测试",
|
|
117
|
-
helper:"123123",
|
|
118
|
-
itemProps: {
|
|
119
|
-
inputHelper:"fff",
|
|
120
|
-
style:{
|
|
121
|
-
width:368
|
|
47
|
+
{
|
|
48
|
+
label: "选择",
|
|
49
|
+
name: "checkboxGroup",
|
|
50
|
+
type: "checkboxGroup",
|
|
51
|
+
rules: [{ required: true }],
|
|
52
|
+
helper: "帮助我",
|
|
53
|
+
options: [
|
|
54
|
+
{ value: "选择1", key: "check1" },
|
|
55
|
+
{ value: "选择2", key: "check2" },
|
|
56
|
+
],
|
|
57
|
+
direction: "vertical",
|
|
58
|
+
labelAlign: "topLeft",
|
|
122
59
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
60
|
+
{
|
|
61
|
+
label: "开关",
|
|
62
|
+
name: "switch",
|
|
63
|
+
type: "switch",
|
|
64
|
+
rules: [{ required: true }],
|
|
65
|
+
itemProps: {
|
|
66
|
+
valueMap: {
|
|
67
|
+
open: 1,
|
|
68
|
+
close: 0,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "submit",
|
|
74
|
+
itemProps: {
|
|
75
|
+
extraList: [
|
|
76
|
+
<Button
|
|
77
|
+
key="wh"
|
|
78
|
+
onClick={() => {
|
|
79
|
+
console.log("起飞");
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
芜湖
|
|
83
|
+
</Button>,
|
|
84
|
+
"666",
|
|
85
|
+
"reset",
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "submit",
|
|
91
|
+
itemProps: {
|
|
92
|
+
extraList: [
|
|
93
|
+
<Button
|
|
94
|
+
key="wh"
|
|
95
|
+
onClick={() => {
|
|
96
|
+
console.log("起飞");
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
芜湖
|
|
100
|
+
</Button>,
|
|
101
|
+
<Ttta key="aa" />,
|
|
102
|
+
"666",
|
|
103
|
+
"submit",
|
|
104
|
+
"reset",
|
|
105
|
+
],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
];
|
|
130
109
|
};
|
|
131
110
|
function Ttta({ form }) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
111
|
+
return (
|
|
112
|
+
<div
|
|
113
|
+
onClick={() => {
|
|
114
|
+
console.log("form", form);
|
|
115
|
+
form.setFieldsValue({ switch: 1 });
|
|
116
|
+
}}
|
|
117
|
+
>
|
|
118
|
+
ttta
|
|
119
|
+
</div>
|
|
120
|
+
);
|
|
142
121
|
}
|
|
143
122
|
|
|
144
123
|
const Test = (props) => {
|
|
145
|
-
|
|
124
|
+
return <div>ffff</div>;
|
|
146
125
|
};
|
|
147
126
|
export default () => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
127
|
+
const form = useHForm();
|
|
128
|
+
const [options, setOptions] = useState([{ label: "1", value: 1 }]);
|
|
129
|
+
const [aForm] = Form.useForm();
|
|
130
|
+
return (
|
|
131
|
+
<div style={{ overflow: "auto", height: "90vh" }}>
|
|
132
|
+
<Form form={aForm} initialValues={{ ttim: "132123" }}>
|
|
133
|
+
<Form.Item name="ttim" rules={[{ required: true }]}>
|
|
134
|
+
<Input />
|
|
135
|
+
</Form.Item>
|
|
136
|
+
</Form>
|
|
137
|
+
<HFormConfigProvider
|
|
138
|
+
valueSwitchMap={{ open: 1, close: 2 }}
|
|
139
|
+
valueCheckMap={{ noChecked: 0, checked: 1 }}
|
|
140
|
+
defaultComponent={{
|
|
141
|
+
test: Test,
|
|
142
|
+
}}
|
|
143
|
+
itemProps={{
|
|
144
|
+
style: {
|
|
145
|
+
borderRadius: 10,
|
|
146
|
+
},
|
|
147
|
+
}}
|
|
148
|
+
fieldNames={{
|
|
149
|
+
label: "value",
|
|
150
|
+
value: "key",
|
|
151
|
+
}}
|
|
152
|
+
>
|
|
153
|
+
<HForm
|
|
154
|
+
configData={formData(options)}
|
|
155
|
+
labelWidth={200}
|
|
156
|
+
form={form}
|
|
157
|
+
labelAlign={"right"}
|
|
158
|
+
onFinish={(value) => {
|
|
159
|
+
console.log(value);
|
|
160
|
+
}}
|
|
161
|
+
onValuesChange={(val) => {
|
|
162
|
+
console.log(val, "onValuesChange");
|
|
163
|
+
}}
|
|
164
|
+
request={(params) => {
|
|
165
|
+
return new Promise<any>((resolve) => {
|
|
166
|
+
setTimeout(() => {
|
|
167
|
+
resolve(params);
|
|
168
|
+
}, 3000);
|
|
169
|
+
});
|
|
170
|
+
}}
|
|
171
|
+
/>
|
|
172
|
+
</HFormConfigProvider>
|
|
173
|
+
<div
|
|
174
|
+
onClick={() => {
|
|
175
|
+
aForm.resetFields();
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
点我
|
|
179
|
+
</div>
|
|
180
|
+
<div
|
|
181
|
+
onClick={() => {
|
|
182
|
+
form.resetFieldsInitValue();
|
|
183
|
+
}}
|
|
184
|
+
>
|
|
185
|
+
重置
|
|
186
|
+
</div>
|
|
187
|
+
</div>
|
|
188
|
+
);
|
|
189
|
+
};
|