From 9a74630e567ca4e08acad9d558264f2337b8d9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E4=BA=86=E4=B8=AA=E7=99=BD?= <543593352@qq.com> Date: Sun, 29 Sep 2024 09:31:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=B9=E9=98=85=E7=AA=97=E5=8F=A3=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=98=B2=E8=BF=9E=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/views/classTask/classTask.vue | 16 ++++++++++------ .../src/views/desktop/container/work-trend.vue | 16 +++++++++++----- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/renderer/src/views/classTask/classTask.vue b/src/renderer/src/views/classTask/classTask.vue index 8247aed..504d49b 100644 --- a/src/renderer/src/views/classTask/classTask.vue +++ b/src/renderer/src/views/classTask/classTask.vue @@ -377,6 +377,7 @@ const closeDialog = () => { getStudentClassWorkDataPolling() } +const openDialogTime = ref(null);//弹窗 /** * 开启新批改弹窗 * @param item 作业对象 @@ -386,12 +387,15 @@ const onClickItem = (item) => { clearInterval(pollingST.value) // itemDialogRef.value.openDialog(item) - // 新跳转子窗口链接 - // 1、本地缓存item数据,2、打开子窗口 3、子窗口加载item数据 - // localStorage.setItem('teachClassWorkItem', JSON.stringify(item)) - sessionStore.set('teachClassWorkItem', item) - toolState.isTaskWin=true //设置打开批改窗口 - createWindow('open-taskwin',{url:'/teachClassTask'}) + if(openDialogTime.value) return; + clearTimeout(openDialogTime.value) + openDialogTime.value = setTimeout(() => { + openDialogTime.value = null; + toolState.isTaskWin=true; // 设置打开批改窗口 + sessionStore.set('teachClassWorkItem', item); // 缓存点击的item + // 调用新窗口批改页面 + createWindow('open-taskwin',{url:'/teachClassTask'}) + }, 1000) } diff --git a/src/renderer/src/views/desktop/container/work-trend.vue b/src/renderer/src/views/desktop/container/work-trend.vue index 40f5e15..45fc049 100644 --- a/src/renderer/src/views/desktop/container/work-trend.vue +++ b/src/renderer/src/views/desktop/container/work-trend.vue @@ -67,14 +67,20 @@ const getHomework = async () => { loading.value = false } } + +const openDialogTime = ref(null);//弹窗 // 批改作业 const onClickItem = (item) => { console.log('开启弹窗') - // itemDialogRef.value.openDialog(item) - // 调用新窗口批改页面 - sessionStore.set('teachClassWorkItem', item) - toolState.isTaskWin=true //设置打开批改窗口 - createWindow('open-taskwin',{url:'/teachClassTask'}) + if(openDialogTime.value) return; + clearTimeout(openDialogTime.value) + openDialogTime.value = setTimeout(() => { + openDialogTime.value = null; + toolState.isTaskWin=true; // 设置打开批改窗口 + sessionStore.set('teachClassWorkItem', item); // 缓存点击的item + // 调用新窗口批改页面 + createWindow('open-taskwin',{url:'/teachClassTask'}) + }, 1000) } const tagType = (time) => { -- 2.44.0.windows.1