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
@@ -162,12 +162,13 @@ type SnackBarType = InstanceType<typeof SnackBar>;
const props = defineProps<{
type: AccountFilterType;
selectedAccountIds?: string[];
dialogMode?: boolean;
autoSave?: boolean;
}>();
const emit = defineEmits<{
(e: 'settings:change', changed: boolean): void;
(e: 'settings:change', changed: boolean, selectedAccountIds?: string[]): void;
}>();
const { tt } = useI18n();
@@ -187,7 +188,7 @@ const {
isAccountChecked,
loadFilterAccountIds,
saveFilterAccountIds
} = useAccountFilterSettingPageBase(props.type);
} = useAccountFilterSettingPageBase(props.type, props.selectedAccountIds);
const accountsStore = useAccountsStore();
@@ -254,8 +255,8 @@ function selectInvertAccounts(): void {
}
function save(): void {
const changed = saveFilterAccountIds();
emit('settings:change', changed);
const [changed, selectedAccountIds] = saveFilterAccountIds();
emit('settings:change', changed, selectedAccountIds);
}
function cancel(): void {
@@ -160,13 +160,14 @@ type SnackBarType = InstanceType<typeof SnackBar>;
const props = defineProps<{
type: CategoryFilterType;
selectedCategoryIds?: string[];
dialogMode?: boolean;
autoSave?: boolean;
categoryTypes?: string;
}>();
const emit = defineEmits<{
(e: 'settings:change', changed: boolean): void;
(e: 'settings:change', changed: boolean, selectedCategoryIds?: string[]): void;
}>();
const { tt } = useI18n();
@@ -186,7 +187,7 @@ const {
getCategoryTypeName,
loadFilterCategoryIds,
saveFilterCategoryIds
} = useCategoryFilterSettingPageBase(props.type, props.categoryTypes);
} = useCategoryFilterSettingPageBase(props.type, props.categoryTypes, props.selectedCategoryIds);
const transactionCategoriesStore = useTransactionCategoriesStore();
@@ -261,8 +262,8 @@ function selectInvertCategories(): void {
}
function save(): void {
const changed = saveFilterCategoryIds();
emit('settings:change', changed);
const [changed, selectedCategoryIds] = saveFilterCategoryIds();
emit('settings:change', changed, selectedCategoryIds);
}
function cancel(): void {