|
|
@ -58,7 +58,7 @@ |
|
|
|
</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" @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="columnClick"></el-tree> |
|
|
|
|
|
|
|
|
|
|
|
<div style="width: 1113px"> |
|
|
|
<div style="width: 1113px"> |
|
|
|
<ul class="articles"> |
|
|
|
<ul class="articles"> |
|
|
@ -92,23 +92,15 @@ |
|
|
|
|
|
|
|
|
|
|
|
<p class="l-title">热点内容</p> |
|
|
|
<p class="l-title">热点内容</p> |
|
|
|
<ul class="list"> |
|
|
|
<ul class="list"> |
|
|
|
<li> |
|
|
|
<li v-for="(item, i) in hots" :key="i" :title="item.title" @click="toArtice(item)"> |
|
|
|
<p class="text">喜报 | 深圳粒子研究院荣获全国科研…</p> |
|
|
|
<p class="text">{{ item.title }}</p> |
|
|
|
<span class="date">2022-08-09</span> |
|
|
|
<span class="date">{{ item.createTime }}</span> |
|
|
|
</li> |
|
|
|
|
|
|
|
<li> |
|
|
|
|
|
|
|
<p class="text">喜报 | 深圳粒子研究院荣获全国科研…</p> |
|
|
|
|
|
|
|
<span class="date">2022-08-09</span> |
|
|
|
|
|
|
|
</li> |
|
|
|
|
|
|
|
<li> |
|
|
|
|
|
|
|
<p class="text">喜报 | 深圳粒子研究院荣获全国科研…</p> |
|
|
|
|
|
|
|
<span class="date">2022-08-09</span> |
|
|
|
|
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</ul> |
|
|
|
</ul> |
|
|
|
|
|
|
|
|
|
|
|
<p class="l-title">最新资讯</p> |
|
|
|
<p class="l-title">最新资讯</p> |
|
|
|
<ul class="list"> |
|
|
|
<ul class="list"> |
|
|
|
<li v-for="(item, i) in news" :key="i"> |
|
|
|
<li v-for="(item, i) in news" :key="i" :title="item.title" @click="toArtice(item)"> |
|
|
|
<p class="text">{{ item.title }}</p> |
|
|
|
<p class="text">{{ item.title }}</p> |
|
|
|
<span class="date">{{ item.createTime }}</span> |
|
|
|
<span class="date">{{ item.createTime }}</span> |
|
|
|
</li> |
|
|
|
</li> |
|
|
@ -125,7 +117,7 @@ import Util from '@/libs/util' |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
id: this.$route.query.id, |
|
|
|
id: +this.$route.query.id, |
|
|
|
site: this.$store.state.content.site, |
|
|
|
site: this.$store.state.content.site, |
|
|
|
columnId: '', |
|
|
|
columnId: '', |
|
|
|
info: {}, |
|
|
|
info: {}, |
|
|
@ -167,7 +159,8 @@ export default { |
|
|
|
value: 'id', |
|
|
|
value: 'id', |
|
|
|
label: 'columnName' |
|
|
|
label: 'columnName' |
|
|
|
}, |
|
|
|
}, |
|
|
|
news: [] |
|
|
|
news: [], |
|
|
|
|
|
|
|
hots: [] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
watch: { |
|
|
|
watch: { |
|
|
@ -222,18 +215,13 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 左边栏目 |
|
|
|
// 左边栏目 |
|
|
|
getLeftColumn() { |
|
|
|
getLeftColumn() { |
|
|
|
this.$post(`${this.api.getsTheSubColumn}?id=${this.id}`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.oneLevelChecksThemAll}?id=${this.id}`).then(({ data }) => { |
|
|
|
// if (data.length > 1 && !data.find(e => e.listStyleId !== data[0].listStyleId)) { |
|
|
|
this.getArticle([+this.$route.query.id]) |
|
|
|
// this.all = data[0] |
|
|
|
|
|
|
|
// this.getArticle(data.map(e => e.id)) |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// this.all = null |
|
|
|
|
|
|
|
// this.getArticle([data[data.length > 1 ? 1 : 0].id]) |
|
|
|
|
|
|
|
// // data = data.slice(1) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
data.length && this.getArticle([data[0].id]) |
|
|
|
|
|
|
|
this.curColumn = 0 |
|
|
|
this.curColumn = 0 |
|
|
|
this.columns = data |
|
|
|
this.columns = data |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
this.$refs.leftColumn.setCurrentKey(this.id) |
|
|
|
|
|
|
|
}) |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 右边资讯 |
|
|
|
// 右边资讯 |
|
|
@ -247,6 +235,10 @@ export default { |
|
|
|
}).then(({ data }) => { |
|
|
|
}).then(({ data }) => { |
|
|
|
this.infoColumns = data |
|
|
|
this.infoColumns = data |
|
|
|
}).catch(err => {}) |
|
|
|
}).catch(err => {}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.$post(`${this.api.hotContent}?siteId=${this.$route.query.siteId || this.$store.state.content.site}`).then(({ data }) => { |
|
|
|
|
|
|
|
this.hots = data |
|
|
|
|
|
|
|
}).catch(err => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 最新资讯 |
|
|
|
// 最新资讯 |
|
|
|
getNews() { |
|
|
|
getNews() { |
|
|
@ -264,9 +256,40 @@ export default { |
|
|
|
this.filter() |
|
|
|
this.filter() |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 点击栏目回调 |
|
|
|
// 点击栏目回调 |
|
|
|
columnClick(data) { |
|
|
|
columnClick(to) { |
|
|
|
this.page = 1 |
|
|
|
console.log("🚀 ~ file: index.vue ~ line 268 ~ columnClick ~ data", to) |
|
|
|
this.getArticle([data.id]) |
|
|
|
const { typeId } = to |
|
|
|
|
|
|
|
// 跳转链接 |
|
|
|
|
|
|
|
if (typeId === 2) { |
|
|
|
|
|
|
|
let href = to.linkAddress |
|
|
|
|
|
|
|
const cType = to.connectionType |
|
|
|
|
|
|
|
if (cType !== 2) { // 非站外链接 |
|
|
|
|
|
|
|
const ids = href.split('-') // 栏目文章是用-分割的,栏目是必选,文章不是必选。选择了文章则跳转到文章页,否则跳转到栏目页 |
|
|
|
|
|
|
|
// 站点id:站内链接取当前站点,其他站点链接取siteSelection |
|
|
|
|
|
|
|
const site = cType === 1 ? |
|
|
|
|
|
|
|
(this.$route.query.siteId || this.site) : |
|
|
|
|
|
|
|
to.siteSelection |
|
|
|
|
|
|
|
if (ids[1]) { // 文章 |
|
|
|
|
|
|
|
href = '/article?id=' + ids[1] |
|
|
|
|
|
|
|
} else { // 栏目 |
|
|
|
|
|
|
|
const columnIds = ids[0].split(',') |
|
|
|
|
|
|
|
href = '/column?id=' + columnIds[columnIds.length - 1] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
href = this.$router.resolve(href + '&siteId=' + site).href |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// 是否新窗口打开 |
|
|
|
|
|
|
|
if (to.isOpen) { |
|
|
|
|
|
|
|
window.open(href) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
location.href = href |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else if (typeId === 3) { |
|
|
|
|
|
|
|
// 长页栏目直接获取path |
|
|
|
|
|
|
|
this.$router.push(`/${to.path}?id=${to.id}`).catch(err => {}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.page = 1 |
|
|
|
|
|
|
|
this.getArticle([to.id]) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 查询文章列表 |
|
|
|
// 查询文章列表 |
|
|
|
getArticle(columnIds) { |
|
|
|
getArticle(columnIds) { |
|
|
@ -276,7 +299,7 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.$post(this.api.newlyPublishedArticles, { |
|
|
|
this.$post(this.api.newlyPublishedArticles, { |
|
|
|
siteId: this.$route.query.siteId || this.site, |
|
|
|
siteId: this.$route.query.siteId || this.site, |
|
|
|
columnIds, |
|
|
|
columnIds: columnIds.length ? columnIds : [this.id], |
|
|
|
pageNum: this.page, |
|
|
|
pageNum: this.page, |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageSize: this.pageSize, |
|
|
|
labelName, |
|
|
|
labelName, |
|
|
@ -294,7 +317,7 @@ export default { |
|
|
|
getIds(data, ids) { |
|
|
|
getIds(data, ids) { |
|
|
|
data.map(e => { |
|
|
|
data.map(e => { |
|
|
|
ids.push(e.id) |
|
|
|
ids.push(e.id) |
|
|
|
this.getIds(e.children, ids) |
|
|
|
e.children && this.getIds(e.children, ids) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 筛选 |
|
|
|
// 筛选 |
|
|
@ -312,7 +335,14 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
currentChange(val) { |
|
|
|
currentChange(val) { |
|
|
|
this.page = val |
|
|
|
this.page = val |
|
|
|
// this.getData() |
|
|
|
this.isFilter = !!(this.form.classificationId || this.form.title || this.form.convokeType || this.lableId.length) |
|
|
|
|
|
|
|
let id = [] |
|
|
|
|
|
|
|
if (this.isFilter || this.all) { |
|
|
|
|
|
|
|
this.getIds(this.columns, id) |
|
|
|
|
|
|
|
} else if (this.columns.length) { |
|
|
|
|
|
|
|
id = [this.$refs.leftColumn.getCurrentKey()] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.getArticle(id) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 跳转文章页面 |
|
|
|
// 跳转文章页面 |
|
|
|
toArtice(item) { |
|
|
|
toArtice(item) { |
|
|
@ -332,6 +362,7 @@ export default { |
|
|
|
position: absolute; |
|
|
|
position: absolute; |
|
|
|
top: 123px; |
|
|
|
top: 123px; |
|
|
|
left: 243px; |
|
|
|
left: 243px; |
|
|
|
|
|
|
|
@include ellipsis; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.column-wrap { |
|
|
|
.column-wrap { |
|
|
@ -417,37 +448,69 @@ export default { |
|
|
|
.contents { |
|
|
|
.contents { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
} |
|
|
|
} |
|
|
|
.columns { |
|
|
|
/deep/.columns { |
|
|
|
width: 174px; |
|
|
|
width: 174px; |
|
|
|
margin-right: 12px; |
|
|
|
margin-right: 12px; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|
li { |
|
|
|
&:after { |
|
|
|
display: flex; |
|
|
|
content: ''; |
|
|
|
align-items: center; |
|
|
|
position: absolute; |
|
|
|
|
|
|
|
top: 0; |
|
|
|
|
|
|
|
right: 0; |
|
|
|
|
|
|
|
width: 2px; |
|
|
|
|
|
|
|
height: 100%; |
|
|
|
|
|
|
|
background-color: #E1E6F2; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.el-tree-node__content { |
|
|
|
|
|
|
|
// z-index: 1; |
|
|
|
|
|
|
|
position: relative; |
|
|
|
height: 48px; |
|
|
|
height: 48px; |
|
|
|
padding-left: 40px; |
|
|
|
padding-left: 40px; |
|
|
|
margin-bottom: 1px; |
|
|
|
margin-bottom: 1px; |
|
|
|
font-size: 16px; |
|
|
|
font-size: 16px; |
|
|
|
color: #666; |
|
|
|
color: #666; |
|
|
|
background-color: #fff; |
|
|
|
background-color: #fff; |
|
|
|
border-right: 2px solid transparent; |
|
|
|
border-bottom: 1px solid #F8F9F9; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
&:before { |
|
|
|
&:before { |
|
|
|
content: ''; |
|
|
|
content: ''; |
|
|
|
width: 2px; |
|
|
|
width: 2px; |
|
|
|
height: 2px; |
|
|
|
height: 2px; |
|
|
|
margin-right: 5px; |
|
|
|
margin: 0 10px 0 20px; |
|
|
|
background-color: #666; |
|
|
|
background-color: #666; |
|
|
|
border-radius: 50%; |
|
|
|
border-radius: 50%; |
|
|
|
} |
|
|
|
} |
|
|
|
&:hover { |
|
|
|
&:hover { |
|
|
|
color: #0c84eb; |
|
|
|
color: #0c84eb; |
|
|
|
} |
|
|
|
} |
|
|
|
&.active { |
|
|
|
} |
|
|
|
border-right-color: #083A93; |
|
|
|
.el-tree-node__label { |
|
|
|
|
|
|
|
font-size: 16px; |
|
|
|
|
|
|
|
color: #666; |
|
|
|
|
|
|
|
line-height: 22px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.el-tree-node__expand-icon.expanded { |
|
|
|
|
|
|
|
transform: rotate(180deg); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.el-tree-node__expand-icon { |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
right: 10px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.is-current > .el-tree-node__content { |
|
|
|
|
|
|
|
&:after { |
|
|
|
|
|
|
|
content: ''; |
|
|
|
|
|
|
|
z-index: 2; |
|
|
|
|
|
|
|
position: absolute; |
|
|
|
|
|
|
|
top: 0; |
|
|
|
|
|
|
|
right: 0; |
|
|
|
|
|
|
|
width: 2px; |
|
|
|
|
|
|
|
height: 100%; |
|
|
|
|
|
|
|
background-color: #083A93; |
|
|
|
} |
|
|
|
} |
|
|
|
&.all { |
|
|
|
// border-right: 2px solid #083A93; |
|
|
|
padding-left: 24px; |
|
|
|
.el-tree-node__label { |
|
|
|
|
|
|
|
font-weight: 600; |
|
|
|
|
|
|
|
color: #1150AC; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -495,15 +558,15 @@ export default { |
|
|
|
.column { |
|
|
|
.column { |
|
|
|
width: 100%; |
|
|
|
width: 100%; |
|
|
|
margin-bottom: 25px; |
|
|
|
margin-bottom: 25px; |
|
|
|
} |
|
|
|
/deep/.el-tree-node__content { |
|
|
|
/deep/.el-tree-node__content { |
|
|
|
height: 60px; |
|
|
|
height: 60px; |
|
|
|
background-color: #E5EDF8; |
|
|
|
background-color: #E5EDF8; |
|
|
|
border-bottom: 2px solid #fff; |
|
|
|
border-bottom: 2px solid #fff; |
|
|
|
} |
|
|
|
} |
|
|
|
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content { |
|
|
|
/deep/.el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content { |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
background-color: #0f5698; |
|
|
|
background-color: #0f5698; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
.list { |
|
|
|
.list { |
|
|
|
margin-bottom: 20px; |
|
|
|
margin-bottom: 20px; |
|
|
@ -515,6 +578,7 @@ export default { |
|
|
|
margin-bottom: 5px; |
|
|
|
margin-bottom: 5px; |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
|
cursor: pointer; |
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
@include ellipsis; |
|
|
|
&:hover { |
|
|
|
&:hover { |
|
|
|
color: $main-color; |
|
|
|
color: $main-color; |
|
|
|
} |
|
|
|
} |
|
|
|