Browse Source

筛选条件优化

master_hella_20240701
陈薪名 8 months ago
parent
commit
c7be9e729d
  1. 24
      src/components/SearchTable/src/SearchTable.vue

24
src/components/SearchTable/src/SearchTable.vue

@ -98,28 +98,38 @@ const open = (titleName: any, allSchemas: any,getApiPage: any, formField: any, s
// //
const searchFormClick = (searchData) => { const searchFormClick = (searchData) => {
// console.log(99, rowRef.value) console.log(99, rowRef.value)
// console.log(100, searchData) console.log(100, searchData)
// console.log(101, searchConditionRef.value) console.log(101, searchConditionRef.value)
// 20240104 searchData.filters // 20240104 searchData.filters
if (searchConditionRef.value) { // 20240321 searchData
Object.keys(searchConditionRef.value).forEach(key => {
if (searchData.filters) { if (searchData.filters) {
if (searchConditionRef.value.filters) {
Object.keys(searchConditionRef.value.filters).forEach(key => {
searchData.filters.push(searchConditionRef.value.filters[key])
});
} else {
Object.keys(searchConditionRef.value).forEach(key => {
searchData.filters.push({ searchData.filters.push({
action: "==", action: "==",
column: key, column: key,
value: searchConditionRef.value[key] value: searchConditionRef.value[key]
}) })
// } });
}
} else {
if (searchConditionRef.value.filters) {
searchData.filters = searchConditionRef.value.filters
} else { } else {
Object.keys(searchConditionRef.value).forEach(key => {
searchData.filters = [{ searchData.filters = [{
action: "==", action: "==",
column: key, column: key,
value: searchConditionRef.value[key] value: searchConditionRef.value[key]
}] }]
}
}); });
} }
}
tableObjectRef.value.params = { tableObjectRef.value.params = {
isSearch: true, isSearch: true,
filters: searchData.filters filters: searchData.filters

Loading…
Cancel
Save