From 30ac801641e1a56f2c7479259f978cba0061248c Mon Sep 17 00:00:00 2001 From: guoapeng Date: Tue, 8 Jul 2025 17:18:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=A6=96=E9=A1=B5=E5=92=8C=E5=9B=BE?= =?UTF-8?q?=E8=A1=A8=E6=B7=BB=E5=8A=A0=E5=AE=9E=E6=97=B6=E6=B6=88=E6=AF=92?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E5=92=8Cui=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.vue | 7 +- src/components/home/HomeFormula.vue | 93 ++++++++++++---- src/components/home/HomeOperation.vue | 11 +- src/components/home/HomeSetting.vue | 1 + src/components/home/LineChart.vue | 10 +- src/libs/constant.ts | 18 ---- src/stores/homeStore.ts | 7 ++ src/views/home/chart.vue | 195 ++++++++++++++++++++++------------ src/views/home/index.vue | 12 +-- 9 files changed, 225 insertions(+), 129 deletions(-) diff --git a/src/app.vue b/src/app.vue index 23ed3cc..6075edb 100644 --- a/src/app.vue +++ b/src/app.vue @@ -1,16 +1,15 @@ diff --git a/src/components/home/HomeOperation.vue b/src/components/home/HomeOperation.vue index ce804a1..8743a9e 100644 --- a/src/components/home/HomeOperation.vue +++ b/src/components/home/HomeOperation.vue @@ -117,6 +117,7 @@ const doStartDisinfect = async () => { const onFinishDisinfect = () => { FtMessageBox.warning('请确认是否结束消毒').then(() => { homeStore.setRate(undefined) + homeStore.setLog(undefined) doStopDisinfect() }) } @@ -264,16 +265,14 @@ const formatSeconds = (seconds: number) => { background: #ff6767; } .home-remain-time { - background: #f6fafe; - margin-top: 1.5em; - margin-left: 1rem; - margin-right: 1rem; - height: 8vh; + background: #fff; + margin: 10px; + height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; - font-size: 24px; + font-size: 20px; gap: 10px; .home-remaini-value { color: #2892f3; diff --git a/src/components/home/HomeSetting.vue b/src/components/home/HomeSetting.vue index 0190b71..72cee17 100644 --- a/src/components/home/HomeSetting.vue +++ b/src/components/home/HomeSetting.vue @@ -124,6 +124,7 @@ const onSave = async () => { ) FtMessage.success('设定成功') homeStore.setRate(formData.injection_pump_speed) + homeStore.setLog(formData.loglevel) } } /** diff --git a/src/components/home/LineChart.vue b/src/components/home/LineChart.vue index 74a679c..c26b629 100644 --- a/src/components/home/LineChart.vue +++ b/src/components/home/LineChart.vue @@ -50,10 +50,10 @@ watch( case '相对湿度': unit = ' %RH' break - case 'H2O2浓度': + case 'H₂O₂浓度': unit = ' ppm' break - case 'H2O2相对饱和度': + case 'H₂O₂相对饱和度': unit = ' %RS' break } @@ -64,7 +64,7 @@ watch( }, }, legend: { - data: ['温度', '相对湿度', 'H2O2浓度', 'H2O2相对饱和度'], + data: ['温度', '相对湿度', 'H₂O₂浓度', 'H₂O₂相对饱和度'], orient: 'horizontal', // 水平布局 itemWidth: 10, // 图例图形宽度 itemHeight: 10, // 图例图形高度 @@ -104,7 +104,7 @@ watch( }, }, { - name: 'H2O2浓度', + name: 'H₂O₂浓度', type: 'line', data: newValue.data?.map(item => item.h2o2.toFixed(2)), symbol: 'circle', @@ -115,7 +115,7 @@ watch( }, }, { - name: 'H2O2相对饱和度', + name: 'H₂O₂相对饱和度', type: 'line', data: newValue.data?.map(item => item.rs.toFixed(2)), symbol: 'circle', diff --git a/src/libs/constant.ts b/src/libs/constant.ts index b9b9dd1..0dd8412 100644 --- a/src/libs/constant.ts +++ b/src/libs/constant.ts @@ -3,24 +3,6 @@ export const HEADER_TOKEN_KEY = 'Authorization' // sessionStorage里token的名称 export const SESSIONSTORAGE_TOKEN_KEY = 'web_token' - -export const formulaNameMap: Record = { - stoped_gs: '停止H2o2浓度', - continued_gs: '继续H2o2浓度', - stoped_satur: '停止H2o2饱和度', - continued_satur: '继续H2o2饱和度', - max_humidity: '消毒最大湿度', - injection_pump_speed: '喷射蠕动泵转速', - pre_heat_time_s: '预热时间', - stoped_humi: '停止相对湿度', - continued_humi: '湿度', - proportional_valve_default_value: '正负压比例', - loglevel: '消毒等级', - dvalue_correct_coefficient: 'D值修正系数', - record_period_min: '消毒日志记录间隔', - record_printer_period_min: '消毒日志打印间隔', -} - // 空气压力初始化数据 export const PARSSURE_DATA = { intensitys: { diff --git a/src/stores/homeStore.ts b/src/stores/homeStore.ts index ffe9557..4b3968e 100644 --- a/src/stores/homeStore.ts +++ b/src/stores/homeStore.ts @@ -134,6 +134,7 @@ export const useHomeStore = defineStore('home', () => { const defaultIntensityTypeValue = ref() const realRate = ref() + const realLog = ref() const allData = ref([]) @@ -141,6 +142,10 @@ export const useHomeStore = defineStore('home', () => { realRate.value = data } + const setLog = (data: any) => { + realLog.value = data + } + /** * @function updateHomeData * @param {Home.DisplayrelyMgr[]} data - 当前设备所有环境数据(仓内、探头) @@ -235,7 +240,9 @@ export const useHomeStore = defineStore('home', () => { return { realRate, + realLog, setRate, + setLog, isDeviceIdle, h2O2SensorData, diff --git a/src/views/home/chart.vue b/src/views/home/chart.vue index f274e7d..06083c9 100644 --- a/src/views/home/chart.vue +++ b/src/views/home/chart.vue @@ -1,12 +1,12 @@