mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamShowboard-Legacy.git
synced 2025-04-29 08:06:32 +00:00
fix(pre): 递交
This commit is contained in:
parent
2ee240ccaf
commit
189b0467e1
@ -21,20 +21,22 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { useProfileStore } from '@renderer/stores/app';
|
import { useProfileStore } from '@renderer/stores/app';
|
||||||
import { getCurrentTimeSlot, getNextExamTimeSlot } from '@renderer/utils/subjectUtils';
|
import { getCurrentTimeSlot, getNextExamTimeSlot } from '@renderer/utils/subjectUtils';
|
||||||
|
|
||||||
const globalStore = useProfileStore();
|
const globalStore = useProfileStore();
|
||||||
|
const currentExam = ref(null);
|
||||||
|
|
||||||
getCurrentTimeSlot(globalStore.examInfos);
|
const updateCurrentExam = () => {
|
||||||
|
|
||||||
const currentExam = computed(() => {
|
|
||||||
const current = getCurrentTimeSlot(globalStore.examInfos);
|
const current = getCurrentTimeSlot(globalStore.examInfos);
|
||||||
if (current == null) {
|
currentExam.value = current ? current : getNextExamTimeSlot(globalStore.examInfos);
|
||||||
return getNextExamTimeSlot(globalStore.examInfos);
|
};
|
||||||
} else {
|
|
||||||
return current;
|
onMounted(() => {
|
||||||
}
|
updateCurrentExam();
|
||||||
|
const interval = setInterval(updateCurrentExam, 20000); // 每20秒刷新一次
|
||||||
|
onUnmounted(() => clearInterval(interval));
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user