From c74e8f03adf2d2eadbcde5d7935cb572b68cb6e9 Mon Sep 17 00:00:00 2001 From: chenos Date: Thu, 26 Aug 2021 10:30:52 +0800 Subject: [PATCH] improve code --- .../src/components/admin-layout/UserInfo.tsx | 26 ++++-- .../src/components/admin-layout/style.less | 6 +- packages/client/src/schemas/chart/index.tsx | 6 +- packages/client/src/schemas/menu/index.tsx | 88 ++++++++++--------- 4 files changed, 73 insertions(+), 53 deletions(-) diff --git a/packages/client/src/components/admin-layout/UserInfo.tsx b/packages/client/src/components/admin-layout/UserInfo.tsx index 010d7284f..40b7a86e7 100644 --- a/packages/client/src/components/admin-layout/UserInfo.tsx +++ b/packages/client/src/components/admin-layout/UserInfo.tsx @@ -1,19 +1,24 @@ import React, { useContext, useEffect } from 'react'; -import { Button, Dropdown, Menu } from 'antd'; +import { Button, Dropdown, Menu, Select } from 'antd'; import { useHistory } from 'react-router-dom'; import { request, SchemaField } from '../../schemas'; import { AuthContext, useCurrentUser } from './Auth'; import { FormButtonGroup, FormDrawer, FormLayout, Submit } from '@formily/antd'; +import { useState } from 'react'; export const UserInfo = () => { const history = useHistory(); const { service, currentUser } = useContext(AuthContext); + const [visible, setVisible] = useState(false); return ( { + setVisible(false); const values = await FormDrawer('个人资料', () => { return ( @@ -38,10 +43,7 @@ export const UserInfo = () => { /> - { - }}> - 保存 - + {}}>保存 @@ -58,6 +60,20 @@ export const UserInfo = () => { > 个人资料 + +