提交 ee889536 authored 作者: huaxinzhu's avatar huaxinzhu

商品添加和编辑时,连续同一张图片时,后续上传失效问题

上级 54b11697
......@@ -44,12 +44,10 @@
loading: false,
goodsDeForm: {
description: '',
},
// goodsDeRules: {
// description:[{required: true, message: '请上传商品详情图片', validator: checkImg}]
// },
goodsDetailsImgFileList: [],
editorOption: {
placeholder: '',
......@@ -61,6 +59,7 @@
'image': function (value) {
if (value) {
// 触发input框选择图片文件
document.querySelector('#file').value = '' // 清空是为了解决,联系上传同一张图片时,后续上传失效问题
document.querySelector('#file').click()
} else {
this.quill.format('image', false);
......@@ -68,7 +67,7 @@
}
}
},
// // 禁止粘贴图片
// 禁止粘贴图片
clipboard: {
matchers: [[Node.ELEMENT_NODE, this.handleCustomMatcher]]
}
......@@ -107,11 +106,9 @@
insert: ''
})
Delta.ops = ops;
// console.log('我是粘贴的');
}
})
//
//console.log(113,Delta);
return Delta
},
......@@ -125,7 +122,6 @@
const list = this.$refs.file.files;
this.indexall = list.length
this.uploadImgs()
//debugger
},
// 向后台 传输 base64的图片数据
uploadImgs() {
......@@ -133,8 +129,6 @@
let result = res.split(",");
this.Base64img = result[1];
let data = {"img_data": this.Base64img}
//debugger
// this.loading = true;
UploadImg(data).then(res => {
//debugger
if (res && res.code === 1) {
......@@ -149,6 +143,7 @@
// 调整光标到最后
quill.setSelection(length + 1)
if(this.index < this.indexall){
debugger
this.uploadImgs()
}else{
this.index = 0
......@@ -163,18 +158,12 @@
//
onEditorChange({editor, html, text}) {
this.goodsDeForm.description = html;
// console.log( 100,this.$refs.file.files );
// console.log( 200,this.goodsDeForm.description );
// console.log( 300,this.goodsDetailsImgFileList );
// if( this.goodsDeForm.description.indexOf('img') < -1 ) {
// this.goodsDetailsImgFileList = [];
// }
},
onEditorBlur(){//失去焦点事件
},
//失去焦点事件
onEditorBlur(){},
// 商品详情 子组件 form表单校验, 在父组件中被调用
// validateGoodsDeImgForm() {
// let flag = null
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论