|
@@ -7,7 +7,7 @@
|
|
:limit="limit"
|
|
:limit="limit"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:headers="headers"
|
|
:headers="headers"
|
|
- :data="data"
|
|
|
|
|
|
+ :data="uploadData"
|
|
:on-progress="handleProgress"
|
|
:on-progress="handleProgress"
|
|
:on-success="handleSuccess"
|
|
:on-success="handleSuccess"
|
|
:on-exceed="handleExceed"
|
|
:on-exceed="handleExceed"
|
|
@@ -98,7 +98,16 @@ export default defineComponent({
|
|
const visible = ref(false)
|
|
const visible = ref(false)
|
|
const fileList = ref<any[]>([])
|
|
const fileList = ref<any[]>([])
|
|
|
|
|
|
|
|
+ // 定义响应式的上传参数
|
|
|
|
+ const uploadData = ref(props.data)
|
|
|
|
+
|
|
const beforeUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
|
|
const beforeUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => {
|
|
|
|
+ // 更新上传参数
|
|
|
|
+ uploadData.value = {
|
|
|
|
+ ...props.data,
|
|
|
|
+ fileName: rawFile.name
|
|
|
|
+ }
|
|
|
|
+
|
|
let q = 0.5
|
|
let q = 0.5
|
|
if (rawFile.size > 1000000 && rawFile.size < 5000000) {
|
|
if (rawFile.size > 1000000 && rawFile.size < 5000000) {
|
|
q = 0.5
|
|
q = 0.5
|
|
@@ -174,7 +183,8 @@ export default defineComponent({
|
|
handleError,
|
|
handleError,
|
|
handleExceed,
|
|
handleExceed,
|
|
handleClose,
|
|
handleClose,
|
|
- beforeUpload
|
|
|
|
|
|
+ beforeUpload,
|
|
|
|
+ uploadData
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|