|
|
@ -1,5 +1,5 @@ |
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div class="wrap"> |
|
|
|
<div v-show="loaded" :class="['wrap', {activity: info.listStyleId === 15}]"> |
|
|
|
<div class="banner"> |
|
|
|
<div class="banner"> |
|
|
|
<img width="100%" height="280" :src="info.columnBanner" alt=""> |
|
|
|
<img width="100%" height="280" :src="info.columnBanner" alt=""> |
|
|
|
<p class="text">{{ info.columnName }}</p> |
|
|
|
<p class="text">{{ info.columnName }}</p> |
|
|
@ -58,9 +58,13 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="contents"> |
|
|
|
<div class="contents"> |
|
|
|
<el-tree v-if="!isFilter && showNav" class="columns" ref="leftColumn" :data="columns" highlight-current :expand-on-click-node="false" default-expand-all :props="defaultProps" node-key="id" icon-class="el-icon-arrow-down" @node-click="columnClick"></el-tree> |
|
|
|
<el-tree v-if="!isFilter && showNav" class="columns" ref="leftColumn" :data="columns" highlight-current :expand-on-click-node="false" default-expand-all :props="defaultProps" node-key="id" icon-class="el-icon-arrow-down" @node-click="item => columnClick(item, 1)"> |
|
|
|
|
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }"> |
|
|
|
|
|
|
|
<span :title="node.label">{{ node.label }}</span> |
|
|
|
|
|
|
|
</span> |
|
|
|
|
|
|
|
</el-tree> |
|
|
|
|
|
|
|
|
|
|
|
<div style="width: 1113px"> |
|
|
|
<div class="article-wrap"> |
|
|
|
<ul class="articles"> |
|
|
|
<ul class="articles"> |
|
|
|
<li v-for="(item, i) in articles" :key="i" @click="toArtice(item)"> |
|
|
|
<li v-for="(item, i) in articles" :key="i" @click="toArtice(item)"> |
|
|
|
<div class="texts"> |
|
|
|
<div class="texts"> |
|
|
@ -72,10 +76,10 @@ |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<span v-if="item.listStyleId === 10" class="meta">{{ item.updateTime }} {{ item.labelName && ' | ' + item.labelName }}</span> |
|
|
|
<span v-if="item.listStyleId === 10" class="meta">{{ item.updateTime }} {{ item.labelName && ' | ' + item.labelName }}</span> |
|
|
|
<template v-if="item.listStyleId === 15 || item.listStyleId === 16"> |
|
|
|
<template v-if="item.listStyleId === 15 || item.listStyleId === 16"> |
|
|
|
<div v-if="item.keynoteSpeaker" class="meta m-b-10"><i class="el-icon-user"></i> {{ item.keynoteSpeaker }}</div> |
|
|
|
<div v-if="item.keynoteSpeaker" class="meta m-b-10"><img class="icon" src="@/assets/images/mine.png" alt=""> {{ item.keynoteSpeaker }}</div> |
|
|
|
<div v-if="item.activityStartTime" class="meta m-b-10"><i class="el-icon-alarm-clock"></i> {{ item.activityStartTime + ' ~ ' + item.activityEndTime }}</div> |
|
|
|
<div v-if="item.activityStartTime" class="meta m-b-10"><img class="icon" src="@/assets/images/time.png" alt=""> {{ item.activityStartTime + ' ~ ' + item.activityEndTime }}</div> |
|
|
|
<div v-if="item.offlineLocation" class="meta m-b-10"><i class="el-icon-location-outline"></i> {{ item.offlineLocation }}</div> |
|
|
|
<div v-if="item.offlineLocation" class="meta m-b-10"><img class="icon" src="@/assets/images/location.png" alt=""> {{ item.offlineLocation }}</div> |
|
|
|
<div v-if="item.onlineLocation" class="meta"><i class="el-icon-position"></i> {{ item.onlineLocation }}</div> |
|
|
|
<div v-if="item.onlineLocation" class="meta"><img class="icon" src="@/assets/images/online.png" alt=""> {{ item.onlineLocation }}</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<img class="pic" :src="item.titleImg" alt=""> |
|
|
|
<img class="pic" :src="item.titleImg" alt=""> |
|
|
@ -88,7 +92,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="right"> |
|
|
|
<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="columnClick"></el-tree> |
|
|
|
<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> |
|
|
|
<p class="l-title">热点内容</p> |
|
|
|
<ul class="list"> |
|
|
|
<ul class="list"> |
|
|
@ -114,10 +118,13 @@ |
|
|
|
<script> |
|
|
|
<script> |
|
|
|
import Setting from '@/setting' |
|
|
|
import Setting from '@/setting' |
|
|
|
import Util from '@/libs/util' |
|
|
|
import Util from '@/libs/util' |
|
|
|
|
|
|
|
import Breadcrumb from '@/components/breadcrumb' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
|
|
|
|
loaded: false, |
|
|
|
id: +this.$route.query.id, |
|
|
|
id: +this.$route.query.id, |
|
|
|
|
|
|
|
fromColumn: this.$route.query.column, |
|
|
|
site: this.$store.state.content.site, |
|
|
|
site: this.$store.state.content.site, |
|
|
|
columnId: '', |
|
|
|
columnId: '', |
|
|
|
info: {}, |
|
|
|
info: {}, |
|
|
@ -147,7 +154,8 @@ export default { |
|
|
|
columns: [], |
|
|
|
columns: [], |
|
|
|
all: null, |
|
|
|
all: null, |
|
|
|
infoColumns: [], |
|
|
|
infoColumns: [], |
|
|
|
curColumn: 0, |
|
|
|
sameStyle: 1, |
|
|
|
|
|
|
|
allColumnId: [], |
|
|
|
showNav: false, |
|
|
|
showNav: false, |
|
|
|
showNavIds: [10, 11, 12, 16], // 显示侧导航的模板id |
|
|
|
showNavIds: [10, 11, 12, 16], // 显示侧导航的模板id |
|
|
|
isFilter: false, |
|
|
|
isFilter: false, |
|
|
@ -163,6 +171,9 @@ export default { |
|
|
|
hots: [] |
|
|
|
hots: [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
components: { |
|
|
|
|
|
|
|
Breadcrumb |
|
|
|
|
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
|
'$route'() { |
|
|
|
'$route'() { |
|
|
|
this.id = this.$route.query.id |
|
|
|
this.id = this.$route.query.id |
|
|
@ -189,7 +200,11 @@ export default { |
|
|
|
// 获取栏目详情 |
|
|
|
// 获取栏目详情 |
|
|
|
getInfo() { |
|
|
|
getInfo() { |
|
|
|
this.$post(`${this.api.findColumn}?id=${this.id}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.findColumn}?id=${this.id}`).then(({ data }) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!data.columnBanner) data.columnBanner = require('@/assets/images/column-banner.png') |
|
|
|
this.info = data |
|
|
|
this.info = data |
|
|
|
|
|
|
|
this.loaded = true |
|
|
|
this.showNav = this.showNavIds.includes(data.listStyleId) |
|
|
|
this.showNav = this.showNavIds.includes(data.listStyleId) |
|
|
|
this.getClassification() |
|
|
|
this.getClassification() |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
@ -205,7 +220,6 @@ export default { |
|
|
|
this.classifications = data |
|
|
|
this.classifications = data |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 获取标签 |
|
|
|
// 获取标签 |
|
|
|
getLabel() { |
|
|
|
getLabel() { |
|
|
@ -213,15 +227,29 @@ export default { |
|
|
|
this.labels = data |
|
|
|
this.labels = data |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 递归查询是否每个层级的栏目都是同一列表样式,如果是,则查询全部栏目下的文章,否则查询当前栏目下的 |
|
|
|
|
|
|
|
handleColumn(data, id) { |
|
|
|
|
|
|
|
for (const e of data) { |
|
|
|
|
|
|
|
this.allColumnId.push(e.id) |
|
|
|
|
|
|
|
if (e.listStyleId !== id) { |
|
|
|
|
|
|
|
this.sameStyle = 0 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.handleColumn(e.children, id) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 左边栏目 |
|
|
|
// 左边栏目 |
|
|
|
getLeftColumn() { |
|
|
|
getLeftColumn() { |
|
|
|
this.$post(`${this.api.oneLevelChecksThemAll}?id=${this.id}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.oneLevelChecksThemAll}?id=${this.id}`).then(({ data }) => { |
|
|
|
this.getArticle([+this.$route.query.id]) |
|
|
|
const fromColumn = this.$route.query.column |
|
|
|
this.curColumn = 0 |
|
|
|
this.sameStyle = !fromColumn |
|
|
|
|
|
|
|
this.allColumnId = [] |
|
|
|
|
|
|
|
fromColumn || data.length && this.handleColumn(data, data[0].listStyleId) |
|
|
|
|
|
|
|
this.getArticle(this.sameStyle ? this.allColumnId : [+this.$route.query.id]) |
|
|
|
this.columns = data |
|
|
|
this.columns = data |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
const el = this.$refs.leftColumn |
|
|
|
const el = this.$refs.leftColumn |
|
|
|
el && el.setCurrentKey(this.id) |
|
|
|
el && el.setCurrentKey(this.sameStyle ? data[0].id : this.id) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -257,8 +285,10 @@ export default { |
|
|
|
this.filter() |
|
|
|
this.filter() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 点击栏目回调 |
|
|
|
// 点击栏目回调 |
|
|
|
columnClick(to) { |
|
|
|
columnClick(to, left) { |
|
|
|
const { typeId } = to |
|
|
|
const { typeId } = to |
|
|
|
|
|
|
|
// 如果是左边的栏目,并且是第一级,并且长页/链接,则不作反应 |
|
|
|
|
|
|
|
if (left && to.level === 1 && (typeId === 2 || typeId === 3)) return false |
|
|
|
// 跳转链接 |
|
|
|
// 跳转链接 |
|
|
|
if (typeId === 2) { |
|
|
|
if (typeId === 2) { |
|
|
|
let href = to.linkAddress |
|
|
|
let href = to.linkAddress |
|
|
@ -283,9 +313,12 @@ export default { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
location.href = href |
|
|
|
location.href = href |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (typeId !== 4 || (typeId === 4 && !to.children.length)) { |
|
|
|
} else if (typeId === 3) { |
|
|
|
// 常规栏目跳转到column页,长页栏目直接获取path |
|
|
|
// 长页栏目直接获取path |
|
|
|
this.$router.push(`/${typeId === 3 ? to.path : 'column'}?id=${to.id}`).catch(err => {}) |
|
|
|
this.$router.push(`/${to.path}?id=${to.id}`).catch(err => {}) |
|
|
|
|
|
|
|
} else if (typeId === 1 || (typeId === 4 && !to.children.length)) { |
|
|
|
|
|
|
|
// 常规栏目跳转到column页 |
|
|
|
|
|
|
|
this.$router.push(`/column?id=${to.id}&column=1`).catch(err => {}) |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询文章列表 |
|
|
|
// 查询文章列表 |
|
|
@ -302,11 +335,7 @@ export default { |
|
|
|
labelName, |
|
|
|
labelName, |
|
|
|
...this.form |
|
|
|
...this.form |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
const list = data.records |
|
|
|
this.articles = Util.removeTag(data.records) |
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
e.mainBody = e.mainBody.replace(/<img.*?>/g , '') // 去掉正文里的图片 |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.articles = list |
|
|
|
|
|
|
|
this.total = +data.total |
|
|
|
this.total = +data.total |
|
|
|
}).catch(res => {}) |
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
@ -327,7 +356,6 @@ export default { |
|
|
|
} else if (this.columns.length) { |
|
|
|
} else if (this.columns.length) { |
|
|
|
id = [this.columns[0].id] |
|
|
|
id = [this.columns[0].id] |
|
|
|
} |
|
|
|
} |
|
|
|
this.curColumn = 0 |
|
|
|
|
|
|
|
this.getArticle(id) |
|
|
|
this.getArticle(id) |
|
|
|
}, |
|
|
|
}, |
|
|
|
currentChange(val) { |
|
|
|
currentChange(val) { |
|
|
@ -368,11 +396,14 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
.article { |
|
|
|
.article { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
justify-content: center; |
|
|
|
width: 1666px; |
|
|
|
|
|
|
|
margin: 0 auto; |
|
|
|
margin: 0 auto; |
|
|
|
.left { |
|
|
|
.left { |
|
|
|
width: 1295px; |
|
|
|
width: 1295px; |
|
|
|
|
|
|
|
margin-right: 28px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.article-wrap { |
|
|
|
|
|
|
|
width: 1113px; |
|
|
|
} |
|
|
|
} |
|
|
|
.switch { |
|
|
|
.switch { |
|
|
|
display: inline-flex; |
|
|
|
display: inline-flex; |
|
|
@ -381,15 +412,15 @@ export default { |
|
|
|
li { |
|
|
|
li { |
|
|
|
padding: 0 15px; |
|
|
|
padding: 0 15px; |
|
|
|
margin-right: 10px; |
|
|
|
margin-right: 10px; |
|
|
|
line-height: 32px; |
|
|
|
line-height: 36px; |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
|
color: #333; |
|
|
|
color: #333; |
|
|
|
border-radius: 4px; |
|
|
|
background: #F7F7F7; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
} |
|
|
|
.active { |
|
|
|
.active { |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
background-color: #1fa7ff; |
|
|
|
background: linear-gradient(126deg, #1150AC 0%, #17BEFF 100%); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.forms { |
|
|
|
.forms { |
|
|
@ -446,7 +477,7 @@ export default { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/.columns { |
|
|
|
/deep/.columns { |
|
|
|
width: 174px; |
|
|
|
width: 210px; |
|
|
|
margin-right: 12px; |
|
|
|
margin-right: 12px; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
&:after { |
|
|
|
&:after { |
|
|
@ -537,20 +568,26 @@ export default { |
|
|
|
@include mul-ellipsis(2); |
|
|
|
@include mul-ellipsis(2); |
|
|
|
} |
|
|
|
} |
|
|
|
.meta { |
|
|
|
.meta { |
|
|
|
font-size: 16px; |
|
|
|
display: flex; |
|
|
|
color: #666; |
|
|
|
align-items: center; |
|
|
|
|
|
|
|
font-size: 14px; |
|
|
|
|
|
|
|
font-family: PingFangSC-Medium; |
|
|
|
|
|
|
|
color: #333; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.icon { |
|
|
|
|
|
|
|
margin-right: 10px; |
|
|
|
} |
|
|
|
} |
|
|
|
.des { |
|
|
|
.des { |
|
|
|
margin-top: 15px; |
|
|
|
margin-top: 15px; |
|
|
|
@include mul-ellipsis(2); |
|
|
|
@include mul-ellipsis(2); |
|
|
|
} |
|
|
|
} |
|
|
|
img { |
|
|
|
.pic { |
|
|
|
width: 417px; |
|
|
|
width: 417px; |
|
|
|
height: 244px; |
|
|
|
height: 244px; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.right { |
|
|
|
.right { |
|
|
|
width: 324px; |
|
|
|
width: 290px; |
|
|
|
} |
|
|
|
} |
|
|
|
.column { |
|
|
|
.column { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
@ -586,4 +623,33 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.activity { |
|
|
|
|
|
|
|
.column-wrap { |
|
|
|
|
|
|
|
padding: 0; |
|
|
|
|
|
|
|
background: none; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.article-wrap { |
|
|
|
|
|
|
|
width: 100%; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.article { |
|
|
|
|
|
|
|
justify-content: center; |
|
|
|
|
|
|
|
.left { |
|
|
|
|
|
|
|
width: 1136px; |
|
|
|
|
|
|
|
margin-right: 36px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.forms { |
|
|
|
|
|
|
|
padding: 30px 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.articles li { |
|
|
|
|
|
|
|
flex-direction: row-reverse; |
|
|
|
|
|
|
|
justify-content: flex-end; |
|
|
|
|
|
|
|
padding-bottom: 38px; |
|
|
|
|
|
|
|
margin-bottom: 38px; |
|
|
|
|
|
|
|
border-bottom: 1px solid #ddd; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.right { |
|
|
|
|
|
|
|
padding-top: 30px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |