管理人员角色优化

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 { interface PropInterface {
roleId: number; roleId: number;
refresh: boolean;
open: boolean; open: boolean;
onCancel: () => void; onCancel: () => void;
} }
export const SystemAdministratorCreate: React.FC<PropInterface> = ({ export const SystemAdministratorCreate: React.FC<PropInterface> = ({
roleId, roleId,
refresh,
open, open,
onCancel, onCancel,
}) => { }) => {
@ -20,7 +22,7 @@ export const SystemAdministratorCreate: React.FC<PropInterface> = ({
useEffect(() => { useEffect(() => {
getParams(); getParams();
}, []); }, [refresh]);
useEffect(() => { useEffect(() => {
let roleIds = []; let roleIds = [];

View File

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

View File

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