inleft
2024-05-18 57e3bead08715d72efaeffe90fafa179b8366473
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<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>