From b8182b6c3013b8e12c165313b601d555945d0c1e Mon Sep 17 00:00:00 2001 From: jinmao Date: Wed, 6 Nov 2024 12:14:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=88=9D=E6=AD=A5=E9=9B=86=E6=88=90Pag?= =?UTF-8?q?eSpy=EF=BC=8C=E8=AE=BE=E7=BD=AE=E5=86=85=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E7=A6=BB=E7=BA=BF=E6=97=A5=E5=BF=97=E6=8C=89?= =?UTF-8?q?=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../preferences/preferences-drawer.vue | 23 +++++++++++++-- .../locales/src/langs/en-US/preferences.json | 3 ++ .../locales/src/langs/zh-CN/preferences.json | 3 ++ playground/index.html | 29 +++++++++++++++++++ 4 files changed, 56 insertions(+), 2 deletions(-) diff --git a/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue b/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue index 77bf4d703..e3a2429ba 100644 --- a/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue +++ b/packages/effects/layouts/src/widgets/preferences/preferences-drawer.vue @@ -14,7 +14,7 @@ import type { SegmentedItem } from '@vben-core/shadcn-ui'; import { computed, ref } from 'vue'; -import { Copy, RotateCw } from '@vben/icons'; +import { CloudUpload, Copy, RotateCw } from '@vben/icons'; import { $t, loadLocaleMessages } from '@vben/locales'; import { clearPreferencesCache, @@ -30,7 +30,7 @@ import { } from '@vben-core/shadcn-ui'; import { globalShareState } from '@vben-core/shared/global-state'; -import { useClipboard } from '@vueuse/core'; +import { useClipboard, useThrottleFn } from '@vueuse/core'; import { Animation, @@ -217,6 +217,18 @@ async function handleReset() { resetPreferences(); await loadLocaleMessages(preferences.app.locale); } +const harbor = computed(() => window.$harbor); +// 防抖 +const handleUploadLog = useThrottleFn(() => { + if (!harbor.value) { + return; + } + harbor.value.onOfflineLog('upload'); + message.copyPreferencesSuccess?.( + $t('preferences.logUploadSuccessTitle'), + $t('preferences.logUploadSuccess'), + ); +}, 5000);