chore: update image upload

This commit is contained in:
dap 2024-10-08 11:27:03 +08:00
parent 297c0ecbea
commit b696456350

View File

@ -1,5 +1,4 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { Recordable } from '@vben/types';
import type { UploadFile, UploadProps } from 'ant-design-vue'; import type { UploadFile, UploadProps } from 'ant-design-vue';
import type { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface'; import type { UploadRequestOption } from 'ant-design-vue/lib/vc-upload/interface';
@ -29,7 +28,6 @@ const props = withDefaults(
accept?: string[]; accept?: string[];
api?: (...args: any[]) => Promise<any>; api?: (...args: any[]) => Promise<any>;
disabled?: boolean; disabled?: boolean;
filename?: null | string;
helpText?: string; helpText?: string;
// eslint-disable-next-line no-use-before-define // eslint-disable-next-line no-use-before-define
listType?: ListType; listType?: ListType;
@ -37,11 +35,11 @@ const props = withDefaults(
maxNumber?: number; maxNumber?: number;
// MB // MB
maxSize?: number; maxSize?: number;
//
multiple?: boolean; multiple?: boolean;
name?: string;
// support xxx.xxx.xx // support xxx.xxx.xx
resultField?: string; // url
uploadParams?: Recordable<any>; resultField?: 'fileName' | 'ossId' | 'url' | string;
value?: string[]; value?: string[];
}>(), }>(),
{ {
@ -53,10 +51,7 @@ const props = withDefaults(
maxNumber: 1, maxNumber: 1,
accept: () => [], accept: () => [],
multiple: false, multiple: false,
uploadParams: () => ({}),
api: uploadApi, api: uploadApi,
name: 'file',
filename: null,
resultField: '', resultField: '',
}, },
); );