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

View File

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

View File

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