Skip to content

armgit / dbx

Public Imported from GitHub
0

25 MB lightweight cross-platform database client for 100+ databases, including MySQL, PostgreSQL, SQLite, Redis, MongoDB, DuckDB, SQL Server, and Dameng. Built-in AI, MCP Server, CLI, desktop and Docker. | 轻量级跨平台数据库管理工具,支持 MySQL、PostgreSQL、SQLite、Redis、MongoDB、达梦等 100+ 数据库,提供桌面端、Docker、CLI、内置 AI 助手和 MCP。

fix(grid): 调整列排序菜单顺序,数据库排序置顶

t8y25ffac129e0e0
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<ContextMenuItem[]>(() => {
// 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 });