作业批阅:最小化再次打开会刷新的逻辑修改
This commit is contained in:
parent
e3ce510322
commit
35a00e2aca
|
@ -340,7 +340,7 @@ const eventHandles = (type, win) => {
|
||||||
// 监听窗口的激活事件
|
// 监听窗口的激活事件
|
||||||
win.on('focus', async () => {
|
win.on('focus', async () => {
|
||||||
toolState.isTaskWin=true
|
toolState.isTaskWin=true
|
||||||
win&&win.reload(); //刷新该窗口
|
// win&&win.reload(); //刷新该窗口
|
||||||
});
|
});
|
||||||
// 监听窗口关闭事件
|
// 监听窗口关闭事件
|
||||||
win.on('closed', function () {
|
win.on('closed', function () {
|
||||||
|
|
|
@ -158,6 +158,7 @@ import quizStats from '@/views/classTask/container/quizStats.vue'
|
||||||
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
import ClassOverview from '@/views/classTask/container/classOverview.vue'
|
||||||
import {sessionStore} from '@/utils/store'
|
import {sessionStore} from '@/utils/store'
|
||||||
|
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
const emit = defineEmits(['cle-click'])
|
const emit = defineEmits(['cle-click'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -636,16 +637,29 @@ const closeDialog = () => {
|
||||||
emit('cle-click')
|
emit('cle-click')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reloadTimer = ref(0); // 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
||||||
|
const cutid = ref(0); // 当前初始化的作业id
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|
||||||
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||||
// const data = sessionStore.get('teachClassWorkItem');
|
// const data = sessionStore.get('teachClassWorkItem');
|
||||||
// const data = localStorage.getItem('teachClassWorkItem');
|
|
||||||
console.log(data,'????????????????????' )
|
|
||||||
if(data){
|
if(data){
|
||||||
openDialog(data)
|
openDialog(data)
|
||||||
}
|
}
|
||||||
|
// 开始定时查询
|
||||||
|
cutid.value = data.id;
|
||||||
|
isReloadTimer();
|
||||||
})
|
})
|
||||||
|
const isReloadTimer = () =>{
|
||||||
|
clearInterval(reloadTimer.value) // 关闭定时器
|
||||||
|
// 开启定时查询,作业id是否刷新了,刷新了就重新获取
|
||||||
|
reloadTimer.value = setInterval(() => {
|
||||||
|
const data = JSON.parse(localStorage.getItem('teachClassWorkItem'));
|
||||||
|
if(cutid.value != data.id){
|
||||||
|
cutid.value = data.id;
|
||||||
|
openDialog(data)
|
||||||
|
}
|
||||||
|
}, 1000)
|
||||||
|
}
|
||||||
|
|
||||||
watch(classWorkAnalysis, (newVal, oldVal) => {
|
watch(classWorkAnalysis, (newVal, oldVal) => {
|
||||||
if(newVal.view != 'quizStats'){
|
if(newVal.view != 'quizStats'){
|
||||||
|
@ -656,6 +670,7 @@ watch(classWorkAnalysis, (newVal, oldVal) => {
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题讲评的
|
clearInterval(classWorkActiveData.timerId) // 关闭定时器 逐题讲评的
|
||||||
|
clearInterval(reloadTimer.value) // 关闭定时器 查询作业id是否刷新了
|
||||||
})
|
})
|
||||||
|
|
||||||
// defineExpose({
|
// defineExpose({
|
||||||
|
|
Loading…
Reference in New Issue