add insights & explore page

This commit is contained in:
MaysWind
2025-12-18 00:49:14 +08:00
parent 861e4c036b
commit e9b4392163
43 changed files with 3579 additions and 43 deletions
+20
View File
@@ -143,6 +143,11 @@ import {
ChartDateAggregationType
} from '@/core/statistics.ts';
import {
TransactionExploreConditionField,
TransactionExploreConditionOperator
} from '@/core/explore.ts';
import {
type LocalizedImportFileCategoryAndTypes,
type LocalizedImportFileType,
@@ -553,6 +558,19 @@ export function useI18n() {
return ret;
}
function getLocalizedNameValue(nameValues: NameValue[]): NameValue[] {
const ret: NameValue[] = [];
for (const nameValue of nameValues) {
ret.push({
name: t(nameValue.name),
value: nameValue.value
});
}
return ret;
}
function getLocalizedDisplayNameAndTypeWithSystemDefault(typeAndNames: TypeAndName[], defaultValue: number, defaultType: TypeAndName): TypeAndDisplayName[] {
const ret: TypeAndDisplayName[] = [];
@@ -2366,6 +2384,8 @@ export function useI18n() {
getAllTransactionDefaultCategories,
getAllDisplayExchangeRates,
getAllSupportedImportFileCagtegoryAndTypes,
getAllTransactionExploreConditionFields: () => getLocalizedNameValue(TransactionExploreConditionField.values()),
getAllTransactionExploreConditionOperators: (operators?: TransactionExploreConditionOperator[]) => getLocalizedNameValue(operators ?? TransactionExploreConditionOperator.values()),
// get localized info
getLanguageInfo,
getMonthShortName,