Commit 8aff44afd131dcbb7c7fcb774709384711614302
Merge branch 'ft_local_dev' into 'main'
fix:新增租户管理员点击确定按钮,服务端未响应数据导致按钮loading消失 See merge request huang/yun-teng-iot-front!432
Showing
1 changed file
with
11 additions
and
10 deletions
| @@ -144,8 +144,8 @@ | @@ -144,8 +144,8 @@ | ||
| 144 | const getTitle = computed(() => (!unref(isUpdate) ? '新增租户管理员' : '编辑租户管理员')); | 144 | const getTitle = computed(() => (!unref(isUpdate) ? '新增租户管理员' : '编辑租户管理员')); |
| 145 | 145 | ||
| 146 | async function handleSubmit() { | 146 | async function handleSubmit() { |
| 147 | - setDrawerProps({ confirmLoading: true }); | ||
| 148 | try { | 147 | try { |
| 148 | + setDrawerProps({ confirmLoading: true }); | ||
| 149 | const values = await validate(); | 149 | const values = await validate(); |
| 150 | const requestParams = { | 150 | const requestParams = { |
| 151 | id: values.id, | 151 | id: values.id, |
| @@ -160,15 +160,16 @@ | @@ -160,15 +160,16 @@ | ||
| 160 | : null, | 160 | : null, |
| 161 | tenantId: tenantId.value, | 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 | return { | 175 | return { |