新建学员携带部门id

This commit is contained in:
禺狨 2023-04-25 10:45:16 +08:00
parent 6bbe2cbeec
commit e133c724f3
2 changed files with 9 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import { ValidataCredentials } from "../../../utils/index";
interface PropInterface { interface PropInterface {
open: boolean; open: boolean;
depIds: any;
onCancel: () => void; onCancel: () => void;
} }
@ -17,7 +18,11 @@ interface Option {
children?: Option[]; children?: Option[];
} }
export const MemberCreate: React.FC<PropInterface> = ({ open, onCancel }) => { export const MemberCreate: React.FC<PropInterface> = ({
open,
depIds,
onCancel,
}) => {
const [form] = Form.useForm(); const [form] = Form.useForm();
const [loading, setLoading] = useState<boolean>(true); const [loading, setLoading] = useState<boolean>(true);
const [departments, setDepartments] = useState<any>([]); const [departments, setDepartments] = useState<any>([]);
@ -39,10 +44,10 @@ export const MemberCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
password: "", password: "",
avatar: memberDefaultAvatar, avatar: memberDefaultAvatar,
idCard: "", idCard: "",
dep_ids: [], dep_ids: depIds,
}); });
setAvatar(memberDefaultAvatar); setAvatar(memberDefaultAvatar);
}, [form, open]); }, [form, open, depIds]);
const getParams = () => { const getParams = () => {
department.departmentList().then((res: any) => { department.departmentList().then((res: any) => {

View File

@ -361,6 +361,7 @@ const MemberPage = () => {
/> />
<MemberCreate <MemberCreate
open={createVisible} open={createVisible}
depIds={dep_ids}
onCancel={() => { onCancel={() => {
setCreateVisible(false); setCreateVisible(false);
setRefresh(!refresh); setRefresh(!refresh);