feat: Upload failde Second Modal done.

This commit is contained in:
chiayin
2024-01-05 16:39:09 +08:00
parent 68981e98f5
commit fe5731ae15
4 changed files with 37 additions and 10 deletions

View File

@@ -167,11 +167,11 @@ export async function leaveConformance(next, addConformanceCreateCheckId, toPath
}
};
/**
* Upload failde
* Upload failde First
* @param { string } failureType
* @param { string } failureMsg
*/
export async function uploadFailed(failureType, failureMsg) {
export async function uploadFailedFirst(failureType, failureMsg) {
// msg: 'not in UTF-8' | 'insufficient columns' | 'the csv file is empty' | 'the filename does not ends with .csv'
// type: 'encoding' | 'insufficient_columns' | 'empty' | 'name_suffix'
let value = '';
@@ -205,6 +205,34 @@ export async function uploadFailed(failureType, failureMsg) {
customClass: customClass
})
};
/**
* Upload failde Second
* @param { string } failureType
* @param { string } failureMsg
*/
export async function uploadFailedSecond(failureType, failureMsg) {
let value = '';
switch (failureType) {
case 'malformed':
value = failureMsg;
break;
case 'missing':
value = failureMsg;
break;
default:
value = failureMsg;
break;
}
await Swal.fire({
title: 'UPLOAD FAILED',
html: value,
timer: 5000, // 停留5秒後自動關閉
showConfirmButton: false,
icon: 'error',
iconColor: '#FF3366',
customClass: customClass
})
};
/**
* Upload Success
* @param { string } value