Commit 5cf94d98 by xuebiao

seesee

parent 22807fc7
...@@ -66,13 +66,23 @@ ...@@ -66,13 +66,23 @@
import config from "../../../action/config"; import config from "../../../action/config";
export default { export default {
async asyncData({$axios, query}) { async asyncData({$axios, query}) {
const questionClass = await $axios.$get(config.api.get.QuestionCategory.list);
let classList = [];
questionClass.data.forEach(item => {
classList.push({
tag: item.category,
tagId: item.categoryId
})
});
if (query.hasOwnProperty('id')) { if (query.hasOwnProperty('id')) {
const response = await $axios.$get(config.api.get.Question.detail + query.id); const response = await $axios.$get(config.api.get.Question.detail + query.id);
console.log(response); console.log(response);
return { return {
response:response, response:response,
classList
} }
} }else{return classList}
}, },
mounted(){ mounted(){
if (this.$route.query.id) { if (this.$route.query.id) {
...@@ -136,20 +146,13 @@ ...@@ -136,20 +146,13 @@
questionDetail:'', questionDetail:'',
questionTitle:'', questionTitle:'',
lastSaveTime: new Date(), lastSaveTime: new Date(),
classList: [{tagId:1,tag:"web"}, {tagId:2,tag:"java"},{tagId:3,tag:"javascript"}], //classList: [{tagId:1,tag:"web"}, {tagId:2,tag:"java"},{tagId:3,tag:"javascript"}],
contentHtml:'', contentHtml:'',
} }
}, },
methods: { methods: {
handleClass(value) { handleClass(value) {
this.blogClass = value.tag; this.blogClass = value.tagId;
if (value.tag === "web") {
this.blogClass = 1;
} else if (value.tag === "java") {
this.blogClass = 2
} else if (value.tag === "javascript") {
this.blogClass = 3
}
}, },
// 获得得标签数组 // 获得得标签数组
handleTagList(tagList) { handleTagList(tagList) {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
<select-card <select-card
ref="language" ref="language"
selectType="2" selectType="2"
:class-list="classList" :class-list="List"
@handleClass="(val) => this.language = val.tag" @handleClass="(val) => this.language = val.tag"
placeholder="请选择开发语言"></select-card> placeholder="请选择开发语言"></select-card>
</div> </div>
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
ref="projectClass" ref="projectClass"
selectType="2" selectType="2"
:class-list="classList" :class-list="classList"
@handleClass="(val) => this.projectClass = val.tag" @handleClass="(val) => this.projectClass = val.tagId"
placeholder="请选择项目类型"></select-card> placeholder="请选择项目类型"></select-card>
</div> </div>
</div> </div>
...@@ -157,12 +157,24 @@ import config from '../../../action/config'; ...@@ -157,12 +157,24 @@ import config from '../../../action/config';
export default { export default {
async asyncData({$axios, query}) { async asyncData({$axios, query}) {
const projectCategory = await $axios.$get(config.api.get.ProjectCategory.list);
let classList=[];
projectCategory.data.forEach(item=>{
classList.push({
tag:item.category,
tagId:item.categoryId
})
});
console.log(classList);
if (query.hasOwnProperty('id')) { if (query.hasOwnProperty('id')) {
const response = await $axios.$get(config.api.get.Project.detail + query.id); const response = await $axios.$get(config.api.get.Project.detail + query.id);
console.log(response); console.log(response);
return { return {
response:response, response:response,
classList
} }
}else{
return classList
} }
}, },
mounted() { mounted() {
...@@ -219,7 +231,7 @@ export default { ...@@ -219,7 +231,7 @@ export default {
zIndex: 100, zIndex: 100,
imgSrc: '', imgSrc: '',
lastSaveTime: new Date(), lastSaveTime: new Date(),
classList: [{tagId:1,tag:"web"}, {tagId:2,tag:"java"},{tagId:3,tag:"javascript"}], List: [{tagId:1,tag:"web"}, {tagId:2,tag:"java"},{tagId:3,tag:"javascript"}],
license: '', // 项目协议 license: '', // 项目协议
language: '', // 项目语言 language: '', // 项目语言
system: '', // 项目系统 system: '', // 项目系统
...@@ -385,30 +397,6 @@ export default { ...@@ -385,30 +397,6 @@ export default {
} }
} }
}, },
// get修改信息
/* dataGetProject() {
this.$axios.$get(config.api.get.Project.detail+136,).then((response)=>{
//this.projectList=response.data.dataList;
//console.log(response);
this.imgSrc=response.data.cover,
this.language=response.data.devLang,
this.$refs.language.$refs.select.value=response.data.devLang,
this.docLink=response.data.docLink,
this.homeLink=response.data.homeLink,
this.content=response.data.devLang,//内容
this.license=response.data.license,
this.$refs.license.$refs.select.value=response.data.license,
this.projectDescription=response.data.projectDescription,
//this.projectDetail=response.data.content,
this.name=response.data.projectName;
// console.log(this.name)
this.projectClass=response.data.projectClass,
this.$refs.projectClass.$refs.select.value=response.data.projectClass,
this.system=response.data.runtimePlatform,
this.$refs.system.$refs.select.value=response.data.runtimePlatform,
this.addressLink=response.data.sourceLink
})
},*/
// 发布项目 // 发布项目
async postProject() { async postProject() {
let projectRes; let 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