Commit 8d2745f1 by yanju

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

parents dc128700 5febda17
......@@ -7,8 +7,10 @@
height="400px"
>
<div class="blog-release_List" v-for="val in blogList" :key="val.blogId" :info="val">
<div style="width: 60%"><p @click="toDetail">{{val.blogTitle}}</p></div>
<div class="blog-release_List_r" @click="toDetail">{{val.category}}</div>
<div class="blog-box" @click="toDetail(val.blogId)">
<p>{{val.blogTitle}}</p>
<p style="color: #999">{{val.category}}</p>
</div>
</div>
</card-container>
<card-container
......@@ -41,6 +43,7 @@
placeholder="请选择文章分类"
></select-card>
</div>
<!-- 博客链接 -->
<input v-if="false" type="text" placeholder="相关链接" style="width: 461px;" v-model="originLink" ref="originLink">
</div>
<div class="header-content">
......@@ -163,7 +166,7 @@ export default {
this.way = this.detailContent.viewPrivileges;
this.$refs.blogClass.$refs.select.value = this.detailContent.category;
this.blogClass = this.detailContent.categoryId;
console.log(this.$refs.tagIds);
let tags = [];
this.tagList = new Set();
this.detailContent.tags.forEach(item => {
......@@ -230,12 +233,11 @@ export default {
tagList: new Set(),
img: "",
classList: [{tagId: 1, tag: "web"}, {tagId: 2, tag: "java"}, {tagId: 3, tag: "javascript"}]
// classList:["web","java","javascript"]
}
},
methods: {
toDetail() {
this.$router.push('/detail')
toDetail(path) {
this.$router.push(`/blog/detail/${path}`);
},
// 获得下拉框得内容
handleBlogClass(value) {
......@@ -255,7 +257,7 @@ export default {
},
// 获得得标签数组
handleTagList(tagList) {
console.log(this.tagList);
this.tagList = new Set();
tagList.forEach(item => {
this.tagList.add(item.tagId)
});
......@@ -266,8 +268,7 @@ export default {
let formData = new window.FormData();
formData.append('file', e.target.files[0]);
formData.append('type', 1);
//console.log(formData);
const isLt5M = (e).target.files[0].size / 1024 / 1024 < 5
const isLt5M = (e).target.files[0].size / 1024 / 1024 < 5;
if (!isLt5M) {
this.$message.error('图片大小超过5M,请重新选择图片!');
return false
......@@ -326,7 +327,6 @@ export default {
return false;
}
if (this.tagList.size === '') {
//this.$refs.tagIds.focus();
this.$refs.tagIds.handleShow();
this.$refs.tagIds.$refs.tag.focus();
this.$message({
......@@ -402,7 +402,6 @@ export default {
"null"//话题id
],
viewPrivileges: this.way //1公开,0私有
})
.then((response) => {
if (response.code === 0) {
......@@ -410,11 +409,7 @@ export default {
message: "发布博客成功",
type: 'success'
});
/* setTimeout(() => {
this.$router.push('/personal-center/home/blog')
}, 500);*/
this.$router.push('/personal-center/home/blog')
} else {
this.$message({
message: response.msg,
......@@ -476,7 +471,6 @@ export default {
input {
border: 1*$length solid transparent;
@extend %animate-transition;
&:focus {
border: 1*$length solid #00AAE6;
}
......@@ -487,30 +481,26 @@ export default {
margin: 24*$length auto 32*$length auto;
@extend %flex-row-spb;
align-items: start;
overflow: hidden;
.blog-release-container__l {
.blog-release_List {
width: 266*$length;
@extend %flex-row-spb;
margin-top: 5px;
padding-left: 18*$length;
padding-right: 18*$length;
font-size: 13*$length;
p {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.blog-release_List_r {
color: #999999
padding: 0 18*$length;
.blog-box {
margin: 15*$length 0;
@extend %cursorPointer;
@include fontStyle(13,17,500,#333,left);
@extend %flex-row-spb;
@extend %cursorPointer;
.blog-box__title {
width: 60%;
@extend %nowrap;
}
&:hover {
color: #00AAE6;
}
}
:hover {
color: #00AAE6;
cursor: pointer
}
}
}
......@@ -519,19 +509,15 @@ export default {
.blog-release {
width: 748*$length;
margin: 0 auto;
.blog-release__header {
margin-top: 40*$length;
.header-content {
@extend %flex-row-spb;
margin-bottom: 32*$length;
> span {
color: #FF7474;
font-size: 6*$length;
}
> input {
width: 726*$length;
padding: 14*$length 16*$length;
......@@ -540,11 +526,9 @@ export default {
@include border-radius(4*$length);
@include fontStyle(14, 46, 500, #666, left);
}
.select__wrap {
@extend %flex-row-spb;
align-items: start;
> span {
color: #FF7474;
font-size: 6*$length;
......@@ -558,19 +542,16 @@ export default {
.blog-release__content {
@extend %flex-row-spb;
align-items: start;
> span {
display: inline-block;
margin-top: 18*$length;
color: #FF7474;
font-size: 6*$length;
}
.editor-container {
width: 723*$length;
height: 230*$length;
overflow: auto;
.editor {
min-height: 230*$length;
min-width: 723*$length;
......@@ -582,11 +563,9 @@ export default {
@extend %flex-row-spb;
align-items: start;
margin-top: 32*$length;
.select-content {
@extend %flex-row-spb;
align-items: start;
> span {
color: #FF7474;
font-size: 6*$length;
......@@ -598,29 +577,23 @@ export default {
.choose-container {
@extend %flex-row-spb;
.input-box__wrap {
@extend %flex-row-spb;
> span {
margin-right: 16*$length;
color: #FF7474;
font-size: 6*$length;
}
.input-box {
margin-right: 40*$length;
line-height: 16*$length;
input[type="radio"] {
display: none;
}
label {
@include fontStyle(12, 16, 500, #999, left);
vertical-align: middle;
}
input[type="radio"] + label::before {
content: "\a0"; /*不换行空格*/
display: inline-block;
......@@ -635,7 +608,6 @@ export default {
background-color: #fff;
@include border-radius(2*$length);
}
input[type="radio"]:checked + label::before {
display: inline-block;
width: 12*$length;
......@@ -659,7 +631,6 @@ export default {
@extend %flex-row-spb;
align-items: flex-end;
margin-top: 35*$length;
.footer__left {
overflow: hidden;
width: 196*$length;
......@@ -667,7 +638,6 @@ export default {
@extend %cursorPointer;
@include border-radius(4*$length);
@include fontStyle(12, 130, 500, #666, center);
& input {
float: left;
height: 100%;
......@@ -676,7 +646,6 @@ export default {
transform: translateY(-200%);
@extend %cursorPointer;
}
& img {
float: left;
height: 100%;
......@@ -685,16 +654,13 @@ export default {
object-fit: contain;
}
}
.footer__right {
@extend %flex-row-spb;
justify-content: flex-end;
> p {
margin-right: 32*$length;
@include fontStyle(12, 16, 500, #999, left);
}
> button {
@include fontStyle(14, 19, 500, #fff, center);
width: 100*$length;
......@@ -704,13 +670,11 @@ export default {
@extend %cursorPointer;
@include border-radius(4*$length);
}
.preview {
color: #666;
background-color: #fff;
margin-right: 16*$length;
@extend %animate-transition;
&:hover {
color: #fff;
background-color: #00AAE6;
......
......@@ -104,6 +104,7 @@
>
<select-card
selectType="2"
v-if="false"
:class-list="classList"
@handleClass="(val) => this.childClass = val.tag"
placeholder="请选择项目子类型"></select-card>
......@@ -138,7 +139,7 @@
</p>
<div class="footer__right">
<p>已自动存为草稿</p>
<button class="preview">预览</button>
<button class="preview" >预览</button>
<button class="submit" @click="postProject">提交</button>
</div>
</div>
......@@ -155,6 +156,34 @@ import SelectCard from "../../../components/pc/select/selectCard";
import config from '../../../action/config';
export default {
async asyncData({$axios, query}) {
if (query.hasOwnProperty('id')) {
const response = await $axios.$get(config.api.get.Project.detail + query.id);
console.log(response);
return {
response:response,
}
}
},
mounted() {
if (this.$route.query.id) {
this.imgSrc = this.response.data.cover,
this.language = this.response.data.devLang,
this.$refs.language.$refs.select.value = this.response.data.devLang,
this.docLink = this.response.data.docLink,
this.homeLink = this.response.data.homeLink,
this.content = this.response.data.devLang,//内容
this.license = this.response.data.license,
this.$refs.license.$refs.select.value = this.response.data.license,
this.projectDescription = this.response.data.projectDescription,
this.name = this.response.data.projectName;
this.projectClass = this.response.data.projectType,
this.$refs.projectClass.$refs.select.value = this.response.data.projectType,
this.system = this.response.data.runtimePlatform,
this.$refs.system.$refs.select.value = this.response.data.runtimePlatform,
this.addressLink = this.response.data.sourceLink
}
},
components: {SelectCard, CardContainer},
data() {
return {
......@@ -356,35 +385,67 @@ export default {
}
}
},
//get修改信息
dataGetProject(id) {
this.$axios.$get(config.api.get.Project.list+id,).then((response)=>{
this.projectList=response.data.dataList;
// 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() {
let projectRes;
if (this.checkProject()) {
if (this.$route.query.id) {
// 修改执行这个接口
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//项目源码地址
projectRes = await this.$axios.$put(config.api.put.Project.revise + this.$route.query.id, {
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
})
.then((response) => {
if (response.code === 0) {
this.$message({
message: "修改项目成功",
type: 'success'
});
this.$router.push('/personal-center/home/project')
} else {
this.$message({
message: response.msg,
type: 'warning'
})
}
})
} else {
projectRes = await this.$axios.$post(config.api.post.Project.release, {
author: this.author,
......
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