mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
code refactor
This commit is contained in:
@@ -7,7 +7,7 @@ import { useUserStore } from '@/stores/user.ts';
|
||||
import { type TransactionStatisticsFilter, useStatisticsStore } from '@/stores/statistics.ts';
|
||||
|
||||
import type { TypeAndDisplayName } from '@/core/base.ts';
|
||||
import { type LocalizedDateRange, DateRangeScene, DateRange } from '@/core/datetime.ts';
|
||||
import { type LocalizedDateRange, type WeekDayValue, DateRangeScene, DateRange } from '@/core/datetime.ts';
|
||||
import { StatisticsAnalysisType, ChartDataType, ChartSortingType, ChartDateAggregationType } from '@/core/statistics.ts';
|
||||
import type { TransactionCategoricalAnalysisData, TransactionTrendsAnalysisData } from '@/models/transaction.ts';
|
||||
|
||||
@@ -36,7 +36,7 @@ export function useStatisticsTransactionPageBase() {
|
||||
|
||||
const showAccountBalance = computed<boolean>(() => settingsStore.appSettings.showAccountBalance);
|
||||
const defaultCurrency = computed<string>(() => userStore.currentUserDefaultCurrency);
|
||||
const firstDayOfWeek = computed<number>(() => userStore.currentUserFirstDayOfWeek);
|
||||
const firstDayOfWeek = computed<WeekDayValue>(() => userStore.currentUserFirstDayOfWeek);
|
||||
const fiscalYearStart = computed<number>(() => userStore.currentUserFiscalYearStart);
|
||||
|
||||
const allDateRanges = computed<LocalizedDateRange[]>(() => {
|
||||
|
||||
@@ -10,6 +10,7 @@ import { useTransactionTagsStore } from '@/stores/transactionTag.ts';
|
||||
import { useTransactionsStore } from '@/stores/transaction.ts';
|
||||
import { useExchangeRatesStore } from '@/stores/exchangeRates.ts';
|
||||
|
||||
import type { WeekDayValue } from '@/core/datetime.ts';
|
||||
import type { LocalizedTimezoneInfo } from '@/core/timezone.ts';
|
||||
import { TransactionType } from '@/core/transaction.ts';
|
||||
import { TemplateType } from '@/core/template.ts';
|
||||
@@ -91,7 +92,7 @@ export function useTransactionEditPageBase(type: TransactionEditPageType, initMo
|
||||
const showAccountBalance = computed<boolean>(() => settingsStore.appSettings.showAccountBalance);
|
||||
const defaultCurrency = computed<string>(() => userStore.currentUserDefaultCurrency);
|
||||
const defaultAccountId = computed<string>(() => userStore.currentUserDefaultAccountId);
|
||||
const firstDayOfWeek = computed<number>(() => userStore.currentUserFirstDayOfWeek);
|
||||
const firstDayOfWeek = computed<WeekDayValue>(() => userStore.currentUserFirstDayOfWeek);
|
||||
const coordinateDisplayType = computed<number>(() => userStore.currentUserCoordinateDisplayType);
|
||||
|
||||
const allTimezones = computed<LocalizedTimezoneInfo[]>(() => getAllTimezones(true));
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useTransactionTagsStore } from '@/stores/transactionTag.ts';
|
||||
import { type TransactionListFilter, type TransactionMonthList, useTransactionsStore } from '@/stores/transaction.ts';
|
||||
|
||||
import type { TypeAndName } from '@/core/base.ts';
|
||||
import { type LocalizedDateRange, DateRange, DateRangeScene } from '@/core/datetime.ts';
|
||||
import { type LocalizedDateRange, type WeekDayValue, DateRange, DateRangeScene } from '@/core/datetime.ts';
|
||||
import { AccountType } from '@/core/account.ts';
|
||||
import { TransactionType } from '@/core/transaction.ts';
|
||||
|
||||
@@ -101,7 +101,7 @@ export function useTransactionListPageBase() {
|
||||
const currentCalendarDate = ref<string>('');
|
||||
|
||||
const currentTimezoneOffsetMinutes = computed<number>(() => getTimezoneOffsetMinutes(settingsStore.appSettings.timeZone));
|
||||
const firstDayOfWeek = computed<number>(() => userStore.currentUserFirstDayOfWeek);
|
||||
const firstDayOfWeek = computed<WeekDayValue>(() => userStore.currentUserFirstDayOfWeek);
|
||||
const fiscalYearStart = computed<number>(() => userStore.currentUserFiscalYearStart);
|
||||
const defaultCurrency = computed<string>(() => getUnifiedSelectedAccountsCurrencyOrDefaultCurrency(allAccountsMap.value, queryAllFilterAccountIds.value, userStore.currentUserDefaultCurrency));
|
||||
const showTotalAmountInTransactionListPage = computed<boolean>(() => settingsStore.appSettings.showTotalAmountInTransactionListPage);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<v-text-field
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
autofocus="autofocus"
|
||||
:autofocus="true"
|
||||
:disabled="requesting"
|
||||
:label="tt('E-mail')"
|
||||
:placeholder="tt('Your email address')"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<v-text-field
|
||||
type="text"
|
||||
autocomplete="username"
|
||||
autofocus="autofocus"
|
||||
:autofocus="true"
|
||||
:disabled="show2faInput || logining || verifying"
|
||||
:label="tt('Username')"
|
||||
:placeholder="tt('Your username or email')"
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
<v-text-field
|
||||
type="email"
|
||||
autocomplete="email"
|
||||
autofocus="autofocus"
|
||||
:autofocus="true"
|
||||
:disabled="updating"
|
||||
:label="tt('E-mail')"
|
||||
:placeholder="tt('Your email address')"
|
||||
|
||||
@@ -179,8 +179,8 @@
|
||||
:disabled="currentStep === 'basicSetting' || currentStep === 'finalResult' || submitting || navigateToHomePage"
|
||||
:prepend-icon="mdiArrowLeft"
|
||||
@click="switchToPreviousTab">{{ tt('Previous') }}</v-btn>
|
||||
<v-btn :color="(currentStep === 'presetCategories' || currentStep === 'finalResult') ? 'secondary' : 'primary'"
|
||||
:disabled="currentStep === 'presetCategories' || currentStep === 'finalResult' || submitting || navigateToHomePage"
|
||||
<v-btn color="primary"
|
||||
:disabled="submitting || navigateToHomePage"
|
||||
:append-icon="mdiArrowRight"
|
||||
@click="switchToNextTab"
|
||||
v-if="currentStep === 'basicSetting'">{{ tt('Next') }}</v-btn>
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<p class="text-body-1" v-if="status === true">
|
||||
{{ tt('Please copy these backup codes to safe place, the following backup codes will be displayed only once. If these codes were lost, you can regenerate them at any time.') }}
|
||||
</p>
|
||||
<v-textarea class="backup-code" readonly="readonly" :rows="10" :value="currentBackupCode"/>
|
||||
<v-textarea class="backup-code" :readonly="true" :rows="10" :value="currentBackupCode"/>
|
||||
</v-card-text>
|
||||
</v-card>
|
||||
</v-col>
|
||||
|
||||
Reference in New Issue
Block a user