管理人员角色优化

This commit is contained in:
禺狨 2023-04-04 14:55:29 +08:00
parent 64511b9cba
commit a583c31950
3 changed files with 8 additions and 2 deletions

View File

@ -5,12 +5,14 @@ import { adminUser } from "../../../../api/index";
interface PropInterface {
roleId: number;
refresh: boolean;
open: boolean;
onCancel: () => void;
}
export const SystemAdministratorCreate: React.FC<PropInterface> = ({
roleId,
refresh,
open,
onCancel,
}) => {
@ -20,7 +22,7 @@ export const SystemAdministratorCreate: React.FC<PropInterface> = ({
useEffect(() => {
getParams();
}, []);
}, [refresh]);
useEffect(() => {
let roleIds = [];

View File

@ -5,12 +5,14 @@ import { adminUser } from "../../../../api/index";
interface PropInterface {
id: number;
refresh: boolean;
open: boolean;
onCancel: () => void;
}
export const SystemAdministratorUpdate: React.FC<PropInterface> = ({
id,
refresh,
open,
onCancel,
}) => {
@ -20,7 +22,7 @@ export const SystemAdministratorUpdate: React.FC<PropInterface> = ({
useEffect(() => {
getParams();
}, []);
}, [refresh]);
useEffect(() => {
if (id === 0) {

View File

@ -312,6 +312,7 @@ const SystemAdministratorPage = () => {
rowKey={(record) => record.id}
/>
<SystemAdministratorCreate
refresh={refresh}
roleId={role_ids[0]}
open={createVisible}
onCancel={() => {
@ -321,6 +322,7 @@ const SystemAdministratorPage = () => {
/>
<SystemAdministratorUpdate
id={cid}
refresh={refresh}
open={updateVisible}
onCancel={() => {
setUpdateVisible(false);