diff --git a/package.json b/package.json index 49815b6..15cd668 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "matrix-spray-web", "type": "module", "version": "0.0.58", - "device": "DT600B", + "device": "DT100N", "description": "", "author": "", "license": "ISC", diff --git a/src/app.vue b/src/app.vue index 3722be8..ef3f9d1 100644 --- a/src/app.vue +++ b/src/app.vue @@ -4,6 +4,7 @@ import { delToken } from 'libs/token' import { useDebugStore } from 'stores/debugStore' import { useDeviceStore } from 'stores/deviceStore' import { useFormulaStore } from 'stores/formulaStore' +import { useGasStore } from 'stores/gasStore' import { useHomeStore } from 'stores/homeStore' import { useLiquidStore } from 'stores/liquidStore' import { useSealStore } from 'stores/sealStore' @@ -26,6 +27,7 @@ const systemStore = useSystemStore() const sealStore = useSealStore() const deviceStateStore = useDeviceStore() const debugStore = useDebugStore() +const gasStore = useGasStore() const deviceType = useDeviceStore().deviceTypeMap // 组件状态 const progress = ref(0) // 初始化进度百分比 @@ -79,6 +81,10 @@ watch( // 测试页面状态上报 debugStore.updateDebugPageState(data.rely) } + else if (data.fromClass === 'DMGasPathMgrService') { + // 气路通道控制状态 + gasStore.updateChannelByReport(data.rely) + } }) } }, diff --git a/src/assets/images/menuIcon/n-gas.svg b/src/assets/images/menuIcon/n-gas.svg new file mode 100644 index 0000000..f5adad1 --- /dev/null +++ b/src/assets/images/menuIcon/n-gas.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/images/menuIcon/s-gas.svg b/src/assets/images/menuIcon/s-gas.svg new file mode 100644 index 0000000..8444908 --- /dev/null +++ b/src/assets/images/menuIcon/s-gas.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/layouts/default.vue b/src/layouts/default.vue index 077631b..c43d53d 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -55,6 +55,7 @@ const menuList = computed(() => { || (deviceType === deviceStore.deviceTypeMap.LargeSpaceDM && item.name === 'seal') || (deviceType === deviceStore.deviceTypeMap.SmallSpaceDM && item.name === 'seal') || (deviceType === deviceStore.deviceTypeMap.DrawBarDM && item.name === 'liquid') + || (deviceType !== deviceStore.deviceTypeMap.DrawBarDM && item.name === 'gas') ) { return false } diff --git a/src/router/routes.ts b/src/router/routes.ts index f2ca438..099124f 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -3,6 +3,7 @@ import n_audit from 'assets/images/menuIcon/n-audit.svg' import n_debug from 'assets/images/menuIcon/n-debug.svg' import n_disinfect from 'assets/images/menuIcon/n-disinfect.svg' import n_formula from 'assets/images/menuIcon/n-formula.svg' +import n_gas from 'assets/images/menuIcon/n-gas.svg' import n_liquid from 'assets/images/menuIcon/n-liquid.svg' import n_seal from 'assets/images/menuIcon/n-seal.svg' import n_setting from 'assets/images/menuIcon/n-setting.svg' @@ -10,6 +11,7 @@ import s_audit from 'assets/images/menuIcon/s-audit.svg' import s_debug from 'assets/images/menuIcon/s-debug.svg' import s_disinfect from 'assets/images/menuIcon/s-disinfect.svg' import s_formula from 'assets/images/menuIcon/s-formula.svg' +import s_gas from 'assets/images/menuIcon/s-gas.svg' import s_liquid from 'assets/images/menuIcon/s-liquid.svg' import s_seal from 'assets/images/menuIcon/s-seal.svg' import s_setting from 'assets/images/menuIcon/s-setting.svg' @@ -74,6 +76,17 @@ const authRoutes: RouteRecordRaw[] = [ }, }, { + path: '/gas', + name: 'gas', + component: () => import('views/gas/index.vue'), + meta: { + isDefault: true, + title: '气路控制', + icon: n_gas, + activeIcon: s_gas, + }, + }, + { path: '/debug', name: 'debug', component: () => import('views/debug/index.vue'), diff --git a/src/stores/gasStore.ts b/src/stores/gasStore.ts new file mode 100644 index 0000000..0a77ed2 --- /dev/null +++ b/src/stores/gasStore.ts @@ -0,0 +1,50 @@ +import { sendCmd } from 'apis/system' +import { defineStore } from 'pinia' +import { ref } from 'vue' + +/** + * 主页数据管理模块 + * @module useHomeStore + */ +interface gasPathSwitcher { + gasPathSwitcher: gasPathSwitcher + path: string +} +interface gasPathSwitcher { + isOnline: boolean +} + +export const useGasStore = defineStore('gas', () => { + // 状态定义 + const channelSwitcherMap = ['degradation', 'disinfection', 'dehumidification'] + const isOnline = ref(false) + const currentChannel = ref(null) + /** + * 选择通道 + */ + const selectChannel = async (data: string) => { + const defaultParams = { + className: 'DMGasPathMgrService', + fnName: 'selectChannel', + params: { + dmGasPath: data, + }, + } + return await sendCmd(defaultParams) + } + /** + * 根据上报的数据更新当前通道和线上状态 + */ + const updateChannelByReport = (data: gasPathSwitcher) => { + isOnline.value = data.gasPathSwitcher.isOnline + currentChannel.value = data.path + } + + return { + channelSwitcherMap, + currentChannel, + isOnline, + selectChannel, + updateChannelByReport, + } +}) diff --git a/src/views/gas/index.vue b/src/views/gas/index.vue new file mode 100644 index 0000000..34e2adf --- /dev/null +++ b/src/views/gas/index.vue @@ -0,0 +1,52 @@ + + + + +