diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm index 8d290b1d..fb59ae09 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-drawer.vue.vm @@ -6,7 +6,7 @@ :unmount-on-close="true" :ok-button-props="{ disabled: loading }" :cancel-button-props="{ disabled: loading }" - :on-before-ok="handlerOk" + :on-before-ok="handleOk" @cancel="handleClose"> { + const handleOk = async () => { setLoading(true); try { // 验证参数 @@ -133,8 +133,8 @@ Message.success('修改成功'); emits('updated'); } - // 清空 - handlerClear(); + handleClose(); + return true; } catch (e) { return false; } finally { @@ -144,11 +144,12 @@ // 关闭 const handleClose = () => { - handlerClear(); + handleClear(); + setVisible(false); }; // 清空 - const handlerClear = () => { + const handleClear = () => { setLoading(false); }; diff --git a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm index 14dcc169..307da03e 100644 --- a/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm +++ b/orion-visor-framework/orion-visor-spring-boot-starter-mybatis/src/main/resources/templates/orion-vue-views-components-form-modal.vue.vm @@ -10,7 +10,7 @@ :unmount-on-close="true" :ok-button-props="{ disabled: loading }" :cancel-button-props="{ disabled: loading }" - :on-before-ok="handlerOk" + :on-before-ok="handleOk" @close="handleClose"> { + const handleOk = async () => { setLoading(true); try { // 验证参数 @@ -137,8 +137,8 @@ Message.success('修改成功'); emits('updated'); } - // 清空 - handlerClear(); + handleClose(); + return true; } catch (e) { return false; } finally { @@ -148,11 +148,12 @@ // 关闭 const handleClose = () => { - handlerClear(); + handleClear(); + setVisible(false); }; // 清空 - const handlerClear = () => { + const handleClear = () => { setLoading(false); };