Merge branch '绿色触摸屏' into 触摸屏-直流

触摸屏-直流
Lufaneng 3 months ago
commit 3a7fff040d

@ -64,9 +64,10 @@ const handleVerify = async () => {
if (res?.session_id) { if (res?.session_id) {
localStorage.setItem('m9z_session_id', res.session_id) localStorage.setItem('m9z_session_id', res.session_id)
ElMessage.success('验证成功') ElMessage.success('验证成功')
location.reload()
visible.value = false visible.value = false
emits('verified', res.session_id) emits('verified', res.session_id)
//
window.dispatchEvent(new CustomEvent('m9z:session-restored'))
} else { } else {
hint.value = '密码错误,请重试' hint.value = '密码错误,请重试'
password.value = '' password.value = ''

@ -237,15 +237,27 @@ const goBack = () => {
let timeInterval = null let timeInterval = null
// session
const handleSessionRestored = () => {
console.log('Session 已恢复,重新加载数据')
getData()
}
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>

@ -553,15 +553,34 @@ const restartSystem = () => {
let timeInterval = null let timeInterval = null
// session
const handleSessionRestored = () => {
console.log('Session 已恢复,重新加载数据')
getTask()
RPC.post('/m9z/getDeviceMode', { comm_uid: commit_uid }).then(res => {
currentMode.value = res
})
RPC.post('/m9z/getDeviceSunRiseTime', { comm_uid: commit_uid }).then(res => {
sunriseTime.value = res.Sunrise ? dayjs(res.Sunrise).format('HH:mm:ss') : ''
sunsetTime.value = res.Sunset ? dayjs(res.Sunset).format('HH:mm:ss') : ''
})
}
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)
}) })
const delMode = () => { const delMode = () => {

@ -546,15 +546,27 @@ const changeMode = () => {
let timeInterval = null let timeInterval = null
// session
const handleSessionRestored = () => {
console.log('Session 已恢复,重新加载数据')
getInfo()
}
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>

@ -107,15 +107,33 @@ const handleCardClick = (key) => {
let timeInterval = null let timeInterval = null
// session
const handleSessionRestored = () => {
console.log('Session 已恢复,重新加载数据')
// Menu
RPC.post('/m9z/touchdisplay/getDeviceID').then(res => {
commit_uid.value = res.deviceId
version.value = res.version
sessionStorage.setItem('central_control_comm_uid', res.deviceId)
sessionStorage.setItem('central_control_meterAddr', res.meterAddr)
})
}
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>

@ -545,15 +545,27 @@ const restartSystem = () => {
let timeInterval = null let timeInterval = null
// session
const handleSessionRestored = () => {
console.log('Session 已恢复,重新加载数据')
getInfo()
}
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>

@ -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>

@ -258,14 +258,29 @@ const goBack = () => {
} }
let timeInterval = null let timeInterval = null
// session
const handleSessionRestored = () => {
console.log('Session 已恢复,重新加载数据')
getSystemTime()
getPasswordStatus()
}
onMounted(() => { onMounted(() => {
updateTime() updateTime()
timeInterval = setInterval(updateTime, 1000) timeInterval = setInterval(updateTime, 1000)
getSystemTime() getSystemTime()
getPasswordStatus() getPasswordStatus()
// session
window.addEventListener('m9z:session-restored', handleSessionRestored)
}) })
onUnmounted(() => { onUnmounted(() => {
if (timeInterval) clearInterval(timeInterval) if (timeInterval) clearInterval(timeInterval)
//
window.removeEventListener('m9z:session-restored', handleSessionRestored)
}) })
</script> </script>

Loading…
Cancel
Save