|
@@ -6,7 +6,12 @@
|
|
|
<h2 class="title">{{ contentsItem.title }}</h2>
|
|
|
<h4 class="title" v-if="contentsItem && contentsItem.curtTitle">{{ contentsItem.curtTitle }}</h4>
|
|
|
<!-- <span class="describe">{{ contentsItem.describe }}</span> -->
|
|
|
- <span class="date">发表时间: {{ contentsItem.date | dates }}<span class="visit" v-if="contentsItem.source">来源: {{ contentsItem.source | source }}</span><span class="visit">访问量: {{ contentsItem.visit }}</span></span>
|
|
|
+ <span class="date">
|
|
|
+ 发表时间: {{ contentsItem.date | dates }}
|
|
|
+ <span class="visit" v-if="contentsItem.source">来源: {{ contentsItem.source | source }}</span>
|
|
|
+ <span class="visit" v-if="contentsItem.author">作者 : {{ contentsItem && contentsItem.author }}</span>
|
|
|
+ <span class="visit">访问量: {{ contentsItem.visit }}</span>
|
|
|
+ </span>
|
|
|
<div class="content" v-html="contentsItem.content"></div>
|
|
|
<div v-if="contentsItem && contentsItem.annex">
|
|
|
<a v-for="(item, index) in contentsItem.annex" :key="index" :href="item.url" :download="item.url" target="view_window">下载附件:{{ item.name }}<br/></a>
|
|
@@ -47,8 +52,9 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
await this.contentsFetch({ id: this.id });
|
|
|
- this.$refs.detailsHome.scrollIntoView(true);
|
|
|
await this.sourceQuery();
|
|
|
+ // eslint-disable-next-line no-unused-expressions
|
|
|
+ if (this.$refs.detailsHome) this.$refs.detailsHome?.scrollIntoView(true);
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['contentsFetch', 'imgNewsFetch', 'sourceQuery'])
|
|
@@ -58,7 +64,7 @@ export default {
|
|
|
return moment(e).format('YYYY-MM-DD');
|
|
|
},
|
|
|
source(code) {
|
|
|
- const name = _this.dict.source.find(e => e.code == code).name;
|
|
|
+ const name = _this.dict?.source?.find(e => e.code == code).name;
|
|
|
return name;
|
|
|
}
|
|
|
}
|