feat(系统): 文件大小限制文案
This commit is contained in:
parent
8da2ebc414
commit
1790bac49b
|
@ -108,6 +108,7 @@
|
|||
isAllScreen: false,
|
||||
cutHeight: 110,
|
||||
allowRepeat: false,
|
||||
sizeUnit: 'MB',
|
||||
});
|
||||
|
||||
const emit = defineEmits(['update:fileList', 'change']);
|
||||
|
@ -141,7 +142,7 @@
|
|||
const maxSize = props.maxSize || appStore.getFileMaxSize;
|
||||
const _maxSize = props.sizeUnit === 'MB' ? maxSize * 1024 * 1024 : maxSize * 1024;
|
||||
if (props.isLimit && file.size > _maxSize) {
|
||||
Message.warning(t('ms.upload.overSize'));
|
||||
Message.warning(t('ms.upload.overSize', { size: maxSize, unit: props.sizeUnit }));
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
if (!props.multiple) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export default {
|
||||
'ms.upload.changeFile': 'Change file',
|
||||
'ms.upload.overSize': 'The file size exceeds the limit, please reselect the file',
|
||||
'ms.upload.overSize': 'The file size limit is {size} {unit}, please reselect the file',
|
||||
'ms.upload.importModalDragText': 'Drag or click this area to select a file',
|
||||
'ms.upload.importModalFileTip': 'Only {type} format files are supported, and the file size does not exceed {size} MB',
|
||||
'ms.upload.waiting': 'Waiting',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
export default {
|
||||
'ms.upload.changeFile': '更改文件',
|
||||
'ms.upload.overSize': '文件大小超出限制,请重新选择文件',
|
||||
'ms.upload.overSize': '文件大小限制为 {size} {unit},请重新选择文件',
|
||||
'ms.upload.importModalDragText': '拖拽或点击此区域选择文件',
|
||||
'ms.upload.importModalFileTip': '只支持 {type} 格式文件,文件大小不超过 {size} MB',
|
||||
'ms.upload.waiting': '等待上传',
|
||||
|
|
|
@ -180,7 +180,9 @@
|
|||
v-model:file-list="fileList"
|
||||
accept="none"
|
||||
:auto-upload="false"
|
||||
:sub-text="acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: 50 })"
|
||||
:sub-text="
|
||||
acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: appStore.getFileMaxSize })
|
||||
"
|
||||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
|
|
|
@ -161,7 +161,9 @@
|
|||
v-model:file-list="fileList"
|
||||
accept="none"
|
||||
:auto-upload="false"
|
||||
:sub-text="acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: 50 })"
|
||||
:sub-text="
|
||||
acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: appStore.getFileMaxSize })
|
||||
"
|
||||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
|
|
|
@ -208,7 +208,9 @@
|
|||
v-model:file-list="fileList"
|
||||
accept="none"
|
||||
:auto-upload="false"
|
||||
:sub-text="acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: 50 })"
|
||||
:sub-text="
|
||||
acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: appStore.getFileMaxSize })
|
||||
"
|
||||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
|
|
|
@ -203,7 +203,9 @@
|
|||
v-model:file-list="fileList"
|
||||
accept="none"
|
||||
:auto-upload="false"
|
||||
:sub-text="acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: 50 })"
|
||||
:sub-text="
|
||||
acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: appStore.getFileMaxSize })
|
||||
"
|
||||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
|
|
|
@ -198,7 +198,9 @@
|
|||
v-model:file-list="fileList"
|
||||
:accept="acceptType"
|
||||
:auto-upload="false"
|
||||
:sub-text="acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: 50 })"
|
||||
:sub-text="
|
||||
acceptType === 'jar' ? '' : t('project.fileManagement.normalFileSubText', { size: appStore.getFileMaxSize })
|
||||
"
|
||||
multiple
|
||||
draggable
|
||||
size-unit="MB"
|
||||
|
|
Loading…
Reference in New Issue