@hw-component/form 1.9.27 → 1.9.29
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/Form/config.d.ts +5 -0
- package/es/Form/config.js +4 -2
- package/es/Select/TreeSelect.d.ts +8 -0
- package/es/Select/TreeSelect.js +100 -0
- package/es/Upload/UrlUpload/index.d.ts +1 -1
- package/es/index.css +9 -9
- package/lib/Form/config.d.ts +5 -0
- package/lib/Form/config.js +4 -2
- package/lib/Select/TreeSelect.d.ts +8 -0
- package/lib/Select/TreeSelect.js +103 -0
- package/lib/Upload/UrlUpload/index.d.ts +1 -1
- package/lib/index.css +9 -9
- package/package.json +1 -1
- package/src/components/DialogForm/hooks.ts +0 -1
- package/src/components/Form/Basic.tsx +5 -5
- package/src/components/Form/FormItem/BasicItem.tsx +11 -9
- package/src/components/Form/FormItem/index.tsx +2 -2
- package/src/components/Form/Label.tsx +1 -1
- package/src/components/Form/config.ts +9 -1
- package/src/components/Form/hooks/index.ts +2 -2
- package/src/components/Form/index.less +3 -3
- package/src/components/Form/index.tsx +2 -2
- package/src/components/Form/modal.ts +3 -3
- package/src/components/Input/ColorInput/index.tsx +2 -2
- package/src/components/Input/InputNumberGroup.tsx +27 -23
- package/src/components/Input/index.less +10 -10
- package/src/components/Select/TreeSelect.tsx +64 -0
- package/src/components/Switch/index.less +2 -2
- package/src/components/Switch/index.tsx +12 -14
- package/src/components/Upload/UrlUpload/index.tsx +1 -1
- package/src/pages/Form/index.tsx +88 -44
- package/src/pages/Input/index.tsx +3 -3
- package/src/pages/InputNumberGroup/index.tsx +21 -13
- package/src/pages/Switch/index.tsx +10 -11
- package/src/routes.tsx +1 -1
|
@@ -98,7 +98,7 @@ export interface HItemProps
|
|
|
98
98
|
labelAlign?: LabelAlignModal;
|
|
99
99
|
label?: React.ReactNode | HelperModal;
|
|
100
100
|
hidden?: boolean | HideModal;
|
|
101
|
-
rowWrapper?:boolean;
|
|
101
|
+
rowWrapper?: boolean;
|
|
102
102
|
}
|
|
103
103
|
export interface HFormProps<T = any, R = any>
|
|
104
104
|
extends Omit<FormProps, "form" | "onFinish" | "labelAlign"> {
|
|
@@ -118,7 +118,7 @@ export interface HFormProps<T = any, R = any>
|
|
|
118
118
|
formItemStyle?: React.CSSProperties;
|
|
119
119
|
itemProps?: ItemPropsType;
|
|
120
120
|
dismissOnPressEnter?: boolean;
|
|
121
|
-
rowWrapper?:boolean;
|
|
121
|
+
rowWrapper?: boolean;
|
|
122
122
|
}
|
|
123
123
|
export interface HFormItemProps extends HItemProps {
|
|
124
124
|
required?: boolean;
|
|
@@ -142,7 +142,7 @@ export interface FormContextProps {
|
|
|
142
142
|
itemProps?: ItemPropsType;
|
|
143
143
|
itemSpan?: ColProps;
|
|
144
144
|
setData?: (newData: any) => void;
|
|
145
|
-
rowWrapper?:boolean;
|
|
145
|
+
rowWrapper?: boolean;
|
|
146
146
|
}
|
|
147
147
|
interface ConfigUploadProps {
|
|
148
148
|
exFiles?: string[];
|
|
@@ -19,9 +19,9 @@ interface IProps<T = any> {
|
|
|
19
19
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
20
20
|
noHandlerWrap?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
-
addonBefore?:React.ReactNode;
|
|
23
|
-
minValMk?:(val:number)=>number;
|
|
24
|
-
maxValMk?:(val:number)=>number;
|
|
22
|
+
addonBefore?: React.ReactNode;
|
|
23
|
+
minValMk?: (val: number) => number;
|
|
24
|
+
maxValMk?: (val: number) => number;
|
|
25
25
|
}
|
|
26
26
|
const useArrayProps = (props: any) => {
|
|
27
27
|
return useMemo(() => {
|
|
@@ -31,20 +31,20 @@ const useArrayProps = (props: any) => {
|
|
|
31
31
|
return [props, props];
|
|
32
32
|
}, [props]);
|
|
33
33
|
};
|
|
34
|
-
const Addon:React.FC<IProps
|
|
35
|
-
const addonClassname=useClassName(["hw-input-group-addon"])
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (React.isValidElement(children)){
|
|
40
|
-
return <div className={addonClassname}>
|
|
41
|
-
{ React.cloneElement(children as any, { value, onChange })}
|
|
42
|
-
</div>
|
|
34
|
+
const Addon: React.FC<IProps> = ({ children, value, onChange }) => {
|
|
35
|
+
const addonClassname = useClassName(["hw-input-group-addon"]);
|
|
36
|
+
if (!children) {
|
|
37
|
+
return <></>;
|
|
43
38
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
39
|
+
if (React.isValidElement(children)) {
|
|
40
|
+
return (
|
|
41
|
+
<div className={addonClassname}>
|
|
42
|
+
{React.cloneElement(children as any, { value, onChange })}
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
return <div className={addonClassname}>{children}</div>;
|
|
47
|
+
};
|
|
48
48
|
const InputNumberGroup = ({
|
|
49
49
|
value = {},
|
|
50
50
|
valueMap = { min: "min", max: "max" },
|
|
@@ -55,9 +55,9 @@ const InputNumberGroup = ({
|
|
|
55
55
|
noHandlerWrap = true,
|
|
56
56
|
addFormat,
|
|
57
57
|
disabled,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
addonBefore,
|
|
59
|
+
minValMk,
|
|
60
|
+
maxValMk,
|
|
61
61
|
}: IProps) => {
|
|
62
62
|
const { min, max } = valueMap;
|
|
63
63
|
const { [min]: minVal, [max]: maxVal } = value;
|
|
@@ -115,7 +115,9 @@ const InputNumberGroup = ({
|
|
|
115
115
|
};
|
|
116
116
|
return (
|
|
117
117
|
<Input.Group compact className={contentClassname}>
|
|
118
|
-
<Addon value={value} onChange={onChange}>
|
|
118
|
+
<Addon value={value} onChange={onChange}>
|
|
119
|
+
{addonBefore}
|
|
120
|
+
</Addon>
|
|
119
121
|
<div
|
|
120
122
|
className={`${bodyClassname}
|
|
121
123
|
${focus ? activeClassname : ""}
|
|
@@ -127,7 +129,7 @@ const InputNumberGroup = ({
|
|
|
127
129
|
<InputNumber<number>
|
|
128
130
|
bordered={false}
|
|
129
131
|
value={minVal}
|
|
130
|
-
max={maxValMk?maxValMk(maxVal):maxVal}
|
|
132
|
+
max={maxValMk ? maxValMk(maxVal) : maxVal}
|
|
131
133
|
min={0}
|
|
132
134
|
className={oneClassname}
|
|
133
135
|
onFocus={() => {
|
|
@@ -151,7 +153,7 @@ const InputNumberGroup = ({
|
|
|
151
153
|
value={maxVal}
|
|
152
154
|
className={oneClassname}
|
|
153
155
|
placeholder={edPlaceholder}
|
|
154
|
-
min={minValMk?minValMk(minVal):minVal}
|
|
156
|
+
min={minValMk ? minValMk(minVal) : minVal}
|
|
155
157
|
onFocus={() => {
|
|
156
158
|
setFocus(true);
|
|
157
159
|
}}
|
|
@@ -165,7 +167,9 @@ const InputNumberGroup = ({
|
|
|
165
167
|
disabled={disabled}
|
|
166
168
|
/>
|
|
167
169
|
</div>
|
|
168
|
-
<Addon value={value} onChange={onChange}>
|
|
170
|
+
<Addon value={value} onChange={onChange}>
|
|
171
|
+
{addonAfter}
|
|
172
|
+
</Addon>
|
|
169
173
|
</Input.Group>
|
|
170
174
|
);
|
|
171
175
|
};
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
@all-input-group: ~"@{ant-prefix}-hw-input-group";
|
|
3
3
|
.@{ant-prefix}-form-item-has-error {
|
|
4
4
|
.@{all-input-group}-body {
|
|
5
|
-
border-color
|
|
5
|
+
border-color: #ff4d4f !important;
|
|
6
6
|
}
|
|
7
7
|
.@{all-input-group}-active {
|
|
8
8
|
border-color: #ff4d4f !important;
|
|
9
9
|
box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2) !important;
|
|
10
10
|
}
|
|
11
|
-
.@{all-input-group}-addon{
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
.@{all-input-group}-addon {
|
|
12
|
+
color: #ff4d4f;
|
|
13
|
+
border-color: #ff4d4f !important;
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
.@{all-input-group} {
|
|
@@ -63,12 +63,12 @@
|
|
|
63
63
|
border-color: #40a9ff;
|
|
64
64
|
box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
|
|
65
65
|
}
|
|
66
|
-
.@{all-input-group}-addon{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
.@{all-input-group}-addon {
|
|
67
|
+
display: flex !important;
|
|
68
|
+
align-items: center;
|
|
69
|
+
padding: 0 11px;
|
|
70
|
+
background-color: #fafafa;
|
|
71
|
+
border: 1px solid #d9d9d9;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { TreeSelect } from "antd";
|
|
2
|
+
import { TreeSelectProps } from "antd/lib/tree-select";
|
|
3
|
+
import { PromiseFnResult } from "../modal";
|
|
4
|
+
import { useRequest } from "ahooks";
|
|
5
|
+
interface IProps extends TreeSelectProps {
|
|
6
|
+
request?: PromiseFnResult;
|
|
7
|
+
onlyCheckChild?:boolean;
|
|
8
|
+
}
|
|
9
|
+
interface OpMkParamsModal {
|
|
10
|
+
options?:any[];
|
|
11
|
+
onlyCheckChild?:boolean;
|
|
12
|
+
fieldNames?:TreeSelectProps["fieldNames"]
|
|
13
|
+
}
|
|
14
|
+
const opMk=({options,onlyCheckChild=false,fieldNames}:OpMkParamsModal)=>{
|
|
15
|
+
const {children="children"}=fieldNames||{}
|
|
16
|
+
return options?.map((item)=>{
|
|
17
|
+
const {[children]:child}=item;
|
|
18
|
+
const len=child?.length;
|
|
19
|
+
if (!len){
|
|
20
|
+
return {
|
|
21
|
+
...item
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const newChild=opMk({options:child,onlyCheckChild,fieldNames});
|
|
25
|
+
return {
|
|
26
|
+
...item,
|
|
27
|
+
selectable:!onlyCheckChild,
|
|
28
|
+
[children]:newChild
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
}
|
|
32
|
+
const useGetOnlyCheckChild=({onlyCheckChild,treeCheckable,multiple}:IProps)=>{
|
|
33
|
+
if (typeof onlyCheckChild!=="undefined"){
|
|
34
|
+
return onlyCheckChild;
|
|
35
|
+
}
|
|
36
|
+
if (!treeCheckable&&!multiple){
|
|
37
|
+
return true
|
|
38
|
+
}
|
|
39
|
+
return false;
|
|
40
|
+
}
|
|
41
|
+
export default ({ request,onlyCheckChild,multiple,treeCheckable,treeData,fieldNames, ...props }: IProps) => {
|
|
42
|
+
const cuOnlyCheckChild=useGetOnlyCheckChild({
|
|
43
|
+
onlyCheckChild,
|
|
44
|
+
treeCheckable,
|
|
45
|
+
multiple
|
|
46
|
+
})
|
|
47
|
+
const { loading, data } = useRequest(async () => {
|
|
48
|
+
let options=treeData;
|
|
49
|
+
if (request) {
|
|
50
|
+
options=await request({});
|
|
51
|
+
}
|
|
52
|
+
return opMk({
|
|
53
|
+
options,
|
|
54
|
+
onlyCheckChild:cuOnlyCheckChild,
|
|
55
|
+
fieldNames
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
return <TreeSelect treeData={data}
|
|
59
|
+
loading={loading}
|
|
60
|
+
fieldNames={fieldNames}
|
|
61
|
+
treeCheckable={treeCheckable}
|
|
62
|
+
multiple={multiple}
|
|
63
|
+
{...props}/>;
|
|
64
|
+
};
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
display: flex;
|
|
5
5
|
flex-direction: row;
|
|
6
6
|
align-items: center;
|
|
7
|
-
.@{ant-prefix}-hw-switch-before{
|
|
7
|
+
.@{ant-prefix}-hw-switch-before {
|
|
8
8
|
margin-right: 4px;
|
|
9
9
|
}
|
|
10
|
-
.@{ant-prefix}-hw-switch-after{
|
|
10
|
+
.@{ant-prefix}-hw-switch-after {
|
|
11
11
|
margin-left: 4px;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { SwitchProps } from "antd";
|
|
2
|
-
import {Switch } from "antd";
|
|
2
|
+
import { Switch } from "antd";
|
|
3
3
|
import React, { useMemo } from "react";
|
|
4
|
-
import {useClassName, useMatchConfigProps} from "../hooks";
|
|
4
|
+
import { useClassName, useMatchConfigProps } from "../hooks";
|
|
5
5
|
import type { ValueSwitchMapModal } from "../modal";
|
|
6
6
|
import type { addFormatItemModal } from "../Form/modal";
|
|
7
7
|
import HFormConnect from "../Form/HFormConnect";
|
|
@@ -28,9 +28,9 @@ const Index: React.FC<HSwitchProps> = ({
|
|
|
28
28
|
const { valueSwitchMap = {} } = useMatchConfigProps({
|
|
29
29
|
valueSwitchMap: propsValueSwitchMap,
|
|
30
30
|
});
|
|
31
|
-
const switchClassName=useClassName("hw-switch");
|
|
32
|
-
const switchBefore=useClassName("hw-switch-before");
|
|
33
|
-
const switchAfter=useClassName("hw-switch-after")
|
|
31
|
+
const switchClassName = useClassName("hw-switch");
|
|
32
|
+
const switchBefore = useClassName("hw-switch-before");
|
|
33
|
+
const switchAfter = useClassName("hw-switch-after");
|
|
34
34
|
|
|
35
35
|
const swChecked = useMemo(() => {
|
|
36
36
|
const { open } = valueSwitchMap;
|
|
@@ -66,17 +66,15 @@ const Index: React.FC<HSwitchProps> = ({
|
|
|
66
66
|
});
|
|
67
67
|
return (
|
|
68
68
|
<div style={style} className={switchClassName}>
|
|
69
|
-
{beforeText
|
|
70
|
-
{beforeText}
|
|
71
|
-
</span>}
|
|
69
|
+
{beforeText && <span className={switchBefore}>{beforeText}</span>}
|
|
72
70
|
<Switch
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
checked={swChecked}
|
|
72
|
+
checkedChildren={checkedChildren}
|
|
73
|
+
unCheckedChildren={unCheckedChildren}
|
|
74
|
+
onChange={change}
|
|
75
|
+
{...props}
|
|
78
76
|
/>
|
|
79
|
-
{children&&
|
|
77
|
+
{children && <span className={switchAfter}>{children}</span>}
|
|
80
78
|
</div>
|
|
81
79
|
);
|
|
82
80
|
};
|
|
@@ -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 type { HItemProps } from "@/components/Form/modal";
|
|
10
10
|
const { Text } = Typography;
|
|
11
11
|
const mkSubFileList = (fileList: UploadFile[], maxCount = 1) => {
|
|
12
12
|
const len = fileList.length;
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -70,62 +70,106 @@ const formData = (options) => {
|
|
|
70
70
|
{
|
|
71
71
|
name: "name",
|
|
72
72
|
label: "输入框",
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
rules: [
|
|
74
|
+
{
|
|
75
|
+
validator: () => {
|
|
76
|
+
return Promise.reject(new Error("错误"));
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
],
|
|
76
80
|
itemProps: {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
81
|
+
addonBefore: "前面",
|
|
82
|
+
addonAfter: "后面",
|
|
83
|
+
},
|
|
80
84
|
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
{
|
|
86
|
+
name: "inputNumberGroup",
|
|
87
|
+
label: "输入框",
|
|
88
|
+
rules: [
|
|
89
|
+
{
|
|
90
|
+
validator: () => {
|
|
91
|
+
return Promise.reject(new Error("错误"));
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
type: "inputNumberGroup",
|
|
96
|
+
itemProps: {
|
|
97
|
+
addonBefore: "前面",
|
|
98
|
+
addonAfter: "后面",
|
|
92
99
|
},
|
|
100
|
+
},
|
|
93
101
|
{
|
|
94
102
|
name: "url",
|
|
95
103
|
type: "urlUpload",
|
|
96
104
|
label: "文本",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
105
|
+
hideLabel: true,
|
|
106
|
+
rules: [
|
|
107
|
+
{
|
|
108
|
+
validator: () => {
|
|
109
|
+
return Promise.reject(new Error("错误"));
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
itemProps: {
|
|
114
|
+
initValueProvider: (props, val) => {
|
|
115
|
+
console.log(props, val, "fff");
|
|
116
|
+
return {
|
|
117
|
+
...val,
|
|
118
|
+
name: "ffffsfsadasda",
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
},
|
|
110
122
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
+
{
|
|
124
|
+
nameKey: "name1",
|
|
125
|
+
label: "输入框",
|
|
126
|
+
render: () => {
|
|
127
|
+
return (
|
|
128
|
+
<Basic
|
|
129
|
+
configData={[
|
|
130
|
+
{
|
|
131
|
+
label: "1",
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
label: "2",
|
|
135
|
+
},
|
|
136
|
+
]}
|
|
137
|
+
/>
|
|
138
|
+
);
|
|
123
139
|
},
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: "treeSelect",
|
|
143
|
+
label: "treeSelect",
|
|
144
|
+
type: "treeSelect",
|
|
145
|
+
itemProps: {
|
|
146
|
+
multiple:true,
|
|
147
|
+
request: async () => {
|
|
148
|
+
return [
|
|
149
|
+
{
|
|
150
|
+
name: "父亲",
|
|
151
|
+
key: "1",
|
|
152
|
+
child: [
|
|
153
|
+
{
|
|
154
|
+
name: "儿子",
|
|
155
|
+
key: "1-1",
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
];
|
|
160
|
+
},
|
|
161
|
+
fieldNames: {
|
|
162
|
+
label: "name",
|
|
163
|
+
value: "key",
|
|
164
|
+
children: "child",
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
124
168
|
{
|
|
125
169
|
label: "输入框",
|
|
126
170
|
type: "checkboxGroup",
|
|
127
171
|
name: "check",
|
|
128
|
-
hover:"你好",
|
|
172
|
+
hover: "你好",
|
|
129
173
|
itemProps: {
|
|
130
174
|
options: [
|
|
131
175
|
{
|
|
@@ -208,7 +252,7 @@ export default () => {
|
|
|
208
252
|
</div>
|
|
209
253
|
<div
|
|
210
254
|
onClick={() => {
|
|
211
|
-
form.submit()
|
|
255
|
+
form.submit();
|
|
212
256
|
}}
|
|
213
257
|
>
|
|
214
258
|
提交
|
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
HInputNumberGroup,
|
|
9
9
|
} from "../../components";
|
|
10
10
|
import { Space } from "antd";
|
|
11
|
-
import {useState} from "react";
|
|
11
|
+
import { useState } from "react";
|
|
12
12
|
export default () => {
|
|
13
|
-
const [colorVal,setColorVal]=useState();
|
|
13
|
+
const [colorVal, setColorVal] = useState();
|
|
14
14
|
return (
|
|
15
15
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
16
16
|
<HInput placeholder="基础输入框" copy value="11111" />
|
|
@@ -22,7 +22,7 @@ export default () => {
|
|
|
22
22
|
/>
|
|
23
23
|
<HButtonInput>点我</HButtonInput>
|
|
24
24
|
<HInputNumber />
|
|
25
|
-
<HColorInput value={colorVal} onChange={setColorVal}/>
|
|
25
|
+
<HColorInput value={colorVal} onChange={setColorVal} />
|
|
26
26
|
<HVerificationCodeInput
|
|
27
27
|
request={() => {
|
|
28
28
|
return Promise.resolve({ code: 200 });
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import {HInputNumberGroup} from
|
|
2
|
-
import {Col, Row} from
|
|
3
|
-
const Test=({value,onChange})=>{
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { HInputNumberGroup } from "@/components";
|
|
2
|
+
import { Col, Row } from "antd";
|
|
3
|
+
const Test = ({ value, onChange }) => {
|
|
4
|
+
console.log(value);
|
|
5
|
+
return (
|
|
6
|
+
<div
|
|
7
|
+
onClick={() => {
|
|
6
8
|
onChange(1);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
}}
|
|
10
|
+
>
|
|
11
|
+
1231
|
|
12
|
+
</div>
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
export default () => {
|
|
16
|
+
return (
|
|
17
|
+
<Row style={{ marginTop: 20, marginLeft: 20 }}>
|
|
18
|
+
<Col span={10}>
|
|
19
|
+
<HInputNumberGroup addonBefore={<Test />} />
|
|
20
|
+
</Col>
|
|
14
21
|
</Row>
|
|
15
|
-
|
|
22
|
+
);
|
|
23
|
+
};
|
|
@@ -15,17 +15,16 @@ export default () => {
|
|
|
15
15
|
打开
|
|
16
16
|
</HSwitch>
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</HSwitch>
|
|
18
|
+
<HSwitch
|
|
19
|
+
value={1}
|
|
20
|
+
beforeText="开关"
|
|
21
|
+
valueMap={{ open: 1, close: 0 }}
|
|
22
|
+
onChange={(val) => {
|
|
23
|
+
console.log(val);
|
|
24
|
+
}}
|
|
25
|
+
>
|
|
26
|
+
手机设备发送微信红包
|
|
27
|
+
</HSwitch>
|
|
29
28
|
</Space>
|
|
30
29
|
);
|
|
31
30
|
};
|