|
@@ -97,19 +97,6 @@
|
|
</el-upload>
|
|
</el-upload>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <!-- <el-form-item label="新闻封面" prop="photoId">
|
|
|
|
- <el-upload
|
|
|
|
- class="anniu"
|
|
|
|
- ref="upload"
|
|
|
|
- action="http://192.168.1.199:18083/newsmess/save_news"
|
|
|
|
- :on-preview="handlePreview"
|
|
|
|
- :on-remove="handleRemove"
|
|
|
|
- :on-change="handleSuccess"
|
|
|
|
- :auto-upload="false">
|
|
|
|
- <el-button slot="trigger" size="small" type="primary">选取封面</el-button>
|
|
|
|
- </el-upload>
|
|
|
|
- </el-form-item> -->
|
|
|
|
-
|
|
|
|
<el-form-item label="导航分类">
|
|
<el-form-item label="导航分类">
|
|
<el-tree
|
|
<el-tree
|
|
:data="menuList"
|
|
:data="menuList"
|
|
@@ -132,6 +119,8 @@
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
:action="serverUrl"
|
|
:action="serverUrl"
|
|
name="photo"
|
|
name="photo"
|
|
|
|
+ :format="['jpg','jpeg','png','gif']"
|
|
|
|
+ :max-size="2048"
|
|
:headers="header"
|
|
:headers="header"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:on-success="uploadSuccess"
|
|
:on-success="uploadSuccess"
|
|
@@ -189,20 +178,6 @@
|
|
<img style="width: 150px; height: 150px;" :src="dialogImageUrl" alt="">
|
|
<img style="width: 150px; height: 150px;" :src="dialogImageUrl" alt="">
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
- <!-- <el-form-item label="新闻封面">
|
|
|
|
- <el-upload
|
|
|
|
- class="anniu"
|
|
|
|
- ref="upload"
|
|
|
|
- action="http://192.168.1.199:18083/newsmess/save_news"
|
|
|
|
- :on-preview="handlePreview"
|
|
|
|
- :on-remove="handleRemove"
|
|
|
|
- :on-change="handleSuccess"
|
|
|
|
- :auto-upload="false">
|
|
|
|
- <el-button slot="trigger" size="small" type="primary">选取封面</el-button>
|
|
|
|
- <img style="width: 150px; height: 150px;" :src= "dialogImageUrl" alt="">
|
|
|
|
- </el-upload>
|
|
|
|
- </el-form-item> -->
|
|
|
|
-
|
|
|
|
<el-form-item label="导航分类">
|
|
<el-form-item label="导航分类">
|
|
<el-tree
|
|
<el-tree
|
|
:data="menuList"
|
|
:data="menuList"
|
|
@@ -224,6 +199,8 @@
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
:action="serverUrl"
|
|
:action="serverUrl"
|
|
name="photo"
|
|
name="photo"
|
|
|
|
+ :format="['jpg','jpeg','png','gif']"
|
|
|
|
+ :max-size="2048"
|
|
:headers="header"
|
|
:headers="header"
|
|
:show-file-list="false"
|
|
:show-file-list="false"
|
|
:on-success="uploadSuccessOne"
|
|
:on-success="uploadSuccessOne"
|
|
@@ -486,30 +463,22 @@ 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);
|
|
|
|
+ // }
|
|
|
|
|
|
-
|
|
|
|
- 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]);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- // this.photoList.push(src);
|
|
|
|
- // console.log(this.photoList);
|
|
|
|
- // console.log(event.html)
|
|
|
|
- // console.log(document.getElementsByTagName('img'));
|
|
|
|
- // this.picList.push(document.getElementsByTagName('img').src);
|
|
|
|
- // console.log(this.picList)
|
|
|
|
- // console.log(this.formList.content)
|
|
|
|
}, // 内容改变事件
|
|
}, // 内容改变事件
|
|
|
|
|
|
// 打开修改并赋予信息
|
|
// 打开修改并赋予信息
|
|
@@ -526,7 +495,6 @@ export default {
|
|
this.haveRight = response.data.responseData.navigationBarIds;
|
|
this.haveRight = response.data.responseData.navigationBarIds;
|
|
this.formChangeList.urlList = response.data.responseData.urlList;
|
|
this.formChangeList.urlList = response.data.responseData.urlList;
|
|
console.log(this.formChangeList.urlList);
|
|
console.log(this.formChangeList.urlList);
|
|
- // console.log(response.data.responseData)
|
|
|
|
}
|
|
}
|
|
|
|
|
|
},
|
|
},
|
|
@@ -549,20 +517,20 @@ export default {
|
|
formData.append('navigationBarIds', this.formChangeList.navigationBarIds);
|
|
formData.append('navigationBarIds', this.formChangeList.navigationBarIds);
|
|
formData.append('content', this.detailContent);
|
|
formData.append('content', this.detailContent);
|
|
|
|
|
|
- // const response = await this.$http.put(`app/newsArticle`, formData);
|
|
|
|
- // if(response.data.code === 1) {
|
|
|
|
- // this.loadData();
|
|
|
|
- // this.changeUser = false;
|
|
|
|
- // this.$message({
|
|
|
|
- // type: 'success',
|
|
|
|
- // message: '修改新闻成功'
|
|
|
|
- // });
|
|
|
|
- // }else {
|
|
|
|
- // this.$message({
|
|
|
|
- // type: 'error',
|
|
|
|
- // message: '修改新闻失败'
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
|
|
+ const response = await this.$http.put(`app/newsArticle`, formData);
|
|
|
|
+ if(response.data.code === 1) {
|
|
|
|
+ this.loadData();
|
|
|
|
+ this.changeUser = false;
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '修改新闻成功'
|
|
|
|
+ });
|
|
|
|
+ }else {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'error',
|
|
|
|
+ message: '修改新闻失败'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
// 点击删除按钮
|
|
// 点击删除按钮
|
|
Delete(id) {
|
|
Delete(id) {
|