|
|
|
@ -92,8 +92,6 @@ |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="right"> |
|
|
|
|
<el-tree class="column" ref="column" :data="infoColumns" highlight-current :expand-on-click-node="false" :props="defaultProps" node-key="id" @node-click="item => columnClick(item, 0)"></el-tree> |
|
|
|
|
|
|
|
|
|
<p class="l-title">热点内容</p> |
|
|
|
|
<ul class="list"> |
|
|
|
|
<li v-for="(item, i) in hots" :key="i" :title="item.title" @click="toArtice(item)"> |
|
|
|
@ -119,13 +117,13 @@ |
|
|
|
|
import Setting from '@/setting' |
|
|
|
|
import Util from '@/libs/util' |
|
|
|
|
import Breadcrumb from '@/components/breadcrumb' |
|
|
|
|
import mixins from '@/mixins/article' |
|
|
|
|
export default { |
|
|
|
|
mixins: [mixins], |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
loaded: false, |
|
|
|
|
id: +this.$route.query.id, |
|
|
|
|
fromColumn: this.$route.query.column, |
|
|
|
|
site: this.$store.state.content.site, |
|
|
|
|
columnId: '', |
|
|
|
|
info: {}, |
|
|
|
|
searchTimer: null, |
|
|
|
@ -200,11 +198,10 @@ export default { |
|
|
|
|
// 获取栏目详情 |
|
|
|
|
getInfo() { |
|
|
|
|
this.$post(`${this.api.findColumn}?id=${this.id}`).then(({ data }) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.columnTo(data) |
|
|
|
|
if (data.typeId !== 3) this.loaded = true // 非长页,才展示页面 |
|
|
|
|
if (!data.columnBanner) data.columnBanner = require('@/assets/images/column-banner.png') |
|
|
|
|
this.info = data |
|
|
|
|
this.loaded = true |
|
|
|
|
this.showNav = this.showNavIds.includes(data.listStyleId) |
|
|
|
|
this.getClassification() |
|
|
|
|
}).catch(res => {}) |
|
|
|
@ -241,7 +238,7 @@ export default { |
|
|
|
|
// 左边栏目 |
|
|
|
|
getLeftColumn() { |
|
|
|
|
this.$post(`${this.api.oneLevelChecksThemAll}?id=${this.id}`).then(({ data }) => { |
|
|
|
|
const fromColumn = this.$route.query.column |
|
|
|
|
const fromColumn = this.$route.query.column // 有column标识的,说明是通过点击左侧导航跳转过来的,这种情况只查询该栏目下的文章 |
|
|
|
|
this.sameStyle = !fromColumn |
|
|
|
|
this.allColumnId = [] |
|
|
|
|
fromColumn || data.length && this.handleColumn(data, data[0].listStyleId) |
|
|
|
@ -324,6 +321,7 @@ export default { |
|
|
|
|
// 查询文章列表 |
|
|
|
|
getArticle(columnIds) { |
|
|
|
|
const labelName = [] |
|
|
|
|
// 获取标签名称 |
|
|
|
|
this.labels.map(e => { |
|
|
|
|
if (this.lableId.includes(e.id)) labelName.push(e.labelName) |
|
|
|
|
}) |
|
|
|
@ -337,6 +335,8 @@ export default { |
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
this.articles = Util.removeTag(data.records) |
|
|
|
|
this.total = +data.total |
|
|
|
|
// 如果栏目那勾选了“只有一篇文章时,以详情方式展示”,并且只有一篇文章,则跳转到详情页 |
|
|
|
|
this.total == 1 && this.info.showWithDetails && this.$router.push(`/article?articleId=${this.articles[0].id}&id=${this.articles[0].columnId}`) |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 递归获取栏目所有id |
|
|
|
@ -369,10 +369,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.getArticle(id) |
|
|
|
|
}, |
|
|
|
|
// 跳转文章页面 |
|
|
|
|
toArtice(item) { |
|
|
|
|
this.$router.push(`/article?id=${item.id}&site=${this.$route.query.siteId || this.site}`) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
@ -399,11 +395,11 @@ export default { |
|
|
|
|
justify-content: center; |
|
|
|
|
margin: 0 auto; |
|
|
|
|
.left { |
|
|
|
|
width: 1295px; |
|
|
|
|
width: 66%; |
|
|
|
|
margin-right: 28px; |
|
|
|
|
} |
|
|
|
|
.article-wrap { |
|
|
|
|
width: 1113px; |
|
|
|
|
width: 78%; |
|
|
|
|
} |
|
|
|
|
.switch { |
|
|
|
|
display: inline-flex; |
|
|
|
@ -437,9 +433,10 @@ export default { |
|
|
|
|
.label { |
|
|
|
|
font-size: 16px; |
|
|
|
|
color: #333; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
} |
|
|
|
|
/deep/.el-input__inner { |
|
|
|
|
width: 238px; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 48px; |
|
|
|
|
line-height: 48px; |
|
|
|
|
border: 0; |
|
|
|
@ -447,10 +444,11 @@ export default { |
|
|
|
|
} |
|
|
|
|
.search { |
|
|
|
|
display: inline-flex; |
|
|
|
|
width: 34%; |
|
|
|
|
input { |
|
|
|
|
width: 443px; |
|
|
|
|
width: 100%; |
|
|
|
|
height: 48px; |
|
|
|
|
padding: 0 10px; |
|
|
|
|
padding: 0 15px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #333; |
|
|
|
|
background: #F7F7F7; |
|
|
|
@ -477,7 +475,7 @@ export default { |
|
|
|
|
display: flex; |
|
|
|
|
} |
|
|
|
|
/deep/.columns { |
|
|
|
|
width: 210px; |
|
|
|
|
width: 22%; |
|
|
|
|
margin-right: 12px; |
|
|
|
|
overflow: auto; |
|
|
|
|
&:after { |
|
|
|
@ -490,7 +488,6 @@ export default { |
|
|
|
|
background-color: #E1E6F2; |
|
|
|
|
} |
|
|
|
|
.el-tree-node__content { |
|
|
|
|
// z-index: 1; |
|
|
|
|
position: relative; |
|
|
|
|
height: 48px; |
|
|
|
|
padding-left: 40px; |
|
|
|
@ -535,8 +532,7 @@ export default { |
|
|
|
|
height: 100%; |
|
|
|
|
background-color: #083A93; |
|
|
|
|
} |
|
|
|
|
// border-right: 2px solid #083A93; |
|
|
|
|
.el-tree-node__label { |
|
|
|
|
.el-tree-node__label, .custom-tree-node { |
|
|
|
|
font-weight: 600; |
|
|
|
|
color: #1150AC; |
|
|
|
|
} |
|
|
|
@ -582,12 +578,15 @@ export default { |
|
|
|
|
@include mul-ellipsis(2); |
|
|
|
|
} |
|
|
|
|
.pic { |
|
|
|
|
width: 417px; |
|
|
|
|
width: 45%; |
|
|
|
|
min-width: 380px; |
|
|
|
|
height: 244px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.right { |
|
|
|
|
width: 290px; |
|
|
|
|
width: 14%; |
|
|
|
|
min-width: 240px; |
|
|
|
|
overflow: hidden; |
|
|
|
|
} |
|
|
|
|
.column { |
|
|
|
|
width: 100%; |
|
|
|
|