Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

表格组件如何支持查询呢,使用fetchDataApi,如何传入查询参数,怎样动态更新 #552

Open
cjp314 opened this issue Oct 30, 2024 · 0 comments

Comments

@cjp314
Copy link

cjp314 commented Oct 30, 2024

const { tableMethods, tableState } = useTable({
fetchDataApi: async () => {
const { currentPage, pageSize } = tableState
const res = await getGasWeekList({
pageIndex: unref(currentPage),
pageSize: unref(pageSize),
siteNo: getSiteNo()
})
const list: Array = []
res.data.forEach(element => {
const weekDate = [${dayjs(element.weekStart).format('YYYY.MM.DD')}]--[${dayjs(element.weekEnd).format('YYYY.MM.DD')}]
list.push({
weekDate,
siteName: siteNameMap[element.siteNo], ...element
})
})
return {
list: list,
total: res.total
}
}
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant