mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-31 16:24:33 +00:00
fix(grid): preserve page size when reloading data after save
The reload event did not carry limit/offset, so buildTableSelectSql always fell back to its default LIMIT 100, resetting 1000-row pages back to 100 after every commit.
This commit is contained in:
@@ -101,7 +101,7 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
reload: [sql?: string, searchText?: string, whereInput?: string, orderBy?: string];
|
||||
reload: [sql?: string, searchText?: string, whereInput?: string, orderBy?: string, limit?: number, offset?: number];
|
||||
paginate: [offset: number, limit: number, whereInput?: string, orderBy?: string];
|
||||
sort: [column: string, columnIndex: number, direction: "asc" | "desc" | null, whereInput?: string];
|
||||
}>();
|
||||
@@ -857,6 +857,8 @@ const editor = useDataGridEditor({
|
||||
rowStatusFilter,
|
||||
initialEditColumn: firstVisibleColumnIndex,
|
||||
getRowItem,
|
||||
pageSize,
|
||||
currentPage,
|
||||
emit,
|
||||
});
|
||||
|
||||
@@ -904,6 +906,8 @@ async function onToolbarRefresh() {
|
||||
searchText.value,
|
||||
whereFilterInput.value.trim() || undefined,
|
||||
orderByInput.value.trim() || undefined,
|
||||
pageSize.value,
|
||||
(currentPage.value - 1) * pageSize.value,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -919,6 +923,8 @@ function onToolbarRollback() {
|
||||
searchText.value,
|
||||
whereFilterInput.value.trim() || undefined,
|
||||
orderByInput.value.trim() || undefined,
|
||||
pageSize.value,
|
||||
(currentPage.value - 1) * pageSize.value,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ const emit = defineEmits<{
|
||||
editorSelectionChange: [value: string];
|
||||
editorCursorChange: [pos: number];
|
||||
formatError: [];
|
||||
reload: [sql?: string, searchText?: string, whereInput?: string, orderBy?: string];
|
||||
reload: [sql?: string, searchText?: string, whereInput?: string, orderBy?: string, limit?: number, offset?: number];
|
||||
paginate: [offset: number, limit: number, whereInput?: string, orderBy?: string];
|
||||
sort: [column: string, columnIndex: number, direction: "asc" | "desc" | null, whereInput?: string];
|
||||
executeSql: [sql: string];
|
||||
@@ -283,8 +283,14 @@ function onHandleCloseColumnPanel() {
|
||||
:table-meta="activeTab.tableMeta"
|
||||
:on-execute-sql="async (sql: string) => emit('executeSql', sql)"
|
||||
@reload="
|
||||
(sql?: string, searchText?: string, whereInput?: string, orderBy?: string) =>
|
||||
emit('reload', sql, searchText, whereInput, orderBy)
|
||||
(
|
||||
sql?: string,
|
||||
searchText?: string,
|
||||
whereInput?: string,
|
||||
orderBy?: string,
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
) => emit('reload', sql, searchText, whereInput, orderBy, limit, offset)
|
||||
"
|
||||
@paginate="
|
||||
(offset: number, limit: number, whereInput?: string, orderBy?: string) =>
|
||||
@@ -381,8 +387,14 @@ function onHandleCloseColumnPanel() {
|
||||
:table-meta="activeTab.tableMeta"
|
||||
:on-execute-sql="async (sql: string) => emit('executeSql', sql)"
|
||||
@reload="
|
||||
(sql?: string, searchText?: string, whereInput?: string, orderBy?: string) =>
|
||||
emit('reload', sql, searchText, whereInput, orderBy)
|
||||
(
|
||||
sql?: string,
|
||||
searchText?: string,
|
||||
whereInput?: string,
|
||||
orderBy?: string,
|
||||
limit?: number,
|
||||
offset?: number,
|
||||
) => emit('reload', sql, searchText, whereInput, orderBy, limit, offset)
|
||||
"
|
||||
@paginate="
|
||||
(offset: number, limit: number, whereInput?: string, orderBy?: string) =>
|
||||
|
||||
Reference in New Issue
Block a user