Your Name
2022-06-27 0a3027eccd3b0bb6542e5fc831f7e02740dcfc95
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
<template>
    <div class="big-data-up mb15">
        <div class="up-left">
            <i class="el-icon-time mr5"></i>
            <span>{{ time.txt }}</span>
        </div>
        <div class="up-center">
            <span>智慧农业系统平台</span>
        </div>
    </div>
</template>
 
<script lang="ts">
import { reactive, toRefs, onBeforeMount, onUnmounted, defineComponent } from 'vue';
import { formatDate } from '/@/utils/formatTime';
 
export default defineComponent({
    name: 'chartHead',
    setup() {
        const state = reactive({
            time: {
                txt: '',
                fun: 0,
            },
        });
        // 初始化时间
        const initTime = () => {
            state.time.txt = formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS WWW QQQQ');
            state.time.fun = window.setInterval(() => {
                state.time.txt = formatDate(new Date(), 'YYYY-mm-dd HH:MM:SS WWW QQQQ');
            }, 1000);
        };
        // 页面加载前
        onBeforeMount(() => {
            initTime();
        });
        // 页面卸载时
        onUnmounted(() => {
            window.clearInterval(state.time.fun);
        });
        return {
            ...toRefs(state),
        };
    },
});
</script>
 
<style scoped lang="scss">
.big-data-up {
    height: 55px;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: var(--el-color-primary);
    overflow: hidden;
    position: relative;
    .up-left {
        position: absolute;
    }
    .up-center {
        width: 100%;
        display: flex;
        justify-content: center;
        font-size: 18px;
        letter-spacing: 5px;
        background-image: -webkit-linear-gradient(
            left,
            var(--el-color-primary),
            var(--el-color-primary-light-3) 25%,
            var(--el-color-primary) 50%,
            var(--el-color-primary-light-3) 75%,
            var(--el-color-primary)
        );
        -webkit-text-fill-color: transparent;
        -webkit-background-clip: text;
        background-clip: text;
        background-size: 200% 100%;
        -webkit-animation: masked-animation-data-v-b02d8052 4s linear infinite;
        animation: masked-animation-data-v-b02d8052 4s linear infinite;
        -webkit-box-reflect: below -2px -webkit-gradient(linear, left top, left bottom, from(transparent), to(hsla(0, 0%, 100%, 0.1)));
        position: relative;
        @keyframes masked-animation {
            0% {
                background-position: 0 0;
            }
            100% {
                background-position: -100% 0;
            }
        }
        position: relative;
        &::after {
            content: '';
            width: 250px;
            position: absolute;
            bottom: -15px;
            left: 50%;
            transform: translateX(-50%);
            border: 1px transparent solid;
            border-image: linear-gradient(to right, var(--el-color-primary-light-9), var(--el-color-primary)) 1 10;
        }
        span {
            cursor: pointer;
        }
    }
}
</style>