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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user