|
|
@ -4,7 +4,7 @@ import type { ComputedRef, Ref } from 'vue' |
|
|
|
import { |
|
|
|
import { |
|
|
|
IsPublicInj, |
|
|
|
IsPublicInj, |
|
|
|
NOCO, |
|
|
|
NOCO, |
|
|
|
RowNavDir, |
|
|
|
NavigateDir, |
|
|
|
computed, |
|
|
|
computed, |
|
|
|
extractPkFromRow, |
|
|
|
extractPkFromRow, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
|
extractSdkResponseErrorMsg, |
|
|
@ -478,14 +478,14 @@ export function useViewData( |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const navigateToSiblingRow = async (dir: RowNavDir) => { |
|
|
|
const navigateToSiblingRow = async (dir: NavigateDir) => { |
|
|
|
// get current expanded row index
|
|
|
|
// get current expanded row index
|
|
|
|
const expandedRowIndex = formattedData.value.findIndex( |
|
|
|
const expandedRowIndex = formattedData.value.findIndex( |
|
|
|
(row: Row) => routeQuery.rowId === extractPkFromRow(row.row, meta.value?.columns as ColumnType[]), |
|
|
|
(row: Row) => routeQuery.rowId === extractPkFromRow(row.row, meta.value?.columns as ColumnType[]), |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// calculate next row index based on direction
|
|
|
|
// calculate next row index based on direction
|
|
|
|
let siblingRowIndex = expandedRowIndex + (dir === RowNavDir.NEXT ? 1 : -1) |
|
|
|
let siblingRowIndex = expandedRowIndex + (dir === NavigateDir.NEXT ? 1 : -1) |
|
|
|
|
|
|
|
|
|
|
|
const currentPage = paginationData?.value?.page || 1 |
|
|
|
const currentPage = paginationData?.value?.page || 1 |
|
|
|
|
|
|
|
|
|
|
@ -500,7 +500,6 @@ export function useViewData( |
|
|
|
// if next row index is greater than total rows in current view
|
|
|
|
// if next row index is greater than total rows in current view
|
|
|
|
// then load next page of formattedData and set next row index to 0
|
|
|
|
// then load next page of formattedData and set next row index to 0
|
|
|
|
} else if (siblingRowIndex >= formattedData.value.length) { |
|
|
|
} else if (siblingRowIndex >= formattedData.value.length) { |
|
|
|
console.log(paginationData?.value) |
|
|
|
|
|
|
|
if (paginationData?.value?.isLastPage) return message.info(t('msg.info.noMoreRecords')) |
|
|
|
if (paginationData?.value?.isLastPage) return message.info(t('msg.info.noMoreRecords')) |
|
|
|
|
|
|
|
|
|
|
|
await changePage(currentPage + 1) |
|
|
|
await changePage(currentPage + 1) |
|
|
|