From d13a229b9c2e4acc0272cb9e21e67c2b79016e98 Mon Sep 17 00:00:00 2001 From: LiLongLong <13717757313@163.com> Date: Sat, 28 Jun 2025 17:08:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A0=B7=E5=BC=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/CascadingSelectModal/index.vue | 6 +++ src/components/common/SoftKeyboard/index.vue | 8 +-- src/components/formula/FormulaConfig.vue | 16 +++--- src/components/formula/FormulaTable.vue | 2 + src/components/home/HomeSetting.vue | 17 ++++-- src/components/setting/Device.vue | 14 ++++- src/components/setting/History.vue | 1 + src/components/setting/HistoryDetail.vue | 2 +- src/components/setting/User.vue | 3 +- src/layouts/default.vue | 16 ++++-- src/router/routes.ts | 19 +++++-- src/stores/deviceStore.ts | 13 ++--- src/stores/homeStore.ts | 2 +- src/views/audit/index.vue | 2 +- src/views/debug/index.vue | 61 ++++++++++++++-------- src/views/home/index.vue | 3 ++ src/views/seal/index.vue | 2 +- src/views/setting/index.vue | 1 - 18 files changed, 126 insertions(+), 62 deletions(-) diff --git a/src/components/common/CascadingSelectModal/index.vue b/src/components/common/CascadingSelectModal/index.vue index da73bf3..3850cff 100644 --- a/src/components/common/CascadingSelectModal/index.vue +++ b/src/components/common/CascadingSelectModal/index.vue @@ -1,4 +1,5 @@ - + { button-text="查看图表" text-size="1.3rem" border-radius="5px" - width="7.5rem" + :width="settingWidth" height="3rem" text-color="#1989fa" :disabled="deviceState" @@ -244,7 +253,7 @@ const onClose = () => { button-text="消毒设置" text-size="1.3rem" border-radius="5px" - width="7.5rem" + :width="settingWidth" text-color="#1989fa" height="3rem" @click="onDisinfectConfig" @@ -254,7 +263,7 @@ const onClose = () => { button-text="运行参数" text-size="1rem" border-radius="5px" - width="7rem" + :width="settingWidth" text-color="#1989fa" height="3rem" @click="onDisinfectConfig" diff --git a/src/components/setting/Device.vue b/src/components/setting/Device.vue index c60de68..98778e3 100644 --- a/src/components/setting/Device.vue +++ b/src/components/setting/Device.vue @@ -4,8 +4,18 @@ import { ref } from 'vue' const deviceStore = useDeviceStore() const deviceInfo = ref(deviceStore.deviceInfo) -const screenWidth = ref(window.screen.width) -const screenHeight = ref(window.screen.height) +const screenInfo = { + width: window.innerWidth, // 屏幕宽度(逻辑像素) + height: window.innerHeight, // 屏幕高度(逻辑像素) + availWidth: window.screen.availWidth, // 可用宽度(排除任务栏等) + availHeight: window.screen.availHeight, // 可用高度 + pixelRatio: window.devicePixelRatio, // 设备像素比(物理像素/逻辑像素) + colorDepth: window.screen.colorDepth, // 颜色深度 +} +const width = Math.floor(screenInfo.width * screenInfo.pixelRatio) +const height = Math.floor(screenInfo.height * screenInfo.pixelRatio) +const screenWidth = ref(width) +const screenHeight = ref(height) diff --git a/src/components/setting/History.vue b/src/components/setting/History.vue index 74f9697..0799bc0 100644 --- a/src/components/setting/History.vue +++ b/src/components/setting/History.vue @@ -106,6 +106,7 @@ const onClose = () => { @click="onExportHistory" /> diff --git a/src/components/setting/HistoryDetail.vue b/src/components/setting/HistoryDetail.vue index ae1551a..d9d66d6 100644 --- a/src/components/setting/HistoryDetail.vue +++ b/src/components/setting/HistoryDetail.vue @@ -54,7 +54,7 @@ const tableColumns = computed(() => { :key="column.prop" :prop="column.prop" :label="column.label" - width="150" + width="200" :min-width="column.minWidth" /> diff --git a/src/components/setting/User.vue b/src/components/setting/User.vue index b6c23b6..0c5d2db 100644 --- a/src/components/setting/User.vue +++ b/src/components/setting/User.vue @@ -89,7 +89,7 @@ const handleSelectionChange = (users: User.UserItem[]) => { - + @@ -129,5 +129,6 @@ const handleSelectionChange = (users: User.UserItem[]) => { .user-opera{ display: flex; gap: 10px; + justify-content: center; } diff --git a/src/layouts/default.vue b/src/layouts/default.vue index 2692a1b..8ed8621 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -41,7 +41,7 @@ const sealInfo = ref(sealStore.sealInfo) const websocketConnected = ref(systemStore.websocketConnected) let touchStartTime = 0 let touchCount = 0 -const deviceType = ref() +const isLowCost = ref() onMounted(() => { // 连续3次点击任意地方,全屏显示 @@ -99,7 +99,7 @@ watchEffect(() => { // 密封测试状态 sealInfo.value = sealStore.sealInfo showDeviceStateName() - deviceType.value = deviceStore.deviceType + isLowCost.value = deviceStore.isLowCost }) onUnmounted(() => { @@ -153,7 +153,7 @@ const toggleLanguage = () => { - + @@ -201,12 +201,20 @@ const toggleLanguage = () => { box-sizing: border-box; height: 100%; background: #fff; - .header, .footer { + .header { + height: 50px; + width: 100%; + display: flex; + align-items: center; + padding: 10px 15px; + } + .footer { height: 50px; width: 100%; display: flex; align-items: center; padding: 10px 15px; + position: sticky; } .header { color: #393F46; diff --git a/src/router/routes.ts b/src/router/routes.ts index 86d8363..3c6f60e 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -13,8 +13,10 @@ import s_formula from 'assets/images/menuIcon/s-formula.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' +import { useDeviceStore } from 'stores/deviceStore' +import { ref, watchEffect } from 'vue' -const authRoutes: RouteRecordRaw[] = [ +const authRoutes = ref([ { path: '/home', name: 'home', @@ -102,7 +104,18 @@ const authRoutes: RouteRecordRaw[] = [ activeIcon: s_setting, }, }, -] +]) + +watchEffect(() => { + setTimeout(() => { + const deviceStore = useDeviceStore() + if (deviceStore.isLowCost) { + authRoutes.value = authRoutes.value.filter((item) => { + return item.name !== 'seal' + }) + } + }, 2000) +}) const routes: RouteRecordRaw[] = [ { @@ -114,7 +127,7 @@ const routes: RouteRecordRaw[] = [ path: '/', component: () => import('../layouts/default.vue'), redirect: '/home', - children: authRoutes, + children: authRoutes.value, }, ] diff --git a/src/stores/deviceStore.ts b/src/stores/deviceStore.ts index 3edfb1a..4ce7754 100644 --- a/src/stores/deviceStore.ts +++ b/src/stores/deviceStore.ts @@ -27,23 +27,24 @@ const deviceTypeMap = { SmallSpaceDM: 'DT300N', // 小空间 PipeDM: 'DT300W', // 管道式 DrawBarDM: 'DT100N', // 拉杆箱 - LargeSpaceDM_B: 'DT600B', // 大空间标准 + LargeSpaceDM_B: 'DT600B', // 大空间标准(低成本) } export const useDeviceStore = defineStore('device', () => { const deviceInfo = ref(initDeviceInfo) // 使用deviceType区分是什么消毒机。低成本消毒机部署在移动pad,不显示软件键盘的开关。 拉杆消毒机是上位机显示软键盘 // 暂时使用 deviceType : ture 表示 为低成本。 - const deviceType = ref(true) + const isLowCost = ref(true) const deviceStete = ref(initState) // 设备状态 const updateDeviceInfo = (info: Device.DeviceInfo) => { deviceInfo.value = info - if (info.projectType === 'SmallSpaceDM') { - deviceType.value = true + console.log('info.projectType--', info.projectType) + if (info.projectType === 'DT600B') { + isLowCost.value = true } else { - deviceType.value = false + isLowCost.value = false } } @@ -67,7 +68,7 @@ export const useDeviceStore = defineStore('device', () => { return { deviceTypeMap, deviceInfo, - deviceType, + isLowCost, deviceStete, updateDeviceInfo, setDeviceState, diff --git a/src/stores/homeStore.ts b/src/stores/homeStore.ts index b651d5e..6b9ab07 100644 --- a/src/stores/homeStore.ts +++ b/src/stores/homeStore.ts @@ -37,7 +37,7 @@ export const useHomeStore = defineStore('home', () => { const curStateRemainTime = ref() const disinfectionState = ref(initDisinfectState) // 当前设备消毒状态 let renderTimer: any - const defaultIntensityValue = ref(0) + const defaultIntensityValue = ref(10) const defaultIntensityTypeValue = ref() /** diff --git a/src/views/audit/index.vue b/src/views/audit/index.vue index 4d2e3de..4f33fe9 100644 --- a/src/views/audit/index.vue +++ b/src/views/audit/index.vue @@ -138,8 +138,8 @@ const handleSelectionChange = (users: Audit.AuditItem[]) => { .audit-pagination{ height: 12%; display: flex; - justify-content: end; align-items: center; + float: right; } } diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index de1efa3..d6f3470 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -2,16 +2,17 @@ import { sendCmd } from 'apis/system' import { roundNumber } from 'libs/utils' import { useHomeStore } from 'stores/homeStore' -import { ref, watch } from 'vue' +import { ref, watchEffect } from 'vue' const homeStore = useHomeStore() const h2O2SensorData = ref(homeStore.h2O2SensorData) -watch(() => homeStore.h2O2SensorData, (newVal) => { - if (newVal && newVal.length) { - h2O2SensorData.value = newVal +watchEffect(() => { + const hdData = homeStore.h2O2SensorData + if (hdData && hdData.length) { + h2O2SensorData.value = [...hdData] } -}, { deep: true }) +}) // 加液 const onAddLiquid = async () => { @@ -85,22 +86,24 @@ const onBottomState = () => {} - - - - {{ index === 0 ? '仓内环境' : item.title }} - - - 温度 - {{ roundNumber(item.temp, 2) }}°C - - - 湿度 - {{ roundNumber(item.rh, 2) }} - - - 过氧化氢浓度 - {{ roundNumber(item.h2o2, 2) }}PPM + + + + + {{ index === 0 ? '仓内环境' : item.title || `探头${index}` }} + + + 温度 + {{ roundNumber(item.temp, 2) }}°C + + + 湿度 + {{ roundNumber(item.rh, 2) }} + + + H202浓度 + {{ roundNumber(item.h2o2, 2) }}PPM + @@ -267,7 +270,7 @@ const onBottomState = () => {} height: $main-container-height; overflow: hidden; background: $gradient-color; - padding-top: 50px; + padding-top: 4vh; padding-left: 30px; font-size: 20px; .debug-upper{ @@ -286,11 +289,23 @@ const onBottomState = () => {} } } } - + .debug-env { + display: grid; + grid-template-columns: repeat(2, 1fr); + } .debug-left-lh{ display: flex; gap: 1rem; height: $lineHeight; + .debug-env-content{ + display: flex; + .env-content-p{ + padding: 5px; + } + } + } + .env-lh{ + height: 10vh; } .debug-bw{ width: 8vw; diff --git a/src/views/home/index.vue b/src/views/home/index.vue index ed01de0..6ac8d3f 100644 --- a/src/views/home/index.vue +++ b/src/views/home/index.vue @@ -65,6 +65,9 @@ watchEffect(() => { // 当前消毒液余量百分比 const nowLiquidProgress = computed(() => { + if (!liquidInfo.value.nowLiquid) { + return 0 + } const nl = roundNumber(Number(((liquidInfo.value.nowLiquid / liquidTotal.value) * 100)), 0) return nl }) diff --git a/src/views/seal/index.vue b/src/views/seal/index.vue index d849a6f..b947916 100644 --- a/src/views/seal/index.vue +++ b/src/views/seal/index.vue @@ -340,7 +340,7 @@ const stopDisabled = computed(() => { display: grid; grid-template-rows: repeat(3, 1fr); .left-title{ - padding-top: 3.5vw; + //padding-top: 3.5vw; padding-left: 2.5vw; display: flex; height: 25vh; diff --git a/src/views/setting/index.vue b/src/views/setting/index.vue index ed32da4..2228d2e 100644 --- a/src/views/setting/index.vue +++ b/src/views/setting/index.vue @@ -100,7 +100,6 @@ const selectItem = (menuCode: string) => { width: 100%; /* 占满父容器 */ background: #fff; // border: 1px solid #eee; - border-radius: 12px; overflow: hidden; /* 配合圆角,避免阴影/边框溢出 */ } .menu-item {