From 4216b6c1103415d7b893a7085fce4d48acb9f13c Mon Sep 17 00:00:00 2001 From: sige Date: Fri, 24 May 2024 10:31:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE-=E8=AE=BE=E5=A4=87=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E8=AE=BE=E7=BD=AE=E5=A2=9E=E5=8A=A0=E6=81=A2=E5=A4=8D?= =?UTF-8?q?=E5=87=BA=E5=8E=82=E8=AE=BE=E7=BD=AE=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Setting/components/Device.vue | 26 ++++++++++++++++++++++++++ src/store/modules/setting.js | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/components/Setting/components/Device.vue b/src/components/Setting/components/Device.vue index bd09eaf..789f8da 100644 --- a/src/components/Setting/components/Device.vue +++ b/src/components/Setting/components/Device.vue @@ -97,6 +97,13 @@ />

+
+

恢复默认设置

+

+

恢复
+

+
+ { const ele = document.getElementById('set_device_container') ele.scrollTop = ele.scrollTop - 100 < 100 ? 0 : ele.scrollTop - 100 @@ -721,6 +733,20 @@ const setSprayLiquidVal = () => { } showSuccessToast('设置成功') } + +// 恢复到默认设置 +async function actionDefaultSetting() { + let isConfirmed = await MyModal.confirm('是否恢复到默认设置?'); + if (!isConfirmed) { + return; + } + + if ( !props.runInfection ) { + await webSocketStore.call('factoryResetSettings'); + webSocketStore.sendCommandMsg(getAllSettingJSON); + } + showSuccessToast('设置成功') +}