mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 08:44:25 +08:00
migrate to typescript
This commit is contained in:
@@ -58,8 +58,8 @@ import { useUserStore } from '@/stores/user.js';
|
||||
import { useTransactionsStore } from '@/stores/transaction.js';
|
||||
|
||||
import numeralConstants from '@/consts/numeral.js';
|
||||
import transactionConstants from '@/consts/transaction.js';
|
||||
import { isString } from '@/lib/common.js';
|
||||
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT } from '@/consts/transaction.ts';
|
||||
import { isString } from '@/lib/common.ts';
|
||||
import logger from '@/lib/logger.js';
|
||||
|
||||
export default {
|
||||
@@ -82,10 +82,10 @@ export default {
|
||||
return numeralConstants.allAmountFilterTypeArray;
|
||||
},
|
||||
allowedMinAmount() {
|
||||
return transactionConstants.minAmountNumber;
|
||||
return TRANSACTION_MIN_AMOUNT;
|
||||
},
|
||||
allowedMaxAmount() {
|
||||
return transactionConstants.maxAmountNumber;
|
||||
return TRANSACTION_MAX_AMOUNT;
|
||||
},
|
||||
amountCount() {
|
||||
return this.getAmountFilterParameterCount(this.type);
|
||||
|
||||
@@ -37,8 +37,8 @@
|
||||
<f7-list-item class="list-item-with-header-and-title list-item-title-hide-overflow" header="Category" title="Category Names"></f7-list-item>
|
||||
<f7-list-item class="list-item-with-header-and-title" header="Account" title="Account Name"></f7-list-item>
|
||||
<f7-list-item class="list-item-with-header-and-title" header="Transaction Time" title="YYYY/MM/DD HH:mm:ss" v-if="type === 'transaction'"></f7-list-item>
|
||||
<f7-list-item class="list-item-with-header-and-title" header="Scheduled Transaction Frequency" title="Every XXXXX" v-if="type === 'template' && transaction.templateType === allTemplateTypes.Schedule"></f7-list-item>
|
||||
<f7-list-item class="list-item-with-header-and-title list-item-title-hide-overflow list-item-no-item-after" header="Transaction Timezone" title="(UTC XX:XX) System Default" link="#" :no-chevron="mode === 'view'" v-if="type === 'transaction' || (type === 'template' && transaction.templateType === allTemplateTypes.Schedule)"></f7-list-item>
|
||||
<f7-list-item class="list-item-with-header-and-title" header="Scheduled Transaction Frequency" title="Every XXXXX" v-if="type === 'template' && transaction.templateType === allTemplateTypes.Schedule.type"></f7-list-item>
|
||||
<f7-list-item class="list-item-with-header-and-title list-item-title-hide-overflow list-item-no-item-after" header="Transaction Timezone" title="(UTC XX:XX) System Default" link="#" :no-chevron="mode === 'view'" v-if="type === 'transaction' || (type === 'template' && transaction.templateType === allTemplateTypes.Schedule.type)"></f7-list-item>
|
||||
<f7-list-item class="list-item-with-header-and-title list-item-title-hide-overflow" header="Geographic Location" title="No Location" v-if="type === 'transaction'"></f7-list-item>
|
||||
<f7-list-item header="Tags">
|
||||
<template #footer>
|
||||
@@ -258,7 +258,7 @@
|
||||
:header="$t('Scheduled Transaction Frequency')"
|
||||
:title="transactionDisplayScheduledFrequency"
|
||||
@click="showTransactionScheduledFrequencySheet = true"
|
||||
v-if="type === 'template' && transaction.templateType === allTemplateTypes.Schedule"
|
||||
v-if="type === 'template' && transaction.templateType === allTemplateTypes.Schedule.type"
|
||||
>
|
||||
<schedule-frequency-sheet v-model:show="showTransactionScheduledFrequencySheet"
|
||||
v-model:type="transaction.scheduledFrequencyType"
|
||||
@@ -272,7 +272,7 @@
|
||||
:class="{ 'readonly': mode === 'view' }"
|
||||
:header="$t('Transaction Timezone')"
|
||||
smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: $t('Timezone'), searchbarDisableText: $t('Cancel'), appendSearchbarNotFound: $t('No results'), pageTitle: $t('Transaction Timezone'), popupCloseLinkText: $t('Done') }"
|
||||
v-if="type === 'transaction' || (type === 'template' && transaction.templateType === allTemplateTypes.Schedule)"
|
||||
v-if="type === 'transaction' || (type === 'template' && transaction.templateType === allTemplateTypes.Schedule.type)"
|
||||
>
|
||||
<select v-model="transaction.timeZone">
|
||||
<option :value="timezone.name" :key="timezone.name"
|
||||
@@ -439,16 +439,17 @@ import { useTransactionsStore } from '@/stores/transaction.js';
|
||||
import { useTransactionTemplatesStore } from '@/stores/transactionTemplate.js';
|
||||
import { useExchangeRatesStore } from '@/stores/exchangeRates.js';
|
||||
|
||||
import fileConstants from '@/consts/file.js';
|
||||
import categoryConstants from '@/consts/category.js';
|
||||
import transactionConstants from '@/consts/transaction.js';
|
||||
import templateConstants from '@/consts/template.js';
|
||||
import apiConstants from '@/consts/api.js';
|
||||
import { CategoryType } from '@/core/category.ts';
|
||||
import { TransactionType, TransactionEditScopeType } from '@/core/transaction.ts';
|
||||
import { TemplateType, ScheduledTemplateFrequencyType } from '@/core/template.ts';
|
||||
import { TRANSACTION_MIN_AMOUNT, TRANSACTION_MAX_AMOUNT, TRANSACTION_MAX_PICTURE_COUNT } from '@/consts/transaction.ts';
|
||||
import { KnownErrorCode } from '@/consts/api.ts';
|
||||
import { SUPPORTED_IMAGE_EXTENSIONS } from '@/consts/file.ts';
|
||||
import logger from '@/lib/logger.js';
|
||||
import {
|
||||
isArray,
|
||||
getNameByKeyValue
|
||||
} from '@/lib/common.js';
|
||||
} from '@/lib/common.ts';
|
||||
import {
|
||||
getTimezoneOffset,
|
||||
getTimezoneOffsetMinutes,
|
||||
@@ -456,7 +457,7 @@ import {
|
||||
getUtcOffsetByUtcOffsetMinutes,
|
||||
getActualUnixTimeForStore
|
||||
} from '@/lib/datetime.js';
|
||||
import { generateRandomUUID } from '@/lib/misc.js';
|
||||
import { generateRandomUUID } from '@/lib/misc.ts';
|
||||
import {
|
||||
getTransactionPrimaryCategoryName,
|
||||
getTransactionSecondaryCategoryName,
|
||||
@@ -466,7 +467,7 @@ import { setTransactionModelByTransaction } from '@/lib/transaction.js';
|
||||
import {
|
||||
isTransactionPicturesEnabled,
|
||||
getMapProvider
|
||||
} from '@/lib/server_settings.js';
|
||||
} from '@/lib/server_settings.ts';
|
||||
|
||||
export default {
|
||||
props: [
|
||||
@@ -524,13 +525,13 @@ export default {
|
||||
} else {
|
||||
return 'Transaction Detail';
|
||||
}
|
||||
} else if (this.type === 'template' && this.transaction.templateType === templateConstants.allTemplateTypes.Normal) {
|
||||
} else if (this.type === 'template' && this.transaction.templateType === TemplateType.Normal.type) {
|
||||
if (this.mode === 'add') {
|
||||
return 'Add Transaction Template';
|
||||
} else if (this.mode === 'edit') {
|
||||
return 'Edit Transaction Template';
|
||||
}
|
||||
} else if (this.type === 'template' && this.transaction.templateType === templateConstants.allTemplateTypes.Schedule) {
|
||||
} else if (this.type === 'template' && this.transaction.templateType === TemplateType.Schedule.type) {
|
||||
if (this.mode === 'add') {
|
||||
return 'Add Scheduled Transaction';
|
||||
} else if (this.mode === 'edit') {
|
||||
@@ -598,13 +599,13 @@ export default {
|
||||
return this.userStore.currentUserFirstDayOfWeek;
|
||||
},
|
||||
allTransactionTypes() {
|
||||
return transactionConstants.allTransactionTypes;
|
||||
return TransactionType;
|
||||
},
|
||||
allCategoryTypes() {
|
||||
return categoryConstants.allCategoryTypes;
|
||||
return CategoryType;
|
||||
},
|
||||
allTemplateTypes() {
|
||||
return templateConstants.allTemplateTypes;
|
||||
return TemplateType.all();
|
||||
},
|
||||
allTimezones() {
|
||||
return this.$locale.getAllTimezones(true);
|
||||
@@ -634,7 +635,7 @@ export default {
|
||||
return this.transactionTagsStore.allTransactionTagsMap;
|
||||
},
|
||||
supportedImageExtensions() {
|
||||
return fileConstants.supportedImageExtensions;
|
||||
return SUPPORTED_IMAGE_EXTENSIONS;
|
||||
},
|
||||
hasAvailableExpenseCategories() {
|
||||
if (!this.allCategories || !this.allCategories[this.allCategoryTypes.Expense] || !this.allCategories[this.allCategoryTypes.Expense].length) {
|
||||
@@ -711,7 +712,7 @@ export default {
|
||||
return '';
|
||||
}
|
||||
|
||||
if (this.transaction.scheduledFrequencyType === templateConstants.allTemplateScheduledFrequencyTypes.Disabled.type) {
|
||||
if (this.transaction.scheduledFrequencyType === ScheduledTemplateFrequencyType.Disabled.type) {
|
||||
return this.$t('Disabled');
|
||||
}
|
||||
|
||||
@@ -724,7 +725,7 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.transaction.scheduledFrequencyType === templateConstants.allTemplateScheduledFrequencyTypes.Weekly.type) {
|
||||
if (this.transaction.scheduledFrequencyType === ScheduledTemplateFrequencyType.Weekly.type) {
|
||||
if (scheduledFrequencyValues.length) {
|
||||
return this.$t('format.misc.everyMultiDaysOfWeek', {
|
||||
days: this.$locale.getMultiWeekdayLongNames(scheduledFrequencyValues, this.firstDayOfWeek)
|
||||
@@ -732,7 +733,7 @@ export default {
|
||||
} else {
|
||||
return this.$t('Weekly');
|
||||
}
|
||||
} else if (this.transaction.scheduledFrequencyType === templateConstants.allTemplateScheduledFrequencyTypes.Monthly.type) {
|
||||
} else if (this.transaction.scheduledFrequencyType === ScheduledTemplateFrequencyType.Monthly.type) {
|
||||
if (scheduledFrequencyValues.length) {
|
||||
return this.$t('format.misc.everyMultiDaysOfMonth', {
|
||||
days: this.$locale.getMultiMonthdayShortNames(scheduledFrequencyValues)
|
||||
@@ -812,10 +813,10 @@ export default {
|
||||
return thumbs;
|
||||
},
|
||||
allowedMinAmount() {
|
||||
return transactionConstants.minAmountNumber;
|
||||
return TRANSACTION_MIN_AMOUNT;
|
||||
},
|
||||
allowedMaxAmount() {
|
||||
return transactionConstants.maxAmountNumber;
|
||||
return TRANSACTION_MAX_AMOUNT;
|
||||
},
|
||||
showAccountBalance() {
|
||||
return this.settingsStore.appSettings.showAccountBalance;
|
||||
@@ -828,7 +829,7 @@ export default {
|
||||
return false;
|
||||
}
|
||||
|
||||
return !isArray(this.transaction.pictures) || this.transaction.pictures.length < transactionConstants.maxPictureCount;
|
||||
return !isArray(this.transaction.pictures) || this.transaction.pictures.length < TRANSACTION_MAX_PICTURE_COUNT;
|
||||
},
|
||||
mapProvider() {
|
||||
return getMapProvider();
|
||||
@@ -933,7 +934,7 @@ export default {
|
||||
self.accountsStore.loadAllAccounts({ force: false }),
|
||||
self.transactionCategoriesStore.loadAllCategories({ force: false }),
|
||||
self.transactionTagsStore.loadAllTags({ force: false }),
|
||||
self.transactionTemplatesStore.loadAllTemplates({ force: false, templateType: templateConstants.allTemplateTypes.Normal })
|
||||
self.transactionTemplatesStore.loadAllTemplates({ force: false, templateType: TemplateType.Normal.type })
|
||||
];
|
||||
|
||||
if (self.type === 'transaction') {
|
||||
@@ -953,8 +954,8 @@ export default {
|
||||
self.transaction.templateType = parseInt(query.templateType);
|
||||
}
|
||||
|
||||
if (self.transaction.templateType === templateConstants.allTemplateTypes.Schedule) {
|
||||
self.transaction.scheduledFrequencyType = templateConstants.allTemplateScheduledFrequencyTypes.Disabled.type;
|
||||
if (self.transaction.templateType === TemplateType.Schedule.type) {
|
||||
self.transaction.scheduledFrequencyType = ScheduledTemplateFrequencyType.Disabled.type;
|
||||
self.transaction.scheduledFrequency = '';
|
||||
}
|
||||
|
||||
@@ -995,8 +996,8 @@ export default {
|
||||
if (self.type === 'transaction') {
|
||||
if (query.id) {
|
||||
fromTransaction = responses[4];
|
||||
} else if (query.templateId && self.transactionTemplatesStore.allTransactionTemplatesMap && self.transactionTemplatesStore.allTransactionTemplatesMap[templateConstants.allTemplateTypes.Normal]) {
|
||||
fromTransaction = self.transactionTemplatesStore.allTransactionTemplatesMap[templateConstants.allTemplateTypes.Normal][query.templateId];
|
||||
} else if (query.templateId && self.transactionTemplatesStore.allTransactionTemplatesMap && self.transactionTemplatesStore.allTransactionTemplatesMap[TemplateType.Normal.type]) {
|
||||
fromTransaction = self.transactionTemplatesStore.allTransactionTemplatesMap[TemplateType.Normal.type][query.templateId];
|
||||
|
||||
if (fromTransaction) {
|
||||
self.addByTemplateId = fromTransaction.id;
|
||||
@@ -1039,7 +1040,7 @@ export default {
|
||||
self.transaction.templateType = template.templateType;
|
||||
self.transaction.name = template.name;
|
||||
|
||||
if (self.transaction.templateType === templateConstants.allTemplateTypes.Schedule) {
|
||||
if (self.transaction.templateType === TemplateType.Schedule.type) {
|
||||
self.transaction.scheduledFrequencyType = template.scheduledFrequencyType;
|
||||
self.transaction.scheduledFrequency = template.scheduledFrequency;
|
||||
self.transaction.utcOffset = template.utcOffset;
|
||||
@@ -1134,13 +1135,13 @@ export default {
|
||||
self.submitting = false;
|
||||
self.$hideLoading();
|
||||
|
||||
if (error.error && (error.error.errorCode === apiConstants.transactionCannotCreateInThisTimeErrorCode || error.error.errorCode === apiConstants.transactionCannotModifyInThisTimeErrorCode)) {
|
||||
if (error.error && (error.error.errorCode === KnownErrorCode.TransactionCannotCreateInThisTime || error.error.errorCode === KnownErrorCode.TransactionCannotModifyInThisTime)) {
|
||||
self.$confirm('You have set this time range to prevent editing transactions. Would you like to change the editable transaction range to All?', () => {
|
||||
self.submitting = true;
|
||||
self.$showLoading(() => self.submitting);
|
||||
|
||||
self.userStore.updateUserTransactionEditScope({
|
||||
transactionEditScope: transactionConstants.allTransactionEditScopeTypes.All.type
|
||||
transactionEditScope: TransactionEditScopeType.All.type
|
||||
}).then(() => {
|
||||
self.submitting = false;
|
||||
self.$hideLoading();
|
||||
@@ -1326,7 +1327,7 @@ export default {
|
||||
self.removingPictureId = '';
|
||||
self.submitting = false;
|
||||
}).catch(error => {
|
||||
if (error.error && error.error.errorCode === apiConstants.transactionPictureNotFoundErrorCode) {
|
||||
if (error.error && error.error.errorCode === KnownErrorCode.TransactionPictureNotFound) {
|
||||
for (let i = 0; i < self.transaction.pictures.length; i++) {
|
||||
if (self.transaction.pictures[i].pictureId === pictureInfo.pictureId) {
|
||||
self.transaction.pictures.splice(i, 1);
|
||||
|
||||
@@ -46,76 +46,77 @@
|
||||
</f7-link>
|
||||
</f7-toolbar>
|
||||
|
||||
<f7-block class="combination-list-wrapper margin-vertical skeleton-text"
|
||||
:key="blockIdx" v-for="blockIdx in [ 1, 2 ]" v-if="loading">
|
||||
<f7-accordion-item>
|
||||
<f7-block-title>
|
||||
<f7-accordion-toggle>
|
||||
<f7-list strong inset dividers media-list
|
||||
class="transaction-amount-list combination-list-header combination-list-opened">
|
||||
<f7-list-item>
|
||||
<template #title>
|
||||
<small>YYYY-MM</small>
|
||||
<small class="transaction-amount-statistics" v-if="showTotalAmountInTransactionListPage">
|
||||
<span>0.00 USD</span>
|
||||
<span>0.00 USD</span>
|
||||
</small>
|
||||
<f7-icon class="combination-list-chevron-icon" f7="chevron_up"></f7-icon>
|
||||
<div class="skeleton-text" v-if="loading">
|
||||
<f7-block class="combination-list-wrapper margin-vertical" :key="blockIdx" v-for="blockIdx in [ 1, 2 ]">
|
||||
<f7-accordion-item>
|
||||
<f7-block-title>
|
||||
<f7-accordion-toggle>
|
||||
<f7-list strong inset dividers media-list
|
||||
class="transaction-amount-list combination-list-header combination-list-opened">
|
||||
<f7-list-item>
|
||||
<template #title>
|
||||
<small>YYYY-MM</small>
|
||||
<small class="transaction-amount-statistics" v-if="showTotalAmountInTransactionListPage">
|
||||
<span>0.00 USD</span>
|
||||
<span>0.00 USD</span>
|
||||
</small>
|
||||
<f7-icon class="combination-list-chevron-icon" f7="chevron_up"></f7-icon>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
</f7-accordion-toggle>
|
||||
</f7-block-title>
|
||||
<f7-accordion-content style="height: auto">
|
||||
<f7-list strong inset dividers media-list accordion-list class="transaction-info-list combination-list-content">
|
||||
<f7-list-item link="#" chevron-center class="transaction-info"
|
||||
:key="itemIdx" v-for="itemIdx in (blockIdx === 1 ? [ 1, 2, 3, 4, 5, 6, 7 ] : [ 1, 2, 3 ])">
|
||||
<template #media>
|
||||
<div class="display-flex flex-direction-column transaction-date">
|
||||
<span class="transaction-day full-line flex-direction-column">DD</span>
|
||||
<span class="transaction-day-of-week full-line flex-direction-column">Sun</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #inner>
|
||||
<div class="display-flex no-padding-horizontal">
|
||||
<div class="item-media">
|
||||
<div class="transaction-icon display-flex align-items-center">
|
||||
<f7-icon f7="app_fill"></f7-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actual-item-inner">
|
||||
<div class="item-title-row">
|
||||
<div class="item-title">
|
||||
<div class="transaction-category-name no-padding">
|
||||
<span>Category</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after">
|
||||
<div class="transaction-amount">
|
||||
<span>0.00 USD</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-text">
|
||||
<div class="transaction-description">
|
||||
<span>Transaction Description</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-footer">
|
||||
<div class="transaction-footer">
|
||||
<span>HH:mm</span>
|
||||
<span>·</span>
|
||||
<span>Source Account</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
</f7-accordion-toggle>
|
||||
</f7-block-title>
|
||||
<f7-accordion-content style="height: auto">
|
||||
<f7-list strong inset dividers media-list accordion-list class="transaction-info-list combination-list-content">
|
||||
<f7-list-item link="#" chevron-center class="transaction-info"
|
||||
:key="itemIdx" v-for="itemIdx in (blockIdx === 1 ? [ 1, 2, 3, 4, 5, 6, 7 ] : [ 1, 2, 3 ])">
|
||||
<template #media>
|
||||
<div class="display-flex flex-direction-column transaction-date">
|
||||
<span class="transaction-day full-line flex-direction-column">DD</span>
|
||||
<span class="transaction-day-of-week full-line flex-direction-column">Sun</span>
|
||||
</div>
|
||||
</template>
|
||||
<template #inner>
|
||||
<div class="display-flex no-padding-horizontal">
|
||||
<div class="item-media">
|
||||
<div class="transaction-icon display-flex align-items-center">
|
||||
<f7-icon f7="app_fill"></f7-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actual-item-inner">
|
||||
<div class="item-title-row">
|
||||
<div class="item-title">
|
||||
<div class="transaction-category-name no-padding">
|
||||
<span>Category</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-after">
|
||||
<div class="transaction-amount">
|
||||
<span>0.00 USD</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-text">
|
||||
<div class="transaction-description">
|
||||
<span>Transaction Description</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-footer">
|
||||
<div class="transaction-footer">
|
||||
<span>HH:mm</span>
|
||||
<span>·</span>
|
||||
<span>Source Account</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
</f7-list>
|
||||
</f7-accordion-content>
|
||||
</f7-accordion-item>
|
||||
</f7-block>
|
||||
</f7-accordion-content>
|
||||
</f7-accordion-item>
|
||||
</f7-block>
|
||||
</div>
|
||||
|
||||
<f7-list strong inset dividers class="margin-vertical" v-if="!loading && noTransaction">
|
||||
<f7-list-item :title="$t('No transaction data')"></f7-list-item>
|
||||
@@ -471,19 +472,20 @@
|
||||
</template>
|
||||
</f7-list-item>
|
||||
|
||||
<f7-list-item :title="filterType.displayName"
|
||||
:key="filterType.type"
|
||||
v-for="filterType in allTransactionTagFilterTypes"
|
||||
v-if="query.tagIds && query.tagIds !== 'none'"
|
||||
@click="changeTagFilterType(filterType.type)"
|
||||
>
|
||||
<template #after>
|
||||
<f7-icon class="list-item-checked-icon"
|
||||
f7="checkmark_alt"
|
||||
v-if="query.tagFilterType === filterType.type">
|
||||
</f7-icon>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
<template v-if="query.tagIds && query.tagIds !== 'none'">
|
||||
<f7-list-item :title="filterType.displayName"
|
||||
:key="filterType.type"
|
||||
v-for="filterType in allTransactionTagFilterTypes"
|
||||
@click="changeTagFilterType(filterType.type)"
|
||||
>
|
||||
<template #after>
|
||||
<f7-icon class="list-item-checked-icon"
|
||||
f7="checkmark_alt"
|
||||
v-if="query.tagFilterType === filterType.type">
|
||||
</f7-icon>
|
||||
</template>
|
||||
</f7-list-item>
|
||||
</template>
|
||||
|
||||
<f7-list-item :title="transactionTag.name"
|
||||
:class="{ 'list-item-selected': query.tagIds === transactionTag.id, 'item-in-multiple-selection': queryAllFilterTagIdsCount > 1 && queryAllFilterTagIds[transactionTag.id] }"
|
||||
@@ -526,11 +528,11 @@ import { useTransactionCategoriesStore } from '@/stores/transactionCategory.js';
|
||||
import { useTransactionTagsStore } from '@/stores/transactionTag.js';
|
||||
import { useTransactionsStore } from '@/stores/transaction.js';
|
||||
|
||||
import { AccountType } from '@/core/account.ts';
|
||||
import { TransactionType } from '@/core/transaction.ts';
|
||||
import numeralConstants from '@/consts/numeral.js';
|
||||
import datetimeConstants from '@/consts/datetime.js';
|
||||
import accountConstants from '@/consts/account.js';
|
||||
import transactionConstants from '@/consts/transaction.js';
|
||||
import { getNameByKeyValue } from '@/lib/common.js';
|
||||
import { getNameByKeyValue } from '@/lib/common.ts';
|
||||
import {
|
||||
getCurrentUnixTime,
|
||||
getSpecifiedDayFirstUnixTime,
|
||||
@@ -549,7 +551,7 @@ import {
|
||||
import { categoryTypeToTransactionType, transactionTypeToCategoryType } from '@/lib/category.js';
|
||||
import { getUnifiedSelectedAccountsCurrencyOrDefaultCurrency } from '@/lib/account.js';
|
||||
import { getTransactionDisplayAmount } from '@/lib/transaction.js';
|
||||
import { onSwipeoutDeleted, scrollToSelectedItem } from '@/lib/ui.mobile.js';
|
||||
import { onSwipeoutDeleted, scrollToSelectedItem } from '@/lib/ui/mobile.js';
|
||||
|
||||
export default {
|
||||
props: [
|
||||
@@ -581,7 +583,7 @@ export default {
|
||||
if (this.query.accountIds && this.queryAllFilterAccountIdsCount === 1) {
|
||||
const account = this.allAccounts[this.query.accountIds];
|
||||
|
||||
if (account && account.type === accountConstants.allAccountTypes.MultiSubAccounts) {
|
||||
if (account && account.type === AccountType.MultiSubAccounts.type) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -678,7 +680,7 @@ export default {
|
||||
return numeralConstants.allAmountFilterTypeArray;
|
||||
},
|
||||
allTransactionTypes() {
|
||||
return transactionConstants.allTransactionTypes;
|
||||
return TransactionType;
|
||||
},
|
||||
allTransactionTagFilterTypes() {
|
||||
return this.$locale.getAllTransactionTagFilterTypes();
|
||||
@@ -938,7 +940,7 @@ export default {
|
||||
if (type && this.query.categoryIds) {
|
||||
newCategoryFilter = '';
|
||||
|
||||
for (let categoryId in this.queryAllFilterCategoryIds) {
|
||||
for (const categoryId in this.queryAllFilterCategoryIds) {
|
||||
if (!Object.prototype.hasOwnProperty.call(this.queryAllFilterCategoryIds, categoryId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user