DESKTOP-9BNTV8O
2025-03-11 3b87f36219202b4cec47840bd9f56fdbe53e7d04
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
<template>
    <div class="layout-footer pb15">
        <div class="layout-footer-warp">
            <!-- <div>{{ themeConfig.globalTitle }}</div> -->
            <div class="mt5">{{ themeConfig.copyright }} {{ themeConfig.globalTitle }}&nbsp;&nbsp;系统时间:{{currentTime }}</div>
        </div>
    </div>
</template>
 
<script setup lang="ts" name="layoutFooter">
import { ref } from 'vue';
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
 
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
 
const currentTime=ref('');
getCurrentTime();
let timer;
timer = setInterval(getCurrentTime, 1000); // 每秒更新一次
function getCurrentTime() {
      const now = new Date();
      const year = now.getFullYear();
      const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,所以要加1
      const day = String(now.getDate()).padStart(2, '0');
      const hours = String(now.getHours()).padStart(2, '0');
      const minutes = String(now.getMinutes()).padStart(2, '0');
      const seconds = String(now.getSeconds()).padStart(2, '0');
 
      currentTime.value ='2025年02月21日 14:33:36'//`${year}年${month}月${day}日 ${hours}:${minutes}:${seconds}`;
}
</script>
 
<style scoped lang="scss">
.layout-footer {
    width: 100%;
    display: flex;
 
    &-warp {
        margin: auto;
        color: var(--el-text-color-secondary);
        text-align: center;
        animation: error-num 0.3s ease;
    }
}
</style>