-
- 上传图片
-
+
+
+ 上传图片
+
+
+
+ {{ file.attachmentName }}
+
+
+
@@ -355,8 +370,8 @@ export default {
this.formData = newVal;
console.log(this.formData);
if(this.formData.internalFile){
- this.imgList = this.formData.internalFile.filter(item=>item.type==='image')
- this.audioList = this.formData.internalFile.filter(item=>item.type==='voice')
+ this.imgList = this.formData.internalFile.filter(item=>item.attachmentType==='image')
+ this.audioList = this.formData.internalFile.filter(item=>item.attachmentType==='voice')
}
}
},
@@ -390,11 +405,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.audioList.push({
- format: file.name.split(".").pop(),
- name: file.name,
+ attachmentFormat: file.name.split(".").pop(),
+ attachmentName: file.name,
size: file.size,
- type: file.raw.type,
- url: res.data.url,
+ attachmentType: file.raw.type,
+ attachmentUrl: res.data.url,
});
console.log(this.formData.files);
} else {
@@ -403,8 +418,9 @@ export default {
},
handleAudioRemove(file) {
+ if(this.pageType === 'check')return
let index = this.audioList.findIndex(
- (item) => item.url == file.response.data.url
+ (item) => item.attachmentUrl == file.attachmentUrl
);
this.audioList.splice(index, 1);
console.log(this.audioList);
@@ -422,11 +438,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.imgList.push({
- format: file.name.split(".").pop(),
- name: file.name,
+ attachmentFormat: file.name.split(".").pop(),
+ attachmentName: file.name,
size: file.size,
- type: file.raw.type,
- url: res.data.url,
+ attachmentType: file.raw.type,
+ attachmentUrl: res.data.url,
});
console.log(this.formData.files);
} else {
@@ -447,11 +463,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.examineImgList.push({
- format: file.name.split(".").pop(),
- name: file.name,
+ attachmentFormat: file.name.split(".").pop(),
+ attachmentName: file.name,
size: file.size,
- type: file.raw.type,
- url: res.data.url,
+ attachmentType: file.raw.type,
+ attachmentUrl: res.data.url,
});
console.log(this.formData.files);
} else {
@@ -460,8 +476,9 @@ export default {
},
handleImgRemove(file) {
- let index = this.imgList.findIndex(
- (item) => item.url == file.response.data.url
+ if(this.pageType === 'check')return
+ let index = this.audioList.findIndex(
+ (item) => item.attachmentUrl == file.attachmentUrl
);
this.imgList.splice(index, 1);
console.log(this.imgList);
diff --git a/src/views/modules/shequzhili/event/cpts/process-form-contact.vue b/src/views/modules/shequzhili/event/cpts/process-form-contact.vue
index f927eba52..dc9510a87 100644
--- a/src/views/modules/shequzhili/event/cpts/process-form-contact.vue
+++ b/src/views/modules/shequzhili/event/cpts/process-form-contact.vue
@@ -179,11 +179,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.audioList.push({
- format: file.name.split(".").pop(),
- name: file.name,
+ attachmentFormat: file.name.split(".").pop(),
+ attachmentName: file.name,
size: file.size,
- type: file.raw.type,
- url: res.data.url,
+ attachmentType: file.raw.type,
+ attachmentUrl: res.data.url,
});
} else {
this.$message.error(res.msg);
@@ -209,11 +209,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.imgList.push({
- format: file.name.split(".").pop(),
- name: file.name,
+ attachmentFormat: file.name.split(".").pop(),
+ attachmentName: file.name,
size: file.size,
- type: file.raw.type,
- url: res.data.url,
+ attachmentType: file.raw.type,
+ attachmentUrl: res.data.url,
});
} else {
this.$message.error(res.msg);
diff --git a/src/views/modules/shequzhili/event/cpts/process-form-process.vue b/src/views/modules/shequzhili/event/cpts/process-form-process.vue
index 58ffb2df0..eca8e9af8 100644
--- a/src/views/modules/shequzhili/event/cpts/process-form-process.vue
+++ b/src/views/modules/shequzhili/event/cpts/process-form-process.vue
@@ -195,11 +195,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.imgList.push({
- format: file.name.split(".").pop(),
- name: file.name,
+ attachmentFormat: file.name.split(".").pop(),
+ attachmentName: file.name,
size: file.size,
- type: file.raw.type,
- url: res.data.url,
+ attachmentType: file.raw.type,
+ attachmentUrl: res.data.url,
});
console.log(this.imgList);
} else {
@@ -226,11 +226,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
console.log("res.data.url", res.data.url);
this.audioList.push({
- format: file.name.split(".").pop(),
- name: file.name,
+ attachmentFormat: file.name.split(".").pop(),
+ attachmentName: file.name,
size: file.size,
- type: file.raw.type,
- url: res.data.url,
+ attachmentType: file.raw.type,
+ attachmentUrl: res.data.url,
});
console.log(this.audioList);
} else {
@@ -253,22 +253,7 @@ export default {
}
return isLt1M;
},
- handleImgSuccess(res, file, fileList) {
- console.log("res.data.url", file);
- if (res.code === 0 && res.msg === "success") {
- console.log("res.data.url", res.data.url);
- this.imgList.push({
- format: file.name.split(".").pop(),
- name: file.name,
- size: file.size,
- type: file.raw.type,
- url: res.data.url,
- });
- console.log(this.formData.files);
- } else {
- this.$message.error(res.msg);
- }
- },
+
handleImgRemove(file) {
let index = this.formData.files.findIndex(