inleft
2022-02-23 81c155e7e00b83f06e6486a8d904428a44b8b275
commit | author | age
41b36f 1 <template>
I 2     <div class="swichTag">
3
4         <a-page-header title="归档时间线" style="padding: 0px;" @back="() => this.$router.go(-1)" />
5
6         <a-timeline pending="没有更多了...">
7             <a-icon slot="pendingDot" type="close-circle" style="font-size: 18px;" />
8             <div v-for="yearData in list">
9                 <a-divider orientation="left">
10                     {{yearData.year}}年
11                 </a-divider>
12
63f511 13                 <a-timeline-item v-for="monthData in yearData.list" color="white">
41b36f 14                     <a-icon slot="dot" type="clock-circle-o" style="font-size: 18px;" />
I 15                     <h3>{{monthData.month}}</h3>
16                     <div v-for="article in monthData.list">
63f511 17                         <router-link :to="{path:'/mdDetail',query:{id:article.id}}" class="article-title">
I 18                             <span>
19                                 {{article.name}}
20                             </span>
21                             <a-icon type="lock" style="color:rgba(0,0,0,.25)" v-if="article.authStatus==3" />
22                             <a-icon type="stop" style="color:rgba(0,0,0,.25)" v-if="article.authStatus==2" />
23
24                         </router-link>
41b36f 25                     </div>
I 26                 </a-timeline-item>
27             </div>
28         </a-timeline>
29     </div>
30 </template>
31
32 <script>
63f511 33     import {
I 34         archiveGroup
35     } from '../../api/blogStatistics.js'
41b36f 36
63f511 37     export default {
I 38         data() {
39             return {
40                 year: "",
41                 month: "",
42                 list: []
43             }
44         },
45         created() {
46             this.year = this.$route.query.year;
47             this.month = this.$route.query.month;
81c155 48             archiveGroup({
I 49                 year: this.year,
50                 month: this.month
51             }).then((res) => {
52                 this.list = res.data;
53             })
63f511 54         },
aab811 55         watch: {
I 56             '$route'(to, from) {
63f511 57                 if ("tagTime" === to.name) {
I 58                     this.year = this.$route.query.year;
59                     this.month = this.$route.query.month;
81c155 60                     this.$message.info('loading', 0.3);
63f511 61                     archiveGroup({
I 62                         year: this.year,
63                         month: this.month
64                     }).then((res) => {
65                         this.list = res.data;
66                     })
41b36f 67                 }
63f511 68             },
aab811 69         },
41b36f 70     }
I 71 </script>
72
73
74 <style lang="less">
75     .ant-timeline-item-content {
63f511 76         a {
I 77             color: #555;
78         }
79
41b36f 80         span {
I 81             line-height: 30px;
82         }
83     }
84 </style>