mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamShowboard-Legacy.git
synced 2025-04-29 07:56:33 +00:00
add autoEnter
This commit is contained in:
parent
96867ac0d6
commit
09f1d1ed7d
@ -4,7 +4,7 @@
|
||||
|
||||
<template #append>
|
||||
<div class="ga-4">
|
||||
<v-btn @click="router.push('/mainWindow')">回到主页</v-btn>
|
||||
<v-btn @click="gotoHome">回到主页</v-btn>
|
||||
<v-btn @click="router.push('/about')">关于</v-btn>
|
||||
<v-icon icon="mdi-window-close" @click="ipcHandleExit"></v-icon>
|
||||
</div>
|
||||
@ -20,4 +20,8 @@ const profileStore = useProfileStore();
|
||||
const router = useRouter();
|
||||
|
||||
const ipcHandleExit = () => window.electron.ipcRenderer.send('prog:exit');
|
||||
</script>
|
||||
|
||||
function gotoHome() {
|
||||
router.push({ path: '/mainWindow', query: { skipAutoEnter: true } });
|
||||
}
|
||||
</script>
|
@ -20,6 +20,11 @@
|
||||
>直接进入看板</v-btn
|
||||
>
|
||||
<p class="mt-2 text-center">直接进入看板,将继续使用上次加载的配置</p>
|
||||
<v-switch
|
||||
v-model="autoEnter"
|
||||
label="下次自动进入看板"
|
||||
class="mt-2 auto-enter-switch"
|
||||
></v-switch>
|
||||
</v-card>
|
||||
</v-col>
|
||||
</v-row>
|
||||
@ -36,13 +41,15 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { ref, onMounted, watch } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { useProfileStore } from '@renderer/stores/app';
|
||||
|
||||
const globalStore = useProfileStore();
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const remoteUrl = ref(localStorage.getItem('remoteUrl') || '');
|
||||
const autoEnter = ref(JSON.parse(localStorage.getItem('autoEnter') || 'false'));
|
||||
const errorDialog = ref(false);
|
||||
const errorMessage = ref('');
|
||||
|
||||
@ -91,6 +98,16 @@ onMounted(() => {
|
||||
if (savedUrl) {
|
||||
remoteUrl.value = savedUrl;
|
||||
}
|
||||
|
||||
// 检查路由参数是否跳过自动跳转
|
||||
const skipAutoEnter = route.query.skipAutoEnter === 'true';
|
||||
if (!skipAutoEnter && autoEnter.value) {
|
||||
router.push('/infoPage');
|
||||
}
|
||||
});
|
||||
|
||||
watch(autoEnter, (newVal) => {
|
||||
localStorage.setItem('autoEnter', JSON.stringify(newVal));
|
||||
});
|
||||
</script>
|
||||
|
||||
@ -115,6 +132,11 @@ onMounted(() => {
|
||||
.text-center {
|
||||
text-align: center;
|
||||
}
|
||||
.auto-enter-switch {
|
||||
margin-top: 8px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.fade-in {
|
||||
animation: fadeIn 1s ease-in-out;
|
||||
}
|
||||
@ -137,4 +159,4 @@ onMounted(() => {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
Loading…
x
Reference in New Issue
Block a user