Add 10/20/50/100 page-size pagination across treasury list pages.

EOF

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-11-17 16:07:13 +03:30
co-authored by Cursor
parent 64280e85c4
commit 634af8a653
13 changed files with 465 additions and 66 deletions
@@ -9,7 +9,9 @@ import {
Typography,
} from 'ant-design-vue';
import { api } from '@/lib/api';
import TreasuryListPagination from '@/components/treasury/TreasuryListPagination.vue';
import { formatJalaliNumeric } from '@/lib/jalali';
import { useTreasuryListPaging } from './useTreasuryListPaging';
const { Paragraph: ATypographyParagraph } = Typography;
const AListItem = AList.Item;
@@ -26,6 +28,15 @@ type Row = {
const rows = ref<Row[]>([]);
const error = ref('');
const {
page,
pageSize,
pageSizeOptions,
total,
pagedRows,
onPageSizeChange,
showTotal,
} = useTreasuryListPaging(() => rows.value, 'treasury.audit');
const actionLabel: Record<string, string> = {
settle: 'تسویه سند',
cash_post: 'نشستن وجه در حساب',
@@ -47,7 +58,7 @@ onMounted(async () => {
<a-card :bordered="false">
<a-empty v-if="!error && !rows.length" description="سابقه‌ای نیست." />
<a-list v-else item-layout="vertical" :data-source="rows">
<a-list v-else item-layout="vertical" :data-source="pagedRows">
<template #renderItem="{ item }">
<a-list-item>
<a-list-item-meta>
@@ -67,6 +78,14 @@ onMounted(async () => {
</a-list-item>
</template>
</a-list>
<TreasuryListPagination
v-model:page="page"
:total="total"
:page-size="pageSize"
:page-size-options="pageSizeOptions"
:show-total="showTotal"
@update:page-size="onPageSizeChange"
/>
</a-card>
</a-flex>
</template>