feat(division-detail): add row numbering and remove pagination
- Add index column to division position list table - Remove pagination component as it's no longer needed - Map data to include row numbers before display
This commit is contained in:
@@ -11,6 +11,7 @@ export const config: Config = {
|
||||
|
||||
headers: [
|
||||
[
|
||||
{ label: '#' },
|
||||
{ label: 'Kode Jabatan' },
|
||||
{ label: 'Nama Jabatan' },
|
||||
{ label: 'Pengisi Jabatan' },
|
||||
@@ -19,7 +20,7 @@ export const config: Config = {
|
||||
],
|
||||
],
|
||||
|
||||
keys: ['code', 'name', 'employee', 'head', 'action'],
|
||||
keys: ['index', 'code', 'name', 'employee', 'head', 'action'],
|
||||
|
||||
delKeyNames: [
|
||||
{ key: 'code', label: 'Kode' },
|
||||
|
||||
@@ -31,9 +31,5 @@ function handlePageChange(page: number) {
|
||||
:rows="data"
|
||||
:skeleton-size="paginationMeta?.pageSize"
|
||||
/>
|
||||
<PaginationView
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -70,12 +70,21 @@ const {
|
||||
sort: 'createdAt:asc',
|
||||
'page-number': params['page-number'] || 0,
|
||||
'page-size': params['page-size'] || 10,
|
||||
'page-no-limit': true,
|
||||
})
|
||||
return { success: result.success || false, body: result.body || {} }
|
||||
},
|
||||
entityName: 'division-position',
|
||||
})
|
||||
|
||||
const dataMap = computed(() => {
|
||||
return data.value.map((v, i) => {
|
||||
return {
|
||||
...v,
|
||||
index: i + 1,
|
||||
}
|
||||
})
|
||||
})
|
||||
const headerPrep: HeaderPrep = {
|
||||
title: 'Detail Divisi',
|
||||
icon: 'i-lucide-user',
|
||||
@@ -154,7 +163,7 @@ watch([recId, recAction], () => {
|
||||
<div class="h-6"></div>
|
||||
|
||||
<LazyAppDivisionDetailList
|
||||
:data="data"
|
||||
:data="dataMap"
|
||||
:pagination-meta="paginationMeta"
|
||||
@page-change="handlePageChange"
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user