Commit 81a8063bcaf51f75c30e07657d82dcd235c0bff2
1 parent
28dd094a
fix:新增租户管理员点击确定按钮,服务端未响应数据导致按钮loading消失
Showing
1 changed file
with
11 additions
and
10 deletions
| ... | ... | @@ -144,8 +144,8 @@ |
| 144 | 144 | const getTitle = computed(() => (!unref(isUpdate) ? '新增租户管理员' : '编辑租户管理员')); |
| 145 | 145 | |
| 146 | 146 | async function handleSubmit() { |
| 147 | - setDrawerProps({ confirmLoading: true }); | |
| 148 | 147 | try { |
| 148 | + setDrawerProps({ confirmLoading: true }); | |
| 149 | 149 | const values = await validate(); |
| 150 | 150 | const requestParams = { |
| 151 | 151 | id: values.id, |
| ... | ... | @@ -160,15 +160,16 @@ |
| 160 | 160 | : null, |
| 161 | 161 | tenantId: tenantId.value, |
| 162 | 162 | }; |
| 163 | - saveTenantAdmin(requestParams as any as UserDTO).then(() => { | |
| 164 | - closeDrawer(); //关闭侧框 | |
| 165 | - emit('success'); | |
| 166 | - }); | |
| 167 | - } finally { | |
| 168 | - setTimeout(() => { | |
| 169 | - setDrawerProps({ confirmLoading: false }); | |
| 170 | - }, 300); | |
| 171 | - } | |
| 163 | + saveTenantAdmin(requestParams as any as UserDTO) | |
| 164 | + .then(() => { | |
| 165 | + closeDrawer(); //关闭侧框 | |
| 166 | + emit('success'); | |
| 167 | + setDrawerProps({ confirmLoading: false }); | |
| 168 | + }) | |
| 169 | + .catch(() => { | |
| 170 | + setDrawerProps({ confirmLoading: false }); | |
| 171 | + }); | |
| 172 | + } catch {} | |
| 172 | 173 | } |
| 173 | 174 | |
| 174 | 175 | return { | ... | ... |