|
|
|
@ -135,6 +135,34 @@ |
|
|
|
|
</el-tree> |
|
|
|
|
|
|
|
|
|
<template v-if="articles.length"> |
|
|
|
|
<!-- 只有一篇文章,则直接显示文章详情 --> |
|
|
|
|
<div v-if="articles.length === 1" |
|
|
|
|
class="detail"> |
|
|
|
|
|
|
|
|
|
<template v-if="article.articleTemplate != 72"> |
|
|
|
|
<h2>{{ article.title }}</h2> |
|
|
|
|
<!-- <div class="meta">{{ article.source && article.source + ' | ' }} {{ article.author && article.author + ' | ' }} {{ article.releaseTime }}</div> |
|
|
|
|
<div class="meta">{{ article.edit && $t('column.edit') + ':' + article.edit }} {{ article.audit && ' | ' + $t('column.auditor') + ':' + article.audit }} {{ article.label && ' | ' + $t('column.label') + ':' + article.label }}</div> --> |
|
|
|
|
</template> |
|
|
|
|
<p v-if="article.summary" |
|
|
|
|
class="brief">{{ article.summary }}</p> |
|
|
|
|
<div class="des" |
|
|
|
|
v-html="article.mainBody"></div> |
|
|
|
|
<div v-if="article.fileList && article.fileList.length" |
|
|
|
|
class="annex"> |
|
|
|
|
<h6>{{$t('column.attachmentDownload')}}</h6> |
|
|
|
|
<ul class="files"> |
|
|
|
|
<li v-for="(file, i) in article.fileList" |
|
|
|
|
:key="i"> |
|
|
|
|
<span class="name">{{ file.fileName }}</span> |
|
|
|
|
<span class="download" |
|
|
|
|
@click="download(file)">{{$t('column.download')}}</span> |
|
|
|
|
</li> |
|
|
|
|
</ul> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
|
<template v-else> |
|
|
|
|
<template v-if="info.listStyleId === 12"> |
|
|
|
|
<div class="article-wrap"> |
|
|
|
|
<ul class="articles"> |
|
|
|
@ -373,6 +401,7 @@ |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
<div v-else |
|
|
|
|
class="none"> |
|
|
|
|
<img src="@/assets/images/none.png" |
|
|
|
@ -451,7 +480,8 @@ export default { |
|
|
|
|
news: [], |
|
|
|
|
hots: [], |
|
|
|
|
deepestId: '', |
|
|
|
|
getAllId: null |
|
|
|
|
getAllId: null, |
|
|
|
|
article: {} |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
components: { |
|
|
|
@ -744,8 +774,14 @@ export default { |
|
|
|
|
}) |
|
|
|
|
this.articles = articles |
|
|
|
|
this.total = +data.total; |
|
|
|
|
// 如果栏目那勾选了“只有一篇文章时,以详情方式展示”,并且只有一篇文章,则跳转到详情页 |
|
|
|
|
// 如果栏目那勾选了“只有一篇文章时,以详情方式展示”,并且只有一篇文章,则直接展示详情 |
|
|
|
|
// this.total == 1 && this.info.showWithDetails && this.$router.push(`/article?articleId=${this.articles[0].id}&id=${this.articles[0].columnId}`) |
|
|
|
|
if (this.total == 1) { |
|
|
|
|
this.$post(`${this.api.findArticle}?id=${articles[0].id}`).then(async ({ data }) => { |
|
|
|
|
this.article = data |
|
|
|
|
console.log("🚀 ~ file: index.vue:778 ~ .then ~ this.article:", this.article) |
|
|
|
|
}).catch(err => { }) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch((res) => { }); |
|
|
|
|
}, |
|
|
|
@ -778,7 +814,11 @@ export default { |
|
|
|
|
id = [this.$refs.leftColumn.getCurrentKey()]; |
|
|
|
|
} |
|
|
|
|
this.getArticle(id); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 下载附件 |
|
|
|
|
download (e) { |
|
|
|
|
Util.downloadFile(e.fileName, e.filePath) |
|
|
|
|
}, |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
@ -922,6 +962,9 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/.columns { |
|
|
|
|
& + .detail { |
|
|
|
|
padding-left: 10px; |
|
|
|
|
} |
|
|
|
|
width: 22%; |
|
|
|
|
margin-right: 0.6rem; |
|
|
|
|
overflow: auto; |
|
|
|
@ -1207,6 +1250,58 @@ export default { |
|
|
|
|
background-color: $partyTheme !important; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.detail { |
|
|
|
|
flex: 1; |
|
|
|
|
h2 { |
|
|
|
|
margin-bottom: 1rem; |
|
|
|
|
font-size: 1.9rem; |
|
|
|
|
color: #1c1c1c; |
|
|
|
|
} |
|
|
|
|
.meta { |
|
|
|
|
margin: 1rem 0; |
|
|
|
|
font-size: 0.88rem; |
|
|
|
|
color: #9b9b9b; |
|
|
|
|
} |
|
|
|
|
.brief { |
|
|
|
|
padding-bottom: 1.5rem; |
|
|
|
|
margin-bottom: 1rem; |
|
|
|
|
font-size: 1.2rem; |
|
|
|
|
line-height: 1.33; |
|
|
|
|
color: #606060; |
|
|
|
|
border-bottom: 1px solid #d8d8d8; |
|
|
|
|
} |
|
|
|
|
/deep/.des { |
|
|
|
|
img { |
|
|
|
|
max-width: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.annex { |
|
|
|
|
margin-top: 30px; |
|
|
|
|
h6 { |
|
|
|
|
padding-left: 8px; |
|
|
|
|
margin-bottom: 20px; |
|
|
|
|
font-size: 16px; |
|
|
|
|
font-family: PingFangSC-Medium, PingFang SC; |
|
|
|
|
font-weight: 500; |
|
|
|
|
line-height: 1; |
|
|
|
|
color: #333; |
|
|
|
|
border-left: 4px solid #1583ff; |
|
|
|
|
} |
|
|
|
|
li { |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
|
margin-bottom: 10px; |
|
|
|
|
} |
|
|
|
|
.name { |
|
|
|
|
margin-right: 8px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
} |
|
|
|
|
.download { |
|
|
|
|
color: #1583ff; |
|
|
|
|
cursor: pointer; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.none { |
|
|
|
|
display: inline-flex; |
|
|
|
|
flex-direction: column; |
|
|
|
|