From 7e41b763f6f207504fb1b370d8b1e9c55e45cc90 Mon Sep 17 00:00:00 2001 From: xingyu Date: Tue, 29 Nov 2022 21:02:42 +0800 Subject: [PATCH] feat: grid add delete api --- yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts index 89203c754..af930b7ce 100644 --- a/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts +++ b/yudao-ui-admin-vue3/src/hooks/web/useVxeGrid.ts @@ -87,6 +87,15 @@ export const useVxeGrid = (config?: UseVxeGridConfig) => { resolve(await config?.getListApi(queryParams)) }) }, + delete: ({ body }) => { + return new Promise(async (resolve) => { + if (config?.deleteApi) { + resolve(await config?.deleteApi(JSON.stringify(body))) + } else { + Promise.reject('未设置deleteApi') + } + }) + }, queryAll: ({ form }) => { const queryParams = Object.assign({}, JSON.parse(JSON.stringify(form))) return new Promise(async (resolve) => {