Commit 0a983cc2 by 高浩杰

Merge branch 'master' of coding.yundingshuyuan.com:pigbigbig/beyond-clouds-front into yoona

parents 29cefba4 3efcd4bd
...@@ -74,7 +74,8 @@ ...@@ -74,7 +74,8 @@
tagId: item.categoryId tagId: item.categoryId
}) })
}); });
console.log(classList); console.log(classList)
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);
...@@ -82,9 +83,7 @@ ...@@ -82,9 +83,7 @@
response:response, response:response,
classList classList
} }
}else{ }else{ return {classList}}
return {classList}
}
}, },
mounted(){ mounted(){
...@@ -149,20 +148,13 @@ ...@@ -149,20 +148,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) {
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<select-card <select-card
ref="license" ref="license"
selectType="2" selectType="2"
:class-list="classList" :class-list="List1"
@handleClass="(val) => this.license = val.tag" @handleClass="(val) => this.license = val.tag"
placeholder="请选择授权协议"></select-card> placeholder="请选择授权协议"></select-card>
</div> </div>
...@@ -40,18 +40,18 @@ ...@@ -40,18 +40,18 @@
<select-card <select-card
ref="language" ref="language"
selectType="2" selectType="2"
:class-list="classList" :class-list="List2"
@handleClass="(val) => this.language = val.tag" @handleClass="(val) => this.language = val.tag"
placeholder="请选择开发语言"></select-card> placeholder="请选择开发语言"></select-card>
</div> </div>
<div class="select__wrap"> <div class="select__wrap">
<span>*</span> <span>*</span>
<select-card <select-card
ref="system" ref="projectClass"
selectType="2" selectType="2"
:class-list="classList" :class-list="classList"
@handleClass="(val) => this.system = val.tag" @handleClass="(val) => this.projectClass = val.tagId"
placeholder="请选择操作系统"></select-card> placeholder="请选择项目类型"></select-card>
</div> </div>
</div> </div>
<div class="header-content"> <div class="header-content">
...@@ -82,14 +82,14 @@ ...@@ -82,14 +82,14 @@
@focus="() => this.$refs.docLink.style.border = '1px solid transparent'" @focus="() => this.$refs.docLink.style.border = '1px solid transparent'"
@blur="checkAddress(docLink, 'docLink')" @blur="checkAddress(docLink, 'docLink')"
> >
<div class="select__wrap"> <div class="select__wrap" v-if="false">
<span>*</span> <span>*</span>
<select-card <select-card
ref="projectClass" ref="system"
selectType="2" selectType="2"
:class-list="classList" :class-list="classList"
@handleClass="(val) => this.projectClass = val.tag" @handleClass="(val) => this.system = val.tag"
placeholder="请选择项目类型"></select-card> placeholder="请选择操作系统"></select-card>
</div> </div>
</div> </div>
<div class="header-content"> <div class="header-content">
...@@ -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() {
...@@ -177,11 +189,12 @@ export default { ...@@ -177,11 +189,12 @@ export default {
this.$refs.license.$refs.select.value = this.response.data.license; this.$refs.license.$refs.select.value = this.response.data.license;
this.projectDescription = this.response.data.projectDescription; this.projectDescription = this.response.data.projectDescription;
this.name = this.response.data.projectName; this.name = this.response.data.projectName;
this.projectClass = this.response.data.projectType; this.projectClass = this.response.data.categoryId;
this.$refs.projectClass.$refs.select.value = this.response.data.projectType; this.$refs.projectClass.$refs.select.value = this.response.data.category;
this.system = this.response.data.runtimePlatform; //this.system = this.response.data.runtimePlatform;
this.$refs.system.$refs.select.value = this.response.data.runtimePlatform; //this.$refs.system.$refs.select.value = this.response.data.runtimePlatform;
this.addressLink = this.response.data.sourceLink this.addressLink = this.response.data.sourceLink
} }
}, },
components: {SelectCard, CardContainer}, components: {SelectCard, CardContainer},
...@@ -219,7 +232,8 @@ export default { ...@@ -219,7 +232,8 @@ 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"}], List1: [{tagId:1,tag:"MPL"},{tagId:2,tag:"BSD"},{tagId:3,tag:"Com"},{tagId:4,tag:"QPL"},{tagId:5,tag:"QNCL"},{tagId:6,tag:"Jab"},{tagId:7,tag:"IBM"}],
List2: [{tagId:1,tag:"C"}, {tagId:2,tag:"Java"},{tagId:3,tag:"Javascript"},{tagId:4,tag:"python"},{tagId:5,tag:"C++"}],
license: '', // 项目协议 license: '', // 项目协议
language: '', // 项目语言 language: '', // 项目语言
system: '', // 项目系统 system: '', // 项目系统
...@@ -316,7 +330,7 @@ export default { ...@@ -316,7 +330,7 @@ export default {
message: '请输入项目名称' message: '请输入项目名称'
}) })
} else if (this.license === '') { } else if (this.license === '') {
console.log(this.$refs.license); //console.log(this.$refs.license);
this.$refs.license.handleShow(); this.$refs.license.handleShow();
this.$refs.license.$refs.select.focus(); this.$refs.license.$refs.select.focus();
this.$message({ this.$message({
...@@ -330,13 +344,6 @@ export default { ...@@ -330,13 +344,6 @@ export default {
type: 'warning', type: 'warning',
message: '请选择开发语言' message: '请选择开发语言'
}) })
}else if (this.system === '') {
this.$refs.system.handleShow();
this.$refs.system.$refs.select.focus();
this.$message({
type: 'warning',
message: '请选择操作系统'
})
}else if (this.addressLink === '') { }else if (this.addressLink === '') {
this.$refs.addressLink.focus(); this.$refs.addressLink.focus();
this.$message({ this.$message({
...@@ -371,7 +378,7 @@ export default { ...@@ -371,7 +378,7 @@ export default {
return true return true
} }
} else { } else {
if (this.name !== '' && this.license !== '' && this.language !== '' && this.system !== '' if (this.name !== '' && this.license !== '' && this.language !== ''
&& this.addressLink !== '' && this.projectClass !== '' && this.projectDescription !== '' && this.addressLink !== '' && this.projectClass !== '' && this.projectDescription !== ''
&& this.value !== '' && this.imgSrc !== '' && this.value !== '' && this.imgSrc !== ''
) { ) {
...@@ -385,30 +392,6 @@ export default { ...@@ -385,30 +392,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;
...@@ -417,7 +400,7 @@ export default { ...@@ -417,7 +400,7 @@ export default {
// 修改执行这个接口 // 修改执行这个接口
projectRes = await this.$axios.$put(config.api.put.Project.revise + this.$route.query.id, { projectRes = await this.$axios.$put(config.api.put.Project.revise + this.$route.query.id, {
author: this.author, author: this.author,
categoryId: 1, categoryId: this.projectClass,
cover: this.imgSrc, cover: this.imgSrc,
devLang: this.language, devLang: this.language,
docLink: this.docLink, docLink: this.docLink,
...@@ -428,8 +411,8 @@ export default { ...@@ -428,8 +411,8 @@ export default {
projectDescription: this.projectDescription, projectDescription: this.projectDescription,
contentHtml: this.projectDetail, contentHtml: 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
}) })
.then((response) => { .then((response) => {
...@@ -449,19 +432,18 @@ export default { ...@@ -449,19 +432,18 @@ export default {
} 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: this.projectClass,
cover: this.imgSrc, cover: this.imgSrc,
devLang: this.language, devLang: this.language,
docLink: this.docLink, docLink: this.docLink,
homeLink: this.homeLink, homeLink: this.homeLink,
content: this.content,//内容 content: this.content,//内容
//contentHtml: this.blogDetail,// 内容的html
license: this.license, license: this.license,
projectDescription: this.projectDescription, projectDescription: this.projectDescription,
contentHtml: this.projectDetail, contentHtml: 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
}) })
} }
......
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