fix: Issues #243 uploadFailedSecond done.
This commit is contained in:
@@ -238,13 +238,35 @@ export async function uploadFailedSecond(detail) {
|
|||||||
manySrt = 'There are more errors.';
|
manySrt = 'There are more errors.';
|
||||||
break;
|
break;
|
||||||
case 'unrecognized':
|
case 'unrecognized':
|
||||||
content = `<li>Data unregnizable in [Status] Column: (Row #${i.loc[1]}, "${i.input}")</li>`;
|
content = `<li>Data unregnizable in Status Column: (Row #${i.loc[1]}, "${i.input}")</li>`;
|
||||||
break;
|
break;
|
||||||
case 'malformed':
|
case 'malformed':
|
||||||
content = `<li>Data malformed in [Timestamp] Column: (Row #${i.loc[1]}, "${i.input}")</li>`;
|
content = `<li>Data malformed in Timestamp Column: (Row #${i.loc[1]}, "${i.input}")</li>`;
|
||||||
break;
|
break;
|
||||||
case 'missing':
|
case 'missing':
|
||||||
content = `<li>Data missing in [${i.loc[2]}] Column: (Row #${i.loc[1]})</li>`;
|
let key = '';
|
||||||
|
|
||||||
|
switch (i.loc[2]) {
|
||||||
|
case 'case id':
|
||||||
|
key = 'Case ID';
|
||||||
|
break;
|
||||||
|
case 'timestamp':
|
||||||
|
key = 'Timestamp';
|
||||||
|
break;
|
||||||
|
case 'name':
|
||||||
|
key = 'Activity';
|
||||||
|
break;
|
||||||
|
case 'instance':
|
||||||
|
key = 'Activity Instance ID';
|
||||||
|
break;
|
||||||
|
case 'status':
|
||||||
|
key = 'Status';
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
key = i.loc[2];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
content = `<li>Data missing in ${key} Column: (Row #${i.loc[1]})</li>`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
srt += content;
|
srt += content;
|
||||||
@@ -252,7 +274,7 @@ export async function uploadFailedSecond(detail) {
|
|||||||
await Swal.fire({
|
await Swal.fire({
|
||||||
title: 'IMPORT FAILED',
|
title: 'IMPORT FAILED',
|
||||||
html: `<div class="text-left mx-3 space-y-1"><p>Error(s) detected:</p><ul class="list-disc ml-6">${srt}</ul><p>${manySrt} Please check.</p></div>`,
|
html: `<div class="text-left mx-3 space-y-1"><p>Error(s) detected:</p><ul class="list-disc ml-6">${srt}</ul><p>${manySrt} Please check.</p></div>`,
|
||||||
// timer: 5000, // 停留5秒後自動關閉
|
timer: 3000, // 停留 3 秒後自動關閉
|
||||||
showConfirmButton: false,
|
showConfirmButton: false,
|
||||||
icon: 'error',
|
icon: 'error',
|
||||||
iconColor: '#FF3366',
|
iconColor: '#FF3366',
|
||||||
|
|||||||
Reference in New Issue
Block a user