From 0e422b5a8fcecc026c3451edd00dcaa5332f8f82 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Sun, 5 Jan 2025 19:11:09 +0800 Subject: [PATCH] migrate settings store to composition API and typescript --- src/DesktopApp.vue | 2 +- src/MobileApp.vue | 2 +- src/components/desktop/AmountInput.vue | 2 +- src/components/desktop/PieChart.vue | 2 +- src/components/desktop/TrendsChart.vue | 2 +- src/components/mobile/PieChart.vue | 2 +- src/components/mobile/TrendsBarChart.vue | 2 +- src/core/setting.ts | 92 ++++++ src/lib/i18n.js | 4 +- src/lib/settings.ts | 311 +++--------------- src/stores/index.js | 2 +- src/stores/overview.js | 2 +- src/stores/setting.js | 156 --------- src/stores/setting.ts | 187 +++++++++++ src/stores/statistics.js | 2 +- src/stores/transaction.js | 2 +- src/stores/user.js | 2 +- src/views/desktop/ExchangeRatesPage.vue | 2 +- src/views/desktop/ForgetPasswordPage.vue | 2 +- src/views/desktop/HomePage.vue | 2 +- src/views/desktop/LoginPage.vue | 2 +- src/views/desktop/MainLayout.vue | 2 +- src/views/desktop/ResetPasswordPage.vue | 2 +- src/views/desktop/SignupPage.vue | 2 +- src/views/desktop/UnlockPage.vue | 2 +- src/views/desktop/VerifyEmailPage.vue | 2 +- src/views/desktop/accounts/ListPage.vue | 2 +- .../accounts/list/dialogs/EditDialog.vue | 2 +- .../app/settings/tabs/AppBasicSettingTab.vue | 2 +- .../app/settings/tabs/AppLockSettingTab.vue | 2 +- .../settings/tabs/AppStatisticsSettingTab.vue | 2 +- .../cards/AccountFilterSettingsCard.vue | 2 +- .../cards/CategoryFilterSettingsCard.vue | 2 +- .../cards/MonthlyIncomeAndExpenseCard.vue | 2 +- .../desktop/statistics/TransactionPage.vue | 2 +- src/views/desktop/transactions/ListPage.vue | 2 +- .../list/dialogs/BatchReplaceDialog.vue | 2 +- .../transactions/list/dialogs/EditDialog.vue | 2 +- .../list/dialogs/ImportDialog.vue | 2 +- .../settings/tabs/UserBasicSettingTab.vue | 2 +- .../tabs/UserDataManagementSettingTab.vue | 2 +- .../settings/tabs/UserSecuritySettingTab.vue | 2 +- src/views/mobile/ApplicationLockPage.vue | 2 +- src/views/mobile/ExchangeRatesPage.vue | 2 +- src/views/mobile/HomePage.vue | 2 +- src/views/mobile/LoginPage.vue | 2 +- src/views/mobile/SettingsPage.vue | 2 +- src/views/mobile/SignupPage.vue | 2 +- src/views/mobile/UnlockPage.vue | 2 +- src/views/mobile/accounts/EditPage.vue | 2 +- src/views/mobile/accounts/ListPage.vue | 2 +- .../settings/AccountFilterSettingsPage.vue | 2 +- .../settings/CategoryFilterSettingsPage.vue | 2 +- .../mobile/settings/PageSettingsPage.vue | 2 +- .../mobile/settings/TextSizeSettingsPage.vue | 2 +- src/views/mobile/statistics/SettingsPage.vue | 2 +- .../mobile/statistics/TransactionPage.vue | 2 +- .../mobile/transactions/AmountFilterPage.vue | 2 +- src/views/mobile/transactions/EditPage.vue | 2 +- src/views/mobile/transactions/ListPage.vue | 2 +- src/views/mobile/users/DataManagementPage.vue | 2 +- src/views/mobile/users/UserProfilePage.vue | 2 +- 62 files changed, 376 insertions(+), 488 deletions(-) create mode 100644 src/core/setting.ts delete mode 100644 src/stores/setting.js create mode 100644 src/stores/setting.ts diff --git a/src/DesktopApp.vue b/src/DesktopApp.vue index 03fff19f..9057dba0 100644 --- a/src/DesktopApp.vue +++ b/src/DesktopApp.vue @@ -21,7 +21,7 @@ import { register } from 'register-service-worker'; import { mapStores } from 'pinia'; import { useRootStore } from '@/stores/index.js'; -import { useSettingsStore } from '@/stores/setting.js'; +import { useSettingsStore } from '@/stores/setting.ts'; import { useUserStore } from '@/stores/user.js'; import { useTokensStore } from '@/stores/token.js'; import { useExchangeRatesStore } from '@/stores/exchangeRates.js'; diff --git a/src/MobileApp.vue b/src/MobileApp.vue index 746bd3fa..01fdd938 100644 --- a/src/MobileApp.vue +++ b/src/MobileApp.vue @@ -10,7 +10,7 @@ import routes from './router/mobile.js'; import { mapStores } from 'pinia'; import { useRootStore } from '@/stores/index.js'; -import { useSettingsStore } from '@/stores/setting.js'; +import { useSettingsStore } from '@/stores/setting.ts'; import { useUserStore } from '@/stores/user.js'; import { useTokensStore } from '@/stores/token.js'; import { useExchangeRatesStore } from '@/stores/exchangeRates.js'; diff --git a/src/components/desktop/AmountInput.vue b/src/components/desktop/AmountInput.vue index 1bdad5d9..4d0d2a32 100644 --- a/src/components/desktop/AmountInput.vue +++ b/src/components/desktop/AmountInput.vue @@ -31,7 +31,7 @@