From 83f22134044c4351cdde2d4f809aa84488f49ff9 Mon Sep 17 00:00:00 2001 From: keven1024 Date: Mon, 6 Apr 2026 22:36:20 +0800 Subject: [PATCH] feat(front): add text-translate feature with corresponding UI components and action handlers --- front/components/Drawer/TextShareDrawer.vue | 9 +++++++++ front/components/Preprocessing/types.ts | 2 +- front/components/Result/ResultIndexView.vue | 2 ++ front/composables/useFeatureMeta.ts | 10 ++++++++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/front/components/Drawer/TextShareDrawer.vue b/front/components/Drawer/TextShareDrawer.vue index f0aaaa5..97c9a77 100644 --- a/front/components/Drawer/TextShareDrawer.vue +++ b/front/components/Drawer/TextShareDrawer.vue @@ -20,6 +20,15 @@ const actionHandlers: Partial> = { 'text-share': { onClick: () => showDrawer({ render: ({ hide }) => h(TextShareHandle, { ...props, hide }) }), }, + 'text-translate': { + onClick: () => + props.onTextHandle({ + type: 'text-translate', + config: { + source: 'auto', + }, + }), + }, // 'text-image-generate': { // label: '生成配图', icon: LucideImage, className: 'bg-red-300', // onClick: () => { console.log('复制链接') } diff --git a/front/components/Preprocessing/types.ts b/front/components/Preprocessing/types.ts index ede41ce..05d70ab 100644 --- a/front/components/Preprocessing/types.ts +++ b/front/components/Preprocessing/types.ts @@ -1,5 +1,5 @@ export type FileHandleKey = 'file-share' | 'file-image-compress' | 'file-image-convert' export type FileShareHandleProps = { type: FileHandleKey; config: Record } -export type TextHandleKey = 'text-share' +export type TextHandleKey = 'text-share' | 'text-translate' export type TextShareHandleProps = { type: TextHandleKey; config: Record } diff --git a/front/components/Result/ResultIndexView.vue b/front/components/Result/ResultIndexView.vue index fa4927e..94bc7a9 100644 --- a/front/components/Result/ResultIndexView.vue +++ b/front/components/Result/ResultIndexView.vue @@ -1,6 +1,7 @@