save the number of transactions per page in database

This commit is contained in:
MaysWind
2026-01-07 23:56:31 +08:00
parent 6829eddde5
commit f0a74a6108
2 changed files with 20 additions and 9 deletions
@@ -12,7 +12,7 @@
:disabled="loading || disabled"
:label="tt('Transactions Per Page')"
:items="allPageCounts"
v-model="countPerPage"
v-model="currentExplorer.countPerPage"
/>
</div>
</v-col>
@@ -27,7 +27,7 @@
:headers="dataTableHeaders"
:items="filteredTransactions"
:hover="true"
v-model:items-per-page="countPerPage"
v-model:items-per-page="currentExplorer.countPerPage"
v-model:page="currentPage"
>
<template #item.time="{ item }">
@@ -121,9 +121,8 @@ import type { NameNumeralValue } from '@/core/base.ts';
import type { NumeralSystem } from '@/core/numeral.ts';
import { TransactionType } from '@/core/transaction.ts';
import {
type TransactionInsightDataItem
} from '@/models/transaction.ts';
import type { TransactionInsightDataItem } from '@/models/transaction.ts';
import type { InsightsExplorer} from '@/models/explorer.ts';
import { replaceAll } from '@/lib/common.ts';
@@ -164,11 +163,12 @@ const userStore = useUserStore();
const explorersStore = useExplorersStore();
const currentPage = ref<number>(1);
const countPerPage = ref<number>(15);
const numeralSystem = computed<NumeralSystem>(() => getCurrentNumeralSystemType());
const defaultCurrency = computed<string>(() => userStore.currentUserDefaultCurrency);
const currentExplorer = computed<InsightsExplorer>(() => explorersStore.currentInsightsExplorer);
const filteredTransactions = computed<TransactionInsightDataItem[]>(() => explorersStore.filteredTransactions);
const allPageCounts = computed<NameNumeralValue[]>(() => {
@@ -187,7 +187,7 @@ const allPageCounts = computed<NameNumeralValue[]>(() => {
const skeletonData = computed<number[]>(() => {
const data: number[] = [];
for (let i = 0; i < countPerPage.value; i++) {
for (let i = 0; i < currentExplorer.value.countPerPage; i++) {
data.push(i);
}
@@ -200,7 +200,7 @@ const totalPageCount = computed<number>(() => {
}
const count = filteredTransactions.value.length;
return Math.ceil(count / countPerPage.value);
return Math.ceil(count / currentExplorer.value.countPerPage);
});
const dataTableHeaders = computed<object[]>(() => {