From 66469ae2cfa5f24922db5763538ef9591bd2071b Mon Sep 17 00:00:00 2001 From: Kuingsmile <96409857+Kuingsmile@users.noreply.github.com> Date: Sun, 10 Aug 2025 16:07:25 +0800 Subject: [PATCH] :bug: Fix(custom): fix window.prompt usage --- src/renderer/manage/pages/BucketPage.vue | 114 +++++++++++++++++++---- 1 file changed, 94 insertions(+), 20 deletions(-) diff --git a/src/renderer/manage/pages/BucketPage.vue b/src/renderer/manage/pages/BucketPage.vue index 06010a44..1eef6cfb 100644 --- a/src/renderer/manage/pages/BucketPage.vue +++ b/src/renderer/manage/pages/BucketPage.vue @@ -1490,6 +1490,61 @@ + + +
@@ -1519,7 +1574,7 @@ import { } from 'lucide-vue-next' import { marked } from 'marked' import { v4 as uuidv4 } from 'uuid' -import { computed, onBeforeMount, onBeforeUnmount, reactive, ref, watch } from 'vue' +import { computed, nextTick, onBeforeMount, onBeforeUnmount, reactive, ref, watch } from 'vue' import { useI18n } from 'vue-i18n' import { useRoute } from 'vue-router' @@ -1693,6 +1748,10 @@ const textfileContent = ref('') const isShowVideoFileDialog = ref(false) const videoFileUrl = ref('') const videoPlayerHeaders = ref({}) +// 创建文件夹相关 +const isShowCreateFolderDialog = ref(false) +const newFolderName = ref('') +const folderNameInput = ref() // 重命名相关 const isShowRenameFileIcon = computed(() => ['tcyun', 'aliyun', 'qiniu', 'upyun', 's3plist', 'webdavplist', 'local', 'sftp'].includes(currentPicBedName.value) @@ -2300,6 +2359,8 @@ async function resetParam (force: boolean = false) { isShowImagePreview.value = false previewedImage.value = '' isShowFileInfo.value = false + isShowCreateFolderDialog.value = false + newFolderName.value = '' lastChoosed.value = -1 layoutStyle.value = 'grid' fileSortExtReverse.value = false @@ -2583,27 +2644,40 @@ function handleCheckAllChange () { } async function handleCreateFolder () { - const value = window.prompt(`${t('pages.manage.bucket.inputFolderTitle')}\n${t('pages.manage.bucket.createFolder')}`) - if (value) { - try { - let formatedPath = value - formatedPath = trimPath(formatedPath) - const param = { - // tcyun - bucketName: configMap.bucketName, - region: configMap.bucketConfig.Location, - key: currentPrefix.value.slice(1) + formatedPath + '/', - githubBranch: currentCustomDomain.value - } - const res = await window.electron.triggerRPC