Commit d8accb64 authored by 张俊's avatar 张俊

接口对接完成

parent e7ec996a
...@@ -66,13 +66,13 @@ export default { ...@@ -66,13 +66,13 @@ export default {
this.editor = new E(this.$refs.toolbar); this.editor = new E(this.$refs.toolbar);
this.editor.config.uploadImgShowBase64 = false; // base 64 存储图片 this.editor.config.uploadImgShowBase64 = false; // base 64 存储图片
this.editor.config.uploadImgServer = this.editor.config.uploadImgServer =
"/tp-jiwei-pcsvc/display/cigApi/common/uploadFile"; // 配置服务器端地址 "/apaas/static/image/upload"; // 配置服务器端地址
this.editor.config.uploadImgHeaders = {}; // 自定义 header this.editor.config.uploadImgHeaders = {}; // 自定义 header
this.editor.config.uploadFileName = "file"; // 后端接受上传文件的参数名 this.editor.config.uploadFileName = "file"; // 后端接受上传文件的参数名
// this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M
this.editor.config.uploadImgMaxLength = 6; // 限制一次最多上传 3 张图片 this.editor.config.uploadImgMaxLength = 6; // 限制一次最多上传 3 张图片
this.editor.config.uploadImgTimeout = 3 * 60 * 1000; // 设置超时时间 this.editor.config.uploadImgTimeout = 3 * 60 * 1000; // 设置超时时间
this.editor.config.uploadImgParams = { category: "图片" }; this.editor.config.uploadImgParams = { directory: "image" };
this.editor.config.uploadImgHooks = { this.editor.config.uploadImgHooks = {
fail: (xhr, editor, result) => { fail: (xhr, editor, result) => {
...@@ -95,13 +95,13 @@ export default { ...@@ -95,13 +95,13 @@ export default {
//循环插入图片 //循环插入图片
// for (let i = 0; i < 1; i++) { // for (let i = 0; i < 1; i++) {
console.log(result); console.log(result);
let imgUrl = "/tp-jiwei-pcsvc/display" + result.data.visitPath; let imgUrl = result.data;
console.log(imgUrl); console.log(imgUrl);
insertImg(imgUrl); insertImg(imgUrl);
// } // }
} }
}; };
this.editor.config.onchange = html => { this.editor.config.onblur = html => {
this.info_ = html; // 绑定当前逐渐地值 this.info_ = html; // 绑定当前逐渐地值
this.$emit("change", this.info_); // 将内容同步到父组件中 this.$emit("change", this.info_); // 将内容同步到父组件中
}; };
......
...@@ -74,13 +74,13 @@ export default { ...@@ -74,13 +74,13 @@ export default {
this.editor = new E(this.$refs.toolbar); this.editor = new E(this.$refs.toolbar);
this.editor.config.uploadImgShowBase64 = false; // base 64 存储图片 this.editor.config.uploadImgShowBase64 = false; // base 64 存储图片
this.editor.config.uploadImgServer = this.editor.config.uploadImgServer =
"/tp-jiwei-pcsvc/display/cigApi/common/uploadFile"; // 配置服务器端地址 "/apaas/static/image/upload"; // 配置服务器端地址
this.editor.config.uploadImgHeaders = {}; // 自定义 header this.editor.config.uploadImgHeaders = {}; // 自定义 header
this.editor.config.uploadFileName = "file"; // 后端接受上传文件的参数名 this.editor.config.uploadFileName = "file"; // 后端接受上传文件的参数名
// this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M this.editor.config.uploadImgMaxSize = 2 * 1024 * 1024; // 将图片大小限制为 2M
this.editor.config.uploadImgMaxLength = 6; // 限制一次最多上传 3 张图片 this.editor.config.uploadImgMaxLength = 6; // 限制一次最多上传 3 张图片
this.editor.config.uploadImgTimeout = 3 * 60 * 1000; // 设置超时时间 this.editor.config.uploadImgTimeout = 3 * 60 * 1000; // 设置超时时间
this.editor.config.uploadImgParams = { category: "图片" }; this.editor.config.uploadImgParams = { directory: "image" };
this.editor.config.uploadImgHooks = { this.editor.config.uploadImgHooks = {
fail: (xhr, editor, result) => { fail: (xhr, editor, result) => {
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
//循环插入图片 //循环插入图片
// for (let i = 0; i < 1; i++) { // for (let i = 0; i < 1; i++) {
console.log(result); console.log(result);
let imgUrl = "/tp-jiwei-pcsvc/display" + result.data.visitPath; let imgUrl = result.data;
console.log(imgUrl); console.log(imgUrl);
insertImg(imgUrl); insertImg(imgUrl);
// } // }
...@@ -113,7 +113,7 @@ export default { ...@@ -113,7 +113,7 @@ export default {
this.editor.config.menus = this.menu this.editor.config.menus = this.menu
} }
this.editor.config.showFullScreen = this.full this.editor.config.showFullScreen = this.full
this.editor.config.onchange = html => { this.editor.config.onblur = html => {
this.info_ = html; // 绑定当前逐渐地值 this.info_ = html; // 绑定当前逐渐地值
this.$emit("change", this.info_); // 将内容同步到父组件中 this.$emit("change", this.info_); // 将内容同步到父组件中
}; };
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</div> </div>
<div class="detail_edit"> <div class="detail_edit">
<wang-e-bd class="editbox" v-model="editstr" :menu="menu" :full="false"></wang-e-bd> <wang-e-bd class="editbox" v-model="editstr" :menu="menu" :full="false"></wang-e-bd>
<div class="pubilc"><img src="../../../assets/imgs/jszc_ic_fabu.png" alt="">发表</div> <div class="pubilc" @click="add_question"><img src="../../../assets/imgs/jszc_ic_fabu.png" alt="">发表</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -35,6 +35,7 @@ export default { ...@@ -35,6 +35,7 @@ export default {
'video' 'video'
], ],
editstr:'', editstr:'',
click_flag:true,
}; };
}, },
watch: { watch: {
...@@ -50,7 +51,43 @@ export default { ...@@ -50,7 +51,43 @@ export default {
}, },
methods: { methods: {
add_question(){
if(!this.click_flag){
return
}
setTimeout(()=>{
if(this.title){
}else{
this.$message.error('请填写标题')
return
}
if(this.editstr){
}else{
this.$message.error('请填写内容')
return
}
this.click_flag = false
this.$http
.post(
`/apaas/support/qa/question/create`,{
title:this.title,
content:this.editstr
}
).then((res)=>{
this.click_flag = true
this.title = ''
this.editstr = ''
if(res.data.success){
this.$message.success('添加成功')
this.$router.push('/technical_support/answer_center/list')
}else{
this.$message.error('添加失败')
}
})
},100)
}
}, },
}; };
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment