feat(settings): configure table open page size

This commit is contained in:
二丫讲梵 authored and GitHub committed 2026-07-20 14:05:40 +08:00
1 parent 5803df3f73
commit cdbe0079e7
21 files changed
+156 -31

No files matched your search

+3 -3
View File
@@ -1878,7 +1878,7 @@ export const useQueryStore = defineStore("query", () => {
const primaryKeys = tab.tableMeta ? tab.tableMeta.primaryKeys : tableMeta.primaryKeys;
const sortOrder = tab.resultSortColumn && tab.resultSortDirection ? `${quoteTableDataIdentifier(effectiveDbType, tab.resultSortColumn, identifierQuote)} ${tab.resultSortDirection.toUpperCase()}` : undefined;
const orderBy = tab.orderByInput?.trim() || sortOrder;
const limit = tab.resultPageLimit ?? tableOpenPageLimit();
const limit = tab.resultPageLimit ?? tableOpenPageLimit(settingsStore.editorSettings.tableOpenPageSize);
const offset = tab.resultPageOffset ?? 0;
const refreshPreparationId = uuid();
@@ -3307,7 +3307,7 @@ export const useQueryStore = defineStore("query", () => {
countSql = plan.countSql;
useAgentResultSession = plan.useAgentResultSession;
} else if (tab.mode === "data") {
pageLimit = options?.pagination?.limit ?? tableOpenPageLimit();
pageLimit = options?.pagination?.limit ?? tableOpenPageLimit(settingsStore.editorSettings.tableOpenPageSize);
pageOffset = options?.pagination?.offset ?? 0;
}
@@ -4126,7 +4126,7 @@ export const useQueryStore = defineStore("query", () => {
pagination:
tab.mode === "data"
? {
limit: tab.resultPageLimit ?? tableOpenPageLimit(),
limit: tab.resultPageLimit ?? tableOpenPageLimit(settingsStore.editorSettings.tableOpenPageSize),
offset: tab.resultPageOffset ?? 0,
}
: undefined,
+4
View File
@@ -377,6 +377,7 @@ export interface EditorSettings {
tabLayout: TabLayoutMode;
appLayout: "separated" | "classic";
pageSize: number;
tableOpenPageSize: number;
infiniteScroll: boolean;
infiniteScrollMaxRows: number;
autoCalculateTotalRows: boolean;
@@ -521,6 +522,7 @@ export const DEFAULT_EDITOR_SETTINGS: EditorSettings = {
tabLayout: "scroll",
appLayout: "classic",
pageSize: 100,
tableOpenPageSize: 100,
infiniteScroll: false,
infiniteScrollMaxRows: 5000,
autoCalculateTotalRows: false,
@@ -770,6 +772,7 @@ export function normalizeEditorSettings(settings: Partial<EditorSettings>, exist
tabLayout: normalizeTabLayout(settings.tabLayout),
appLayout: settings.appLayout ?? DEFAULT_EDITOR_SETTINGS.appLayout,
pageSize: normalizeResultPageSize(settings.pageSize),
tableOpenPageSize: normalizeResultPageSize(settings.tableOpenPageSize, DEFAULT_EDITOR_SETTINGS.tableOpenPageSize),
infiniteScroll: settings.infiniteScroll ?? DEFAULT_EDITOR_SETTINGS.infiniteScroll,
infiniteScrollMaxRows: typeof settings.infiniteScrollMaxRows === "number" && settings.infiniteScrollMaxRows >= 1000 && settings.infiniteScrollMaxRows <= 50000 ? Math.round(settings.infiniteScrollMaxRows) : DEFAULT_EDITOR_SETTINGS.infiniteScrollMaxRows,
autoCalculateTotalRows: settings.autoCalculateTotalRows ?? DEFAULT_EDITOR_SETTINGS.autoCalculateTotalRows,
@@ -1095,6 +1098,7 @@ export const useSettingsStore = defineStore("settings", () => {
if (partial.tabLayout !== undefined) editorSettings.value.tabLayout = normalizeTabLayout(partial.tabLayout);
if (partial.appLayout !== undefined) editorSettings.value.appLayout = partial.appLayout;
if (partial.pageSize !== undefined) editorSettings.value.pageSize = normalizeResultPageSize(partial.pageSize);
if (partial.tableOpenPageSize !== undefined) editorSettings.value.tableOpenPageSize = normalizeResultPageSize(partial.tableOpenPageSize, DEFAULT_EDITOR_SETTINGS.tableOpenPageSize);
if (partial.infiniteScroll !== undefined) editorSettings.value.infiniteScroll = partial.infiniteScroll;
if (partial.infiniteScrollMaxRows !== undefined)
editorSettings.value.infiniteScrollMaxRows = typeof partial.infiniteScrollMaxRows === "number" && partial.infiniteScrollMaxRows >= 1000 && partial.infiniteScrollMaxRows <= 50000 ? Math.round(partial.infiniteScrollMaxRows) : DEFAULT_EDITOR_SETTINGS.infiniteScrollMaxRows;