From ab2d02c27118ed18f142fa21175be9ad20173037 Mon Sep 17 00:00:00 2001 From: guoapeng Date: Tue, 15 Jul 2025 11:14:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A1=A8=E5=8D=95=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/formula/FormulaConfig.vue | 18 ++++++++++++++++++ src/components/formula/RunFormulaConfig.vue | 15 +++++++++++++++ src/components/formula/SettingFormulaConfig.vue | 15 +++++++++++++++ src/stores/homeStore.ts | 4 ++-- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/components/formula/FormulaConfig.vue b/src/components/formula/FormulaConfig.vue index 775785d..9e37071 100644 --- a/src/components/formula/FormulaConfig.vue +++ b/src/components/formula/FormulaConfig.vue @@ -38,6 +38,7 @@ const registerGrandsonMethods = inject<(methods: any) => void>('registerGrandson * 配方配置列表 */ const formulaConfigList = ref(formulaStore.formulaConfigList) +console.log('formulaConfigList', formulaConfigList.value) /** * 标签单位映射表,用于显示各参数的单位 @@ -175,7 +176,9 @@ defineExpose({ addFormula, }) const validatePass = (rule: any, value: any, callback: any, config: Formula.FormulaConfig) => { + console.log(config) if (!value && value !== 0 && value !== '0') { + console.log(config) callback(new Error('此为必填项')) } else if (value.substring(0, 1) === '.' || value.split('.').length > 2) { @@ -187,6 +190,21 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form callback(new Error(`输入范围为${config.val_lower_limit}-${config.val_upper_limit}`)) } } + if (config.setting_id === 'continued_satur') { + if (Number(value) > Number(formData.value.stoped_satur)) { + callback(new Error('继续值不能大于停止值')) + } + } + if (config.setting_id === 'continued_gs') { + if (Number(value) > Number(formData.value.stoped_gs)) { + callback(new Error('继续值不能大于停止值')) + } + } + if (config.setting_id === 'continued_humi') { + if (Number(value) > Number(formData.value.stoped_humi)) { + callback(new Error('继续值不能大于停止值')) + } + } callback() } const validateName = (rule: any, value: any, callback: any) => { diff --git a/src/components/formula/RunFormulaConfig.vue b/src/components/formula/RunFormulaConfig.vue index 1b5395b..85bff22 100644 --- a/src/components/formula/RunFormulaConfig.vue +++ b/src/components/formula/RunFormulaConfig.vue @@ -55,6 +55,21 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form callback(new Error(`输入范围为${config.val_lower_limit}-${config.val_upper_limit}`)) } } + if (config.setting_id === 'continued_satur') { + if (Number(value) > Number(formData.value.stoped_satur)) { + callback(new Error('继续值不能大于停止值')) + } + } + if (config.setting_id === 'continued_gs') { + if (Number(value) > Number(formData.value.stoped_gs)) { + callback(new Error('继续值不能大于停止值')) + } + } + if (config.setting_id === 'continued_humi') { + if (Number(value) > Number(formData.value.stoped_humi)) { + callback(new Error('继续值不能大于停止值')) + } + } callback() } diff --git a/src/components/formula/SettingFormulaConfig.vue b/src/components/formula/SettingFormulaConfig.vue index 7983984..b5cd562 100644 --- a/src/components/formula/SettingFormulaConfig.vue +++ b/src/components/formula/SettingFormulaConfig.vue @@ -76,6 +76,21 @@ const validatePass = (rule: any, value: any, callback: any, config: Formula.Form callback(new Error(`输入范围为${config.val_lower_limit}-${config.val_upper_limit}`)) } } + if (config.setting_id === 'continued_satur') { + if (Number(value) > Number(formData.value.stoped_satur)) { + callback(new Error('继续值不能大于停止值')) + } + } + if (config.setting_id === 'continued_gs') { + if (Number(value) > Number(formData.value.stoped_gs)) { + callback(new Error('继续值不能大于停止值')) + } + } + if (config.setting_id === 'continued_humi') { + if (Number(value) > Number(formData.value.stoped_humi)) { + callback(new Error('继续值不能大于停止值')) + } + } callback() } diff --git a/src/stores/homeStore.ts b/src/stores/homeStore.ts index 26572e8..9a5486d 100644 --- a/src/stores/homeStore.ts +++ b/src/stores/homeStore.ts @@ -179,7 +179,7 @@ export const useHomeStore = defineStore('home', () => { * @desc 更新环境传感器数据(温度、湿度、过氧化氢浓度等) */ const updateHomeData = (data: Home.DisplayrelyMgr[]) => { - console.log(data) + // console.log(data) data.forEach((item, index) => { h2O2SensorData.value[index] = { ...h2O2SensorData.value[index], @@ -225,7 +225,7 @@ export const useHomeStore = defineStore('home', () => { * @desc 更新消毒状态信息,每3秒更新一次传感器数据 */ const updateHomeDisinfectionState = (disinfectState: Home.DisinfectState) => { - console.log(disinfectState) + // console.log(disinfectState) disinfectionState.value = disinfectState if (!renderTimer) { renderTimer = setTimeout(() => {