feat(front): add image conversion option to FileShareDrawer and improve layout in ImageCompressResult

This commit is contained in:
keven1024
2026-02-28 10:16:34 +08:00
parent 67b1d07fbe
commit 1635a31f33
2 changed files with 12 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ import { cx } from 'class-variance-authority'
import { isObject } from 'lodash-es'
import showDrawer from '@/lib/showDrawer'
import FileShareHandle from '@/components/Preprocessing/FileShareHandle.vue'
import ImageConvertHandle from '@/components/Preprocessing/ImageConvertHandle.vue'
import type { FileShareHandleProps } from '../Preprocessing/types'
const { t } = useI18n()
const props = defineProps<{
@@ -52,6 +53,16 @@ const actions = [
props.onFileHandle({ type: 'file-image-compress', config: {} })
},
},
isImage.value && {
label: t('page.upload.file.handleType.file-image-convert'),
icon: LucideArrowRightLeft,
className: 'bg-purple-300',
onClick: () => {
showDrawer({
render: ({ hide }) => h(ImageConvertHandle, { ...props, hide }),
})
},
},
// isImage.value && {
// label: '图片翻译', icon: LucideLanguages, className: 'bg-orange-300', onClick: () => {
// console.log('复制链接')

View File

@@ -158,7 +158,7 @@ watch(
<div class="text-sm text-red-500 px-2 py-1 rounded-md bg-red-100">{{ t('page.result.imageCompress.failed') }}</div>
</div>
<div class="flex flex-row gap-2 items-center" v-if="taskResults?.[index]?.data?.status === 'success'">
<div class="flex flex-col gap-1 items-center">
<div class="flex flex-col gap-1 items-center shrink-0">
<div class="rounded flex flex-row items-center bg-green-100 text-green-600 px-1 text-xs">
<LucideArrowDown class="size-4" />
{{