fix: table search params
This commit is contained in:
parent
6b013fa373
commit
a62929a8da
|
@ -144,13 +144,17 @@ export const useTable = <T = any>(config?: UseTableConfig<T>) => {
|
||||||
},
|
},
|
||||||
// 与Search组件结合
|
// 与Search组件结合
|
||||||
setSearchParams: (data: Recordable) => {
|
setSearchParams: (data: Recordable) => {
|
||||||
tableObject.currentPage = 1
|
|
||||||
tableObject.params = Object.assign(tableObject.params, {
|
tableObject.params = Object.assign(tableObject.params, {
|
||||||
pageSize: tableObject.pageSize,
|
pageSize: tableObject.pageSize,
|
||||||
pageIndex: tableObject.currentPage,
|
pageIndex: 1,
|
||||||
...data
|
...data
|
||||||
})
|
})
|
||||||
methods.getList()
|
// 页码不等于1时更新页码重新获取数据,页码等于1时重新获取数据
|
||||||
|
if (tableObject.currentPage !== 1) {
|
||||||
|
tableObject.currentPage = 1
|
||||||
|
} else {
|
||||||
|
methods.getList()
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 删除数据
|
// 删除数据
|
||||||
delList: async (ids: string[] | number[], multiple: boolean, message = true) => {
|
delList: async (ids: string[] | number[], multiple: boolean, message = true) => {
|
||||||
|
|
Loading…
Reference in New Issue