mirror of
https://github.com/PlayEdu/backend
synced 2025-06-29 22:22:52 +08:00
部门编辑
This commit is contained in:
parent
05bc285d2f
commit
7762b72b53
@ -52,7 +52,7 @@ export const DepartmentCreatePage: React.FC = () => {
|
||||
|
||||
const onFinish = (values: any) => {
|
||||
department
|
||||
.storeDepartment(values.name, parent_id, values.sort)
|
||||
.storeDepartment(values.name, parent_id || 0, values.sort)
|
||||
.then((res: any) => {
|
||||
message.success("保存成功!");
|
||||
navigate(-1);
|
||||
@ -64,8 +64,12 @@ export const DepartmentCreatePage: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleChange = (value: any) => {
|
||||
let it = value[value.length - 1];
|
||||
setParentId(it);
|
||||
if (value !== undefined) {
|
||||
let it = value[value.length - 1];
|
||||
setParentId(it);
|
||||
} else {
|
||||
setParentId(0);
|
||||
}
|
||||
};
|
||||
|
||||
const displayRender = (label: any, selectedOptions: any) => {
|
||||
|
@ -75,7 +75,7 @@ export const DepartmentUpdatePage: React.FC = () => {
|
||||
const onFinish = (values: any) => {
|
||||
let id = Number(params.depId);
|
||||
department
|
||||
.updateDepartment(id, values.name, parent_id, values.sort)
|
||||
.updateDepartment(id, values.name, parent_id || 0, values.sort)
|
||||
.then((res: any) => {
|
||||
message.success("保存成功!");
|
||||
navigate(-1);
|
||||
@ -87,8 +87,12 @@ export const DepartmentUpdatePage: React.FC = () => {
|
||||
};
|
||||
|
||||
const handleChange = (value: any) => {
|
||||
let it = value[value.length - 1];
|
||||
setParentId(it);
|
||||
if (value !== undefined) {
|
||||
let it = value[value.length - 1];
|
||||
setParentId(it);
|
||||
} else {
|
||||
setParentId(0);
|
||||
}
|
||||
};
|
||||
|
||||
const displayRender = (label: any, selectedOptions: any) => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user