常态化干扰源用户管理-入网设计方案/治理工程验收申请添加判断根据浏览器页签变化刷新当前页面

This commit is contained in:
zhujiyan
2024-07-16 11:49:35 +08:00
parent c8c4c50274
commit 589288d9d4
2 changed files with 17 additions and 23 deletions

View File

@@ -55,7 +55,7 @@ defineOptions({
name: 'ProgramReview'
})
import { ref, onMounted, provide, nextTick } from 'vue'
import { ref, onMounted, provide, nextTick, onUnmounted } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { cancel } from '@/api/supervision-boot/interfere/index'
@@ -246,8 +246,20 @@ const titleButton = ref()
const titleButton1 = ref()
provide('tableStore', tableStore)
const handleVisibilityChange = async () => {
if (document.visibilityState === 'visible') {
// 在这里执行页面回到回到当前页签需要做的事情
await tableStore.index()
} else if (document.visibilityState === 'hidden') {
// 在这里执行页面离开时需要做的事情
}
}
onMounted(() => {
tableStore.index()
document.addEventListener('visibilitychange', handleVisibilityChange)
})
onUnmounted(() => {
document.removeEventListener('visibilitychange', handleVisibilityChange)
})
/**取消流程操作*/
const cancelLeave = async (row: any) => {