migrate transaction category store to composition API and typescript

This commit is contained in:
MaysWind
2025-01-12 23:47:56 +08:00
parent abb26ac410
commit 2be329974e
28 changed files with 818 additions and 663 deletions
@@ -145,7 +145,7 @@
<script>
import { mapStores } from 'pinia';
import { useSettingsStore } from '@/stores/setting.ts';
import { useTransactionCategoriesStore } from '@/stores/transactionCategory.js';
import { useTransactionCategoriesStore } from '@/stores/transactionCategory.ts';
import { useTransactionsStore } from '@/stores/transaction.js';
import { useStatisticsStore } from '@/stores/statistics.js';
@@ -162,7 +162,7 @@ import {
isCategoryOrSubCategoriesAllChecked,
isSubCategoriesAllChecked,
isSubCategoriesHasButNotAllChecked
} from '@/lib/category.js';
} from '@/lib/category.ts';
import {
mdiSelectAll,
@@ -187,9 +187,9 @@ export default {
return {
loading: true,
expandCategoryTypes: [
CategoryType.Income.toString(),
CategoryType.Expense.toString(),
CategoryType.Transfer.toString()
CategoryType.Income,
CategoryType.Expense,
CategoryType.Transfer
],
filterCategoryIds: {},
showHidden: false,
@@ -388,11 +388,11 @@ export default {
},
getCategoryTypeName(categoryType) {
switch (categoryType) {
case CategoryType.Income.toString():
case CategoryType.Income:
return this.$t('Income Categories');
case CategoryType.Expense.toString():
case CategoryType.Expense:
return this.$t('Expense Categories');
case CategoryType.Transfer.toString():
case CategoryType.Transfer:
return this.$t('Transfer Categories');
default:
return this.$t('Transaction Categories');