vue-element-plus-admin icon indicating copy to clipboard operation
vue-element-plus-admin copied to clipboard

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

Open cjp314 opened this issue 11 months ago • 0 comments

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 } } })

cjp314 avatar Oct 30 '24 06:10 cjp314