From 74a97da1ff1df1043ca4f918ae63c99773276b0d Mon Sep 17 00:00:00 2001 From: TimSpan Date: Fri, 29 Nov 2024 17:38:02 +0800 Subject: [PATCH] Update publicUnit.vue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复删除不刷新bug --- .../src/views/query/publicUnit.vue | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/policeManagement/src/views/query/publicUnit.vue b/policeManagement/src/views/query/publicUnit.vue index 62cb0da..8d24796 100644 --- a/policeManagement/src/views/query/publicUnit.vue +++ b/policeManagement/src/views/query/publicUnit.vue @@ -304,7 +304,7 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => { icon: ' ', centered: true, content: () => , - onOk: async () => { + onOk: debounce(async () => { await _formRef.value?.validate() const resp = await api.post('/eu/add_upd', { @@ -318,7 +318,7 @@ const saveOrUpdateEnterprisesUnit = (params: _FormType, callback: Function) => { await tableRef.value?.requestGetTableData() callback && callback() - }, + }, 300), }) } @@ -486,7 +486,15 @@ const formItemOptions = ref>(null) +const _tableRef = ref(null) + +const deleteAccount = async (snowFlakeId) => { + const resp = await api.delete('/m2/eu/deleteSpById', { + serviceProjectId: snowFlakeId, + }) + message.success(resp.message) + await _tableRef.value?.requestGetTableData() +} const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => { const _columns: _TableProps['columns'] = [ { @@ -624,16 +632,7 @@ const expandedRowRender: TableProMaxProps['expandedRowRender'] = ({ record }) => > 编辑 - { - const resp = await api.delete('/m2/eu/deleteSpById', { - serviceProjectId: record.snowFlakeId, - }) - message.success(resp.message) - await _tableRef.value?.requestGetTableData() - }} - > + deleteAccount(record.snowFlakeId)}> 删除