Commit 7e41b763f6f207504fb1b370d8b1e9c55e45cc90
1 parent
6b2d1b50
feat: grid add delete api
Showing
1 changed file
with
9 additions
and
0 deletions
yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts
| ... | ... | @@ -87,6 +87,15 @@ export const useVxeGrid = <T = any>(config?: UseVxeGridConfig<T>) => { |
| 87 | 87 | resolve(await config?.getListApi(queryParams)) |
| 88 | 88 | }) |
| 89 | 89 | }, |
| 90 | + delete: ({ body }) => { | |
| 91 | + return new Promise(async (resolve) => { | |
| 92 | + if (config?.deleteApi) { | |
| 93 | + resolve(await config?.deleteApi(JSON.stringify(body))) | |
| 94 | + } else { | |
| 95 | + Promise.reject('未设置deleteApi') | |
| 96 | + } | |
| 97 | + }) | |
| 98 | + }, | |
| 90 | 99 | queryAll: ({ form }) => { |
| 91 | 100 | const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form))) |
| 92 | 101 | return new Promise(async (resolve) => { | ... | ... |