From 18f3dc2d4451a0cc1f3dcdc92935a458a61ab5b4 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 20 Jun 2024 17:40:51 +0800 Subject: [PATCH] fix buttons --- src/components/dialog/ReorganizeDialog.vue | 11 ++++++-- src/components/filebrowser/FileList.vue | 32 +++++++++++++++++----- 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/components/dialog/ReorganizeDialog.vue b/src/components/dialog/ReorganizeDialog.vue index b6702e2a..ed40201a 100644 --- a/src/components/dialog/ReorganizeDialog.vue +++ b/src/components/dialog/ReorganizeDialog.vue @@ -13,6 +13,10 @@ const display = useDisplay() // 输入参数 const props = defineProps({ + storage: { + type: String, + default: () => 'local', + }, paths: Array, target: String, logids: Array, @@ -63,6 +67,7 @@ const dialogTitle = computed(() => { // 表单 const transferForm = reactive({ + storage: props.storage, logid: 0, path: '', target: props.target ?? null, @@ -210,7 +215,7 @@ onMounted(() => { - + { persistent-hint /> - + { - + { @@ -412,7 +412,7 @@ watch( { title: '整理', value: 4, - show: inProps.storage == 'local', + show: true, props: { prependIcon: 'mdi-folder-arrow-right', click: showTransfer, @@ -456,20 +456,30 @@ async function recognize(path: string) { } // 调用API刮削 -async function scrape(path: string) { +async function scrape(path: string, confirm: boolean = true) { try { + if (confirm) { + // 确认 + const confirmed = await createConfirm({ + title: '确认', + content: `是否确认刮削 ${path}?`, + }) + if (!confirmed) return + } + // 显示进度条 progressDialog.value = true progressText.value = `正在刮削 ${path} ...` const result: { [key: string]: any } = await api.get('media/scrape', { params: { path, + storage: inProps.storage, }, }) // 关闭进度条 progressDialog.value = false if (!result.success) $toast.error(result.message) - else $toast.success(`${path}削刮完成!`) + else $toast.success(`${path} 削刮完成!`) } catch (error) { console.error(error) } @@ -477,8 +487,15 @@ async function scrape(path: string) { // 批量刮削 async function batchScrape() { + // 确认 + const confirmed = await createConfirm({ + title: '确认', + content: `是否确认刮削选中的 ${selected.value.length} 项?`, + }) + if (!confirmed) return + selected.value.map(item => { - scrape(item.path || '') + scrape(item.path || '', false) }) } @@ -627,7 +644,7 @@ onMounted(() => { - + - +