fix(grid): preserve structured filter conditions on refresh and rollback

The toolbar refresh, rollback, and post-save reload were passing only
the manual WHERE input to the reload event, discarding structured filter
conditions added via the filter builder popover. Changed all three call
sites to use currentWhereInput() which combines both filter sources.
This commit is contained in:
t8y2 2026-06-05 15:15:03 +08:00
parent 6016b293ce
commit bbe51d409c
2 changed files with 5 additions and 4 deletions

View File

@ -1987,6 +1987,7 @@ const editor = useDataGridEditor({
sql: computed(() => props.sql),
searchText,
whereFilterInput,
currentWhereInput: computed(() => currentWhereInput()),
orderByInput,
rowStatusFilter,
initialEditColumn: firstVisibleColumnIndex,
@ -2101,7 +2102,7 @@ async function onToolbarRefresh() {
"reload",
props.sql,
searchText.value,
whereFilterInput.value.trim() || undefined,
currentWhereInput(),
currentOrderBy(),
pageSize.value,
(currentPage.value - 1) * pageSize.value,
@ -2119,7 +2120,7 @@ function onToolbarRollback() {
"reload",
props.sql,
searchText.value,
whereFilterInput.value.trim() || undefined,
currentWhereInput(),
currentOrderBy(),
pageSize.value,
(currentPage.value - 1) * pageSize.value,

View File

@ -61,6 +61,7 @@ export interface UseDataGridEditorOptions {
sql: ComputedRef<string | undefined>;
searchText: Ref<string>;
whereFilterInput: Ref<string>;
currentWhereInput: ComputedRef<string | undefined>;
orderByInput: Ref<string>;
rowStatusFilter: Ref<RowStatusFilter>;
initialEditColumn?: ComputedRef<number>;
@ -107,7 +108,6 @@ export function useDataGridEditor(options: UseDataGridEditorOptions) {
customSave,
sql,
searchText,
whereFilterInput,
orderByInput,
rowStatusFilter,
initialEditColumn,
@ -633,7 +633,7 @@ export function useDataGridEditor(options: UseDataGridEditorOptions) {
"reload",
sql.value,
searchText.value,
whereFilterInput.value.trim() || undefined,
options.currentWhereInput.value,
orderByInput.value.trim() || undefined,
pageSize.value,
(currentPage.value - 1) * pageSize.value,