zy-react-library 1.1.1 → 1.1.2
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/README.md +5 -1
- package/components/Cascader/Area/index.js +11 -11
- package/components/Cascader/Basic/index.js +23 -30
- package/components/Cascader/Dictionary/index.js +42 -42
- package/components/Cascader/Industry/index.js +12 -11
- package/components/Editor/index.js +43 -63
- package/components/FormBuilder/FormBuilder.js +97 -87
- package/components/FormBuilder/FormItemsRenderer.js +579 -581
- package/components/FormBuilder/index.js +5 -3
- package/components/HeaderBack/index.js +39 -32
- package/components/HiddenInfo/gwj/index.js +507 -439
- package/components/Icon/AddIcon/index.js +6 -6
- package/components/Icon/BackIcon/index.js +6 -6
- package/components/Icon/DeleteIcon/index.js +6 -6
- package/components/Icon/DownloadIcon/index.js +6 -6
- package/components/Icon/EditIcon/index.js +6 -6
- package/components/Icon/ExportIcon/index.js +6 -6
- package/components/Icon/ImportIcon/index.js +6 -6
- package/components/Icon/LocationIcon/index.js +6 -6
- package/components/Icon/PrintIcon/index.js +6 -6
- package/components/Icon/ResetIcon/index.js +6 -6
- package/components/Icon/SearchIcon/index.js +6 -6
- package/components/Icon/VideoIcon/index.js +6 -6
- package/components/Icon/ViewIcon/index.js +6 -6
- package/components/ImportFile/index.js +94 -91
- package/components/LeftTree/Area/index.js +15 -15
- package/components/LeftTree/Basic/index.js +54 -65
- package/components/LeftTree/Department/Gwj/index.js +29 -32
- package/components/LeftTree/Dictionary/index.js +42 -42
- package/components/Map/MapSelector.js +280 -254
- package/components/Map/index.js +90 -77
- package/components/Page/index.js +43 -34
- package/components/Pdf/index.js +92 -90
- package/components/PreviewImg/index.js +26 -32
- package/components/PreviewPdf/index.js +78 -86
- package/components/Search/index.js +147 -141
- package/components/Select/Basic/index.js +70 -76
- package/components/Select/Dictionary/index.js +42 -42
- package/components/Select/Personnel/Gwj/index.js +45 -49
- package/components/SelectCreate/index.js +33 -40
- package/components/SelectTree/Area/index.js +11 -17
- package/components/SelectTree/Basic/index.js +105 -102
- package/components/SelectTree/Department/Gwj/index.js +40 -46
- package/components/SelectTree/Dictionary/index.js +42 -42
- package/components/SelectTree/HiddenLevel/Gwj/index.js +33 -35
- package/components/SelectTree/HiddenPart/Gwj/index.js +16 -19
- package/components/SelectTree/Industry/index.js +12 -18
- package/components/Signature/index.js +68 -62
- package/components/Table/index.js +77 -73
- package/components/Table/index.less +7 -1
- package/components/TooltipPreviewImg/index.js +28 -27
- package/components/Upload/index.js +229 -275
- package/components/Video/AliPlayer.js +182 -160
- package/components/Video/index.js +71 -90
- package/css/common.less +4 -0
- package/enum/dictionary/index.js +5 -3
- package/enum/formItemRender/index.js +37 -35
- package/enum/hidden/gwj/index.js +65 -26
- package/enum/uploadFile/gwj/index.js +166 -84
- package/hooks/useDeleteFile/index.js +24 -30
- package/hooks/useDictionary/index.js +28 -30
- package/hooks/useDownloadBlob/index.js +78 -77
- package/hooks/useDownloadFile/index.js +76 -79
- package/hooks/useGetFile/index.js +32 -32
- package/hooks/useGetUrlQuery/index.js +1 -2
- package/hooks/useGetUserInfo/index.js +19 -26
- package/hooks/useIdle/index.js +9 -11
- package/hooks/useImportFile/index.js +30 -28
- package/hooks/useIsExistenceDuplicateSelection/index.js +25 -18
- package/hooks/useTable/index.js +49 -38
- package/hooks/useUploadFile/index.js +142 -147
- package/hooks/useUrlQueryCriteria/index.js +20 -13
- package/package.json +14 -1
- package/regular/index.js +34 -39
- package/utils/index.js +515 -511
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import PreviewImg from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const renderContent = () => {
|
|
11
|
-
return (
|
|
12
|
-
files
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { Tooltip, Tag } from 'antd';
|
|
2
|
+
import PreviewImg from '../PreviewImg/index.js';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
|
|
5
|
+
const TooltipPreviewImg = props => {
|
|
6
|
+
const {
|
|
7
|
+
files = [],
|
|
8
|
+
fileUrlKey = "filePath"
|
|
9
|
+
} = props;
|
|
10
|
+
const renderContent = () => {
|
|
11
|
+
return files.length > 0 ? /*#__PURE__*/jsx(PreviewImg, {
|
|
12
|
+
files: files,
|
|
13
|
+
fileUrlKey: fileUrlKey
|
|
14
|
+
}) : /*#__PURE__*/jsx("span", {
|
|
15
|
+
children: "\u6682\u65E0\u56FE\u7247"
|
|
16
|
+
});
|
|
17
|
+
};
|
|
18
|
+
return /*#__PURE__*/jsx(Tooltip, {
|
|
19
|
+
placement: "top",
|
|
20
|
+
title: renderContent(),
|
|
21
|
+
children: /*#__PURE__*/jsx(Tag, {
|
|
22
|
+
children: "\u9884\u89C8"
|
|
23
|
+
})
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
TooltipPreviewImg.displayName = "TooltipPreviewImg";
|
|
27
|
+
|
|
28
|
+
export { TooltipPreviewImg as default };
|
|
@@ -1,275 +1,229 @@
|
|
|
1
|
-
import { PlusOutlined,
|
|
2
|
-
import { Upload as
|
|
3
|
-
import { useState } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
if (
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (externalAccept === "*"
|
|
65
|
-
|
|
66
|
-
if (
|
|
67
|
-
|
|
68
|
-
return
|
|
69
|
-
};
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
|
|
76
|
-
if (isImageType)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (
|
|
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
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
);
|
|
231
|
-
|
|
232
|
-
return (
|
|
233
|
-
<>
|
|
234
|
-
<AntUpload
|
|
235
|
-
fileList={value}
|
|
236
|
-
multiple={multiple}
|
|
237
|
-
maxCount={maxCount}
|
|
238
|
-
listType={listType}
|
|
239
|
-
accept={accept}
|
|
240
|
-
onChange={handleChange}
|
|
241
|
-
onPreview={handlePreview}
|
|
242
|
-
onRemove={handleRemove}
|
|
243
|
-
beforeUpload={handleBeforeUpload}
|
|
244
|
-
{...restProps}
|
|
245
|
-
>
|
|
246
|
-
{value.length >= maxCount ? null : uploadButton}
|
|
247
|
-
</AntUpload>
|
|
248
|
-
{
|
|
249
|
-
showTip
|
|
250
|
-
? (getTipText()) && (
|
|
251
|
-
<div style={{ marginTop: 10, color: "#ff4d4f" }}>
|
|
252
|
-
{getTipText()}
|
|
253
|
-
</div>
|
|
254
|
-
)
|
|
255
|
-
: null
|
|
256
|
-
}
|
|
257
|
-
<Modal
|
|
258
|
-
open={previewVisible}
|
|
259
|
-
title="查看图片"
|
|
260
|
-
footer={null}
|
|
261
|
-
onCancel={handleCancel}
|
|
262
|
-
>
|
|
263
|
-
<img
|
|
264
|
-
alt="preview"
|
|
265
|
-
style={{ width: "100%", objectFit: "scale-down" }}
|
|
266
|
-
src={previewImage}
|
|
267
|
-
/>
|
|
268
|
-
</Modal>
|
|
269
|
-
</>
|
|
270
|
-
);
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
Upload.displayName = "Upload";
|
|
274
|
-
|
|
275
|
-
export default Upload;
|
|
1
|
+
import { PlusOutlined, VideoCameraAddOutlined, UploadOutlined } from '@ant-design/icons';
|
|
2
|
+
import { Upload as Upload$1, Modal, Button, message } from 'antd';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
5
|
+
|
|
6
|
+
const Upload = props => {
|
|
7
|
+
const {
|
|
8
|
+
value = [],
|
|
9
|
+
onChange,
|
|
10
|
+
onPreview,
|
|
11
|
+
onRemove,
|
|
12
|
+
onGetRemoveFile,
|
|
13
|
+
beforeUpload,
|
|
14
|
+
maxCount: externalMaxCount,
|
|
15
|
+
listType: externalListType,
|
|
16
|
+
accept: externalAccept,
|
|
17
|
+
ratio = "",
|
|
18
|
+
showTip = true,
|
|
19
|
+
multiple = true,
|
|
20
|
+
size: externalSize,
|
|
21
|
+
tipContent,
|
|
22
|
+
uploadButtonText: externalUploadButtonText,
|
|
23
|
+
fileType: externalFileType,
|
|
24
|
+
...restProps
|
|
25
|
+
} = props;
|
|
26
|
+
const [previewVisible, setPreviewVisible] = useState(false);
|
|
27
|
+
const [previewImage, setPreviewImage] = useState("");
|
|
28
|
+
|
|
29
|
+
// 预设的文件格式
|
|
30
|
+
const imageAccept = ".jpg,.jpeg,.png";
|
|
31
|
+
const documentAccept = ".pdf,.doc,.docx";
|
|
32
|
+
const videoAccept = ".mp4";
|
|
33
|
+
|
|
34
|
+
// 根据accept自动判断文件类型
|
|
35
|
+
const getAutoFileType = () => {
|
|
36
|
+
if (externalAccept) {
|
|
37
|
+
if (externalAccept === "*") return "document";
|
|
38
|
+
const acceptList = externalAccept.split(",");
|
|
39
|
+
if (acceptList.some(format => videoAccept.split(",").includes(format))) return "video";
|
|
40
|
+
if (acceptList.some(format => documentAccept.split(",").includes(format))) return "document";
|
|
41
|
+
if (acceptList.some(format => imageAccept.split(",").includes(format))) return "image";
|
|
42
|
+
return "document";
|
|
43
|
+
}
|
|
44
|
+
return "image";
|
|
45
|
+
};
|
|
46
|
+
const fileType = externalFileType || getAutoFileType();
|
|
47
|
+
|
|
48
|
+
// 文件类型判断
|
|
49
|
+
const isImageType = fileType === "image";
|
|
50
|
+
const isVideoType = fileType === "video";
|
|
51
|
+
const isDocumentType = fileType === "document";
|
|
52
|
+
|
|
53
|
+
// 获取listType
|
|
54
|
+
const getListType = () => {
|
|
55
|
+
if (externalListType) return externalListType;
|
|
56
|
+
if (externalAccept === "*") return "text";
|
|
57
|
+
if (fileType === "image") return "picture-card";
|
|
58
|
+
return "text";
|
|
59
|
+
};
|
|
60
|
+
const listType = getListType();
|
|
61
|
+
|
|
62
|
+
// 获取文件格式
|
|
63
|
+
const getAccept = () => {
|
|
64
|
+
if (externalAccept) return externalAccept === "*" ? "" : externalAccept;
|
|
65
|
+
if (isImageType) return imageAccept;
|
|
66
|
+
if (isVideoType) return videoAccept;
|
|
67
|
+
if (isDocumentType) return documentAccept;
|
|
68
|
+
return imageAccept;
|
|
69
|
+
};
|
|
70
|
+
const accept = getAccept();
|
|
71
|
+
|
|
72
|
+
// 获取默认上传数量
|
|
73
|
+
const getMaxCount = () => {
|
|
74
|
+
if (externalMaxCount) return externalMaxCount;
|
|
75
|
+
if (isVideoType) return 1;
|
|
76
|
+
if (isImageType) return 4;
|
|
77
|
+
if (isDocumentType) return 4;
|
|
78
|
+
return 1;
|
|
79
|
+
};
|
|
80
|
+
const maxCount = getMaxCount();
|
|
81
|
+
|
|
82
|
+
// 获取默认文件大小
|
|
83
|
+
const getSize = () => {
|
|
84
|
+
if (externalSize) return externalSize;
|
|
85
|
+
if (isVideoType) return 100;
|
|
86
|
+
return 0;
|
|
87
|
+
};
|
|
88
|
+
const size = getSize();
|
|
89
|
+
|
|
90
|
+
// 上传按钮文字
|
|
91
|
+
const uploadButtonText = externalUploadButtonText || (isVideoType ? "上传视频" : "上传附件");
|
|
92
|
+
|
|
93
|
+
// 文件格式提示
|
|
94
|
+
const acceptTip = accept.replace(/\./g, "").split(",").join("、");
|
|
95
|
+
|
|
96
|
+
// 生成提示信息
|
|
97
|
+
const getTipText = () => {
|
|
98
|
+
if (tipContent) return tipContent;
|
|
99
|
+
const tips = [`最多上传${maxCount}个文件`, accept ? `并且只能上传${acceptTip}格式的文件` : "可以上传任意格式的文件", size ? `文件大小不能超过${size}M` : "", ratio ? `只能上传${ratio}分辨率的图片` : ""].filter(Boolean);
|
|
100
|
+
return `${tips.join(",")}。`;
|
|
101
|
+
};
|
|
102
|
+
const handleBeforeUpload = (file, fileList) => {
|
|
103
|
+
if (beforeUpload) return beforeUpload(file, fileList);
|
|
104
|
+
return false;
|
|
105
|
+
};
|
|
106
|
+
|
|
107
|
+
// 文件状态改变
|
|
108
|
+
const handleChange = ({
|
|
109
|
+
file,
|
|
110
|
+
fileList
|
|
111
|
+
}) => {
|
|
112
|
+
const acceptList = accept ? accept.split(",") : [];
|
|
113
|
+
const ratioArr = ratio ? ratio.split("*") : [];
|
|
114
|
+
const suffix = file.name.substring(file.name.lastIndexOf("."), file.name.length);
|
|
115
|
+
const maxSize = size * 1024 * 1024;
|
|
116
|
+
|
|
117
|
+
// 验证文件格式
|
|
118
|
+
if (acceptList.length > 0 && !acceptList.includes(suffix)) {
|
|
119
|
+
message.warning(`只能上传${acceptTip}格式的文件`);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 验证文件大小
|
|
124
|
+
if (maxSize && file.size > maxSize) {
|
|
125
|
+
message.warning(`文件大小不能超过${size}M`);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// 验证图片分辨率
|
|
130
|
+
if (ratioArr.length === 2 && file.type?.startsWith("image/")) {
|
|
131
|
+
const validateImageResolution = imageUrl => {
|
|
132
|
+
const img = new Image();
|
|
133
|
+
img.onload = () => {
|
|
134
|
+
if (img.width !== +ratioArr[0] || img.height !== +ratioArr[1]) {
|
|
135
|
+
message.warning(`只能上传${ratio}分辨率的图片`);
|
|
136
|
+
const filtered = fileList.filter(item => item.uid !== file.uid);
|
|
137
|
+
onChange?.(filtered);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
onChange?.(fileList);
|
|
141
|
+
};
|
|
142
|
+
img.src = imageUrl;
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
// 如果有现成的URL则直接使用,否则使用FileReader读取本地文件
|
|
146
|
+
if (file.url) {
|
|
147
|
+
validateImageResolution(file.url);
|
|
148
|
+
} else {
|
|
149
|
+
const reader = new FileReader();
|
|
150
|
+
reader.onload = e => {
|
|
151
|
+
validateImageResolution(e.target.result);
|
|
152
|
+
};
|
|
153
|
+
reader.readAsDataURL(file);
|
|
154
|
+
}
|
|
155
|
+
} else {
|
|
156
|
+
onChange?.(fileList);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// 删除文件
|
|
161
|
+
const handleRemove = file => {
|
|
162
|
+
if (!file.originFileObj) onGetRemoveFile?.(file);
|
|
163
|
+
return onRemove?.(file);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
// 预览文件
|
|
167
|
+
const handlePreview = file => {
|
|
168
|
+
if (isImageType) {
|
|
169
|
+
setPreviewImage(file.url || file.thumbUrl);
|
|
170
|
+
setPreviewVisible(true);
|
|
171
|
+
}
|
|
172
|
+
onPreview?.(file);
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// 关闭预览
|
|
176
|
+
const handleCancel = () => {
|
|
177
|
+
setPreviewVisible(false);
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
// 上传按钮
|
|
181
|
+
const uploadButton = isImageType ? /*#__PURE__*/jsx("div", {
|
|
182
|
+
children: /*#__PURE__*/jsx(PlusOutlined, {
|
|
183
|
+
style: {
|
|
184
|
+
fontSize: 32
|
|
185
|
+
}
|
|
186
|
+
})
|
|
187
|
+
}) : /*#__PURE__*/jsx(Button, {
|
|
188
|
+
type: "primary",
|
|
189
|
+
icon: isVideoType ? /*#__PURE__*/jsx(VideoCameraAddOutlined, {}) : /*#__PURE__*/jsx(UploadOutlined, {}),
|
|
190
|
+
children: uploadButtonText
|
|
191
|
+
});
|
|
192
|
+
return /*#__PURE__*/jsxs(Fragment, {
|
|
193
|
+
children: [/*#__PURE__*/jsx(Upload$1, {
|
|
194
|
+
fileList: value,
|
|
195
|
+
multiple: multiple,
|
|
196
|
+
maxCount: maxCount,
|
|
197
|
+
listType: listType,
|
|
198
|
+
accept: accept,
|
|
199
|
+
onChange: handleChange,
|
|
200
|
+
onPreview: handlePreview,
|
|
201
|
+
onRemove: handleRemove,
|
|
202
|
+
beforeUpload: handleBeforeUpload,
|
|
203
|
+
...restProps,
|
|
204
|
+
children: value.length >= maxCount ? null : uploadButton
|
|
205
|
+
}), showTip ? getTipText() && /*#__PURE__*/jsx("div", {
|
|
206
|
+
style: {
|
|
207
|
+
marginTop: 10,
|
|
208
|
+
color: "#ff4d4f"
|
|
209
|
+
},
|
|
210
|
+
children: getTipText()
|
|
211
|
+
}) : null, /*#__PURE__*/jsx(Modal, {
|
|
212
|
+
open: previewVisible,
|
|
213
|
+
title: "\u67E5\u770B\u56FE\u7247",
|
|
214
|
+
footer: null,
|
|
215
|
+
onCancel: handleCancel,
|
|
216
|
+
children: /*#__PURE__*/jsx("img", {
|
|
217
|
+
alt: "preview",
|
|
218
|
+
style: {
|
|
219
|
+
width: "100%",
|
|
220
|
+
objectFit: "scale-down"
|
|
221
|
+
},
|
|
222
|
+
src: previewImage
|
|
223
|
+
})
|
|
224
|
+
})]
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
Upload.displayName = "Upload";
|
|
228
|
+
|
|
229
|
+
export { Upload as default };
|