From f236e093d189b11dbf47265a2f6e0998385409c2 Mon Sep 17 00:00:00 2001 From: sige Date: Sat, 25 May 2024 00:46:54 +0800 Subject: [PATCH] d --- src/components/AddPreSetting.vue | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/components/AddPreSetting.vue b/src/components/AddPreSetting.vue index 01ce2f2..3cc1023 100644 --- a/src/components/AddPreSetting.vue +++ b/src/components/AddPreSetting.vue @@ -700,7 +700,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') @@ -719,6 +719,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; })