mirror of
https://github.com/t8y2/dbx.git
synced 2026-11-02 00:29:30 +00:00
1. src/components/grid/DataGrid.vue
- 左侧搜索框:移除了 WHERE 支持(isWhereSearch 永远返回 false),现在是纯客户端文本过滤。保留了列名代码提示功能(Tab 补全、箭头导航)。
- WHERE 框:新增列名代码提示(独立的下拉建议面板),支持单双引号和小括号自动配对,Enter 直接应用过滤。
- ORDER BY 框:新增列名代码提示(同样的建议面板),Enter 直接应用排序。
- 刷新/回滚/提交:reload emit 现在传递 4 个参数 (sql, searchText, whereInput, orderBy),确保刷新后所有条件不丢失。
- 分页/排序:统一使用新的 currentWhereInput() 函数,替代已废弃的 activeWhereInput。
- 删除了 applyWhereSearch() 和 onSearchEnter()(左侧搜索不再需要执行 WHERE 查询)。
2. src/composables/useDataGridActions.ts
- onReloadData() 签名改为接受 4 个参数 (sql, searchText, whereInput, orderBy)。
- table-data 模式刷新时,用 buildTableSql(tab, { whereInput, orderBy }) 重建 SQL,保留 WHERE 和 ORDER BY 条件。
3. src/components/layout/ContentArea.vue
- reload emit 签名同步更新为 4 个参数。
- results 模式和 table-data 模式两个 DataGrid 的 @reload 处理器都转发全部 4 个参数。
4. src/App.vue
- ContentArea 的 @reload 处理器转发 4 个参数给 onReloadData()。
This commit is contained in:
@@ -39,7 +39,7 @@ const emit = defineEmits<{
|
||||
editorSelectionChange: [value: string];
|
||||
editorCursorChange: [pos: number];
|
||||
formatError: [];
|
||||
reload: [sql?: string, whereInput?: string];
|
||||
reload: [sql?: string, searchText?: string, whereInput?: string, orderBy?: string];
|
||||
paginate: [offset: number, limit: number, whereInput?: string, orderBy?: string];
|
||||
sort: [column: string, columnIndex: number, direction: "asc" | "desc" | null, whereInput?: string];
|
||||
executeSql: [sql: string];
|
||||
@@ -275,7 +275,10 @@ function onHandleCloseColumnPanel() {
|
||||
:database="activeTab.database"
|
||||
:table-meta="activeTab.tableMeta"
|
||||
:on-execute-sql="async (sql: string) => emit('executeSql', sql)"
|
||||
@reload="(sql?: string, whereInput?: string) => emit('reload', sql, whereInput)"
|
||||
@reload="
|
||||
(sql?: string, searchText?: string, whereInput?: string, orderBy?: string) =>
|
||||
emit('reload', sql, searchText, whereInput, orderBy)
|
||||
"
|
||||
@paginate="
|
||||
(offset: number, limit: number, whereInput?: string, orderBy?: string) =>
|
||||
emit('paginate', offset, limit, whereInput, orderBy)
|
||||
@@ -368,7 +371,10 @@ function onHandleCloseColumnPanel() {
|
||||
:database="activeTab.database"
|
||||
:table-meta="activeTab.tableMeta"
|
||||
:on-execute-sql="async (sql: string) => emit('executeSql', sql)"
|
||||
@reload="(sql?: string, whereInput?: string) => emit('reload', sql, whereInput)"
|
||||
@reload="
|
||||
(sql?: string, searchText?: string, whereInput?: string, orderBy?: string) =>
|
||||
emit('reload', sql, searchText, whereInput, orderBy)
|
||||
"
|
||||
@paginate="
|
||||
(offset: number, limit: number, whereInput?: string, orderBy?: string) =>
|
||||
emit('paginate', offset, limit, whereInput, orderBy)
|
||||
|
||||
Reference in New Issue
Block a user