|
@@ -373,7 +373,10 @@ export default {
|
|
this.$refs[formName].validate(async (valid) => {
|
|
this.$refs[formName].validate(async (valid) => {
|
|
if(valid) {
|
|
if(valid) {
|
|
const formData = new FormData();
|
|
const formData = new FormData();
|
|
- formData.append('photo', this.formList.photo);
|
|
|
|
|
|
+ if(this.flag == 1) {
|
|
|
|
+ formData.append('photo', this.formList.photo);
|
|
|
|
+ }
|
|
|
|
+
|
|
formData.append('title', this.formList.title);
|
|
formData.append('title', this.formList.title);
|
|
formData.append('newsAbstract', this.formList.newsAbstract);
|
|
formData.append('newsAbstract', this.formList.newsAbstract);
|
|
this.treeIds = this.$refs.tree.getCheckedNodes(false, true);
|
|
this.treeIds = this.$refs.tree.getCheckedNodes(false, true);
|
|
@@ -482,21 +485,6 @@ export default {
|
|
onEditorFocus(){}, // 获得焦点事件
|
|
onEditorFocus(){}, // 获得焦点事件
|
|
onEditorChange(event){
|
|
onEditorChange(event){
|
|
this.formList.content = event.html;
|
|
this.formList.content = event.html;
|
|
- // console.log(event.html);
|
|
|
|
- // var imgReg = /<img.*?(?:>|\/>)/gi;
|
|
|
|
- // var srcReg = /src=[\'\"]?([^\'\"]*)[\'\"]?/i;
|
|
|
|
- // this.picList = event.html.match(imgReg);
|
|
|
|
- // if( this.picList == []) {
|
|
|
|
- // return;
|
|
|
|
- // }else{
|
|
|
|
- // for (var i = 0; i < this.picList.length; i++) {
|
|
|
|
- // var src = this.picList[i].match(srcReg);
|
|
|
|
- // //获取图片地址
|
|
|
|
- // // console.log('图片地址'+(i+1)+':'+src[1]);
|
|
|
|
- // // console.log(src[1]);
|
|
|
|
- // }
|
|
|
|
- // console.log(src);
|
|
|
|
- // }
|
|
|
|
|
|
|
|
}, // 内容改变事件
|
|
}, // 内容改变事件
|
|
|
|
|
|
@@ -587,10 +575,9 @@ export default {
|
|
console.log(file);
|
|
console.log(file);
|
|
},
|
|
},
|
|
handleSuccess (a) {
|
|
handleSuccess (a) {
|
|
- // console.log(this.formList.photo)
|
|
|
|
- this.formList.photo = a.raw;
|
|
|
|
if(a !== '') {
|
|
if(a !== '') {
|
|
this.flag = 1
|
|
this.flag = 1
|
|
|
|
+ this.formList.photo = a.raw;
|
|
this.formChangeList.photo = a.raw;
|
|
this.formChangeList.photo = a.raw;
|
|
}else {
|
|
}else {
|
|
this.flag = 0
|
|
this.flag = 0
|