fix: 数据迁移模块
Build and Deploy Vue3 / build (push) Successful in 1m30s
Build and Deploy Vue3 / deploy (push) Successful in 1m5s

This commit is contained in:
2026-04-15 16:18:15 +08:00
parent b3ed406f84
commit cf188bb94a
2 changed files with 70 additions and 7 deletions
+13 -2
View File
@@ -1611,7 +1611,9 @@ const handleDetailMigrateState = () => {
loadDataMigrateProgress()
startMigratePolling()
}
startDetailAutoRefresh()
} else if (!vm.migrating) {
stopDetailAutoRefresh()
if (migratePollingTimer) {
stopMigratePolling()
dataMigrateProgressData.value = null
@@ -2287,12 +2289,21 @@ const migrateProgressBarStatus = (stage) => {
let migratePollingTimer = null
const startMigratePolling = () => {
stopMigratePolling()
migratePollingTimer = setInterval(loadDataMigrateProgress, 5000)
migratePollingTimer = setInterval(loadDataMigrateProgress, 3000)
}
const stopMigratePolling = () => {
if (migratePollingTimer) { clearInterval(migratePollingTimer); migratePollingTimer = null }
}
let detailAutoRefreshTimer = null
const startDetailAutoRefresh = () => {
if (detailAutoRefreshTimer) return
detailAutoRefreshTimer = setInterval(() => { loadDetail() }, 3000)
}
const stopDetailAutoRefresh = () => {
if (detailAutoRefreshTimer) { clearInterval(detailAutoRefreshTimer); detailAutoRefreshTimer = null }
}
const abortLoading = ref(false)
const handleAbortMigrate = () => {
ElMessageBox.confirm('确定要中断当前数据迁移吗?此操作不可恢复!', '中断迁移', {
@@ -3361,7 +3372,7 @@ onActivated(() => {
if (loadedVmId !== vmId.value) initPage()
})
onDeactivated(() => { isPageActive = false; stopMigratePolling() })
onBeforeUnmount(() => { isPageActive = false; disposeCharts(); stopMigratePolling() })
onBeforeUnmount(() => { isPageActive = false; disposeCharts(); stopMigratePolling(); stopDetailAutoRefresh() })
onMounted(() => { isPageActive = true; initPage() })
</script>