|
@ -17,6 +17,7 @@ import { useSealStore } from './stores/sealStore' |
|
|
*/ |
|
|
*/ |
|
|
|
|
|
|
|
|
// 状态管理 |
|
|
// 状态管理 |
|
|
|
|
|
const deviceStore = useDeviceStore() |
|
|
const homeStore = useHomeStore() |
|
|
const homeStore = useHomeStore() |
|
|
const formulaStore = useFormulaStore() |
|
|
const formulaStore = useFormulaStore() |
|
|
const liquidStore = useLiquidStore() |
|
|
const liquidStore = useLiquidStore() |
|
@ -37,6 +38,7 @@ let timer: any = null // 进度条定时器 |
|
|
onBeforeMount(async () => { |
|
|
onBeforeMount(async () => { |
|
|
startProgress() // 启动进度条 |
|
|
startProgress() // 启动进度条 |
|
|
await systemStore.getSystemTime() // 获取系统时间 |
|
|
await systemStore.getSystemTime() // 获取系统时间 |
|
|
|
|
|
await initDeviceInfo() |
|
|
}) |
|
|
}) |
|
|
// 监听设备的主动上报数据,并根据上报类型 保存到对应的store |
|
|
// 监听设备的主动上报数据,并根据上报类型 保存到对应的store |
|
|
subscribeEvent('stateUpdate', (data) => { |
|
|
subscribeEvent('stateUpdate', (data) => { |
|
@ -113,15 +115,15 @@ const initData = async () => { |
|
|
* @function 初始化设备信息 |
|
|
* @function 初始化设备信息 |
|
|
* @desc 从服务端获取设备信息并更新到状态存储 |
|
|
* @desc 从服务端获取设备信息并更新到状态存储 |
|
|
*/ |
|
|
*/ |
|
|
// const initDeviceInfo = async () => { |
|
|
|
|
|
// const deviceParams = { |
|
|
|
|
|
// className: 'DeviceInfoMgrService', |
|
|
|
|
|
// fnName: 'getDeviceInfo', |
|
|
|
|
|
// } |
|
|
|
|
|
// const res = await sendCmd(deviceParams) |
|
|
|
|
|
// deviceStore.updateDeviceInfo(res) |
|
|
|
|
|
// return res |
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
const initDeviceInfo = async () => { |
|
|
|
|
|
const deviceParams = { |
|
|
|
|
|
className: 'DeviceInfoMgrService', |
|
|
|
|
|
fnName: 'getDeviceInfo', |
|
|
|
|
|
} |
|
|
|
|
|
const res = await sendCmd(deviceParams) |
|
|
|
|
|
deviceStore.updateDeviceInfo(res) |
|
|
|
|
|
return res |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @function 初始化 |
|
|
* @function 初始化 |
|
|