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

@@ -13,13 +13,7 @@ import Write from './components/Write.vue'
import Detail from './components/Detail.vue'
import { CrudSchema, useCrudSchemas } from '@/hooks/web/useCrudSchemas'
const { register, tableObject, methods } = useTable<
{
total: number
list: TableData[]
},
TableData
>({
const { register, tableObject, methods } = useTable<TableData>({
getListApi: getTableListApi,
delListApi: delTableListApi,
response: {
@@ -196,9 +190,7 @@ const save = async () => {
if (isValid) {
loading.value = true
const data = (await write?.getFormData()) as TableData
const res = await saveTableApi({
data
})
const res = await saveTableApi(data)
.catch(() => {})
.finally(() => {
loading.value = false