|
@ -1,4 +1,4 @@ |
|
|
<script setup lang='ts'> |
|
|
|
|
|
|
|
|
<script setup lang="ts"> |
|
|
import { useDeviceStore } from 'stores/deviceStore' |
|
|
import { useDeviceStore } from 'stores/deviceStore' |
|
|
import { useHomeStore } from 'stores/homeStore' |
|
|
import { useHomeStore } from 'stores/homeStore' |
|
|
import { useLiquidStore } from 'stores/liquidStore' |
|
|
import { useLiquidStore } from 'stores/liquidStore' |
|
@ -10,6 +10,7 @@ import { sendCmd, subscribeEvent } from '@/apis/system' |
|
|
import { useDebugStore } from './stores/debugStore' |
|
|
import { useDebugStore } from './stores/debugStore' |
|
|
import { useFormulaStore } from './stores/formulaStore' |
|
|
import { useFormulaStore } from './stores/formulaStore' |
|
|
import { useSealStore } from './stores/sealStore' |
|
|
import { useSealStore } from './stores/sealStore' |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 应用初始化组件 |
|
|
* 应用初始化组件 |
|
|
* @description 负责系统初始化流程控制,包括设备信息获取、数据同步及进度展示 |
|
|
* @description 负责系统初始化流程控制,包括设备信息获取、数据同步及进度展示 |
|
@ -40,26 +41,34 @@ onBeforeMount(async () => { |
|
|
}) |
|
|
}) |
|
|
// 监听设备的主动上报数据,并根据上报类型 保存到对应的store |
|
|
// 监听设备的主动上报数据,并根据上报类型 保存到对应的store |
|
|
subscribeEvent('stateUpdate', (data) => { |
|
|
subscribeEvent('stateUpdate', (data) => { |
|
|
if (data.fromClass === 'AirLeakDetectTest') { // 气密性测试 |
|
|
|
|
|
|
|
|
if (data.fromClass === 'AirLeakDetectTest') { |
|
|
|
|
|
// 气密性测试 |
|
|
sealStore.updateSealInfo(data.rely) |
|
|
sealStore.updateSealInfo(data.rely) |
|
|
} |
|
|
} |
|
|
else if (data.fromClass === 'AddLiquidService') { // 加液服务 |
|
|
|
|
|
|
|
|
else if (data.fromClass === 'AddLiquidService') { |
|
|
|
|
|
// 加液服务 |
|
|
liquidStore.updateAddLiquidWorkState(data.rely) |
|
|
liquidStore.updateAddLiquidWorkState(data.rely) |
|
|
} |
|
|
} |
|
|
else if (data.fromClass === 'DrainLiquidService') { // 排液服务 |
|
|
|
|
|
|
|
|
else if (data.fromClass === 'DrainLiquidService') { |
|
|
|
|
|
// 排液服务 |
|
|
liquidStore.updateDrainLiquidWorkState(data.rely) |
|
|
liquidStore.updateDrainLiquidWorkState(data.rely) |
|
|
} |
|
|
} |
|
|
else if (data.fromClass === 'DisinfectionCtrlServiceExt') { // 消毒状态上报 |
|
|
|
|
|
|
|
|
else if (data.fromClass === 'DisinfectionCtrlServiceExt') { |
|
|
|
|
|
// 消毒状态上报 |
|
|
homeStore.updateHomeDisinfectionState(data.rely) |
|
|
homeStore.updateHomeDisinfectionState(data.rely) |
|
|
} |
|
|
} |
|
|
else if (data.fromClass === 'FrontEndRealtimeDisplayContentMgr') { // 首页传感器状态上报 |
|
|
|
|
|
|
|
|
else if (data.fromClass === 'H2O2SensorMgr') { |
|
|
|
|
|
console.log(data.rely) |
|
|
|
|
|
// 首页传感器状态上报 |
|
|
homeStore.updateHomeData(data.rely) |
|
|
homeStore.updateHomeData(data.rely) |
|
|
} |
|
|
} |
|
|
else if (data.fromClass === 'AppCore') { // 应用事件上报 |
|
|
|
|
|
|
|
|
else if (data.fromClass === 'AppCore') { |
|
|
|
|
|
// 应用事件上报 |
|
|
deviceStateStore.setDeviceState(data.rely) |
|
|
deviceStateStore.setDeviceState(data.rely) |
|
|
systemStore.insertLogs(data.rely.appEvents) |
|
|
systemStore.insertLogs(data.rely.appEvents) |
|
|
} |
|
|
} |
|
|
else if (data.fromClass === 'TestPageCtrlService') { // 测试页面状态上报 |
|
|
|
|
|
|
|
|
else if (data.fromClass === 'TestPageCtrlService') { |
|
|
|
|
|
// 测试页面状态上报 |
|
|
debugStore.updateDebugPageState(data.rely) |
|
|
debugStore.updateDebugPageState(data.rely) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -71,7 +80,7 @@ subscribeEvent('stateUpdate', (data) => { |
|
|
const startProgress = () => { |
|
|
const startProgress = () => { |
|
|
timer = setInterval(async () => { |
|
|
timer = setInterval(async () => { |
|
|
// 生成随机进度增长(1-9%) |
|
|
// 生成随机进度增长(1-9%) |
|
|
const randomStep = Math.floor((Math.random() * 9) + 1) |
|
|
|
|
|
|
|
|
const randomStep = Math.floor(Math.random() * 9 + 1) |
|
|
progress.value = Math.min(progress.value + randomStep, 100) |
|
|
progress.value = Math.min(progress.value + randomStep, 100) |
|
|
const deviceInfo: Device.DeviceInfo = await initDeviceInfo() |
|
|
const deviceInfo: Device.DeviceInfo = await initDeviceInfo() |
|
|
if (deviceInfo.deviceType === deviceType.LargeSpaceDM_B) { |
|
|
if (deviceInfo.deviceType === deviceType.LargeSpaceDM_B) { |
|
@ -155,7 +164,7 @@ const initLiquidConfig = async () => { |
|
|
</router-view> |
|
|
</router-view> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
|
|
|
<style scoped lang='scss'> |
|
|
|
|
|
|
|
|
<style scoped lang="scss"> |
|
|
.main-content { |
|
|
.main-content { |
|
|
width: 100%; |
|
|
width: 100%; |
|
|
height: 100%; |
|
|
height: 100%; |
|
@ -190,7 +199,7 @@ img { |
|
|
|
|
|
|
|
|
.progress-bar { |
|
|
.progress-bar { |
|
|
height: 100%; |
|
|
height: 100%; |
|
|
background: linear-gradient(90deg, #1989FA, #096ae0); |
|
|
|
|
|
|
|
|
background: linear-gradient(90deg, #1989fa, #096ae0); |
|
|
border-radius: 30px; |
|
|
border-radius: 30px; |
|
|
transition: width 0.3s ease; |
|
|
transition: width 0.3s ease; |
|
|
} |
|
|
} |
|
|