<template>
|
<div class="swichTag">
|
|
<a-page-header title="归档时间线" style="padding: 0px;" @back="() => this.$router.go(-1)" />
|
|
<a-timeline pending="没有更多了...">
|
<a-icon slot="pendingDot" type="close-circle" style="font-size: 18px;" />
|
<div v-for="yearData in list">
|
<a-divider orientation="left">
|
{{yearData.year}}年
|
</a-divider>
|
|
<a-timeline-item v-for="monthData in yearData.list" color="white">
|
<a-icon slot="dot" type="clock-circle-o" style="font-size: 18px;" />
|
<h3>{{monthData.month}}</h3>
|
<div v-for="article in monthData.list">
|
<router-link :to="{path:'/mdDetail',query:{id:article.id}}" class="article-title">
|
<span>
|
{{article.name}}
|
</span>
|
<a-icon type="lock" style="color:rgba(0,0,0,.25)" v-if="article.authStatus==3" />
|
<a-icon type="stop" style="color:rgba(0,0,0,.25)" v-if="article.authStatus==2" />
|
|
</router-link>
|
</div>
|
</a-timeline-item>
|
</div>
|
</a-timeline>
|
</div>
|
</template>
|
|
<script>
|
import {
|
archiveGroup
|
} from '../../api/blogStatistics.js'
|
|
export default {
|
data() {
|
return {
|
year: "",
|
month: "",
|
list: []
|
}
|
},
|
created() {
|
this.year = this.$route.query.year;
|
this.month = this.$route.query.month;
|
archiveGroup({
|
year: this.year,
|
month: this.month
|
}).then((res) => {
|
this.list = res.data;
|
})
|
},
|
watch: {
|
'$route'(to, from) {
|
if ("tagTime" === to.name) {
|
this.year = this.$route.query.year;
|
this.month = this.$route.query.month;
|
this.$message.info('loading', 0.3);
|
archiveGroup({
|
year: this.year,
|
month: this.month
|
}).then((res) => {
|
this.list = res.data;
|
})
|
}
|
},
|
},
|
}
|
</script>
|
|
|
<style lang="less">
|
|
.ant-timeline-item-content {
|
|
a {
|
color: #555;
|
}
|
|
span {
|
line-height: 30px;
|
}
|
}
|
</style>
|