feat(@vben/web-antdv-next): 添加文件上传组件的下载按钮显示选项

pull/362/head
XuZhiqiang 2026-06-17 14:10:20 +08:00
parent cd66d2a1de
commit e843b75e40
3 changed files with 6 additions and 2 deletions

View File

@ -1,6 +1,5 @@
<script lang="ts" setup>
import type { UploadFile, UploadProps } from 'antdv-next';
import type { UploadRequestOption } from 'antdv-next/lib/vc-upload/interface';
import type { FileUploadProps } from './typing';
@ -17,6 +16,8 @@ import { Button, message, Upload } from 'antdv-next';
import { UploadResultStatus } from './typing';
import { useUpload, useUploadType } from './use-upload';
type UploadRequestOption = any;
defineOptions({ name: 'FileUpload', inheritAttrs: false });
const props = withDefaults(defineProps<FileUploadProps>(), {
@ -34,6 +35,7 @@ const props = withDefaults(defineProps<FileUploadProps>(), {
resultField: '',
returnText: false,
showDescription: false,
showDownloadIcon: true,
});
const emit = defineEmits([
'change',
@ -295,7 +297,7 @@ function getValue() {
:show-upload-list="{
showPreviewIcon: true,
showRemoveIcon: true,
showDownloadIcon: true,
showDownloadIcon,
}"
@remove="handleRemove"
@preview="handlePreview"

View File

@ -29,5 +29,6 @@ export interface FileUploadProps {
resultField?: string; // support xxx.xxx.xx
returnText?: boolean; // 是否返回文件文本内容
showDescription?: boolean; // 是否显示下面的描述
showDownloadIcon?: boolean; // 是否显示下载按钮
value?: string | string[];
}

View File

@ -898,6 +898,7 @@ defineExpose({ loadTodoTask });
v-model:value="approveReasonForm.attachments"
:max-number="10"
:multiple="true"
:show-download-icon="false"
help-text="支持多文件/图片上传"
@preview="handleFilePreview"
/>