From 10e4d0dae19bf42f0d14db73861de207ad38c011 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Tue, 4 Apr 2023 11:19:44 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E4=BA=BA=E5=91=98=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/adminroles/compenents/create.tsx | 42 +++++++++++-------- .../system/adminroles/compenents/update.tsx | 41 ++++++++++-------- 2 files changed, 48 insertions(+), 35 deletions(-) diff --git a/src/pages/system/adminroles/compenents/create.tsx b/src/pages/system/adminroles/compenents/create.tsx index 7acf767..329407f 100644 --- a/src/pages/system/adminroles/compenents/create.tsx +++ b/src/pages/system/adminroles/compenents/create.tsx @@ -1,5 +1,5 @@ import React, { useState, useEffect } from "react"; -import { Modal, Select, Form, Input, message } from "antd"; +import { Drawer, Select, Space, Button, Form, Input, message } from "antd"; import styles from "./create.module.less"; import { adminRole } from "../../../../api/index"; @@ -74,37 +74,45 @@ export const SystemAdminrolesCreate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} + onClose={onCancel} maskClosable={false} + open={open} + footer={ + + + + + } + width={634} >
- + = ({
-
+ ); }; diff --git a/src/pages/system/adminroles/compenents/update.tsx b/src/pages/system/adminroles/compenents/update.tsx index 9486fd6..9a2b17c 100644 --- a/src/pages/system/adminroles/compenents/update.tsx +++ b/src/pages/system/adminroles/compenents/update.tsx @@ -1,10 +1,10 @@ import React, { useState, useEffect } from "react"; -import { Modal, Form, Input, Select, message } from "antd"; +import { Drawer, Select, Space, Button, Form, Input, message } from "antd"; import styles from "./update.module.less"; import { adminRole } from "../../../../api/index"; interface PropInterface { - id: number; + id: any; open: boolean; onCancel: () => void; } @@ -24,7 +24,7 @@ export const SystemAdminrolesUpdate: React.FC = ({ }, []); useEffect(() => { - if (id === 0 || "undefined" || "") { + if (id === undefined) { return; } getDetail(); @@ -86,22 +86,27 @@ export const SystemAdminrolesUpdate: React.FC = ({ return ( <> - form.submit()} - onCancel={() => onCancel()} + + + + + } + width={634} >
= ({ name="name" rules={[{ required: true, message: "请输入角色名!" }]} > - + = ({
-
+ ); };