Commit 6e7913e7 by xuebiao

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

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