fix: 优化中药开方功能
This commit is contained in:
53
apps/web-antd/src/layouts/components/UpdatePasswordModal.vue
Normal file
53
apps/web-antd/src/layouts/components/UpdatePasswordModal.vue
Normal file
@@ -0,0 +1,53 @@
|
||||
<script lang="ts" setup>
|
||||
import {Page, useVbenModal} from '@vben/common-ui';
|
||||
|
||||
import {message} from 'ant-design-vue';
|
||||
|
||||
import {passwordModalForm} from '#/layouts/config/form.ts'
|
||||
import {useVbenForm} from "#/adapter/form";
|
||||
import {updatePassword} from "#/views/system/admin/api";
|
||||
|
||||
const [Form, formApi] = useVbenForm(passwordModalForm);
|
||||
const [Modal, modalApi] = useVbenModal({
|
||||
fullscreenButton: false,
|
||||
draggable: true,
|
||||
onCancel() {
|
||||
modalApi.close();
|
||||
},
|
||||
onConfirm: async () => {
|
||||
formApi.validate().then(async (e: any) => {
|
||||
if (e.valid) {
|
||||
const values = await formApi.getValues();
|
||||
modalApi.setState({loading: true, confirmLoading: true});
|
||||
updatePassword(values).then(() => {
|
||||
modalApi.close();
|
||||
message.success('修改成功,请重新登录');
|
||||
})
|
||||
.finally(() => {
|
||||
modalApi.setState({loading: false, confirmLoading: false});
|
||||
});
|
||||
}
|
||||
});
|
||||
await formApi.validateAndSubmitForm();
|
||||
},
|
||||
onOpenChange(isOpen: boolean) {
|
||||
console.log(isOpen, '开启状态');
|
||||
// if (isOpen) {
|
||||
// const {values} =
|
||||
// modalApi.getData<Record<string, any>>();
|
||||
// if (values) {
|
||||
// }
|
||||
// }
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- <Modal class="w-[60%]" title="西(中成)药列表">-->
|
||||
<Modal class="w-[60%]" title="修改密码">
|
||||
<Page>
|
||||
<Form/>
|
||||
</Page>
|
||||
</Modal>
|
||||
</template>
|
||||
<style lang="scss"></style>
|
||||
Reference in New Issue
Block a user