@hw-component/form 1.9.85 → 1.9.87
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/hooks.d.ts +1 -1
- package/es/Form/config.d.ts +2 -1
- package/es/Form/config.js +3 -1
- package/es/Form/hooks/useHForm.js +10 -0
- package/es/Form/modal.d.ts +1 -0
- package/es/Select/TagSelect/Content.d.ts +7 -0
- package/es/Select/TagSelect/Content.js +90 -0
- package/es/Select/TagSelect/hooks.d.ts +10 -0
- package/es/Select/TagSelect/hooks.js +97 -0
- package/es/Select/TagSelect/index.d.ts +3 -0
- package/es/Select/TagSelect/index.js +100 -0
- package/es/Select/index.js +0 -1
- package/es/Select/modal.d.ts +7 -1
- package/es/index.css +15 -0
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/lib/DialogForm/hooks.d.ts +1 -1
- package/lib/Form/config.d.ts +2 -1
- package/lib/Form/config.js +3 -1
- package/lib/Form/hooks/useHForm.js +10 -0
- package/lib/Form/modal.d.ts +1 -0
- package/lib/Select/TagSelect/Content.d.ts +7 -0
- package/lib/Select/TagSelect/Content.js +93 -0
- package/lib/Select/TagSelect/hooks.d.ts +10 -0
- package/lib/Select/TagSelect/hooks.js +99 -0
- package/lib/Select/TagSelect/index.d.ts +3 -0
- package/lib/Select/TagSelect/index.js +103 -0
- package/lib/Select/index.js +0 -1
- package/lib/Select/modal.d.ts +7 -1
- package/lib/index.css +15 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +2 -0
- package/package.json +1 -1
- package/src/components/Btn.tsx +36 -36
- package/src/components/CheckboxGroup/index.tsx +4 -3
- package/src/components/DialogForm/DrawerForm/index.tsx +13 -13
- package/src/components/DialogForm/ModalForm.tsx +16 -16
- package/src/components/DialogForm/hooks.tsx +3 -3
- package/src/components/DialogForm/modal.ts +8 -2
- package/src/components/Form/HFormConnect.tsx +8 -3
- package/src/components/Form/InitSet.tsx +4 -4
- package/src/components/Form/config.ts +2 -1
- package/src/components/Form/hooks/index.ts +1 -3
- package/src/components/Form/hooks/useAddFormat.tsx +34 -36
- package/src/components/Form/hooks/useHForm.ts +14 -2
- package/src/components/Form/index.less +6 -0
- package/src/components/Form/modal.ts +3 -2
- package/src/components/RichEditor/hooks.ts +36 -34
- package/src/components/RichEditor/index.tsx +31 -23
- package/src/components/RichEditor/modal.ts +2 -2
- package/src/components/Select/TagSelect/Content.tsx +50 -0
- package/src/components/Select/TagSelect/hooks.ts +83 -0
- package/src/components/Select/TagSelect/index.tsx +63 -0
- package/src/components/Select/index.less +13 -0
- package/src/components/Select/index.tsx +0 -1
- package/src/components/Select/modal.ts +7 -1
- package/src/components/TDPicker/TimePicker.tsx +1 -1
- package/src/components/TDPicker/hooks.ts +1 -1
- package/src/components/TextArea/index.tsx +2 -2
- package/src/components/Upload/Btn.tsx +13 -9
- package/src/components/Upload/hooks/customRequest.ts +1 -1
- package/src/components/Upload/index.tsx +8 -8
- package/src/components/Upload/modal.ts +5 -4
- package/src/components/index.tsx +2 -0
- package/src/pages/DrawerForm/index.tsx +17 -15
- package/src/pages/Form/index.tsx +161 -144
- package/src/pages/ModalForm/index.tsx +12 -8
- package/src/pages/Select/index.tsx +25 -4
- package/src/pages/Upload/index.tsx +2 -2
|
@@ -22,7 +22,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
22
22
|
addFormat,
|
|
23
23
|
thumbUrl,
|
|
24
24
|
hideAddBtn,
|
|
25
|
-
|
|
25
|
+
children,
|
|
26
26
|
...props
|
|
27
27
|
},
|
|
28
28
|
ref
|
|
@@ -49,9 +49,9 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
49
49
|
}, [maxRowNum, listType]);
|
|
50
50
|
|
|
51
51
|
const preview = (file) => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
if (onPreview === null) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
55
|
if (onPreview) {
|
|
56
56
|
onPreview(file);
|
|
57
57
|
return;
|
|
@@ -101,7 +101,7 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
101
101
|
},
|
|
102
102
|
});
|
|
103
103
|
const relVal = Array.isArray(value) ? value : [];
|
|
104
|
-
const upListType=listType===null?undefined:listType;
|
|
104
|
+
const upListType = listType === null ? undefined : listType;
|
|
105
105
|
return (
|
|
106
106
|
<div style={contentStyle}>
|
|
107
107
|
<Upload
|
|
@@ -116,9 +116,9 @@ const Index: React.ForwardRefRenderFunction<IUploadRefModal, IUpLoadProps> = (
|
|
|
116
116
|
{...props}
|
|
117
117
|
>
|
|
118
118
|
{hideAddBtn ? null : (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
119
|
+
<Btn value={relVal} maxCount={maxCount} listType={upListType}>
|
|
120
|
+
{children}
|
|
121
|
+
</Btn>
|
|
122
122
|
)}
|
|
123
123
|
</Upload>
|
|
124
124
|
<Preview
|
|
@@ -5,9 +5,10 @@ import type { UploadChangeParam } from "antd/lib/upload/interface";
|
|
|
5
5
|
import type { MediaTypeEnum } from "@/components/Upload/enums";
|
|
6
6
|
import type { addFormatItemModal } from "@/components/Form/modal";
|
|
7
7
|
import type React from "react";
|
|
8
|
-
import {UploadListType} from "antd/lib/upload/interface";
|
|
8
|
+
import { UploadListType } from "antd/lib/upload/interface";
|
|
9
9
|
|
|
10
|
-
export interface IUpLoadProps
|
|
10
|
+
export interface IUpLoadProps
|
|
11
|
+
extends Omit<UploadProps, "onChange" | "listType" | "onPreview"> {
|
|
11
12
|
exFiles?: string[] | null;
|
|
12
13
|
request?: (
|
|
13
14
|
file: Exclude<BeforeUploadFileType, File | boolean> | RcFile
|
|
@@ -20,8 +21,8 @@ export interface IUpLoadProps extends Omit<UploadProps, "onChange"|"listType"|"o
|
|
|
20
21
|
addFormat?: (config: Record<string, addFormatItemModal>) => void;
|
|
21
22
|
thumbUrl?: string;
|
|
22
23
|
hideAddBtn?: boolean;
|
|
23
|
-
listType?:UploadListType|null;
|
|
24
|
-
onPreview?:UploadProps["onPreview"]|null
|
|
24
|
+
listType?: UploadListType | null;
|
|
25
|
+
onPreview?: UploadProps["onPreview"] | null;
|
|
25
26
|
}
|
|
26
27
|
export interface IMediaTypeEleProps {
|
|
27
28
|
file?: UploadFile;
|
package/src/components/index.tsx
CHANGED
|
@@ -13,17 +13,19 @@ const data = [
|
|
|
13
13
|
return <Test />;
|
|
14
14
|
},
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
{
|
|
17
|
+
type: "select",
|
|
18
|
+
label: "下啦",
|
|
19
|
+
name: "select",
|
|
20
|
+
itemProps: {
|
|
21
|
+
options: [
|
|
22
|
+
{
|
|
23
|
+
value: "123",
|
|
24
|
+
key: 1,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
26
27
|
},
|
|
28
|
+
},
|
|
27
29
|
];
|
|
28
30
|
let num = 0;
|
|
29
31
|
const Test1 = ({ formNode, dialogForm, params }) => {
|
|
@@ -65,11 +67,11 @@ export default () => {
|
|
|
65
67
|
</Button>
|
|
66
68
|
<Button
|
|
67
69
|
onClick={() => {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
modalForm.show({
|
|
71
|
+
initialValues: {
|
|
72
|
+
input: "12312",
|
|
73
|
+
},
|
|
74
|
+
});
|
|
73
75
|
}}
|
|
74
76
|
>
|
|
75
77
|
打开
|
package/src/pages/Form/index.tsx
CHANGED
|
@@ -75,151 +75,168 @@ export default () => {
|
|
|
75
75
|
<div style={{ width: 1000 }}>
|
|
76
76
|
<HForm
|
|
77
77
|
configData={[
|
|
78
|
-
{
|
|
79
|
-
label:"文字",
|
|
80
|
-
name:"wz"
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
label:"文字1",
|
|
84
|
-
name:"wz1"
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
label: "inputSelect",
|
|
88
|
-
type: "richEditor",
|
|
89
|
-
name: "richEditor",
|
|
90
|
-
rules: [
|
|
91
|
-
{
|
|
92
|
-
validator: (rule, value, callback) => {
|
|
93
|
-
console.log(value);
|
|
94
|
-
return Promise.resolve();
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
],
|
|
98
|
-
},
|
|
99
78
|
{
|
|
100
|
-
label: "
|
|
101
|
-
type:
|
|
102
|
-
name: "
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
rules: [
|
|
108
|
-
{
|
|
109
|
-
validator: (rule, value, callback) => {
|
|
110
|
-
console.log(value);
|
|
111
|
-
return Promise.resolve();
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
label: "运营商账号",
|
|
118
|
-
name: "mobile",
|
|
119
|
-
type: "buttonInput",
|
|
120
|
-
flexBox: true,
|
|
121
|
-
itemProps: {
|
|
122
|
-
children: "修改手机号",
|
|
123
|
-
disabled: true,
|
|
124
|
-
buttonProps: {
|
|
125
|
-
type: "primary",
|
|
126
|
-
ghost: true,
|
|
127
|
-
style: {
|
|
128
|
-
marginLeft: 8,
|
|
129
|
-
},
|
|
130
|
-
onClick: () => {},
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
label: "验证码",
|
|
136
|
-
name: "newCode",
|
|
137
|
-
type: "verificationCodeInput",
|
|
138
|
-
itemProps: {
|
|
139
|
-
request: async ({ newMobile }) => {
|
|
140
|
-
return Promise.resolve();
|
|
79
|
+
label: "tagSelect",
|
|
80
|
+
type:"tagSelect",
|
|
81
|
+
name: "wz",
|
|
82
|
+
dispatch: {
|
|
83
|
+
fnKey: 'reload',
|
|
84
|
+
dependencies: ['wz1'],
|
|
141
85
|
},
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
width: "100%",
|
|
155
|
-
backgroundColor: "red",
|
|
156
|
-
height: "100%",
|
|
157
|
-
}}
|
|
158
|
-
>
|
|
159
|
-
<div style={{ height: 200 }} />
|
|
160
|
-
</div>
|
|
161
|
-
);
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
label: "你好",
|
|
166
|
-
noStyle: true,
|
|
167
|
-
render: () => {
|
|
168
|
-
return (
|
|
169
|
-
<div
|
|
170
|
-
style={{
|
|
171
|
-
width: "100%",
|
|
172
|
-
backgroundColor: "black",
|
|
173
|
-
height: "100%",
|
|
174
|
-
}}
|
|
175
|
-
/>
|
|
176
|
-
);
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
{
|
|
180
|
-
label: "数字输入框",
|
|
181
|
-
name: "yyy",
|
|
182
|
-
type: "inputNumberGroup",
|
|
183
|
-
rules: [{ required: true }],
|
|
184
|
-
itemProps: {
|
|
185
|
-
inputNumberProps: {
|
|
186
|
-
precision: 2,
|
|
187
|
-
},
|
|
188
|
-
},
|
|
86
|
+
itemProps:{
|
|
87
|
+
request:()=>{
|
|
88
|
+
return new Promise((resolve, reject)=>{
|
|
89
|
+
setTimeout(()=>{
|
|
90
|
+
resolve([{
|
|
91
|
+
value:"你好",
|
|
92
|
+
key:"1"
|
|
93
|
+
}])
|
|
94
|
+
},3000)
|
|
95
|
+
})
|
|
96
|
+
}
|
|
97
|
+
}
|
|
189
98
|
},
|
|
190
99
|
{
|
|
191
|
-
label: "文字",
|
|
192
|
-
|
|
193
|
-
name: "text",
|
|
194
|
-
render:()=>{
|
|
195
|
-
return <div>fff</div>
|
|
196
|
-
},
|
|
197
|
-
itemProps: {
|
|
198
|
-
type: "danger",
|
|
199
|
-
addonBefore: (
|
|
200
|
-
<div style={{ height: 100, backgroundColor: "red" }}>
|
|
201
|
-
nihao
|
|
202
|
-
</div>
|
|
203
|
-
),
|
|
204
|
-
addonAfter: (
|
|
205
|
-
<div style={{ height: 200, backgroundColor: "red" }}>
|
|
206
|
-
wohao
|
|
207
|
-
</div>
|
|
208
|
-
),
|
|
209
|
-
initValueProvider:(...data)=>{
|
|
210
|
-
console.log("initValueProvider")
|
|
211
|
-
return {
|
|
212
|
-
text:"你好"
|
|
213
|
-
}
|
|
214
|
-
},
|
|
215
|
-
},
|
|
100
|
+
label: "文字1",
|
|
101
|
+
name: "wz1",
|
|
216
102
|
},
|
|
103
|
+
// {
|
|
104
|
+
// label: "inputSelect",
|
|
105
|
+
// type: "richEditor",
|
|
106
|
+
// name: "richEditor",
|
|
107
|
+
// rules: [
|
|
108
|
+
// {
|
|
109
|
+
// validator: (rule, value, callback) => {
|
|
110
|
+
// console.log(value);
|
|
111
|
+
// return Promise.resolve();
|
|
112
|
+
// },
|
|
113
|
+
// },
|
|
114
|
+
// ],
|
|
115
|
+
// },
|
|
116
|
+
// {
|
|
117
|
+
// label: "富文本",
|
|
118
|
+
// type: "timePicker",
|
|
119
|
+
// name: "textArea",
|
|
120
|
+
// itemProps: {
|
|
121
|
+
// showCount: true,
|
|
122
|
+
// maxLength: 100,
|
|
123
|
+
// },
|
|
124
|
+
// rules: [
|
|
125
|
+
// {
|
|
126
|
+
// validator: (rule, value, callback) => {
|
|
127
|
+
// console.log(value);
|
|
128
|
+
// return Promise.resolve();
|
|
129
|
+
// },
|
|
130
|
+
// },
|
|
131
|
+
// ],
|
|
132
|
+
// },
|
|
133
|
+
// {
|
|
134
|
+
// label: "运营商账号",
|
|
135
|
+
// name: "mobile",
|
|
136
|
+
// type: "buttonInput",
|
|
137
|
+
// flexBox: true,
|
|
138
|
+
// itemProps: {
|
|
139
|
+
// children: "修改手机号",
|
|
140
|
+
// disabled: true,
|
|
141
|
+
// buttonProps: {
|
|
142
|
+
// type: "primary",
|
|
143
|
+
// ghost: true,
|
|
144
|
+
// style: {
|
|
145
|
+
// marginLeft: 8,
|
|
146
|
+
// },
|
|
147
|
+
// onClick: () => {},
|
|
148
|
+
// },
|
|
149
|
+
// },
|
|
150
|
+
// },
|
|
151
|
+
// {
|
|
152
|
+
// label: "验证码",
|
|
153
|
+
// name: "newCode",
|
|
154
|
+
// type: "verificationCodeInput",
|
|
155
|
+
// itemProps: {
|
|
156
|
+
// request: async ({ newMobile }) => {
|
|
157
|
+
// return Promise.resolve();
|
|
158
|
+
// },
|
|
159
|
+
// buttonProps: {
|
|
160
|
+
// ghost: true,
|
|
161
|
+
// },
|
|
162
|
+
// },
|
|
163
|
+
// },
|
|
164
|
+
// {
|
|
165
|
+
// label: "你好",
|
|
166
|
+
// noStyle: true,
|
|
167
|
+
// render: () => {
|
|
168
|
+
// return (
|
|
169
|
+
// <div
|
|
170
|
+
// style={{
|
|
171
|
+
// width: "100%",
|
|
172
|
+
// backgroundColor: "red",
|
|
173
|
+
// height: "100%",
|
|
174
|
+
// }}
|
|
175
|
+
// >
|
|
176
|
+
// <div style={{ height: 200 }} />
|
|
177
|
+
// </div>
|
|
178
|
+
// );
|
|
179
|
+
// },
|
|
180
|
+
// },
|
|
181
|
+
// {
|
|
182
|
+
// label: "你好",
|
|
183
|
+
// noStyle: true,
|
|
184
|
+
// render: () => {
|
|
185
|
+
// return (
|
|
186
|
+
// <div
|
|
187
|
+
// style={{
|
|
188
|
+
// width: "100%",
|
|
189
|
+
// backgroundColor: "black",
|
|
190
|
+
// height: "100%",
|
|
191
|
+
// }}
|
|
192
|
+
// />
|
|
193
|
+
// );
|
|
194
|
+
// },
|
|
195
|
+
// },
|
|
196
|
+
// {
|
|
197
|
+
// label: "数字输入框",
|
|
198
|
+
// name: "yyy",
|
|
199
|
+
// type: "inputNumberGroup",
|
|
200
|
+
// rules: [{ required: true }],
|
|
201
|
+
// itemProps: {
|
|
202
|
+
// inputNumberProps: {
|
|
203
|
+
// precision: 2,
|
|
204
|
+
// },
|
|
205
|
+
// },
|
|
206
|
+
// },
|
|
207
|
+
// {
|
|
208
|
+
// label: "文字",
|
|
209
|
+
// type: "text",
|
|
210
|
+
// name: "text",
|
|
211
|
+
// render: () => {
|
|
212
|
+
// return <div>fff</div>;
|
|
213
|
+
// },
|
|
214
|
+
// itemProps: {
|
|
215
|
+
// type: "danger",
|
|
216
|
+
// addonBefore: (
|
|
217
|
+
// <div style={{ height: 100, backgroundColor: "red" }}>
|
|
218
|
+
// nihao
|
|
219
|
+
// </div>
|
|
220
|
+
// ),
|
|
221
|
+
// addonAfter: (
|
|
222
|
+
// <div style={{ height: 200, backgroundColor: "red" }}>
|
|
223
|
+
// wohao
|
|
224
|
+
// </div>
|
|
225
|
+
// ),
|
|
226
|
+
// initValueProvider: (...data) => {
|
|
227
|
+
// console.log("initValueProvider");
|
|
228
|
+
// return {
|
|
229
|
+
// text: "你好",
|
|
230
|
+
// };
|
|
231
|
+
// },
|
|
232
|
+
// },
|
|
233
|
+
// },
|
|
217
234
|
]}
|
|
218
235
|
dismissOnPressEnter={false}
|
|
219
236
|
labelWidth={88}
|
|
220
237
|
form={form}
|
|
221
238
|
initialValues={{
|
|
222
|
-
|
|
239
|
+
richEditor: "1312312",
|
|
223
240
|
}}
|
|
224
241
|
labelAlign={"left"}
|
|
225
242
|
onFinish={(value) => {
|
|
@@ -246,15 +263,15 @@ export default () => {
|
|
|
246
263
|
>
|
|
247
264
|
点我
|
|
248
265
|
</div>
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
266
|
+
<div
|
|
267
|
+
onClick={() => {
|
|
268
|
+
form.setFieldsValue({
|
|
269
|
+
wz: "你好",
|
|
270
|
+
});
|
|
271
|
+
}}
|
|
272
|
+
>
|
|
273
|
+
设置
|
|
274
|
+
</div>
|
|
258
275
|
<div
|
|
259
276
|
onClick={() => {
|
|
260
277
|
form.submit();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Button, Input} from "antd";
|
|
1
|
+
import { Button, Input } from "antd";
|
|
2
2
|
import {
|
|
3
3
|
HModalForm,
|
|
4
4
|
useHDialogForm,
|
|
@@ -11,12 +11,16 @@ import { ShowParamsModal } from "@/components/DialogForm/modal";
|
|
|
11
11
|
const Test = (props) => {
|
|
12
12
|
return <HUrlUpload {...props} />;
|
|
13
13
|
};
|
|
14
|
-
const ITest=()=>{
|
|
15
|
-
|
|
14
|
+
const ITest = () => {
|
|
15
|
+
return (
|
|
16
|
+
<Input
|
|
17
|
+
onPressEnter={(e) => {
|
|
16
18
|
e.preventDefault();
|
|
17
|
-
console.log("ITest")
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
console.log("ITest");
|
|
20
|
+
}}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
20
24
|
const data = [
|
|
21
25
|
{
|
|
22
26
|
label: "输入框",
|
|
@@ -207,12 +211,12 @@ export default () => {
|
|
|
207
211
|
destroyOnClose={false}
|
|
208
212
|
autoClear={false}
|
|
209
213
|
onOk={() => {
|
|
210
|
-
|
|
214
|
+
console.log("fff");
|
|
211
215
|
return false;
|
|
212
216
|
}}
|
|
213
217
|
labelAlign={"left"}
|
|
214
218
|
request={(values, params) => {
|
|
215
|
-
|
|
219
|
+
console.log(values, params);
|
|
216
220
|
return Promise.resolve();
|
|
217
221
|
}}
|
|
218
222
|
dialogForm={modalForm}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { HSelect } from "../../components";
|
|
1
|
+
import { HSelect ,HTagSelect} from "../../components";
|
|
2
2
|
import { Form, Space } from "antd";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
export default () => {
|
|
5
5
|
const [selectVal, setSelectVal] = useState([{ name: "11", id: -100 }]);
|
|
6
6
|
const [op, setOp] = useState([{ label: "1", value: 1 }]);
|
|
7
7
|
const [val, setVal] = useState([2, 3]);
|
|
8
|
+
const [tagVal, setTagVal] = useState([]);
|
|
8
9
|
|
|
9
10
|
return (
|
|
10
11
|
<Space size={"large"} direction={"vertical"} style={{ width: "100%" }}>
|
|
@@ -39,13 +40,33 @@ export default () => {
|
|
|
39
40
|
/>
|
|
40
41
|
<HSelect
|
|
41
42
|
value={val}
|
|
42
|
-
onChange={(v) => {
|
|
43
|
-
|
|
43
|
+
onChange={(v,opts) => {
|
|
44
|
+
console.log(v,opts)
|
|
44
45
|
setVal(v);
|
|
45
46
|
}}
|
|
46
47
|
mode="multiple"
|
|
47
|
-
options={op}
|
|
48
48
|
/>
|
|
49
|
+
<HTagSelect
|
|
50
|
+
value={tagVal}
|
|
51
|
+
collapseProps={{
|
|
52
|
+
defaultActiveKey:'1'
|
|
53
|
+
}}
|
|
54
|
+
request={()=>{
|
|
55
|
+
return new Promise((resolve, reject)=>{
|
|
56
|
+
setTimeout(()=>{
|
|
57
|
+
resolve([])
|
|
58
|
+
},3000)
|
|
59
|
+
})
|
|
60
|
+
}}
|
|
61
|
+
onChange={(value, opts)=>{
|
|
62
|
+
setTagVal(value);
|
|
63
|
+
console.log(value,opts)
|
|
64
|
+
}}
|
|
65
|
+
fieldNames={{
|
|
66
|
+
label:"value",
|
|
67
|
+
value:"key"
|
|
68
|
+
}}
|
|
69
|
+
/>
|
|
49
70
|
<div
|
|
50
71
|
onClick={() => {
|
|
51
72
|
setOp([{ label: "2", value: 2 }]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Button, Space} from "antd";
|
|
1
|
+
import { Button, Space } from "antd";
|
|
2
2
|
import { HUpload, HUrlUpload } from "../../components";
|
|
3
3
|
import React, { useState } from "react";
|
|
4
4
|
import { MediaTypeEnum } from "../../components/Upload/enums";
|
|
@@ -33,7 +33,7 @@ export default () => {
|
|
|
33
33
|
}}
|
|
34
34
|
onChange={setFiles1}
|
|
35
35
|
>
|
|
36
|
-
|
|
36
|
+
<Button>按钮</Button>
|
|
37
37
|
</HUpload>
|
|
38
38
|
<HUrlUpload
|
|
39
39
|
inputHelper="测试"
|