|
@@ -61,9 +61,8 @@ export default {
|
|
|
// 大图
|
|
|
imageUrl: '',
|
|
|
//图片地址
|
|
|
- imageFileList: [],
|
|
|
- listObj: {},
|
|
|
- imagefileListAll: [],
|
|
|
+ imageFileList: [], //插入富文本
|
|
|
+ imagefileListAll: [], //上传的所有图片
|
|
|
fileList: []
|
|
|
};
|
|
|
},
|
|
@@ -81,21 +80,24 @@ export default {
|
|
|
handleRemove(file) {
|
|
|
if (file.response.msg === '成功') {
|
|
|
this.$message.success('移除成功');
|
|
|
+ console.log('file', file);
|
|
|
+ let removeName = this.imageFileList.filter((item) => {
|
|
|
+ item.name !== file.name;
|
|
|
+ });
|
|
|
+ let removeNameList = this.imagefileListAll.filter((item) => {
|
|
|
+ console.log('item.url', item.url);
|
|
|
+ console.log('file.response.data', file.response.data);
|
|
|
+ return item.url != file.response.data;
|
|
|
+ });
|
|
|
+ console.log('this.imageFil', this.imageFileList);
|
|
|
+ console.log('removeNameList', removeNameList);
|
|
|
+ this.imagefileListAll = removeNameList;
|
|
|
+ this.imageFileList = removeName;
|
|
|
+ this.$emit('successImageList', removeNameList);
|
|
|
+ this.$emit('deleteImage', file);
|
|
|
} else {
|
|
|
return this.$message.success('移除失败');
|
|
|
}
|
|
|
- console.log('handleRemove', file);
|
|
|
- let removeName = this.imageFileList.filter((item) => {
|
|
|
- item.name !== file.name;
|
|
|
- });
|
|
|
- let removeNameList = this.imagefileListAll.filter((item) => {
|
|
|
- item.name !== file.name;
|
|
|
- });
|
|
|
- this.imagefileListAll = removeNameList;
|
|
|
- this.imageFileList = removeName;
|
|
|
- this.$emit('successImageList', this.imagefileListAll);
|
|
|
- this.$emit('deleteImage', file);
|
|
|
- console.log('handleRemove', this.imageFileList);
|
|
|
},
|
|
|
handlePictureCardPreview(file) {
|
|
|
this.dialogImageUrl = file.url;
|
|
@@ -111,7 +113,7 @@ export default {
|
|
|
handleSuccess(response, file) {
|
|
|
this.message(file.response.status, '图片上传');
|
|
|
this.imageFileList = [];
|
|
|
- if (this.imageFileList.length >= 3) {
|
|
|
+ if (this.imagefileListAll.length >= 3) {
|
|
|
return this.$message.warning(`最多可上传${this.limit}图片`);
|
|
|
}
|
|
|
let obj = {};
|