From c411cc67072d42b7ded1cfa1b70be98d53f54bbb Mon Sep 17 00:00:00 2001 From: t8y2 <1156263951@qq.com> Date: Wed, 24 Jun 2026 12:51:46 +0800 Subject: [PATCH] fix(grid): reset filter/sort when reusing data tab --- apps/desktop/src/components/sidebar/TreeItem.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/desktop/src/components/sidebar/TreeItem.vue b/apps/desktop/src/components/sidebar/TreeItem.vue index d07f59213..23675f0fc 100644 --- a/apps/desktop/src/components/sidebar/TreeItem.vue +++ b/apps/desktop/src/components/sidebar/TreeItem.vue @@ -888,6 +888,15 @@ async function openData() { if (existing) { existing.title = node.label; existing.schema = tableSchema; + // Reset per-table filter/sort state so the reused tab doesn't keep + // the previous table's WHERE/ORDER BY. DataGrid remounts (result is + // cleared below) and reinitializes its inputs from these props. + existing.whereInput = undefined; + existing.orderByInput = undefined; + existing.resultSortColumn = undefined; + existing.resultSortColumnIndex = undefined; + existing.resultSortDirection = undefined; + existing.resultSortedSql = undefined; queryStore.activeTabId = existing.id; return existing.id; }