超时时间修改

This commit is contained in:
2026-02-27 10:27:04 +08:00
parent 745b224062
commit 27afd728e0

View File

@@ -61,6 +61,12 @@
<script>
import { getCalibrationConfigInfo, calibrationDepthcamera, calibrationLaser, startCalibrationCamera, endCalibrationCamera, getCalibrationByTaskId } from '@/config/getData.js'
const POLLING_CONFIG = {
INTERVAL: 1000, // 轮询间隔 1秒
TIMEOUT: 3 * 60 * 1000 // 超时时间 3分钟
}
export default {
name: 'calibration-index',
data () {
@@ -78,7 +84,8 @@ export default {
taskId: null,
timer: null,
isPolling: false,
dialogVisible: false
dialogVisible: false,
timeoutTimer: null
}
},
mounted () {
@@ -94,6 +101,10 @@ export default {
clearInterval(this.timer)
this.timer = null
}
if (this.timeoutTimer) {
clearTimeout(this.timeoutTimer)
this.timeoutTimer = null
}
},
async _pollTaskStatus(type) {
if (!this.taskId) return
@@ -115,9 +126,9 @@ export default {
} catch (e) {
console.error('轮询任务状态失败:', e)
}
}, 1000)
}, POLLING_CONFIG.INTERVAL)
setTimeout(() => {
this.timeoutTimer = setTimeout(() => {
if (this.isPolling) {
this.isPolling = false
this._clearTimer()
@@ -128,7 +139,7 @@ export default {
this.disabled5 = false
}
}
}, 60000)
}, POLLING_CONFIG.TIMEOUT)
},
_handleTaskStatus(status, type) {
if (!this.isPolling) return