@hw-component/form 1.9.8 → 1.9.9
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/Cascader/index.js +6 -6
- package/es/CheckboxGroup/CheckBox/index.js +5 -5
- package/es/CheckboxGroup/hooks.js +4 -4
- package/es/CheckboxGroup/index.js +7 -7
- package/es/DialogForm/DrawerForm/index.js +6 -6
- package/es/DialogForm/ModalForm.js +6 -6
- package/es/DialogForm/hooks.d.ts +0 -1
- package/es/DialogForm/hooks.js +7 -7
- package/es/Form/Basic.d.ts +1 -1
- package/es/Form/Basic.js +6 -6
- package/es/Form/Context/FormConfigProvider.js +2 -2
- package/es/Form/FormItem/BasicItem.js +5 -5
- package/es/Form/FormItem/RegularFormItem.js +5 -5
- package/es/Form/FormItem/UpFormItem.js +5 -5
- package/es/Form/FormItem/hooks.d.ts +1 -1
- package/es/Form/FormItem/index.js +5 -5
- package/es/Form/HFormConnect.js +6 -6
- package/es/Form/config.d.ts +7 -5
- package/es/Form/hooks/index.d.ts +1 -1
- package/es/Form/hooks/index.js +5 -5
- package/es/Form/hooks/useDefaultRender.js +5 -5
- package/es/Form/hooks/useHForm.js +11 -11
- package/es/Form/hooks/useInitConfigData.js +3 -3
- package/es/Form/index.js +5 -5
- package/es/Input/ButtonInput.js +6 -6
- package/es/Input/ColorInput/index.js +25 -26
- package/es/Input/InputNumber.js +5 -5
- package/es/Input/InputNumberGroup.js +18 -21
- package/es/Input/SelectInput.d.ts +0 -1
- package/es/Input/SelectInput.js +4 -4
- package/es/Input/TrimInput.d.ts +0 -1
- package/es/Input/TrimInput.js +7 -7
- package/es/Input/VerificationCodeInput/hooks.d.ts +0 -1
- package/es/Input/VerificationCodeInput/index.js +7 -7
- package/es/Input/index.d.ts +1 -1
- package/es/Input/index.js +8 -8
- package/es/RadioGroup/index.js +6 -6
- package/es/Select/hooks/changeHooks.js +7 -8
- package/es/Select/hooks/norHooks.js +7 -7
- package/es/Select/hooks/util.js +7 -7
- package/es/Select/index.js +5 -5
- package/es/Select/utils.js +6 -7
- package/es/Submit/components.js +5 -5
- package/es/Submit/index.js +6 -6
- package/es/Switch/index.js +6 -6
- package/es/TDPicker/RangePicker.js +8 -8
- package/es/TDPicker/TimePicker.d.ts +0 -1
- package/es/TDPicker/TimePicker.js +5 -5
- package/es/TDPicker/hooks.js +2 -3
- package/es/TDPicker/index.js +5 -5
- package/es/TextArea/TrimTextArea.d.ts +0 -1
- package/es/TextArea/TrimTextArea.js +7 -7
- package/es/TextArea/index.js +5 -5
- package/es/Upload/UrlUpload/hooks.js +1 -2
- package/es/Upload/UrlUpload/index.js +12 -12
- package/es/Upload/hooks/change.js +10 -10
- package/es/Upload/hooks/customRequest.js +9 -9
- package/es/Upload/hooks/propsMaker.js +2 -2
- package/es/Upload/index.js +8 -8
- package/es/config.js +1 -1
- package/es/hooks/index.js +11 -12
- package/es/index.d.ts +3 -4
- package/lib/Cascader/index.js +6 -6
- package/lib/CheckboxGroup/CheckBox/index.js +5 -5
- package/lib/CheckboxGroup/hooks.js +4 -4
- package/lib/CheckboxGroup/index.js +7 -7
- package/lib/DialogForm/DrawerForm/index.js +6 -6
- package/lib/DialogForm/ModalForm.js +6 -6
- package/lib/DialogForm/hooks.d.ts +0 -1
- package/lib/DialogForm/hooks.js +7 -7
- package/lib/Form/Basic.d.ts +1 -1
- package/lib/Form/Basic.js +6 -6
- package/lib/Form/Context/FormConfigProvider.js +2 -2
- package/lib/Form/FormItem/BasicItem.js +5 -5
- package/lib/Form/FormItem/RegularFormItem.js +5 -5
- package/lib/Form/FormItem/UpFormItem.js +5 -5
- package/lib/Form/FormItem/hooks.d.ts +1 -1
- package/lib/Form/FormItem/index.js +5 -5
- package/lib/Form/HFormConnect.js +6 -6
- package/lib/Form/config.d.ts +7 -5
- package/lib/Form/hooks/index.d.ts +1 -1
- package/lib/Form/hooks/index.js +5 -5
- package/lib/Form/hooks/useDefaultRender.js +5 -5
- package/lib/Form/hooks/useHForm.js +11 -11
- package/lib/Form/hooks/useInitConfigData.js +3 -3
- package/lib/Form/index.js +5 -5
- package/lib/Input/ButtonInput.js +6 -6
- package/lib/Input/ColorInput/index.js +25 -26
- package/lib/Input/InputNumber.js +5 -5
- package/lib/Input/InputNumberGroup.js +18 -21
- package/lib/Input/SelectInput.d.ts +0 -1
- package/lib/Input/SelectInput.js +4 -4
- package/lib/Input/TrimInput.d.ts +0 -1
- package/lib/Input/TrimInput.js +7 -7
- package/lib/Input/VerificationCodeInput/hooks.d.ts +0 -1
- package/lib/Input/VerificationCodeInput/index.js +7 -7
- package/lib/Input/index.d.ts +1 -1
- package/lib/Input/index.js +8 -8
- package/lib/RadioGroup/index.js +6 -6
- package/lib/Select/hooks/changeHooks.js +7 -8
- package/lib/Select/hooks/norHooks.js +7 -7
- package/lib/Select/hooks/util.js +7 -7
- package/lib/Select/index.js +5 -5
- package/lib/Select/utils.js +6 -7
- package/lib/Submit/components.js +5 -5
- package/lib/Submit/index.js +6 -6
- package/lib/Switch/index.js +6 -6
- package/lib/TDPicker/RangePicker.js +8 -8
- package/lib/TDPicker/TimePicker.d.ts +0 -1
- package/lib/TDPicker/TimePicker.js +5 -5
- package/lib/TDPicker/hooks.js +2 -3
- package/lib/TDPicker/index.js +5 -5
- package/lib/TextArea/TrimTextArea.d.ts +0 -1
- package/lib/TextArea/TrimTextArea.js +7 -7
- package/lib/TextArea/index.js +5 -5
- package/lib/Upload/UrlUpload/hooks.js +1 -2
- package/lib/Upload/UrlUpload/index.js +12 -12
- package/lib/Upload/hooks/change.js +10 -10
- package/lib/Upload/hooks/customRequest.js +9 -9
- package/lib/Upload/hooks/propsMaker.js +2 -2
- package/lib/Upload/index.js +8 -8
- package/lib/config.js +1 -1
- package/lib/hooks/index.js +11 -12
- package/lib/index.d.ts +3 -4
- package/package.json +16 -19
- package/src/components/Form/Basic.tsx +6 -2
- package/src/components/Form/FormItem/BasicItem.tsx +6 -5
- package/src/components/Form/FormItem/UpFormItem.tsx +9 -2
- package/src/components/Form/FormItem/hooks.tsx +9 -4
- package/src/components/Form/hooks/index.ts +2 -2
- package/src/components/Form/hooks/useHForm.ts +5 -5
- package/src/components/Form/index.tsx +7 -3
- package/src/components/Form/modal.ts +8 -5
- package/src/components/Input/index.tsx +11 -6
- package/src/components/Select/hooks/changeHooks.tsx +1 -1
- package/src/components/Select/hooks/util.ts +6 -6
- package/src/components/Upload/UrlUpload/index.tsx +3 -3
- package/src/components/Upload/hooks/customRequest.ts +1 -1
- package/src/components/Upload/hooks/propsMaker.ts +4 -3
- package/src/components/Upload/index.tsx +4 -6
- package/src/components/Upload/modal.ts +2 -2
- package/src/components/config.ts +8 -8
- package/src/pages/Form/index.tsx +27 -25
- package/src/pages/Input/index.tsx +1 -1
- package/src/pages/Select/index.tsx +23 -21
- package/src/pages/Upload/index.tsx +1 -3
|
@@ -27,7 +27,7 @@ export default ({
|
|
|
27
27
|
itemProps: formItemProps = {},
|
|
28
28
|
colon = true,
|
|
29
29
|
dismissOnPressEnter,
|
|
30
|
-
|
|
30
|
+
preserve,
|
|
31
31
|
...props
|
|
32
32
|
}: HFormProps) => {
|
|
33
33
|
const hForm = useCurrentForm(form);
|
|
@@ -41,7 +41,7 @@ export default ({
|
|
|
41
41
|
form: hForm,
|
|
42
42
|
infoRequest,
|
|
43
43
|
params,
|
|
44
|
-
preserve
|
|
44
|
+
preserve,
|
|
45
45
|
});
|
|
46
46
|
const valuesChange = useValuesChange({
|
|
47
47
|
onValuesChange,
|
|
@@ -98,7 +98,11 @@ export default ({
|
|
|
98
98
|
preserve={preserve}
|
|
99
99
|
{...props}
|
|
100
100
|
>
|
|
101
|
-
<Basic
|
|
101
|
+
<Basic
|
|
102
|
+
configData={configData}
|
|
103
|
+
dismissOnPressEnter={dismissOnPressEnter}
|
|
104
|
+
gutter={gutter}
|
|
105
|
+
/>
|
|
102
106
|
<InitSet />
|
|
103
107
|
</Form>
|
|
104
108
|
</FormContext.Provider>
|
|
@@ -35,7 +35,7 @@ import type { DataFnProvider } from "../modal";
|
|
|
35
35
|
import type { ColProps } from "antd/lib/grid/col";
|
|
36
36
|
import type { Gutter } from "antd/lib/grid/row";
|
|
37
37
|
import type { IUrlUploadProps } from "../Upload/modal";
|
|
38
|
-
import {NamePath} from "rc-field-form/es/interface";
|
|
38
|
+
import { NamePath } from "rc-field-form/es/interface";
|
|
39
39
|
|
|
40
40
|
type RenderFun = (
|
|
41
41
|
props: HItemProps,
|
|
@@ -82,7 +82,7 @@ export interface DispatchModal<T = string | string[]> {
|
|
|
82
82
|
export type LabelAlignModal = "left" | "right" | "topLeft" | "topRight" | "top";
|
|
83
83
|
|
|
84
84
|
export interface HItemProps
|
|
85
|
-
extends Omit<FormItemProps, "name" | "labelAlign" | "label"|"hidden"> {
|
|
85
|
+
extends Omit<FormItemProps, "name" | "labelAlign" | "label" | "hidden"> {
|
|
86
86
|
type?: string;
|
|
87
87
|
itemProps?: ItemPropsType;
|
|
88
88
|
render?: RenderFun;
|
|
@@ -99,7 +99,7 @@ export interface HItemProps
|
|
|
99
99
|
hideLabel?: boolean;
|
|
100
100
|
labelAlign?: LabelAlignModal;
|
|
101
101
|
label?: React.ReactNode | HelperModal;
|
|
102
|
-
hidden?:boolean|HideModal
|
|
102
|
+
hidden?: boolean | HideModal;
|
|
103
103
|
}
|
|
104
104
|
export interface HFormProps<T = any, R = any>
|
|
105
105
|
extends Omit<FormProps, "form" | "onFinish" | "labelAlign"> {
|
|
@@ -118,7 +118,7 @@ export interface HFormProps<T = any, R = any>
|
|
|
118
118
|
labelAlign?: LabelAlignModal;
|
|
119
119
|
formItemStyle?: React.CSSProperties;
|
|
120
120
|
itemProps?: ItemPropsType;
|
|
121
|
-
dismissOnPressEnter?:boolean;
|
|
121
|
+
dismissOnPressEnter?: boolean;
|
|
122
122
|
}
|
|
123
123
|
export interface HFormItemProps extends HItemProps {
|
|
124
124
|
required?: boolean;
|
|
@@ -184,7 +184,10 @@ export interface HFormInstance extends FormInstance {
|
|
|
184
184
|
formatKey?: string
|
|
185
185
|
) => Record<string, any>;
|
|
186
186
|
dispatch: (action: ActionModal, ...args: any[]) => void;
|
|
187
|
-
outputValues: (
|
|
187
|
+
outputValues: (
|
|
188
|
+
values?: Record<string, any>,
|
|
189
|
+
preserve?: HFormProps["preserve"]
|
|
190
|
+
) => Record<string, any>;
|
|
188
191
|
addDispatchListener: AddDispatchListenerFn;
|
|
189
192
|
removeDispatchListener: (action?: ActionModal, fn?: argsFn) => void;
|
|
190
193
|
reload: PromiseFnResult;
|
|
@@ -7,23 +7,28 @@ const CopyDom = ({ value }: HInputProps) => {
|
|
|
7
7
|
return (
|
|
8
8
|
<div
|
|
9
9
|
style={{
|
|
10
|
-
|
|
10
|
+
cursor: "pointer",
|
|
11
11
|
}}
|
|
12
|
-
onClick={()=>{
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
onClick={() => {
|
|
13
|
+
copy(value);
|
|
14
|
+
message.success("复制成功!");
|
|
15
15
|
}}
|
|
16
16
|
>
|
|
17
17
|
<CopyOutlined />
|
|
18
18
|
</div>
|
|
19
19
|
);
|
|
20
20
|
};
|
|
21
|
-
export default ({
|
|
21
|
+
export default ({
|
|
22
|
+
copy: copyProps,
|
|
23
|
+
value,
|
|
24
|
+
addonAfter,
|
|
25
|
+
...props
|
|
26
|
+
}: HInputProps) => {
|
|
22
27
|
return (
|
|
23
28
|
<Input
|
|
24
29
|
{...props}
|
|
25
30
|
value={value}
|
|
26
|
-
addonAfter={
|
|
31
|
+
addonAfter={copyProps ? <CopyDom value={value} /> : addonAfter}
|
|
27
32
|
/>
|
|
28
33
|
);
|
|
29
34
|
};
|
|
@@ -75,20 +75,20 @@ const resultProvider = (
|
|
|
75
75
|
});
|
|
76
76
|
return newResult;
|
|
77
77
|
};
|
|
78
|
-
const notMatchArray=(data,options)=>{
|
|
79
|
-
return data.map((item)=>{
|
|
78
|
+
const notMatchArray = (data, options) => {
|
|
79
|
+
return data.map((item) => {
|
|
80
80
|
const { value: itemVal, index } = item;
|
|
81
81
|
const newItem = single({ options, value: itemVal });
|
|
82
82
|
return {
|
|
83
83
|
...newItem,
|
|
84
84
|
index,
|
|
85
85
|
};
|
|
86
|
-
})
|
|
87
|
-
}
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
88
|
const multiple = ({ options, value }: PartialHSelectProps, oldVal?: any[]) => {
|
|
89
89
|
const { newData, oldData } = sourceDataProvider({ value }, oldVal);
|
|
90
|
-
const notMatchOldVal=notMatchArray(oldData,options);
|
|
91
|
-
const newMatchVal = notMatchArray(newData,options);
|
|
90
|
+
const notMatchOldVal = notMatchArray(oldData, options);
|
|
91
|
+
const newMatchVal = notMatchArray(newData, options);
|
|
92
92
|
return resultProvider(newMatchVal, notMatchOldVal, value);
|
|
93
93
|
}; //多选
|
|
94
94
|
|
|
@@ -6,7 +6,7 @@ import TypeEle from "../MediaTypeEle/TypeEle";
|
|
|
6
6
|
import { useRef, useState } from "react";
|
|
7
7
|
import type { RcFile, UploadFile } from "antd/es/upload/interface";
|
|
8
8
|
import { useDefaultExFiles } from "./hooks";
|
|
9
|
-
import {HItemProps} from "@/components/Form/modal";
|
|
9
|
+
import { HItemProps } from "@/components/Form/modal";
|
|
10
10
|
const { Text } = Typography;
|
|
11
11
|
const mkSubFileList = (fileList: UploadFile[], maxCount = 1) => {
|
|
12
12
|
const len = fileList.length;
|
|
@@ -24,7 +24,7 @@ const Index = ({
|
|
|
24
24
|
inputHelper,
|
|
25
25
|
style = {},
|
|
26
26
|
exFiles,
|
|
27
|
-
|
|
27
|
+
spaceSize = 6,
|
|
28
28
|
...props
|
|
29
29
|
}: IUrlUploadProps) => {
|
|
30
30
|
const { maxCount } = props;
|
|
@@ -120,6 +120,6 @@ const Index = ({
|
|
|
120
120
|
export default {
|
|
121
121
|
Component: Index,
|
|
122
122
|
placeholder: ({ label }: HItemProps) => {
|
|
123
|
-
return `请输入${label}
|
|
123
|
+
return `请输入${label}文件地址`;
|
|
124
124
|
},
|
|
125
125
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useFormConfigContext } from "../../Form/Context/FormConfigProvider";
|
|
2
2
|
import type { IUpLoadProps } from "../modal";
|
|
3
|
-
import {baseConfig} from "../../config";
|
|
3
|
+
import { baseConfig } from "../../config";
|
|
4
4
|
|
|
5
5
|
export const useProps = ({ request, exFiles, maxSize }: IUpLoadProps) => {
|
|
6
6
|
const configUploadProps = useFormConfigContext("uploadProps");
|
|
7
|
-
const cuRequest=
|
|
7
|
+
const cuRequest =
|
|
8
|
+
request === null ? baseConfig.uploadProps?.request : request;
|
|
8
9
|
const inputProps = {
|
|
9
|
-
request:cuRequest,
|
|
10
|
+
request: cuRequest,
|
|
10
11
|
maxSize,
|
|
11
12
|
};
|
|
12
13
|
const keys = Object.keys(inputProps);
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
useImperativeHandle,
|
|
3
|
-
useMemo,
|
|
4
|
-
useState,
|
|
5
|
-
} from "react";
|
|
1
|
+
import React, { useImperativeHandle, useMemo, useState } from "react";
|
|
6
2
|
import type { IUpLoadProps, IUploadRefModal } from "./modal";
|
|
7
3
|
import { useProps } from "./hooks/propsMaker";
|
|
8
4
|
import type { IPreviewProps } from "./Preview";
|
|
@@ -114,7 +110,9 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
114
110
|
}}
|
|
115
111
|
{...props}
|
|
116
112
|
>
|
|
117
|
-
{hideAddBtn?null:
|
|
113
|
+
{hideAddBtn ? null : (
|
|
114
|
+
<Btn value={relVal} maxCount={maxCount} listType={listType} />
|
|
115
|
+
)}
|
|
118
116
|
</Upload>
|
|
119
117
|
<Preview
|
|
120
118
|
visible={visible}
|
|
@@ -18,7 +18,7 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange"> {
|
|
|
18
18
|
maxSize?: number;
|
|
19
19
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
20
20
|
thumbUrl?: string;
|
|
21
|
-
hideAddBtn?:boolean;
|
|
21
|
+
hideAddBtn?: boolean;
|
|
22
22
|
}
|
|
23
23
|
export interface IMediaTypeEleProps {
|
|
24
24
|
file?: UploadFile;
|
|
@@ -34,5 +34,5 @@ export interface IUrlUploadProps extends IUpLoadProps {
|
|
|
34
34
|
placeholder?: string;
|
|
35
35
|
mediaType?: MediaTypeEnum;
|
|
36
36
|
inputHelper?: React.ReactNode;
|
|
37
|
-
spaceSize?:number
|
|
37
|
+
spaceSize?: number;
|
|
38
38
|
}
|
package/src/components/config.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import moment from "moment";
|
|
2
2
|
import type { IFormConfigContextProps } from "./Form/modal";
|
|
3
3
|
import { fileToBase64 } from "./Upload/util";
|
|
4
|
-
const rangeStartDay=(day:number)=>{
|
|
5
|
-
return moment().subtract(day, "days").startOf("days")
|
|
6
|
-
}
|
|
4
|
+
const rangeStartDay = (day: number) => {
|
|
5
|
+
return moment().subtract(day, "days").startOf("days");
|
|
6
|
+
};
|
|
7
7
|
export const baseConfig: IFormConfigContextProps = {
|
|
8
8
|
fieldNames: {
|
|
9
9
|
label: "label",
|
|
@@ -26,14 +26,14 @@ export const baseConfig: IFormConfigContextProps = {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
dateRanges: {
|
|
29
|
-
最近三天: function three(){
|
|
30
|
-
return [rangeStartDay(2), moment()]
|
|
29
|
+
最近三天: function three() {
|
|
30
|
+
return [rangeStartDay(2), moment()];
|
|
31
31
|
},
|
|
32
32
|
最近七天: function seven() {
|
|
33
|
-
return [rangeStartDay(6),moment()]
|
|
33
|
+
return [rangeStartDay(6), moment()];
|
|
34
34
|
},
|
|
35
|
-
最近三十天:function thirty() {
|
|
36
|
-
return
|
|
35
|
+
最近三十天: function thirty() {
|
|
36
|
+
return [rangeStartDay(29), moment()];
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
uploadProps: {
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -66,31 +66,33 @@ const Test3Item = () => {
|
|
|
66
66
|
};
|
|
67
67
|
const formData = (options) => {
|
|
68
68
|
return [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
69
|
+
{
|
|
70
|
+
name: "name",
|
|
71
|
+
label: "输入框",
|
|
72
|
+
hidden: (form) => {
|
|
73
|
+
const { check } = form.getFieldsValue();
|
|
74
|
+
console.log(check, "name");
|
|
75
|
+
return !check?.vv;
|
|
77
76
|
},
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "url",
|
|
80
|
+
type: "urlUpload",
|
|
81
|
+
label: "文本",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
label: "输入框",
|
|
85
|
+
type: "checkboxGroup",
|
|
86
|
+
name: "check",
|
|
87
|
+
itemProps: {
|
|
88
|
+
options: [
|
|
89
|
+
{
|
|
90
|
+
key: "vv",
|
|
91
|
+
value: "测试",
|
|
92
|
+
},
|
|
93
|
+
],
|
|
82
94
|
},
|
|
83
|
-
|
|
84
|
-
label:"输入框",
|
|
85
|
-
type:"checkboxGroup",
|
|
86
|
-
name:"check",
|
|
87
|
-
itemProps:{
|
|
88
|
-
options:[{
|
|
89
|
-
key:"vv",
|
|
90
|
-
value:"测试"
|
|
91
|
-
}]
|
|
92
|
-
}
|
|
93
|
-
}
|
|
95
|
+
},
|
|
94
96
|
];
|
|
95
97
|
};
|
|
96
98
|
function Ttta({ form }) {
|
|
@@ -137,7 +139,7 @@ export default () => {
|
|
|
137
139
|
form={form}
|
|
138
140
|
layout={"vertical"}
|
|
139
141
|
itemSpan={{
|
|
140
|
-
|
|
142
|
+
span: 12,
|
|
141
143
|
}}
|
|
142
144
|
labelAlign={"left"}
|
|
143
145
|
onFinish={(value) => {
|
|
@@ -168,7 +170,7 @@ export default () => {
|
|
|
168
170
|
</div>
|
|
169
171
|
<div
|
|
170
172
|
onClick={() => {
|
|
171
|
-
console.log(form.formatValues())
|
|
173
|
+
console.log(form.formatValues());
|
|
172
174
|
}}
|
|
173
175
|
>
|
|
174
176
|
提交
|
|
@@ -11,7 +11,7 @@ import { Space } from "antd";
|
|
|
11
11
|
export default () => {
|
|
12
12
|
return (
|
|
13
13
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
14
|
-
<HInput placeholder="基础输入框" copy value="11111"/>
|
|
14
|
+
<HInput placeholder="基础输入框" copy value="11111" />
|
|
15
15
|
<HSelectInput
|
|
16
16
|
placeholder="基础输入框"
|
|
17
17
|
selectProps={{
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { HSelect } from "../../components";
|
|
2
|
-
import { Space
|
|
2
|
+
import { Space } from "antd";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
export default () => {
|
|
5
5
|
const [selectVal, setSelectVal] = useState([{ name: "11", id: -100 }]);
|
|
6
|
-
const [op,setOp]=useState([{label:"1",value:1}])
|
|
7
|
-
|
|
6
|
+
const [op, setOp] = useState([{ label: "1", value: 1 }]);
|
|
7
|
+
const [val, setVal] = useState([2, 3]);
|
|
8
8
|
return (
|
|
9
9
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
10
10
|
<HSelect
|
|
@@ -17,38 +17,40 @@ export default () => {
|
|
|
17
17
|
value: "id",
|
|
18
18
|
}}
|
|
19
19
|
value={selectVal}
|
|
20
|
-
onChange={(
|
|
21
|
-
setSelectVal(
|
|
20
|
+
onChange={(chageVal) => {
|
|
21
|
+
setSelectVal(chageVal);
|
|
22
22
|
}}
|
|
23
23
|
request={async (params) => {
|
|
24
|
-
const { page
|
|
25
|
-
const
|
|
24
|
+
const { page } = params;
|
|
25
|
+
const op1 = [];
|
|
26
26
|
for (let i = 0; i < 100; i += 1) {
|
|
27
|
-
|
|
27
|
+
op1.push({ name: `第${page}页第${i}条`, id: i + page });
|
|
28
28
|
}
|
|
29
29
|
return Promise.resolve({
|
|
30
30
|
page,
|
|
31
31
|
size: 100,
|
|
32
32
|
total: 1000,
|
|
33
|
-
data:
|
|
33
|
+
data: op1,
|
|
34
34
|
});
|
|
35
35
|
}}
|
|
36
36
|
isList
|
|
37
37
|
/>
|
|
38
38
|
<HSelect
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
value={val}
|
|
40
|
+
onChange={(v) => {
|
|
41
|
+
console.log(v);
|
|
42
|
+
setVal(v);
|
|
43
|
+
}}
|
|
44
|
+
mode="multiple"
|
|
45
|
+
options={op}
|
|
46
46
|
/>
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
<div
|
|
48
|
+
onClick={() => {
|
|
49
|
+
setOp([{ label: "2", value: 2 }]);
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
改变
|
|
53
|
+
</div>
|
|
52
54
|
</Space>
|
|
53
55
|
);
|
|
54
56
|
};
|