ztxkui 4.2.18-97 → 4.2.18-99
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/dist/UploadDemo.js
CHANGED
|
@@ -301,7 +301,7 @@ function UploadDemo() {
|
|
|
301
301
|
rotationSlider: true,
|
|
302
302
|
aspect: 4 / 5,
|
|
303
303
|
quality: 1,
|
|
304
|
-
}, maxSize: 2 * 1024 * 1024, minSize:
|
|
304
|
+
}, maxSize: 2 * 1024 * 1024, minSize: 20 * 1024, maxResolution: { width: 960, height: 1200 }, minResolution: { width: 480, height: 600 }, ztAccept: ['.jpg', '.jpeg'], listType: "picture-card", method: "post", headers: {
|
|
305
305
|
'Zmdms-Auth': token,
|
|
306
306
|
}, showUploadList: {
|
|
307
307
|
showPreviewIcon: true,
|
|
@@ -283,9 +283,18 @@ var Upload = function (props) {
|
|
|
283
283
|
(dimensions.width > maxResolution.width ||
|
|
284
284
|
dimensions.height > maxResolution.height)) {
|
|
285
285
|
if (needMessage) {
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
286
|
+
if (isCrop) {
|
|
287
|
+
message.warning(i18next.t('裁剪后的图片分辨率宽*高:{{currentResolution}},超出最大值{{maxResolution}}!', {
|
|
288
|
+
maxResolution: maxResolution.width + 'x' + maxResolution.height,
|
|
289
|
+
currentResolution: dimensions.width + 'x' + dimensions.height,
|
|
290
|
+
}));
|
|
291
|
+
}
|
|
292
|
+
else {
|
|
293
|
+
message.warning(i18next.t('图片分辨率超出最大值宽*高 {{maxResolution}}!当前图片分辨率:{{currentResolution}}', {
|
|
294
|
+
maxResolution: maxResolution.width + 'x' + maxResolution.height,
|
|
295
|
+
currentResolution: dimensions.width + 'x' + dimensions.height,
|
|
296
|
+
}));
|
|
297
|
+
}
|
|
289
298
|
}
|
|
290
299
|
return AntUpload.LIST_IGNORE;
|
|
291
300
|
}
|
|
@@ -293,9 +302,18 @@ var Upload = function (props) {
|
|
|
293
302
|
(dimensions.width < minResolution.width ||
|
|
294
303
|
dimensions.height < minResolution.height)) {
|
|
295
304
|
if (needMessage) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
305
|
+
if (isCrop) {
|
|
306
|
+
message.warning(i18next.t('裁剪后的图片分辨率宽*高:{{currentResolution}},低于最小值{{minResolution}}!', {
|
|
307
|
+
minResolution: minResolution.width + 'x' + minResolution.height,
|
|
308
|
+
currentResolution: dimensions.width + 'x' + dimensions.height,
|
|
309
|
+
}));
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
message.warning(i18next.t('图片分辨率低于最小值宽*高 {{minResolution}}!当前图片分辨率:{{currentResolution}}', {
|
|
313
|
+
minResolution: minResolution.width + 'x' + minResolution.height,
|
|
314
|
+
currentResolution: dimensions.width + 'x' + dimensions.height,
|
|
315
|
+
}));
|
|
316
|
+
}
|
|
299
317
|
}
|
|
300
318
|
return AntUpload.LIST_IGNORE;
|
|
301
319
|
}
|
|
@@ -315,8 +333,12 @@ var Upload = function (props) {
|
|
|
315
333
|
var MAXSIZE = maxSize ? maxSize : 1024 * 1024 * 100;
|
|
316
334
|
var MAXSIZESTR = maxSizeStr ? maxSizeStr : transformFileSize(MAXSIZE);
|
|
317
335
|
setMaxSizeTransStr(MAXSIZESTR);
|
|
318
|
-
var MINSIZE = minSize ? minSize :
|
|
319
|
-
var MINSIZSTR = minSizeStr
|
|
336
|
+
var MINSIZE = minSize ? minSize : null;
|
|
337
|
+
var MINSIZSTR = minSizeStr
|
|
338
|
+
? minSizeStr
|
|
339
|
+
: MINSIZE
|
|
340
|
+
? transformFileSize(MINSIZE)
|
|
341
|
+
: '';
|
|
320
342
|
if (!ACCEPT.includes(fileNameSuffix)) {
|
|
321
343
|
message.warning(i18next.t('不支持 {{fileNameSuffix}} 文件格式!', {
|
|
322
344
|
fileNameSuffix: fileNameSuffix,
|
|
@@ -328,11 +350,33 @@ var Upload = function (props) {
|
|
|
328
350
|
return AntUpload.LIST_IGNORE;
|
|
329
351
|
}
|
|
330
352
|
if (fileSize > MAXSIZE) {
|
|
331
|
-
|
|
353
|
+
if (isCrop) {
|
|
354
|
+
message.warning(i18next.t('裁剪后的图片大小:{{fileSizeStr}},超出最大值{{MAXSIZESTR}}!', {
|
|
355
|
+
MAXSIZESTR: MAXSIZESTR,
|
|
356
|
+
fileSizeStr: transformFileSize(fileSize),
|
|
357
|
+
}));
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
message.warning(i18next.t('文件超出 {{MAXSIZESTR}}!当前文件大小:{{fileSizeStr}}', {
|
|
361
|
+
MAXSIZESTR: MAXSIZESTR,
|
|
362
|
+
fileSizeStr: transformFileSize(fileSize),
|
|
363
|
+
}));
|
|
364
|
+
}
|
|
332
365
|
return AntUpload.LIST_IGNORE;
|
|
333
366
|
}
|
|
334
|
-
if (fileSize < MINSIZE) {
|
|
335
|
-
|
|
367
|
+
if (MINSIZE && fileSize < MINSIZE) {
|
|
368
|
+
if (isCrop) {
|
|
369
|
+
message.warning(i18next.t('裁剪后的图片大小:{{fileSizeStr}},低于最小值{{MINSIZSTR}}!', {
|
|
370
|
+
MINSIZSTR: MINSIZSTR,
|
|
371
|
+
fileSizeStr: transformFileSize(fileSize),
|
|
372
|
+
}));
|
|
373
|
+
}
|
|
374
|
+
else {
|
|
375
|
+
message.warning(i18next.t('文件小于 {{MINSIZSTR}}!当前文件大小:{{fileSizeStr}}', {
|
|
376
|
+
MINSIZSTR: MINSIZSTR,
|
|
377
|
+
fileSizeStr: transformFileSize(fileSize),
|
|
378
|
+
}));
|
|
379
|
+
}
|
|
336
380
|
return AntUpload.LIST_IGNORE;
|
|
337
381
|
}
|
|
338
382
|
// 如果是图片,获取文件分辨率
|
|
@@ -347,10 +391,6 @@ var Upload = function (props) {
|
|
|
347
391
|
var onFileChange = function (info) {
|
|
348
392
|
var file = info.file, fileList = info.fileList;
|
|
349
393
|
setFileList(fileList);
|
|
350
|
-
var originalFile = file.originFileObj;
|
|
351
|
-
if (originalFile && listType === 'picture-card') {
|
|
352
|
-
fileResolution(originalFile, false);
|
|
353
|
-
}
|
|
354
394
|
callback &&
|
|
355
395
|
callback(fileList, {
|
|
356
396
|
currentResolution: currentResolutionRef.current,
|
|
@@ -528,24 +568,21 @@ var Upload = function (props) {
|
|
|
528
568
|
}))) : maxCount && fileList.length >= maxCount && !isDirect ? null : (React.createElement("div", null,
|
|
529
569
|
React.createElement(UploadOutlined, { style: { fontSize: 18 } }),
|
|
530
570
|
React.createElement("div", { style: { marginTop: 8 } }, fileBtnText || i18next.t('添加图片'))))));
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
571
|
+
/**裁剪模式下,选择图片时只校验文件类型,裁剪完成后再校验大小和分辨率 */
|
|
572
|
+
var beforeCropUpload = function (file, _fileList) {
|
|
573
|
+
var fileName = file.name, fileSize = file.size;
|
|
574
|
+
var fileNameSuffix = getFileSuffix(fileName);
|
|
575
|
+
if (!ACCEPT.includes(fileNameSuffix)) {
|
|
576
|
+
message.warning(i18next.t('不支持 {{fileNameSuffix}} 文件格式!', {
|
|
577
|
+
fileNameSuffix: fileNameSuffix,
|
|
578
|
+
}));
|
|
579
|
+
return AntUpload.LIST_IGNORE;
|
|
535
580
|
}
|
|
536
|
-
|
|
537
|
-
.
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
}
|
|
542
|
-
else {
|
|
543
|
-
return true;
|
|
544
|
-
}
|
|
545
|
-
})
|
|
546
|
-
.catch(function () {
|
|
547
|
-
return true;
|
|
548
|
-
});
|
|
581
|
+
if (fileSize === 0) {
|
|
582
|
+
message.warning(i18next.t('不能上传空文件!', {}));
|
|
583
|
+
return AntUpload.LIST_IGNORE;
|
|
584
|
+
}
|
|
585
|
+
return true;
|
|
549
586
|
};
|
|
550
587
|
return (React.createElement(React.Fragment, null,
|
|
551
588
|
showAllDeleteloadBtnInner && !showUploadBtn && (React.createElement(Button, { type: "primary", style: { marginRight: '10px' }, onClick: onAllDeleteHandle }, i18next.t('批量删除'))),
|
package/dist/locales/en-US.json
CHANGED
|
@@ -429,6 +429,10 @@
|
|
|
429
429
|
"不支持 {{fileNameSuffix}} 文件格式!": "{{fileName Suffix}} file format is not supported!",
|
|
430
430
|
"不能上传空文件!": "Cannot upload an empty file!",
|
|
431
431
|
"文件超出 {{MAXSIZESTR}}!": "File exceeds {{MAX SIZESTR}}!",
|
|
432
|
+
"文件超出 {{MAXSIZESTR}}!当前文件大小:{{fileSizeStr}}": "File exceeds {{MAX SIZESTR}}! Current file size: {{fileSizeStr}}",
|
|
433
|
+
"裁剪后的图片大小:{{fileSizeStr}},超出最大值{{MAXSIZESTR}}!": "Cropped image size: {{fileSizeStr}} exceeds the maximum value {{MAXSIZESTR}}!",
|
|
434
|
+
"文件小于 {{MINSIZSTR}}!当前文件大小:{{fileSizeStr}}": "File is {{MINSIZSTR}}! Current file size: {{fileSizeStr}}",
|
|
435
|
+
"裁剪后的图片大小:{{fileSizeStr}},低于最小值{{MINSIZSTR}}!": "Cropped image size: {{fileSizeStr}} is below the minimum value {{MINSIZSTR}}!",
|
|
432
436
|
"请选择需要删除得附件!": "Please select the attachment to be deleted!",
|
|
433
437
|
"批量下载": "Batch download",
|
|
434
438
|
"批量删除": "Mass delete",
|
|
@@ -816,5 +820,9 @@
|
|
|
816
820
|
"反选": "Invert selection",
|
|
817
821
|
"请至少保留一个展示项!": "Please keep at least one display item!",
|
|
818
822
|
"图片分辨率低于最小值宽*高 {{minResolution}}!": "Image resolution is below the minimum value width*height {{minResolution}}!",
|
|
819
|
-
"图片分辨率超出最大值宽*高 {{maxResolution}}!": "Image resolution is above the maximum value width*height {{maxResolution}}!"
|
|
823
|
+
"图片分辨率超出最大值宽*高 {{maxResolution}}!": "Image resolution is above the maximum value width*height {{maxResolution}}!",
|
|
824
|
+
"图片分辨率超出最大值宽*高 {{maxResolution}}!当前图片分辨率:{{currentResolution}}": "Image resolution is above the maximum value width*height {{maxResolution}}! Current image resolution: {{currentResolution}}",
|
|
825
|
+
"图片分辨率低于最小值宽*高 {{minResolution}}!当前图片分辨率:{{currentResolution}}": "Image resolution is below the minimum value width*height {{minResolution}}! Current image resolution: {{currentResolution}}",
|
|
826
|
+
"裁剪后的图片分辨率宽*高:{{currentResolution}},超出最大值{{maxResolution}}!": "Cropped image resolution: {{currentResolution}} exceeds the maximum value {{maxResolution}}!",
|
|
827
|
+
"裁剪后的图片分辨率宽*高:{{currentResolution}},低于最小值{{minResolution}}!": "Cropped image resolution: {{currentResolution}} is below the minimum value {{minResolution}}!"
|
|
820
828
|
}
|
package/dist/locales/zh-CN.json
CHANGED
|
@@ -429,6 +429,10 @@
|
|
|
429
429
|
"不支持 {{fileNameSuffix}} 文件格式!": "不支持 {{fileNameSuffix}} 文件格式!",
|
|
430
430
|
"不能上传空文件!": "不能上传空文件!",
|
|
431
431
|
"文件超出 {{MAXSIZESTR}}!": "文件超出 {{MAXSIZESTR}}!",
|
|
432
|
+
"文件超出 {{MAXSIZESTR}}!当前文件大小:{{fileSizeStr}}": "文件超出 {{MAXSIZESTR}}!当前文件大小:{{fileSizeStr}}",
|
|
433
|
+
"裁剪后的图片大小:{{fileSizeStr}},超出最大值{{MAXSIZESTR}}!": "裁剪后的图片大小:{{fileSizeStr}},超出最大值{{MAXSIZESTR}}!",
|
|
434
|
+
"文件小于 {{MINSIZSTR}}!当前文件大小:{{fileSizeStr}}": "文件小于 {{MINSIZSTR}}!当前文件大小:{{fileSizeStr}}",
|
|
435
|
+
"裁剪后的图片大小:{{fileSizeStr}},低于最小值{{MINSIZSTR}}!": "裁剪后的图片大小:{{fileSizeStr}},低于最小值{{MINSIZSTR}}!",
|
|
432
436
|
"请选择需要删除得附件!": "请选择需要删除得附件!",
|
|
433
437
|
"批量下载": "批量下载",
|
|
434
438
|
"批量删除": "批量删除",
|
|
@@ -816,5 +820,9 @@
|
|
|
816
820
|
"反选": "反选",
|
|
817
821
|
"请至少保留一个展示项!": "请至少保留一个展示项!",
|
|
818
822
|
"图片分辨率低于最小值宽*高 {{minResolution}}!": "图片分辨率低于最小值宽*高 {{minResolution}}!",
|
|
819
|
-
"图片分辨率超出最大值宽*高 {{maxResolution}}!": "图片分辨率超出最大值宽*高 {{maxResolution}}!"
|
|
823
|
+
"图片分辨率超出最大值宽*高 {{maxResolution}}!": "图片分辨率超出最大值宽*高 {{maxResolution}}!",
|
|
824
|
+
"图片分辨率超出最大值宽*高 {{maxResolution}}!当前图片分辨率:{{currentResolution}}": "图片分辨率超出最大值宽*高 {{maxResolution}}!当前图片分辨率:{{currentResolution}}",
|
|
825
|
+
"图片分辨率低于最小值宽*高 {{minResolution}}!当前图片分辨率:{{currentResolution}}": "图片分辨率低于最小值宽*高 {{minResolution}}!当前图片分辨率:{{currentResolution}}",
|
|
826
|
+
"裁剪后的图片分辨率宽*高:{{currentResolution}},超出最大值{{maxResolution}}!": "裁剪后的图片分辨率宽*高:{{currentResolution}},超出最大值{{maxResolution}}!",
|
|
827
|
+
"裁剪后的图片分辨率宽*高:{{currentResolution}},低于最小值{{minResolution}}!": "裁剪后的图片分辨率宽*高:{{currentResolution}},低于最小值{{minResolution}}!"
|
|
820
828
|
}
|