refactor: improving the readability
This commit is contained in:
parent
b28a46edcb
commit
6528dc45df
|
|
@ -191,13 +191,13 @@
|
||||||
const { data } = ret;
|
const { data } = ret;
|
||||||
item.status = UploadResultStatus.SUCCESS;
|
item.status = UploadResultStatus.SUCCESS;
|
||||||
item.response = data;
|
item.response = data;
|
||||||
if(props.resultField){
|
if (props.resultField) {
|
||||||
// 适配预览组件而进行封装
|
// 适配预览组件而进行封装
|
||||||
item.response = {
|
item.response = {
|
||||||
code:0,
|
code: 0,
|
||||||
message:"upload Success!",
|
message: 'upload Success!',
|
||||||
url:get(ret, props.resultField)
|
url: get(ret, props.resultField),
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
success: true,
|
success: true,
|
||||||
|
|
@ -216,7 +216,7 @@
|
||||||
// 点击开始上传
|
// 点击开始上传
|
||||||
async function handleStartUpload() {
|
async function handleStartUpload() {
|
||||||
const { maxNumber } = props;
|
const { maxNumber } = props;
|
||||||
if ((fileListRef.value.length + props.previewFileList?.length ?? 0) > maxNumber) {
|
if (fileListRef.value.length + props.previewFileList.length > maxNumber) {
|
||||||
return createMessage.warning(t('component.upload.maxNumber', [maxNumber]));
|
return createMessage.warning(t('component.upload.maxNumber', [maxNumber]));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue