新建学员携带部门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 {
open: boolean;
depIds: any;
onCancel: () => void;
}
@ -17,7 +18,11 @@ interface 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 [loading, setLoading] = useState<boolean>(true);
const [departments, setDepartments] = useState<any>([]);
@ -39,10 +44,10 @@ export const MemberCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
password: "",
avatar: memberDefaultAvatar,
idCard: "",
dep_ids: [],
dep_ids: depIds,
});
setAvatar(memberDefaultAvatar);
}, [form, open]);
}, [form, open, depIds]);
const getParams = () => {
department.departmentList().then((res: any) => {

View File

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