You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
154 lines
2.9 KiB
154 lines
2.9 KiB
<script lang="ts" setup>
|
|
import deviceSvg from '@/assets/images/init-device.svg'
|
|
import CancelSvg from '@/assets/images/user-cancel.svg'
|
|
import LogoutSvg from '@/assets/images/user-logout.svg'
|
|
import { logout } from 'apis/login'
|
|
import Check from 'components/check/index.vue'
|
|
import { delToken } from 'libs/token'
|
|
import { ref } from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
|
|
const isLoading = ref(false)
|
|
const router = useRouter()
|
|
const openModal = () => {
|
|
isLoading.value = true
|
|
}
|
|
|
|
const checking = ref(false)
|
|
const onInitDevice = async () => {
|
|
checking.value = true
|
|
onCancel()
|
|
}
|
|
|
|
const onLogout = () => {
|
|
logout().then(() => {
|
|
delToken()
|
|
router.push('/login').then(() => {})
|
|
})
|
|
}
|
|
const onCancel = () => {
|
|
isLoading.value = false
|
|
}
|
|
|
|
defineExpose({
|
|
openModal,
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<div v-if="isLoading" class="loading-overlay">
|
|
<div class="loading-content" @click="onInitDevice()">
|
|
<img :src="deviceSvg" alt="Icon" width="80">
|
|
<div style="color: rgb(243 168 74);">
|
|
设备初始化
|
|
</div>
|
|
</div>
|
|
<div class="loading-content" @click="onLogout">
|
|
<img :src="LogoutSvg" alt="Icon" width="80">
|
|
<div style="color: #9358df;">
|
|
注销用户
|
|
</div>
|
|
</div>
|
|
<div class="loading-content" @click="onCancel">
|
|
<img :src="CancelSvg" alt="Icon" width="80">
|
|
<div style="color: #ea8864;">
|
|
取消
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-if="checking">
|
|
<Check v-model:checking="checking" type="cancel" />
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped lang="scss">
|
|
#index-container {
|
|
margin: 0;
|
|
padding: 0;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
background-color: #fff;
|
|
position: relative;
|
|
box-sizing: border-box;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
.loading-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100vw;
|
|
height: 100vh;
|
|
background: rgba(0, 0, 0, 0.7);
|
|
backdrop-filter: blur(4px);
|
|
display: flex;
|
|
gap: 10rem;
|
|
justify-content: center;
|
|
align-items: center;
|
|
z-index: 9998;
|
|
}
|
|
|
|
.loading-content {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 20px;
|
|
div{
|
|
font-size: 1.5rem;
|
|
}
|
|
}
|
|
|
|
.loading-spinner {
|
|
width: 60px;
|
|
height: 60px;
|
|
border: 4px solid #f3f3f3;
|
|
border-top: 4px solid #4caf50;
|
|
border-radius: 50%;
|
|
animation: spin 1s linear infinite;
|
|
}
|
|
|
|
.loading-text {
|
|
color: white;
|
|
font-size: 24px;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.loading-progress {
|
|
width: 300px;
|
|
height: 6px;
|
|
background: rgba(255, 255, 255, 0.2);
|
|
border-radius: 3px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.loading-device{
|
|
display: flex;
|
|
gap: 150px;
|
|
}
|
|
|
|
.loading-user{
|
|
display: flex;
|
|
margin-left: 24%;
|
|
gap: 12rem;
|
|
}
|
|
|
|
.logo-img{
|
|
width: 11rem;
|
|
padding-top: 5px;
|
|
}
|
|
|
|
.init-axis{
|
|
display: grid;
|
|
gap: 20px;
|
|
grid-template-columns: 1fr 1fr 1fr;
|
|
width: 60vw;
|
|
}
|
|
|
|
.init-logout{
|
|
display: grid;
|
|
gap: 20px;
|
|
grid-template-columns:1fr 1fr;
|
|
width: 60vw;
|
|
margin-top:10rem;
|
|
}
|
|
</style>
|