烟花爆竹批发企业仓库安全风险监测前端
zhouwx
2025-04-24 6f1e2acc812b2f40359aabdb5d04648acfcdcef5
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
<template>
  <div class="login">
    <login-form ref="loginRef"/>
    <!--  底部  -->
    <div class="el-login-footer">
      <span>Copyright ©2023-{{nowYear}} All Rights Reserved.</span>
    </div>
  </div>
</template>
 
<script setup>
import {onMounted, ref, reactive, watch, defineAsyncComponent, nextTick, onUnmounted} from "vue"
import useUserStore from '@/store/modules/user'
import LoginForm from './components/loginForm'
const { proxy } = getCurrentInstance()
const route = useRoute()
const router = useRouter()
const nowYear = ref();
// 时间格式化
const timeForm = {
  hour12: false,
  year: 'numeric',
  month: '2-digit',
  day: '2-digit',
  hour: '2-digit',
  minute: '2-digit',
  second: '2-digit'
}
 
const noticeRef = ref(null)
 
const state = reactive({
  activeMenu: 1,
  date: '',
  weekDay: '',
  dayTime: '',
  checkDetails: false
})
 
// 当前时间
const getDateTime = () => {
  const curTime = new Date().toLocaleString('zh', timeForm).replace(/\//g, '-');
  state.date = curTime.slice(0, 10);
  nowYear.value = curTime.slice(0, 4);
  let week = ['日', '一', '二', '三', '四', '五', '六'];
  let day = new Date().getDay();
  state.weekDay = '星期' + week[day];
  let curHour = Number(curTime.slice(10, 13));
  if (curHour >= 5 && curHour <= 10) {
    state.dayTime = '上午';
  }
  if (curHour > 10 && curHour <= 12) {
    state.dayTime = '中午';
  }
  if (curHour > 12 && curHour <= 18) {
    state.dayTime = '下午';
  }
  if (curHour > 18 && curHour <= 22) {
    state.dayTime = '晚上';
  }
  if (curHour > 22) {
    state.dayTime = '午夜';
  }
};
 
 
const redirect = ref(undefined);
 
onMounted(()=>{
  getDateTime();
})
 
onUnmounted(()=>{
 
})
 
watch(route, (newRoute) => {
    redirect.value = newRoute.query && newRoute.query.redirect;
}, { immediate: true });
 
</script>
 
<style lang='scss' scoped>
.login {
  width: 100%;
  display: flex;
  justify-content: center;
  height: 100%;
}
 
.el-login-footer {
  height: 40px;
  line-height: 40px;
  position: fixed;
  bottom: 0;
  width: 100%;
  text-align: center;
  color: #fff;
  font-size: 12px;
  letter-spacing: 1px;
}
</style>