feat: File download done.
This commit is contained in:
@@ -290,6 +290,8 @@ export async function uploadloader() {
|
||||
/**
|
||||
* Rename Modal
|
||||
* @param { function } rename
|
||||
* @param { string } type
|
||||
* @param { number } id
|
||||
*/
|
||||
export async function renameModal(rename, type, id) {
|
||||
let fileName = '';
|
||||
@@ -316,3 +318,33 @@ export async function renameModal(rename, type, id) {
|
||||
// 清空欄位
|
||||
fileName = '';
|
||||
}
|
||||
/**
|
||||
* Delete File
|
||||
* @param { string } files 有關連的檔案
|
||||
* @param { string } type
|
||||
* @param { number } id
|
||||
*/
|
||||
export async function deleteFileModal(files, type, id) {
|
||||
const filesStore = FilesStore();
|
||||
|
||||
const result = await Swal.fire({
|
||||
title: 'ARE YOU SURE?',
|
||||
html: '<div class=" w-[227px] text-left mx-auto space-y-1"><p>All related files will be deleted.</p><p>List of file(s) to delete: </p><ul class="list-disc ml-6"><li>[log] Taipower 001</li><li>[filter] Filter0401 - Taipower 001 Filter0401 - Taipower 001 Filter0401 - Taipower 001</li><li>[rule] 1224 - Taipower 001</li></ul></div>',
|
||||
icon: 'warning',
|
||||
iconColor: '#FF3366',
|
||||
reverseButtons:true,
|
||||
confirmButtonText: 'Yes',
|
||||
confirmButtonColor: '#FF3366',
|
||||
showCancelButton: true,
|
||||
cancelButtonText: 'No',
|
||||
cancelButtonColor: '#94a3b8',
|
||||
customClass: customClass,
|
||||
})
|
||||
if(result.isConfirmed) {
|
||||
// filesStore.deleteFile(type, id);
|
||||
} else if(result.dismiss === 'cancel') {
|
||||
// 什麼都不做
|
||||
} else if(result.dismiss === 'backdrop') {
|
||||
// 什麼都不做
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user