|
@@ -66,6 +66,7 @@
|
|
|
<van-uploader
|
|
|
v-model="uploader"
|
|
|
:before-read="beforeRead"
|
|
|
+ :before-delete="beforDelete"
|
|
|
:after-read="afterRead"
|
|
|
:max-count="1"
|
|
|
accept="image/*, .pdf"
|
|
@@ -137,7 +138,9 @@ export default {
|
|
|
groupStatus: false,
|
|
|
timerStatus: false,
|
|
|
selectIds: targetIds ? targetIds.split(",") : [],
|
|
|
- uploader: query.fileUrl ? [{ url: query.fileUrl }] : [],
|
|
|
+ uploader: query.fileUrl
|
|
|
+ ? [{ url: query.fileUrl, file: { name: query.fileName } }]
|
|
|
+ : [],
|
|
|
date: null,
|
|
|
minDate: new Date(),
|
|
|
id: query.id,
|
|
@@ -161,6 +164,11 @@ export default {
|
|
|
}
|
|
|
return true;
|
|
|
},
|
|
|
+ beforDelete() {
|
|
|
+ this.form.fileName = "";
|
|
|
+ this.form.fileUrl = "";
|
|
|
+ return true;
|
|
|
+ },
|
|
|
async afterRead(file) {
|
|
|
// 上传头像
|
|
|
const form = this.form;
|