Files
xj-screen/src/App.vue
T
weixin 8a630dd1cd update
1.修改socket弹窗等
2025-07-08 16:00:47 +08:00

72 lines
2.0 KiB
Vue

<template>
<a-config-provider :locale="locle">
<router-view />
</a-config-provider>
</template>
<script setup lang="ts">
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
import { onMounted, watch } from 'vue';
import { getEmergencyCenterApi } from '/@/api/user.ts';
import { useUserStore } from '/@/store/modules/user.ts';
import { useRouter } from 'vue-router';
import { getBaseLogin } from '/@/enum/pageEnum.ts';
dayjs.locale('zh-cn');
const locle = zhCN;
const userStore = useUserStore();
const router = useRouter();
onMounted(async () => {
try {
if (userStore.getToken) {
const { result } = await getEmergencyCenterApi();
if (result?.screenPath) {
router.replace(result?.screenPath);
} else {
router.replace('/home');
}
userStore.setCenterInfo(result);
}
} catch (e) {}
if (userStore.getUserInfo) {
}
document.body.addEventListener('click', initAudio);
});
watch(
() => userStore.getCount,
() => {
audioPlay();
}
);
const audio = new Audio('13203.wav');
function initAudio() {
audioPlay(true);
document.body.addEventListener('remove', initAudio);
}
function audioPlay(flag: boolean = false) {
audio.muted = flag;
audio.play();
}
</script>
<style lang="less" src="./assets/less/index.less"></style>
<style src="./assets/theme/theme.css"></style>
<style lang="less">
.modal-confirm-d {
top: 28% !important;
.ant-modal-confirm-content,
.ant-modal-confirm-title {
color: #ffffff !important;
}
.ant-modal-confirm-btns {
width: 100%;
display: flex;
justify-content: center;
}
}
</style>