From b3900fbef54c5f06bcfc39cb664d4863e8eb38eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=AC=E6=82=A6?= Date: Fri, 29 Dec 2023 16:39:50 +0800 Subject: [PATCH 01/17] feat: add global loading --- src/hooks/wifiAndMqttDetection.ts | 2 +- src/locale/en-US.ts | 1 + src/locale/zh-CN.ts | 1 + src/pages/components/Loading.vue | 128 ++++++++++++++++++ src/pages/index.vue | 27 +++- src/pages/setup/config/components/Config.vue | 54 +++++--- .../setup/process/grove_ai_we2/Device.vue | 12 +- .../setup/process/xiao_esp32s3/Device.vue | 12 +- src/store/modules/app/index.ts | 21 +++ src/store/modules/app/types.ts | 3 + src/utils/timer.ts | 22 +++ 11 files changed, 253 insertions(+), 30 deletions(-) create mode 100644 src/pages/components/Loading.vue diff --git a/src/hooks/wifiAndMqttDetection.ts b/src/hooks/wifiAndMqttDetection.ts index 6323ab5..3839984 100644 --- a/src/hooks/wifiAndMqttDetection.ts +++ b/src/hooks/wifiAndMqttDetection.ts @@ -19,7 +19,7 @@ const useWifiAndMqttDetection = () => { } isStarted = true; try { - await delay(isFirst ? 0 : 2000); + await delay(isFirst ? 1000 : 5000); await behavior(); } catch (error) { console.log('get wifi info error', error); diff --git a/src/locale/en-US.ts b/src/locale/en-US.ts index 23fec25..5e068b0 100644 --- a/src/locale/en-US.ts +++ b/src/locale/en-US.ts @@ -20,6 +20,7 @@ export default { 'navbar.action.locale': 'Switch to English', 'confirm': 'Confirm', 'cancel': 'Cancel', + 'config.save.success': 'Save Success', ...localeSettings, ...localeProcess, }; diff --git a/src/locale/zh-CN.ts b/src/locale/zh-CN.ts index a631d1d..efa087f 100644 --- a/src/locale/zh-CN.ts +++ b/src/locale/zh-CN.ts @@ -20,6 +20,7 @@ export default { 'navbar.action.locale': '切换为中文', 'confirm': '确定', 'cancel': '取消', + 'config.save.success': '保存成功', ...localeSettings, ...localeProcess, }; diff --git a/src/pages/components/Loading.vue b/src/pages/components/Loading.vue new file mode 100644 index 0000000..a5f1ddb --- /dev/null +++ b/src/pages/components/Loading.vue @@ -0,0 +1,128 @@ + + + + + diff --git a/src/pages/index.vue b/src/pages/index.vue index c06d99e..dbd8561 100644 --- a/src/pages/index.vue +++ b/src/pages/index.vue @@ -35,7 +35,12 @@ - +
+
+ +
+ +