Merge pull request #12202 from dataease/pr@dev-v2@fix_mobile-refresh

fix(仪表板): 修复浏览器整体刷新移动端未生效问题
This commit is contained in:
王嘉豪 2024-09-13 16:28:44 +08:00 committed by GitHub
commit 76cd854929
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,6 +119,7 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
document.title = dvInfo.name
setTitle(dvInfo.name)
}
initBrowserTimer()
}
)
}
@ -139,6 +140,16 @@ onMounted(async () => {
dvMainStore.setPublicLinkStatus(props.publicLinkStatus)
})
const initBrowserTimer = () => {
if (state.canvasStylePreview.refreshBrowserEnable) {
const gap = state.canvasStylePreview.refreshBrowserUnit === 'minute' ? 60 : 1
const browserRefreshTime = state.canvasStylePreview.refreshBrowserTime * gap * 1000
setTimeout(() => {
window.location.reload()
}, browserRefreshTime)
}
}
defineExpose({
loadCanvasDataAsync
})