refactor(front): update onFileHandle prop to use config instead of data for improved clarity

This commit is contained in:
keven1024
2025-05-01 15:05:28 +08:00
parent ca9f537a87
commit b2804450ee
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ import FileShareHandle from '~/components/Preprocessing/FileShareHandle.vue';
const props = defineProps<{
hide: () => void
file: File
onFileHandle: ({ data, type }: { data: any, type: string }) => void
onFileHandle: ({ type, config }: { type: string, config: any }) => void
}>()
const isImage = computed(() => props.file.type.startsWith('image/'))

View File

@@ -6,7 +6,7 @@ import FormButton from '../Field/FormButton.vue';
const props = defineProps<{
hide: () => void
file: File
onFileHandle: ({ data, type }: { data: any, type: string }) => void
onFileHandle: ({ type, config }: { type: string, config: any }) => void
}>()
</script>
@@ -42,7 +42,7 @@ const props = defineProps<{
<InputField v-if="!!values.has_download_notify" name="download_notify_email" placeholder="请输入邮箱" />
</div>
<FormButton @click="(form) => {
onFileHandle({ data: form?.values?.value, type: 'file-share' })
onFileHandle({ type: 'file-share', config: values })
hide()
}">提交</FormButton>
</div>