2024-10-08 13:37:14 +08:00
|
|
|
<script setup lang="ts">
|
2025-03-29 16:22:08 +08:00
|
|
|
import { ref } from 'vue';
|
2024-10-08 13:37:14 +08:00
|
|
|
|
|
|
|
import { useVbenModal } from '@vben/common-ui';
|
|
|
|
|
|
|
|
import { FileUpload } from '#/components/upload';
|
|
|
|
|
|
|
|
const emit = defineEmits<{ reload: [] }>();
|
|
|
|
|
|
|
|
const fileList = ref<string[]>([]);
|
|
|
|
const [BasicModal, modalApi] = useVbenModal({
|
|
|
|
onOpenChange: (isOpen) => {
|
|
|
|
if (isOpen) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
if (fileList.value.length > 0) {
|
|
|
|
fileList.value = [];
|
|
|
|
emit('reload');
|
|
|
|
modalApi.close();
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<BasicModal
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
:footer="false"
|
|
|
|
:fullscreen-button="false"
|
|
|
|
title="文件上传"
|
|
|
|
>
|
|
|
|
<div class="flex flex-col gap-4">
|
2025-05-21 11:54:55 +08:00
|
|
|
<FileUpload
|
|
|
|
v-model:value="fileList"
|
|
|
|
:enable-drag-upload="true"
|
|
|
|
:max-count="3"
|
|
|
|
/>
|
2024-10-08 13:37:14 +08:00
|
|
|
</div>
|
|
|
|
</BasicModal>
|
|
|
|
</template>
|