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