1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-04-30 22:29:01 +08:00

perf: 弹窗在请求报错时不需要关闭

This commit is contained in:
zclzone 2023-12-12 09:04:01 +08:00
parent 14a9f503ae
commit 62fb5b7fe0
4 changed files with 12 additions and 9 deletions

View File

@ -1,7 +1,7 @@
<!--------------------------------
- @Author: Ronnie Zhang
- @LastEditor: Ronnie Zhang
- @LastEditTime: 2023/12/04 22:51:58
- @LastEditTime: 2023/12/12 09:03:22
- @Email: zclzone@outlook.com
- Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
--------------------------------->
@ -80,11 +80,11 @@ const props = defineProps({
},
style: {
type: Object,
default: () => ({}),
default: () => {},
},
contentStyle: {
type: Object,
default: () => ({}),
default: () => {},
},
onOk: {
type: Function,
@ -125,7 +125,7 @@ async function handleOk(data) {
// onOkfalse
res !== false && close()
} catch (error) {
//
okLoading.value = false
console.error(error)
}
}
@ -143,7 +143,7 @@ async function handleCancel(data) {
// onCancelfalse
res !== false && close()
} catch (error) {
//
okLoading.value = false
console.error(error)
}
}

View File

@ -1,7 +1,7 @@
/**********************************
* @Author: Ronnie Zhang
* @LastEditor: Ronnie Zhang
* @LastEditTime: 2023/12/05 21:22:35
* @LastEditTime: 2023/12/12 09:03:00
* @Email: zclzone@outlook.com
* Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
**********************************/
@ -79,6 +79,7 @@ export const useCrud = ({ name, initForm = {}, doCreate, doDelete, doUpdate, ref
data && refresh(data)
} catch (error) {
okLoading.value = false
return false
}
}

View File

@ -1,7 +1,7 @@
<!--------------------------------
- @Author: Ronnie Zhang
- @LastEditor: Ronnie Zhang
- @LastEditTime: 2023/12/05 21:23:12
- @LastEditTime: 2023/12/12 09:03:32
- @Email: zclzone@outlook.com
- Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
--------------------------------->
@ -69,6 +69,7 @@ async function setCurrentRole() {
} catch (error) {
console.error(error)
okLoading.value = false
return false
}
}

View File

@ -1,7 +1,7 @@
<!--------------------------------
- @Author: Ronnie Zhang
- @LastEditor: Ronnie Zhang
- @LastEditTime: 2023/12/05 21:29:12
- @LastEditTime: 2023/12/12 09:03:43
- @Email: zclzone@outlook.com
- Copyright © 2023 Ronnie Zhang(大脸怪) | https://isme.top
--------------------------------->
@ -190,8 +190,9 @@ async function onSave() {
$message.success('保存成功')
emit('refresh', modalForm.value)
} catch (error) {
okLoading.value = false
console.error(error)
okLoading.value = false
return false
}
}