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。
TypeScript aicliclickhousedatabasedatabase-clientdatabase-managementdockerguimcpmongodbmysqlpostgresqlredisrustsql-serversqlitetaurivue
feat(grid): add LIKE, NOT LIKE, <, > context menu filters
t8y21934205c86eb
diff --git a/src/components/grid/DataGrid.vue b/src/components/grid/DataGrid.vueindex 055fecac9f..c36500d4c0 100644--- a/src/components/grid/DataGrid.vue+++ b/src/components/grid/DataGrid.vue@@ -1139,7 +1139,17 @@ function applyContextSort(direction: "asc" | "desc" | null) {emit("sort", column, columnIndex, direction, currentWhereInput());}-function contextFilterCondition(mode: "equals" | "not-equals" | "is-null" | "is-not-null"): string | null {+type FilterMode =+ | "equals"+ | "not-equals"+ | "is-null"+ | "is-not-null"+ | "like"+ | "not-like"+ | "less-than"+ | "greater-than";++function contextFilterCondition(mode: FilterMode): string | null {if (!contextColumn.value) return null;const column = quoteIdent(contextColumn.value);const value = contextCellValue.value;@@ -1147,10 +1157,14 @@ function contextFilterCondition(mode: "equals" | "not-equals" | "is-null" | "is-if (mode === "is-null") return `${column} IS NULL`;if (mode === "is-not-null") return `${column} IS NOT NULL`;if (value === null) return mode === "equals" ? `${column} IS NULL` : `${column} IS NOT NULL`;+ if (mode === "like") return `${column} LIKE ${escapeVal(`%${value}%`)}`;+ if (mode === "not-like") return `${column} NOT LIKE ${escapeVal(`%${value}%`)}`;+ if (mode === "less-than") return `${column} < ${escapeVal(value)}`;+ if (mode === "greater-than") return `${column} > ${escapeVal(value)}`;return mode === "equals" ? `${column} = ${escapeVal(value)}` : `${column} <> ${escapeVal(value)}`;}-async function applyContextFilter(mode: "equals" | "not-equals" | "is-null" | "is-not-null") {+async function applyContextFilter(mode: FilterMode) {if (!canUseWhereSearch.value) return;const condition = contextFilterCondition(mode);if (!condition) return;@@ -2366,6 +2380,13 @@ defineExpose({<ContextMenuItem @click="applyContextFilter('not-equals')">{{ t("grid.filterExcludeValue") }}</ContextMenuItem>+ <ContextMenuItem @click="applyContextFilter('like')">{{ t("grid.filterLike") }}</ContextMenuItem>+ <ContextMenuItem @click="applyContextFilter('not-like')">{{ t("grid.filterNotLike") }}</ContextMenuItem>+ <ContextMenuItem @click="applyContextFilter('less-than')">{{ t("grid.filterLessThan") }}</ContextMenuItem>+ <ContextMenuItem @click="applyContextFilter('greater-than')">+ {{ t("grid.filterGreaterThan") }}+ </ContextMenuItem>+ <ContextMenuSeparator /><ContextMenuItem @click="applyContextFilter('is-null')">{{ t("grid.filterIsNull") }}</ContextMenuItem><ContextMenuItem @click="applyContextFilter('is-not-null')">{{ t("grid.filterIsNotNull") }}diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.tsindex 475b2385c1..c5457756a0 100644--- a/src/i18n/locales/en.ts+++ b/src/i18n/locales/en.ts@@ -242,6 +242,10 @@ export default {moreValues: "{count} more values, keep typing to narrow results",filterByValue: "Filter by This Value",filterExcludeValue: "Exclude This Value",+ filterLike: "Contains Value",+ filterNotLike: "Does Not Contain",+ filterLessThan: "Less Than Value",+ filterGreaterThan: "Greater Than Value",filterIsNull: "Show NULL Values",filterIsNotNull: "Show Non-NULL Values",clearFilter: "Clear Filter",diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.tsindex dd922cd1e8..173594e91c 100644--- a/src/i18n/locales/es.ts+++ b/src/i18n/locales/es.ts@@ -243,6 +243,10 @@ export default {moreValues: "{count} valores más, sigue escribiendo para acotar los resultados",filterByValue: "Filtrar por este valor",filterExcludeValue: "Excluir este valor",+ filterLike: "Contiene este valor",+ filterNotLike: "No contiene este valor",+ filterLessThan: "Menor que este valor",+ filterGreaterThan: "Mayor que este valor",filterIsNull: "Mostrar valores NULL",filterIsNotNull: "Mostrar valores no NULL",clearFilter: "Limpiar filtro",diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.tsindex bdac12b829..dd83077476 100644--- a/src/i18n/locales/zh-CN.ts+++ b/src/i18n/locales/zh-CN.ts@@ -241,6 +241,10 @@ export default {moreValues: "还有 {count} 个值,输入关键词继续缩小范围",filterByValue: "筛选此值",filterExcludeValue: "排除此值",+ filterLike: "包含此值",+ filterNotLike: "不包含此值",+ filterLessThan: "小于此值",+ filterGreaterThan: "大于此值",filterIsNull: "仅显示 NULL",filterIsNotNull: "仅显示非 NULL",clearFilter: "清除筛选",