Commit 6e7913e7 by xuebiao

项目发布问题发布新加字段

parent efa2bf45
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<span>*</span> <span>*</span>
<div class="editor-container"> <div class="editor-container">
<mavon-editor <mavon-editor
v-model="questionDetail" v-model="content"
ref="questionDetail" ref="questionDetail"
:toolbars="markdownOption" :toolbars="markdownOption"
class="editor" class="editor"
...@@ -180,7 +180,9 @@ ...@@ -180,7 +180,9 @@
this.$axios.$post(config.api.post.Question.release,{ this.$axios.$post(config.api.post.Question.release,{
categoryId: this.blogClass, categoryId: this.blogClass,
questionAbstract: "无",//摘要 questionAbstract: "无",//摘要
questionDetail: this.questionDetail, //questionDetail: this.questionDetail,
content: this.content,//内容
contentHtml: this.questionDetail,// 内容的html
questionTitle: this.questionTitle, questionTitle: this.questionTitle,
tagIds: [//标签id tagIds: [//标签id
this.tagList this.tagList
...@@ -241,18 +243,14 @@ ...@@ -241,18 +243,14 @@
console.log(pos); console.log(pos);
}, },
save(value, render) { //保存文章内容 save(value, render) { //保存文章内容
this.projectDetail = render; this.questionDetail = render;
console.log('save'); //console.log('save');
}, },
intervalSave(value, render) { intervalSave(value, render) {
// 自动保存 // 自动保存
// render: value 经过markdown解析后的结果 // render: value 经过markdown解析后的结果
let now = new Date(); this.questionDetail = render;
if (now - this.lastSaveTime >= 2 * 1000) {
this.lastSaveTime = now;
this.content = value;
this.contentHtml = render;
}
}, },
readScreen(boolean, str){ // 预览 readScreen(boolean, str){ // 预览
this.zIndex = 8000; this.zIndex = 8000;
......
...@@ -118,6 +118,7 @@ ...@@ -118,6 +118,7 @@
<div class="editor-container"> <div class="editor-container">
<mavon-editor <mavon-editor
ref="editor" ref="editor"
v-model="content"
:toolbars="markdownOption" :toolbars="markdownOption"
class="editor" class="editor"
:style="{zIndex: zIndex}" :style="{zIndex: zIndex}"
...@@ -238,13 +239,14 @@ export default { ...@@ -238,13 +239,14 @@ export default {
this.projectDetail = render; this.projectDetail = render;
}, },
intervalSave(value, render) { intervalSave(value, render) {
// 自动保存 /* 自动保存
// render: value 经过markdown解析后的结果 render: value 经过markdown解析后的结果
let now = new Date(); let now = new Date();
if (now - this.lastSaveTime >= 2 * 1000) { if (now - this.lastSaveTime >= 2 * 1000) {
this.lastSaveTime = now; this.lastSaveTime = now;
this.projectDetail = render; this.projectDetail = render;
} }*/
this.projectDetail=render;
}, },
// 上传图片 // 上传图片
changeToUploadCover(e) { changeToUploadCover(e) {
...@@ -354,6 +356,14 @@ export default { ...@@ -354,6 +356,14 @@ export default {
} }
} }
}, },
//get修改信息
dataGetProject(id) {
this.$axios.$get(config.api.get.Project.list+id,).then((response)=>{
this.projectList=response.data.dataList;
})
},
// 发布项目 // 发布项目
async postProject() { async postProject() {
let projectRes; let projectRes;
...@@ -362,34 +372,36 @@ export default { ...@@ -362,34 +372,36 @@ export default {
// 修改执行这个接口 // 修改执行这个接口
projectRes = await this.$axios.$put(config.api.put.Project.revise, { projectRes = await this.$axios.$put(config.api.put.Project.revise, {
"author": this.author, "author": this.author,
"categoryId": 1, "categoryId": 1,//项目类型
"cover": this.imgSrc, "cover": this.imgSrc,//封面
"devLang": this.language, "devLang": this.language,//开发语言
"docLink": this.docLink, "docLink": this.docLink,//开发链接
"homeLink": this.homeLink, "homeLink": this.homeLink,//主页链接
"license": this.license, "license": this.license,//协议
"projectDescription": this.projectDescription, "projectDescription": this.projectDescription,//项目描述
"projectDetail": this.projectDetail, "projectDetail": this.projectDetail,//详情
"projectName": this.name, "projectName": this.name,//项目名称
"projectType": this.projectClass, "projectType": this.projectClass,//项目类型
"runtimePlatform": this.system, "runtimePlatform": this.system,//项目运行平台
"sourceLink": this.addressLink "sourceLink": this.addressLink//项目源码地址
}) })
} else { } else {
projectRes = await this.$axios.$post(config.api.post.Project.release, { projectRes = await this.$axios.$post(config.api.post.Project.release, {
"author": this.author, author: this.author,
"categoryId": 1, categoryId: 1,
"cover": this.imgSrc, cover: this.imgSrc,
"devLang": this.language, devLang: this.language,
"docLink": this.docLink, docLink: this.docLink,
"homeLink": this.homeLink, homeLink: this.homeLink,
"license": this.license, content: this.content,//内容
"projectDescription": this.projectDescription, //contentHtml: this.blogDetail,// 内容的html
"projectDetail": this.projectDetail, license: this.license,
"projectName": this.name, projectDescription: this.projectDescription,
"projectType": this.projectClass, contentHtml: this.projectDetail,
"runtimePlatform": this.system, projectName: this.name,
"sourceLink": this.addressLink projectType: this.projectClass,
runtimePlatform: this.system,
sourceLink: this.addressLink
}) })
} }
console.log(projectRes); console.log(projectRes);
......
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