研发图纸文件管理系统-前端项目
longyvfengyun
2024-01-02 bb89a0a6111a9c98d54411d41ec2e63575eea53f
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<script>
import createWs from "@/assets/js/websocket";
const WSMixin = createWs("log");
export default {
    name: "TodayLog",
    mixins: [WSMixin],
    data() {
        return {
            list: []
        }
    },
    methods: {
        onWSMessage(res) {
            let rs = JSON.parse(res.data);
            let data = rs.data;
            this.list = data.map(item=>{
                return {
                    name: item.name,
                    oprateDay: new Date(item.oprateDay).format("hh:mm"),
                    oprateType: item.oprateType,
                    oprateMsg: item.oprateMsg,
                    operateTypeName: item.operateTypeName
                };
            });
        },
        goToLogsMore() {
            this.$router.push({
                path: "/system/logs"
            });
        }
    },
    mounted() {
    }
}
</script>
 
<template>
    <a-card class="a-flex-card" size="small" title="最新动态">
        <template #extra>
            <span class="href-text" @click="goToLogsMore">更多</span>
        </template>
        <div class="list-wrapper">
            <ul class="timeline timeline-tag-left">
                <li v-for="(item, key) in list" :key="'key'+key">
                    <div>
                        <span class="timeline-tag">{{ item.oprateDay }}</span>
                        <span class="timeline-text">
                            {{ item.name }}
                            <span class="label-action">{{ item.operateTypeName }}</span>
                            <span class="href-text" :title="item.oprateMsg">{{ item.oprateMsg }}</span>
                        </span>
                    </div>
                </li>
            </ul>
        </div>
    </a-card>
</template>
 
<style scoped>
.a-flex-card.ant-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}
/deep/.ant-card-body {
    flex: 1;
    position: relative;
    overflow: hidden;
}
.list-wrapper {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow-y: auto;
}
.timeline-tag-left {
    padding-left: 50px;
}
.timeline>li {
    position: relative;
    list-style: none;
}
.timeline > li:before {
    left: -26px;
}
.timeline > li:before {
    position: absolute;
    display: block;
    top: 8px;
    left: -16px;
    z-index: 3;
    width: 7px;
    height: 7px;
    background-color: #c4c4c4;
    border: 1px solid #c4c4c4;
    content: ' ';
    border-radius: 50%;
}
.timeline > li > div:after {
    position: absolute;
    display: block;
    content: ' ';
    top: 11px;
    left: -27px;
    z-index: 3;
    width: 9px;
    height: 9px;
    background-color: #2e7fff;
    border-radius: 50%;
    opacity: 0;
}
.timeline-tag {
    position: absolute;
    top: 2px;
    left: -50px;
    font-size: 12px;
}
.timeline-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 24px;
    font-size: 14px;
}
.timeline>li+li:after {
    position: absolute;
    top: -8px;
    bottom: 10px;
    left: -13px;
    z-index: 1;
    display: block;
    content: ' ';
    border-left: 1px solid #eee;
}
.label-action {
    display: inline-block;
    padding: 0 2px 0 0;
}
.list-wrapper {
    height: 100%;
    overflow: auto;
}
.href-text {
    cursor: pointer;
    color: #13c2c2;
}
</style>