mirror of
https://github.com/keven1024/015.git
synced 2026-06-09 05:44:34 +00:00
feat(front): add text-translate feature with corresponding UI components and action handlers
This commit is contained in:
@@ -20,6 +20,15 @@ const actionHandlers: Partial<Record<FeatureKey, ActionHandler>> = {
|
||||
'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('复制链接') }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export type FileHandleKey = 'file-share' | 'file-image-compress' | 'file-image-convert'
|
||||
export type FileShareHandleProps = { type: FileHandleKey; config: Record<string, any> }
|
||||
|
||||
export type TextHandleKey = 'text-share'
|
||||
export type TextHandleKey = 'text-share' | 'text-translate'
|
||||
export type TextShareHandleProps = { type: TextHandleKey; config: Record<string, any> }
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script lang="ts" setup>
|
||||
import FileShareResult from '@/components/Result/FileShareResult.vue'
|
||||
import TextShareResult from '@/components/Result/TextShareResult.vue'
|
||||
import TextTranslateResult from '@/components/Result/TextTranslateResult.vue'
|
||||
import ImageCompressResult from '@/components/Result/ImageCompressResult.vue'
|
||||
import ImageConvertResult from '@/components/Result/ImageConvertResult.vue'
|
||||
import type { filehandleData, handleComponent, handleKey, texthandleData } from './types'
|
||||
@@ -16,6 +17,7 @@ const emit = defineEmits<{
|
||||
const handleList: { component: handleComponent; key: handleKey }[] = [
|
||||
{ component: FileShareResult, key: 'file-share' },
|
||||
{ component: TextShareResult, key: 'text-share' },
|
||||
{ component: TextTranslateResult, key: 'text-translate' },
|
||||
{ component: ImageCompressResult, key: 'file-image-compress' },
|
||||
{ component: ImageConvertResult, key: 'file-image-convert' },
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user