From 4c59090180e26524dc69f33a4318bfcc384e1324 Mon Sep 17 00:00:00 2001 From: John Bro <42930107+john1298308460@users.noreply.github.com> Date: Wed, 19 Jun 2024 14:06:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9B=9E=E6=94=B6=E7=AB=99=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=94=AF=E6=8C=81=E6=89=B9=E9=87=8F=E8=BF=98=E5=8E=9F?= =?UTF-8?q?=20(#5497)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refs #5148 --- frontend/src/lang/modules/en.ts | 2 + frontend/src/lang/modules/tw.ts | 2 + frontend/src/lang/modules/zh.ts | 2 + .../file-management/recycle-bin/index.vue | 11 +++ .../recycle-bin/reduce/index.vue | 73 +++++++++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 frontend/src/views/host/file-management/recycle-bin/reduce/index.vue diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts index 7542980a7..910e22100 100644 --- a/frontend/src/lang/modules/en.ts +++ b/frontend/src/lang/modules/en.ts @@ -1171,6 +1171,8 @@ const message = { recycleBin: 'Recycle bin', sourcePath: 'Original path', deleteTime: 'Delete time', + confirmReduce: 'Are you sure you want to restore the following files?', + reduceSuccess: 'Restore successful', reduce: 'Reduction', reduceHelper: 'If a file or directory with the same name exists in the original path, it will be overwritten. Do you want to continue?', diff --git a/frontend/src/lang/modules/tw.ts b/frontend/src/lang/modules/tw.ts index c67659277..158ea3886 100644 --- a/frontend/src/lang/modules/tw.ts +++ b/frontend/src/lang/modules/tw.ts @@ -1111,6 +1111,8 @@ const message = { recycleBin: '回收站', sourcePath: '原路徑', deleteTime: '刪除時間', + confirmReduce: '確定還原以下文件?', + reduceSuccess: '還原成功', reduce: '還原', reduceHelper: '如果原路徑存在同名檔案或目錄,將會被覆蓋,是否繼續?', clearRecycleBin: '清空回收站', diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts index 2e32adacf..af6939a93 100644 --- a/frontend/src/lang/modules/zh.ts +++ b/frontend/src/lang/modules/zh.ts @@ -1114,6 +1114,8 @@ const message = { sourcePath: '原路径', deleteTime: '删除时间', reduce: '还原', + confirmReduce: '确定还原以下文件?', + reduceSuccess: '还原成功', reduceHelper: '如果原路径存在同名文件或目录,将会被覆盖,是否继续?', clearRecycleBin: '清空回收站', clearRecycleBinHelper: '是否清空回收站?', diff --git a/frontend/src/views/host/file-management/recycle-bin/index.vue b/frontend/src/views/host/file-management/recycle-bin/index.vue index b1f91ce77..868db749a 100644 --- a/frontend/src/views/host/file-management/recycle-bin/index.vue +++ b/frontend/src/views/host/file-management/recycle-bin/index.vue @@ -16,6 +16,9 @@ {{ $t('commons.button.delete') }} + + {{ $t('file.reduce') }} + @@ -53,6 +56,7 @@ + @@ -62,6 +66,7 @@ import { reactive, ref } from 'vue'; import { dateFormat, computeSize } from '@/utils/util'; import i18n from '@/lang'; import Delete from './delete/index.vue'; +import Reduce from './reduce/index.vue'; import { updateSetting } from '@/api/modules/setting'; import { MsgSuccess } from '@/utils/message'; @@ -85,6 +90,7 @@ const paginationConfig = reactive({ }); const deleteRef = ref(); +const reduceRef = ref(); const handleClose = () => { open.value = false; @@ -138,6 +144,11 @@ const patchDelete = () => { deleteRef.value.acceptParams(files.value); }; +const patchReduce = () => { + files.value = selects.value; + reduceRef.value.acceptParams(files.value); +}; + const rdFile = async (row: any) => { ElMessageBox.confirm(i18n.global.t('file.reduceHelper'), i18n.global.t('file.reduce'), { confirmButtonText: i18n.global.t('commons.button.confirm'), diff --git a/frontend/src/views/host/file-management/recycle-bin/reduce/index.vue b/frontend/src/views/host/file-management/recycle-bin/reduce/index.vue new file mode 100644 index 000000000..28710b3cf --- /dev/null +++ b/frontend/src/views/host/file-management/recycle-bin/reduce/index.vue @@ -0,0 +1,73 @@ + +