diff --git a/front/components/Drawer/FileShareDrawer.vue b/front/components/Drawer/FileShareDrawer.vue index c4a1ad9..ea2102d 100644 --- a/front/components/Drawer/FileShareDrawer.vue +++ b/front/components/Drawer/FileShareDrawer.vue @@ -15,11 +15,12 @@ import { cx } from 'class-variance-authority' import { isObject } from 'lodash-es' import showDrawer from '@/lib/showDrawer' import FileShareHandle from '@/components/Preprocessing/FileShareHandle.vue' +import type { FileShareHandleProps } from '../Preprocessing/types' const { t } = useI18n() const props = defineProps<{ hide: () => void file: File[] - onFileHandle: ({ type, config }: { type: string; config: any }) => void + onFileHandle: (props: FileShareHandleProps) => void }>() const isImage = computed(() => props.file.every((r) => r?.type?.startsWith('image/'))) diff --git a/front/components/Home/File/FileUploadProgressView.vue b/front/components/Home/File/FileUploadProgressView.vue index ee9988e..2c10ca0 100644 --- a/front/components/Home/File/FileUploadProgressView.vue +++ b/front/components/Home/File/FileUploadProgressView.vue @@ -14,9 +14,10 @@ import dayjs from 'dayjs' import showDrawer from '~/lib/showDrawer' import FileUploadSpeedInfoView from './FileUploadSpeedInfoView.vue' import getFileChunk from '~/lib/getFileChunk' +import type { FileHandleKey } from '~/components/Preprocessing/types' const props = defineProps<{ - data: { file: File[]; config: any; handle_type: string } + data: { file: File[]; config: Record; handle_type: FileHandleKey } }>() const emit = defineEmits<{ (e: 'change', key: string): void diff --git a/front/components/Preprocessing/FileShareHandle.vue b/front/components/Preprocessing/FileShareHandle.vue index eaadf3f..f2c1f34 100644 --- a/front/components/Preprocessing/FileShareHandle.vue +++ b/front/components/Preprocessing/FileShareHandle.vue @@ -3,10 +3,11 @@ import SwitchField from '../Field/SwitchField.vue' import InputField from '../Field/InputField.vue' import SelectField from '../Field/SelectField.vue' import FormButton from '../Field/FormButton.vue' +import type { FileShareHandleProps } from './types' const props = defineProps<{ hide: () => void file: File[] - onFileHandle: ({ type, config }: { type: string; config: any }) => void + onFileHandle: (props: FileShareHandleProps) => void }>() diff --git a/front/components/Preprocessing/TextShareHandle.vue b/front/components/Preprocessing/TextShareHandle.vue index 676e50a..81626bb 100644 --- a/front/components/Preprocessing/TextShareHandle.vue +++ b/front/components/Preprocessing/TextShareHandle.vue @@ -1,12 +1,13 @@ @@ -15,51 +16,74 @@ const props = defineProps<{

分享选项

- - + 或 - + 后过期
- +
- +
- +
- 提交 + 提交
- \ No newline at end of file + diff --git a/front/components/Preprocessing/types.ts b/front/components/Preprocessing/types.ts new file mode 100644 index 0000000..0a92c12 --- /dev/null +++ b/front/components/Preprocessing/types.ts @@ -0,0 +1,5 @@ +export type FileHandleKey = 'file-share' | 'file-image-compress' +export type FileShareHandleProps = { type: FileHandleKey; config: Record } + +export type TextHandleKey = 'text-share' +export type TextShareHandleProps = { type: TextHandleKey; config: Record } diff --git a/front/components/Result/FileShareResult.vue b/front/components/Result/FileShareResult.vue index 8290adb..a47f747 100644 --- a/front/components/Result/FileShareResult.vue +++ b/front/components/Result/FileShareResult.vue @@ -14,11 +14,12 @@ import showDrawer from '@/lib/showDrawer' import QrCoreDrawer from '@/components/Drawer/QrCoreDrawer.vue' import { h } from 'vue' import { cx } from 'class-variance-authority' +import type { FileHandleKey } from '../Preprocessing/types' dayjs.extend(relativeTime) // 扩展 relativeTime 插件 dayjs.locale('zh-cn') // 设置语言为中文 const props = defineProps<{ - data: { files: { id: string; file: File }[]; config: any; handle_type: string } + data: { files: { id: string; file: File }[]; config: Record; handle_type: FileHandleKey } }>() const emit = defineEmits<{ (e: 'change', key: string): void @@ -33,7 +34,7 @@ const { data } = useQuery({ const { id, file } = item || {} return { id, name: file.name } }), - config, + config: config as any, }) return data?.map((item) => item?.data) }, diff --git a/front/components/Result/ResultIndexView.vue b/front/components/Result/ResultIndexView.vue index 1e525f9..80dbf01 100644 --- a/front/components/Result/ResultIndexView.vue +++ b/front/components/Result/ResultIndexView.vue @@ -1,45 +1,37 @@ diff --git a/front/components/Result/TextShareResult.vue b/front/components/Result/TextShareResult.vue index 18adeb9..93b8833 100644 --- a/front/components/Result/TextShareResult.vue +++ b/front/components/Result/TextShareResult.vue @@ -9,9 +9,11 @@ import useMyAppConfig from '@/composables/useMyAppConfig' import showDrawer from '@/lib/showDrawer' import QrCoreDrawer from '@/components/Drawer/QrCoreDrawer.vue' import dayjs from 'dayjs' +import { h } from 'vue' +import type { TextHandleKey } from '../Preprocessing/types' const props = defineProps<{ - data: { text: string; config: any; handle_type: string } + data: { text: string; config: Record; handle_type: TextHandleKey } }>() const emit = defineEmits<{