diff --git a/src/components/AddPreSetting.vue b/src/components/AddPreSetting.vue index 1ffcea2..3b87c0f 100644 --- a/src/components/AddPreSetting.vue +++ b/src/components/AddPreSetting.vue @@ -139,7 +139,7 @@ import { ref, onMounted } from 'vue' import SimpleKeyboard from 'cpns/SimpleKeyboard' import { showSuccessToast, showFailToast } from 'vant' -import { useSettingStore, useWebSocketStore, useOperatorStore } from '@/store' +import { useSettingStore, useWebSocketStore, useOperatorStore, useFormulaStore } from '@/store' import { storeToRefs } from 'pinia' import { setSettingValJSON, @@ -151,6 +151,7 @@ import LogPicker from 'cpns/dialogs/LogPicker' const settingStore = useSettingStore() const webSocketStore = useWebSocketStore() const operatorStore = useOperatorStore() +const formulaStore = useFormulaStore() const max_humidity = ref('0') const continued_satur = ref('0') @@ -183,6 +184,15 @@ const save = () => { showFailToast('配方名称不能为空') return } + + let list = formulaStore?.formulaList; + for (let i = 0; i < list.length; i++) { + if (list[i].formula_id == formula_id.value) { + showFailToast('配方名称已存在') + return + } + } + const data = { formula_id: formula_id.value, loglevel: logVal.value, @@ -620,7 +630,7 @@ const handleShowKeyBoard = () => { showkeyboard.value = true } -onMounted(() => { +onMounted(async () => { document.addEventListener('click', e => { let box = document.getElementById('keyboard_formula') let room = document.getElementById('id_formula') @@ -639,6 +649,20 @@ onMounted(() => { } }) $('#id_formula').virtualkeyboard() + + + // 设置默认值 + let defaultSettings = await webSocketStore.call('getAllSetting'); + defaultSettings = defaultSettings.dbval; + let defaultSettingKV = {}; + defaultSettings.forEach(item => defaultSettingKV[item.name] = item.val); + sprayLiquidConfigVal.value = defaultSettingKV['injection_pump_speed'] || 0; + stoped_gs.value = defaultSettingKV['stoped_gs'] || 0; + continued_gs.value = defaultSettingKV['continued_gs'] || 0; + stoped_satur.value = defaultSettingKV['stoped_satur'] || 0; + continued_satur.value = defaultSettingKV['continued_satur'] || 0; + stoped_humi.value = defaultSettingKV['stoped_humi'] || 0; + continued_humi.value = defaultSettingKV['continued_humi'] || 0; }) diff --git a/src/components/Setting/components/RunInfectionSetting.vue b/src/components/Setting/components/RunInfectionSetting.vue index aa30667..1be1969 100644 --- a/src/components/Setting/components/RunInfectionSetting.vue +++ b/src/components/Setting/components/RunInfectionSetting.vue @@ -10,171 +10,73 @@
注射蠕动泵速率(g/min)
-
消毒停止过氧化氢浓度(ppm)
-
消毒继续过氧化氢浓度(ppm)
-
消毒停止相对湿度(%RH)
-
消毒继续相对湿度(%RH)
-
消毒停止过氧化氢相对饱和度(%RS)
-
消毒继续过氧化氢相对饱和度(%RS)
-