|
|
@@ -4,13 +4,12 @@
|
|
|
<a-upload-dragger
|
|
|
ref="fileUpload"
|
|
|
:file-list="fileList"
|
|
|
- :before-upload="beforeUpload"
|
|
|
- @change="handleChange"
|
|
|
+ :before-upload="beforeUploadFile"
|
|
|
+ @change="handleChangeFile"
|
|
|
:show-upload-list="false"
|
|
|
:customRequest="customRequest"
|
|
|
:multiple="false"
|
|
|
:drag="true"
|
|
|
- :progress="progress"
|
|
|
>
|
|
|
<div >
|
|
|
<div><p class="ant-upload-text" style="display: inline-block;">点击上传或将文件拖拽至此区域上传</p></div>
|
|
|
@@ -110,6 +109,7 @@ const fileUpload = ref(null)
|
|
|
import SparkMD5 from 'spark-md5'
|
|
|
import tool from '@/utils/tool'
|
|
|
const uploadFileList = ref([])
|
|
|
+ const fileList = ref([])
|
|
|
const spinning = ref(false)
|
|
|
const chunkSize = ref(5 * 1024 * 1024)
|
|
|
const props = defineProps({
|
|
|
@@ -643,7 +643,7 @@ const chunkSize = ref(5 * 1024 * 1024)
|
|
|
// 检查后缀是否在数组中(包含点号匹配)
|
|
|
return suffixArray.includes(fileSuffix);
|
|
|
}
|
|
|
- const beforeUpload = async (file) => {
|
|
|
+ const beforeUploadFile = async (file) => {
|
|
|
console.log('选择了文件', file)
|
|
|
spinning.value = true
|
|
|
|
|
|
@@ -685,7 +685,7 @@ const chunkSize = ref(5 * 1024 * 1024)
|
|
|
// spinning.value = false
|
|
|
return false // 阻止默认上传
|
|
|
}
|
|
|
- const handleChange = (info) => {
|
|
|
+ const handleChangeFile = (info) => {
|
|
|
const { file } = info
|
|
|
if (file.status === 'removed') {
|
|
|
fileList.value = []
|