|
|
|
@ -633,15 +633,42 @@ const goBack = () => {
|
|
|
|
|
|
|
|
|
|
|
|
let timeInterval = null
|
|
|
|
let timeInterval = null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 处理 session 恢复后的重新加载
|
|
|
|
|
|
|
|
const handleSessionRestored = () => {
|
|
|
|
|
|
|
|
console.log('Session 已恢复,重新加载数据')
|
|
|
|
|
|
|
|
// 重新加载所有参数数据
|
|
|
|
|
|
|
|
RPC.post('/m9z/getLgnLatData', { comm_uid: commit_uid }).then(res => {
|
|
|
|
|
|
|
|
formField.value.lat = String(res.lat)
|
|
|
|
|
|
|
|
formField.value.lgn = String(res.lgn)
|
|
|
|
|
|
|
|
formField.value.loc = res.loc
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
RPC.post('/m9z/getSunRiseSet', { comm_uid: commit_uid }).then(res => {
|
|
|
|
|
|
|
|
formField.value.rise = res.rise
|
|
|
|
|
|
|
|
formField.value.set = res.set
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
RPC.post('/m9z/getDeviceTime', { comm_uid: commit_uid }).then(res => {
|
|
|
|
|
|
|
|
deviceTime.value = res.deviceTime
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
RPC.post('/m9z/getAllSubLoopParameter', { comm_uid: commit_uid }).then(res => {
|
|
|
|
|
|
|
|
subLoopParameter.value = res
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
updateTime()
|
|
|
|
updateTime()
|
|
|
|
timeInterval = setInterval(updateTime, 1000)
|
|
|
|
timeInterval = setInterval(updateTime, 1000)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 监听 session 恢复事件
|
|
|
|
|
|
|
|
window.addEventListener('m9z:session-restored', handleSessionRestored)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
onUnmounted(() => {
|
|
|
|
onUnmounted(() => {
|
|
|
|
if (timeInterval) {
|
|
|
|
if (timeInterval) {
|
|
|
|
clearInterval(timeInterval)
|
|
|
|
clearInterval(timeInterval)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 移除事件监听
|
|
|
|
|
|
|
|
window.removeEventListener('m9z:session-restored', handleSessionRestored)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|