feat: refactoring API

This commit is contained in:
kailong321200875
2022-06-25 21:56:24 +08:00
parent 43518532f1
commit 37b75839a5
29 changed files with 198 additions and 339 deletions

View File

@@ -65,12 +65,12 @@ const loading = ref(true)
let tableDataList = ref<TableData[]>([])
const getTableList = async (params?: Params) => {
const res = await getTableListApi({
params: params || {
const res = await getTableListApi(
params || {
pageIndex: 1,
pageSize: 10
}
})
)
.catch(() => {})
.finally(() => {
loading.value = false

View File

@@ -62,13 +62,7 @@ const columns = reactive<TableColumn[]>([
}
])
const { register, tableObject, methods } = useTable<
{
total: number
list: TableData[]
},
TableData
>({
const { register, tableObject, methods } = useTable<TableData>({
getListApi: getTableListApi,
response: {
list: 'list',

View File

@@ -8,13 +8,7 @@ import { ref, h, reactive, unref } from 'vue'
import { ElTag, ElButton } from 'element-plus'
import { useTable } from '@/hooks/web/useTable'
const { register, tableObject, methods } = useTable<
{
total: number
list: TableData[]
},
TableData
>({
const { register, tableObject, methods } = useTable<TableData>({
getListApi: getTableListApi,
response: {
list: 'list',