From 5ffac129e0e09f26af935f6f04f8db336062e633 Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Fri, 26 Jun 2026 15:05:31 +0800 Subject: [PATCH] =?UTF-8?q?fix(grid):=20=E8=B0=83=E6=95=B4=E5=88=97?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E8=8F=9C=E5=8D=95=E9=A1=BA=E5=BA=8F=EF=BC=8C?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=8E=92=E5=BA=8F=E7=BD=AE=E9=A1=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/desktop/src/components/grid/DataGrid.vue | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/desktop/src/components/grid/DataGrid.vue b/apps/desktop/src/components/grid/DataGrid.vue index 50ee5df77b..882a97cb0d 100644 --- a/apps/desktop/src/components/grid/DataGrid.vue +++ b/apps/desktop/src/components/grid/DataGrid.vue @@ -366,24 +366,11 @@ function columnIsSorted(column: string, columnIndex: number): boolean { function sortMenuItems(column: string, columnIndex: number) { return [ - { - label: t("grid.sortCurrentPageAscending"), - value: "local-asc", - icon: ArrowUp, - checked: columnIsSorted(column, columnIndex) && sortDir.value === "asc" && sortMode.value === "local", - }, - { - label: t("grid.sortCurrentPageDescending"), - value: "local-desc", - icon: ArrowDown, - checked: columnIsSorted(column, columnIndex) && sortDir.value === "desc" && sortMode.value === "local", - }, { label: t("grid.sortDatabaseAscending"), value: "database-asc", icon: Database, checked: columnIsSorted(column, columnIndex) && sortDir.value === "asc" && sortMode.value === "database", - separatorBefore: true, }, { label: t("grid.sortDatabaseDescending"), @@ -391,6 +378,19 @@ function sortMenuItems(column: string, columnIndex: number) { icon: Database, checked: columnIsSorted(column, columnIndex) && sortDir.value === "desc" && sortMode.value === "database", }, + { + label: t("grid.sortCurrentPageAscending"), + value: "local-asc", + icon: ArrowUp, + checked: columnIsSorted(column, columnIndex) && sortDir.value === "asc" && sortMode.value === "local", + separatorBefore: true, + }, + { + label: t("grid.sortCurrentPageDescending"), + value: "local-desc", + icon: ArrowDown, + checked: columnIsSorted(column, columnIndex) && sortDir.value === "desc" && sortMode.value === "local", + }, { label: t("grid.clearSort"), value: "clear", @@ -6485,11 +6485,11 @@ const gridContextMenuItems = computed(() => { // 2. Column sort & filter if (contextColumn.value) { items.push( - { label: t("grid.sortCurrentPageAscending"), action: () => applyContextSort("asc", "local"), icon: ArrowUp }, - { label: t("grid.sortCurrentPageDescending"), action: () => applyContextSort("desc", "local"), icon: ArrowDown }, - { label: "", separator: true }, { label: t("grid.sortDatabaseAscending"), action: () => applyContextSort("asc", "database"), icon: Database }, { label: t("grid.sortDatabaseDescending"), action: () => applyContextSort("desc", "database"), icon: Database }, + { label: "", separator: true }, + { label: t("grid.sortCurrentPageAscending"), action: () => applyContextSort("asc", "local"), icon: ArrowUp }, + { label: t("grid.sortCurrentPageDescending"), action: () => applyContextSort("desc", "local"), icon: ArrowDown }, ); if (sortCol.value) { items.push({ label: t("grid.clearSort"), action: () => applyContextSort(null, sortMode.value), icon: ArrowUpDown });