feat: 添加自动刷新功能,每30秒更新工作流数据

This commit is contained in:
jxxghp
2025-02-26 18:24:38 +08:00
parent 7a9984f392
commit 1b43446b5c
+10
View File
@@ -13,6 +13,9 @@ const appMode = inject('pwaMode') && display.mdAndDown.value
// 是否刷新 // 是否刷新
const isRefreshed = ref(false) const isRefreshed = ref(false)
// 自动刷新定时器
const autoRefresh = ref<NodeJS.Timeout | null>(null)
// 新增对话框 // 新增对话框
const addDialog = ref(false) const addDialog = ref(false)
@@ -37,6 +40,13 @@ function addDone() {
onMounted(() => { onMounted(() => {
fetchData() fetchData()
autoRefresh.value = setInterval(fetchData, 30000)
})
onUnmounted(() => {
if (autoRefresh.value) {
clearInterval(autoRefresh.value)
}
}) })
onActivated(() => { onActivated(() => {