Commit 8d2745f1 by yanju

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

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