@hw-component/form 1.6.9 → 1.7.1
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/.eslintcache +1 -1
- package/es/DialogForm/ChildComponent.d.ts +1 -1
- package/es/Form/Basic.d.ts +3 -0
- package/es/Form/Basic.js +63 -0
- package/es/Form/FormItem/index.js +14 -4
- package/es/Form/index.js +12 -37
- package/es/Form/modal.d.ts +5 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/lib/DialogForm/ChildComponent.d.ts +1 -1
- package/lib/Form/Basic.d.ts +3 -0
- package/lib/Form/Basic.js +66 -0
- package/lib/Form/FormItem/index.js +14 -4
- package/lib/Form/index.js +11 -36
- package/lib/Form/modal.d.ts +5 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -0
- package/package.json +1 -1
- package/src/components/DialogForm/ChildComponent.tsx +25 -16
- package/src/components/DialogForm/DrawerForm/index.tsx +73 -72
- package/src/components/DialogForm/ModalForm.tsx +66 -64
- package/src/components/Form/Basic.tsx +42 -0
- package/src/components/Form/FormItem/index.tsx +24 -5
- package/src/components/Form/index.tsx +13 -41
- package/src/components/Form/modal.ts +7 -2
- package/src/components/Select/hooks/changeHooks.tsx +2 -2
- package/src/components/Select/hooks/norHooks.ts +11 -6
- package/src/components/index.tsx +1 -0
- package/src/pages/DrawerForm/index.tsx +24 -22
- package/src/pages/Form/index.tsx +33 -5
- package/src/pages/ModalForm/index.tsx +11 -9
- package/src/pages/Select/index.tsx +6 -6
|
@@ -10,28 +10,28 @@ import {
|
|
|
10
10
|
useModifyProps,
|
|
11
11
|
useSub,
|
|
12
12
|
} from "./hooks";
|
|
13
|
-
import ChildComponent from
|
|
13
|
+
import ChildComponent from "./ChildComponent";
|
|
14
14
|
import React from "react";
|
|
15
|
-
const Index:React.FC<DialogFormProps
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
const Index: React.FC<DialogFormProps> = ({
|
|
16
|
+
visible,
|
|
17
|
+
title,
|
|
18
|
+
onCancel,
|
|
19
|
+
configData,
|
|
20
|
+
infoRequest,
|
|
21
|
+
request,
|
|
22
|
+
afterClose,
|
|
23
|
+
dialogForm,
|
|
24
|
+
initialValues,
|
|
25
|
+
onFinish,
|
|
26
|
+
params,
|
|
27
|
+
onOk,
|
|
28
|
+
onValuesChange,
|
|
29
|
+
autoClear = true,
|
|
30
|
+
contentRender,
|
|
31
|
+
footer,
|
|
32
|
+
children,
|
|
33
|
+
...props
|
|
34
|
+
}) => {
|
|
35
35
|
const currentForm = useCurrentForm(dialogForm);
|
|
36
36
|
const providerConfig = useFormConfigContext();
|
|
37
37
|
|
|
@@ -59,23 +59,23 @@ const Index:React.FC<DialogFormProps>= ({
|
|
|
59
59
|
};
|
|
60
60
|
const { loading, run } = useSub({ request, onFinish });
|
|
61
61
|
const node = (
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
62
|
+
<HForm
|
|
63
|
+
configData={modalFormData}
|
|
64
|
+
initialValues={initValue}
|
|
65
|
+
onValuesChange={onValuesChange}
|
|
66
|
+
onFinish={async (values, outParams) => {
|
|
67
|
+
const result = await run(values, outParams);
|
|
68
|
+
const close = onOk?.(result, outParams);
|
|
69
|
+
if (close === false) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
cancel();
|
|
73
|
+
}}
|
|
74
|
+
{...props}
|
|
75
|
+
params={formParams}
|
|
76
|
+
form={currentForm}
|
|
77
|
+
infoRequest={infoRequest}
|
|
78
|
+
/>
|
|
79
79
|
);
|
|
80
80
|
const defaultFooter = useFooterRender({
|
|
81
81
|
dialogForm,
|
|
@@ -84,32 +84,34 @@ const Index:React.FC<DialogFormProps>= ({
|
|
|
84
84
|
params: formParams,
|
|
85
85
|
});
|
|
86
86
|
return (
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
87
|
+
<Modal
|
|
88
|
+
title={modalTitle}
|
|
89
|
+
visible={modalVisible}
|
|
90
|
+
onCancel={cancel}
|
|
91
|
+
confirmLoading={loading}
|
|
92
|
+
afterClose={() => {
|
|
93
|
+
if (autoClear) {
|
|
94
|
+
currentForm.clear();
|
|
95
|
+
}
|
|
96
|
+
afterClose?.();
|
|
97
|
+
}}
|
|
98
|
+
{...props}
|
|
99
|
+
onOk={currentForm.submit}
|
|
100
|
+
destroyOnClose={true}
|
|
101
|
+
footer={defaultFooter}
|
|
102
|
+
>
|
|
103
|
+
<FormConfigProvider {...providerConfig}>
|
|
104
|
+
<ChildComponent
|
|
105
|
+
dialogForm={currentForm}
|
|
106
|
+
contentRender={contentRender}
|
|
107
|
+
formNode={node}
|
|
108
|
+
params={params}
|
|
109
|
+
>
|
|
110
|
+
{children}
|
|
111
|
+
</ChildComponent>
|
|
112
|
+
</FormConfigProvider>
|
|
113
|
+
</Modal>
|
|
112
114
|
);
|
|
113
115
|
};
|
|
114
116
|
|
|
115
|
-
export default Index;
|
|
117
|
+
export default Index;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import {HFormProps, HItemProps, ItemPropsType} from "@/components/Form/modal";
|
|
2
|
+
import Item from "./FormItem";
|
|
3
|
+
import {Row} from "antd";
|
|
4
|
+
import {useFormContext} from "./Context";
|
|
5
|
+
|
|
6
|
+
export default ({configData,gutter}:HFormProps)=>{
|
|
7
|
+
const {form,itemProps:formItemProps,itemSpan,colon:formColon}=useFormContext();
|
|
8
|
+
const defaultOnPressEnter = () => {
|
|
9
|
+
form.submit();
|
|
10
|
+
};
|
|
11
|
+
return <Row gutter={gutter} style={{width:"100%"}}>
|
|
12
|
+
{configData.map((itemData: HItemProps, index) => {
|
|
13
|
+
const {
|
|
14
|
+
labelWidth: itemLabelWidth,
|
|
15
|
+
hideLabel ,
|
|
16
|
+
labelAlign,
|
|
17
|
+
name,
|
|
18
|
+
style ,
|
|
19
|
+
itemProps = {},
|
|
20
|
+
colon: itemColon,
|
|
21
|
+
} = itemData;
|
|
22
|
+
const defaultItemProps = {
|
|
23
|
+
onPressEnter: defaultOnPressEnter,
|
|
24
|
+
...formItemProps,
|
|
25
|
+
...itemProps,
|
|
26
|
+
};
|
|
27
|
+
return (
|
|
28
|
+
<Item
|
|
29
|
+
{...itemData}
|
|
30
|
+
labelAlign={labelAlign}
|
|
31
|
+
key={name || index}
|
|
32
|
+
style={style}
|
|
33
|
+
itemProps={defaultItemProps as ItemPropsType}
|
|
34
|
+
hideLabel={hideLabel}
|
|
35
|
+
itemSpan={itemSpan}
|
|
36
|
+
labelWidth={itemLabelWidth}
|
|
37
|
+
colon={typeof itemColon === "undefined" ? formColon : itemColon}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
})}
|
|
41
|
+
</Row>
|
|
42
|
+
}
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
import { useFormItemDomControl } from "./hooks";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import type { HItemProps } from "../modal";
|
|
4
|
-
import {useFormContext} from "../Context";
|
|
4
|
+
import { useFormContext } from "../Context";
|
|
5
5
|
|
|
6
6
|
export default (props: HItemProps) => {
|
|
7
|
-
const {
|
|
8
|
-
|
|
7
|
+
const {
|
|
8
|
+
labelWidth: formLabelWidth,
|
|
9
|
+
labelAlign: formLabelAlign ,
|
|
10
|
+
hideLabel:formLabelHide,
|
|
11
|
+
formItemStyle,
|
|
12
|
+
colon:formColon
|
|
13
|
+
} = useFormContext();
|
|
14
|
+
const {
|
|
15
|
+
labelWidth = formLabelWidth,
|
|
16
|
+
labelAlign = formLabelAlign,
|
|
17
|
+
hideLabel=formLabelHide,
|
|
18
|
+
style=formItemStyle,
|
|
19
|
+
colon
|
|
20
|
+
} = props;
|
|
9
21
|
const Component = useFormItemDomControl(props);
|
|
10
|
-
|
|
11
|
-
|
|
22
|
+
return (
|
|
23
|
+
<Component {...props}
|
|
24
|
+
labelAlign={labelAlign}
|
|
25
|
+
labelWidth={labelWidth}
|
|
26
|
+
hideLabel={hideLabel}
|
|
27
|
+
style={style}
|
|
28
|
+
colon={typeof colon === "undefined" ? colon : formColon}
|
|
29
|
+
/>
|
|
30
|
+
);
|
|
12
31
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { Form
|
|
2
|
-
import type { HFormProps
|
|
3
|
-
import Item from "./FormItem";
|
|
1
|
+
import { Form } from "antd";
|
|
2
|
+
import type { HFormProps } from "./modal";
|
|
4
3
|
import { useCurrentForm, useInfoReq, useValuesChange } from "./hooks";
|
|
5
4
|
import { FormContext } from "./Context";
|
|
6
5
|
import PageHandler from "../PageHandler";
|
|
7
6
|
import useInitConfigData from "./hooks/useInitConfigData";
|
|
8
7
|
import { useEffect } from "react";
|
|
9
8
|
import InitSet from "./InitSet";
|
|
10
|
-
import
|
|
9
|
+
import Basic from "./Basic";
|
|
11
10
|
|
|
12
11
|
export default ({
|
|
13
12
|
configData,
|
|
@@ -62,9 +61,6 @@ export default ({
|
|
|
62
61
|
hForm.removeDispatchListener();
|
|
63
62
|
};
|
|
64
63
|
}, []);
|
|
65
|
-
const defaultOnPressEnter = () => {
|
|
66
|
-
hForm.submit();
|
|
67
|
-
};
|
|
68
64
|
return (
|
|
69
65
|
<PageHandler
|
|
70
66
|
loading={infoLoading}
|
|
@@ -75,9 +71,15 @@ export default ({
|
|
|
75
71
|
<FormContext.Provider
|
|
76
72
|
value={{
|
|
77
73
|
loading: submitLoading || loading,
|
|
78
|
-
form: hForm,
|
|
79
|
-
|
|
80
|
-
|
|
74
|
+
form: hForm,
|
|
75
|
+
valueType,
|
|
76
|
+
labelAlign: formLabelAlign,
|
|
77
|
+
labelWidth,
|
|
78
|
+
formItemStyle,
|
|
79
|
+
hideLabel:formHideLabel,
|
|
80
|
+
colon,
|
|
81
|
+
itemProps:formItemProps,
|
|
82
|
+
itemSpan
|
|
81
83
|
}}
|
|
82
84
|
>
|
|
83
85
|
<Form
|
|
@@ -86,37 +88,7 @@ export default ({
|
|
|
86
88
|
onValuesChange={valuesChange}
|
|
87
89
|
{...props}
|
|
88
90
|
>
|
|
89
|
-
<
|
|
90
|
-
{newConfigData.map((itemData: HItemProps, index) => {
|
|
91
|
-
const {
|
|
92
|
-
labelWidth: itemLabelWidth,
|
|
93
|
-
hideLabel = formHideLabel,
|
|
94
|
-
labelAlign = formLabelAlign,
|
|
95
|
-
name,
|
|
96
|
-
style = formItemStyle,
|
|
97
|
-
itemProps = {},
|
|
98
|
-
colon: itemColon,
|
|
99
|
-
} = itemData;
|
|
100
|
-
const defaultItemProps = {
|
|
101
|
-
onPressEnter: defaultOnPressEnter,
|
|
102
|
-
...formItemProps,
|
|
103
|
-
...itemProps,
|
|
104
|
-
};
|
|
105
|
-
return (
|
|
106
|
-
<Item
|
|
107
|
-
{...itemData}
|
|
108
|
-
labelAlign={labelAlign}
|
|
109
|
-
key={name || index}
|
|
110
|
-
style={style}
|
|
111
|
-
itemProps={defaultItemProps as ItemPropsType}
|
|
112
|
-
hideLabel={hideLabel}
|
|
113
|
-
itemSpan={itemSpan}
|
|
114
|
-
labelWidth={itemLabelWidth || labelWidth}
|
|
115
|
-
colon={typeof itemColon === "undefined" ? colon : itemColon}
|
|
116
|
-
/>
|
|
117
|
-
);
|
|
118
|
-
})}
|
|
119
|
-
</Row>
|
|
91
|
+
<Basic configData={newConfigData} gutter={gutter}/>
|
|
120
92
|
<InitSet />
|
|
121
93
|
</Form>
|
|
122
94
|
</FormContext.Provider>
|
|
@@ -130,8 +130,13 @@ export interface FormContextProps {
|
|
|
130
130
|
loading?: boolean;
|
|
131
131
|
form: HFormInstance;
|
|
132
132
|
valueType?: string;
|
|
133
|
-
labelAlign?:LabelAlignModal;
|
|
134
|
-
labelWidth?:number
|
|
133
|
+
labelAlign?: LabelAlignModal;
|
|
134
|
+
labelWidth?: number;
|
|
135
|
+
formItemStyle?:React.CSSProperties;
|
|
136
|
+
hideLabel?:boolean;
|
|
137
|
+
colon?:boolean;
|
|
138
|
+
itemProps?: ItemPropsType;
|
|
139
|
+
itemSpan?: ColProps;
|
|
135
140
|
}
|
|
136
141
|
interface ConfigUploadProps {
|
|
137
142
|
exFiles?: string[];
|
|
@@ -67,8 +67,8 @@ export const useValueChange = (params: PartialHSelectProps) => {
|
|
|
67
67
|
if (labelInValue) {
|
|
68
68
|
return val;
|
|
69
69
|
}
|
|
70
|
-
if (val===undefined||mode==="tags"){
|
|
71
|
-
return
|
|
70
|
+
if (val === undefined || mode === "tags") {
|
|
71
|
+
return val;
|
|
72
72
|
}
|
|
73
73
|
if (!val) {
|
|
74
74
|
return val;
|
|
@@ -62,9 +62,14 @@ const useOptionsRequest = ({
|
|
|
62
62
|
}
|
|
63
63
|
return params;
|
|
64
64
|
};
|
|
65
|
-
const {
|
|
65
|
+
const {
|
|
66
|
+
run: listRun,
|
|
67
|
+
loading,
|
|
68
|
+
error,
|
|
69
|
+
} = useRequest(
|
|
66
70
|
async (requestParams = {}, type = "init") => {
|
|
67
|
-
const { params = saveParams.listParams.reqParams, values } =
|
|
71
|
+
const { params = saveParams.listParams.reqParams, values } =
|
|
72
|
+
requestParams;
|
|
68
73
|
const formData = values || form?.getFieldsValue();
|
|
69
74
|
if (type === "init") {
|
|
70
75
|
resetSaveParams();
|
|
@@ -94,12 +99,12 @@ const useOptionsRequest = ({
|
|
|
94
99
|
},
|
|
95
100
|
}
|
|
96
101
|
);
|
|
97
|
-
const run=(requestParams = {}, type = "init")=>{
|
|
98
|
-
if (loading){
|
|
102
|
+
const run = (requestParams = {}, type = "init") => {
|
|
103
|
+
if (loading) {
|
|
99
104
|
return;
|
|
100
105
|
}
|
|
101
|
-
listRun(requestParams,type);
|
|
102
|
-
}
|
|
106
|
+
listRun(requestParams, type);
|
|
107
|
+
};
|
|
103
108
|
return {
|
|
104
109
|
loading,
|
|
105
110
|
run,
|
package/src/components/index.tsx
CHANGED
|
@@ -6,6 +6,7 @@ export { default as useHForm } from "./Form/hooks/useHForm";
|
|
|
6
6
|
export { useHDialogForm } from "./DialogForm/hooks";
|
|
7
7
|
export { default as HFormConnect } from "./Form/HFormConnect";
|
|
8
8
|
export { default as HFormConfigProvider } from "./Form/Context/FormConfigProvider";
|
|
9
|
+
export {default as HBasicForm} from './Form/Basic';
|
|
9
10
|
|
|
10
11
|
import ModalForm from "./DialogForm/ModalForm";
|
|
11
12
|
import DrawerForm from "./DialogForm/DrawerForm";
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { Button } from "antd";
|
|
2
2
|
import { HDrawerForm, useHDialogForm } from "../../components";
|
|
3
3
|
import { MediaTypeEnum } from "../../components/Upload/enums";
|
|
4
|
-
import FormItem from
|
|
5
|
-
import {useEffect} from "react";
|
|
6
|
-
const Test=()=>{
|
|
7
|
-
return <FormItem name="123" label="你好"
|
|
8
|
-
}
|
|
4
|
+
import FormItem from "../../components/Form/FormItem";
|
|
5
|
+
import { useEffect } from "react";
|
|
6
|
+
const Test = () => {
|
|
7
|
+
return <FormItem name="123" label="你好" />;
|
|
8
|
+
};
|
|
9
9
|
const data = [
|
|
10
10
|
{
|
|
11
|
-
hideLabel:true,
|
|
12
|
-
render:()=>{
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
}
|
|
11
|
+
hideLabel: true,
|
|
12
|
+
render: () => {
|
|
13
|
+
return <Test />;
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
16
|
];
|
|
17
17
|
let num = 0;
|
|
18
|
-
const Test1=({formNode,dialogForm,params})=>{
|
|
18
|
+
const Test1 = ({ formNode, dialogForm, params }) => {
|
|
19
19
|
useEffect(() => {
|
|
20
|
-
console.log("渲染")
|
|
20
|
+
console.log("渲染");
|
|
21
21
|
}, []);
|
|
22
|
-
return
|
|
23
|
-
<div
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
return (
|
|
23
|
+
<div>
|
|
24
|
+
<div>测试一些</div>
|
|
25
|
+
{formNode}
|
|
26
|
+
</div>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
27
29
|
export default () => {
|
|
28
30
|
const modalForm = useHDialogForm();
|
|
29
31
|
return (
|
|
@@ -66,11 +68,11 @@ export default () => {
|
|
|
66
68
|
labelWidth={88}
|
|
67
69
|
labelAlign={"left"}
|
|
68
70
|
dialogForm={modalForm}
|
|
69
|
-
footer={()=>{
|
|
70
|
-
|
|
71
|
+
footer={() => {
|
|
72
|
+
return <div>ff</div>;
|
|
71
73
|
}}
|
|
72
|
-
request={(values)=>{
|
|
73
|
-
console.log(values)
|
|
74
|
+
request={(values) => {
|
|
75
|
+
console.log(values);
|
|
74
76
|
}}
|
|
75
77
|
afterClose={() => {
|
|
76
78
|
console.log("afterClose");
|
|
@@ -81,7 +83,7 @@ export default () => {
|
|
|
81
83
|
}}
|
|
82
84
|
title="测试"
|
|
83
85
|
>
|
|
84
|
-
|
|
86
|
+
<Test1 />
|
|
85
87
|
</HDrawerForm>
|
|
86
88
|
</>
|
|
87
89
|
);
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
HBasicForm,
|
|
3
|
+
HForm,
|
|
4
|
+
HFormConfigProvider,
|
|
5
|
+
HSwitch,
|
|
6
|
+
useHForm,
|
|
6
7
|
} from "../../components";
|
|
7
8
|
import { useState } from "react";
|
|
8
9
|
import { Button, DatePicker, Form, Input, Row } from "antd";
|
|
@@ -58,6 +59,32 @@ const formData = (options) => {
|
|
|
58
59
|
className: "hdjd",
|
|
59
60
|
name: "test123",
|
|
60
61
|
},
|
|
62
|
+
{
|
|
63
|
+
noStyle:true,
|
|
64
|
+
render:()=>{
|
|
65
|
+
return <HBasicForm configData={[
|
|
66
|
+
{
|
|
67
|
+
label: "下拉",
|
|
68
|
+
className: "hdjd",
|
|
69
|
+
type: "select",
|
|
70
|
+
name: "test321",
|
|
71
|
+
itemProps: {
|
|
72
|
+
options: [
|
|
73
|
+
{
|
|
74
|
+
value: "选项1",
|
|
75
|
+
key: 1,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
value: "选项2",
|
|
79
|
+
key: 2,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
showSearch: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
]}/>
|
|
86
|
+
}
|
|
87
|
+
},
|
|
61
88
|
{
|
|
62
89
|
type: "submit",
|
|
63
90
|
},
|
|
@@ -102,9 +129,10 @@ export default () => {
|
|
|
102
129
|
>
|
|
103
130
|
<HForm
|
|
104
131
|
configData={formData(options)}
|
|
105
|
-
labelWidth={
|
|
132
|
+
labelWidth={300}
|
|
106
133
|
form={form}
|
|
107
134
|
labelAlign={"right"}
|
|
135
|
+
colon={false}
|
|
108
136
|
onFinish={(value) => {
|
|
109
137
|
console.log(value, "onFinish");
|
|
110
138
|
}}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
HFormConfigProvider,
|
|
6
6
|
HUrlUpload,
|
|
7
7
|
} from "../../components";
|
|
8
|
-
import {useEffect, useState} from "react";
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
9
|
import { ShowParamsModal } from "@/components/DialogForm/modal";
|
|
10
10
|
|
|
11
11
|
const Test = (props) => {
|
|
@@ -144,15 +144,17 @@ const data = [
|
|
|
144
144
|
},
|
|
145
145
|
];
|
|
146
146
|
let num = 0;
|
|
147
|
-
const Test1=({formNode})=>{
|
|
147
|
+
const Test1 = ({ formNode }) => {
|
|
148
148
|
useEffect(() => {
|
|
149
|
-
|
|
149
|
+
console.log("渲染");
|
|
150
150
|
}, []);
|
|
151
|
-
return
|
|
152
|
-
<div
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
return (
|
|
152
|
+
<div>
|
|
153
|
+
<div>测试一些</div>
|
|
154
|
+
{formNode}
|
|
155
|
+
</div>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
156
158
|
export default () => {
|
|
157
159
|
const modalForm = useHDialogForm();
|
|
158
160
|
return (
|
|
@@ -205,7 +207,7 @@ export default () => {
|
|
|
205
207
|
dialogForm={modalForm}
|
|
206
208
|
title={<div>fff</div>}
|
|
207
209
|
>
|
|
208
|
-
|
|
210
|
+
<Test1 />
|
|
209
211
|
</HModalForm>
|
|
210
212
|
</HFormConfigProvider>
|
|
211
213
|
</>
|
|
@@ -20,7 +20,7 @@ export default () => {
|
|
|
20
20
|
placeholder="多选"
|
|
21
21
|
value={null}
|
|
22
22
|
onChange={(val, option) => {
|
|
23
|
-
|
|
23
|
+
console.log(val);
|
|
24
24
|
setSelectVal(val);
|
|
25
25
|
}}
|
|
26
26
|
allSelect={true}
|
|
@@ -53,11 +53,11 @@ export default () => {
|
|
|
53
53
|
op.push({ label: `第${page}页第${i}条`, value: i + page });
|
|
54
54
|
}
|
|
55
55
|
return Promise.resolve({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
})
|
|
56
|
+
page,
|
|
57
|
+
size: 100,
|
|
58
|
+
total: 1000,
|
|
59
|
+
data: op,
|
|
60
|
+
});
|
|
61
61
|
}}
|
|
62
62
|
isList
|
|
63
63
|
/>
|