From fc6b23432cf0bf977885d8a4044c65a44dc6792e Mon Sep 17 00:00:00 2001 From: miao <2514145421@qq.com> Date: Wed, 15 Feb 2023 16:30:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=87=E4=BB=B6=E5=A4=B9?= =?UTF-8?q?=E6=97=B6=E6=B7=BB=E5=8A=A0=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FileManageDialog.vue | 44 +++++++++++++++++++++-------- src/i18n/en-US/index.ts | 2 ++ src/i18n/zh-CN/index.ts | 1 + 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/src/components/FileManageDialog.vue b/src/components/FileManageDialog.vue index e15935b..22d4d9e 100644 --- a/src/components/FileManageDialog.vue +++ b/src/components/FileManageDialog.vue @@ -899,7 +899,8 @@ export default defineComponent({ message: $t.t("input folder name") + ":", prompt: { model: "", - isValid: (val: string) => !!val && val.trim().length > 0, + isValid: (val: string) => + !!val && val.trim().length > 0&& val.indexOf(".") != 0 , type: "text", }, ok: { @@ -917,6 +918,7 @@ export default defineComponent({ const response = await GlobalData.getInstance() .getCurrentClient() ?.CreateDirectoryFileManager(path.value, data); + console.log(response); if (response && response.success) { refresh_file_list(); $q.notify({ @@ -926,16 +928,34 @@ export default defineComponent({ timeout: 1500, }); } else { - $q.notify({ - type: "warning", - message: - $t.t("create folder") + - $t.t("fail") + - "!" + - (response ? response.error_message : ""), - position: "top", - timeout: 1500, - }); + // if ( + // response?.error_message == + // "the folder name cannot start with a '.'" + // ) { + // $q.notify({ + // type: "warning", + // message: + // $t.t("create folder") + + // $t.t("fail") + + // "!" + + // $t.t("the folder name cannot start with a '.'"), + // position: "top", + // timeout: 1500, + // }); + // } + // else { + if (response) { + $q.notify({ + type: "warning", + message: + $t.t("create folder") + + $t.t("fail") + + "! " + + $t.t(response.error_message), + position: "top", + timeout: 1500, + }); + } } }); }, @@ -1071,7 +1091,7 @@ export default defineComponent({ timeout: 1500, }); loading.value = false; - uploading.value=false; + uploading.value = false; } }, 500); }, diff --git a/src/i18n/en-US/index.ts b/src/i18n/en-US/index.ts index f087ade..fcb4bb0 100644 --- a/src/i18n/en-US/index.ts +++ b/src/i18n/en-US/index.ts @@ -445,4 +445,6 @@ export default { resize: "Resize", "export magic": "Export", "raster graph": "Raster Graph", + "the folder name cannot start with a '.'":"The Folder Name Cannot Start With a '.'", + }; diff --git a/src/i18n/zh-CN/index.ts b/src/i18n/zh-CN/index.ts index 1de7aa9..d39045e 100644 --- a/src/i18n/zh-CN/index.ts +++ b/src/i18n/zh-CN/index.ts @@ -713,4 +713,5 @@ export default { resize: "缩放", "export magic": "导出", "raster graph": "栅格图", + "the folder name cannot start with a '.'":"文件夹名称不能以“.” 开头", };