|
|
@@ -53,7 +53,7 @@ export function useDataTable<T>(options: DataTableOptions = {}) {
|
|
|
filters.value = []
|
|
|
},
|
|
|
onSearch: () => {
|
|
|
- filters.value = getFilterParam()
|
|
|
+ filters.value = getFilterParams()
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -86,7 +86,7 @@ export function useDataTable<T>(options: DataTableOptions = {}) {
|
|
|
})
|
|
|
|
|
|
// 获取过滤参数,支持多条件查询
|
|
|
- const getFilterParam = () => {
|
|
|
+ const getFilterParams = () => {
|
|
|
const options: FilterValue<T>[] = []
|
|
|
filterOptons.selectList.forEach((e) => {
|
|
|
const { key, selectedValue } = e;
|
|
|
@@ -110,7 +110,7 @@ export function useDataTable<T>(options: DataTableOptions = {}) {
|
|
|
}
|
|
|
|
|
|
// 获取查询参数,支持多条件查询
|
|
|
- const getQueryParam = () => {
|
|
|
+ const getQueryParams = () => {
|
|
|
const params: { [K in keyof T]?: T[K] } = {}
|
|
|
filterOptons.selectList.forEach((e) => {
|
|
|
if (e.selectedValue !== undefined) {
|
|
|
@@ -134,7 +134,7 @@ export function useDataTable<T>(options: DataTableOptions = {}) {
|
|
|
pageSize,
|
|
|
pageCount,
|
|
|
filterMethod,
|
|
|
- getQueryParam,
|
|
|
+ getQueryParams,
|
|
|
...toRefs(filterOptons),
|
|
|
}
|
|
|
}
|