mirror of
https://github.com/PlayEdu/backend
synced 2025-06-22 02:02:50 +08:00
部门组件优化
This commit is contained in:
parent
05ffe7eff9
commit
e182d75a69
@ -11,7 +11,6 @@ interface Option {
|
|||||||
interface PropInterface {
|
interface PropInterface {
|
||||||
type: string;
|
type: string;
|
||||||
text: string;
|
text: string;
|
||||||
|
|
||||||
onUpdate: (keys: any, title: any) => void;
|
onUpdate: (keys: any, title: any) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ interface Option {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface PropInterface {
|
interface PropInterface {
|
||||||
|
type: string;
|
||||||
text: string;
|
text: string;
|
||||||
onUpdate: (keys: any, title: any) => void;
|
onUpdate: (keys: any, title: any) => void;
|
||||||
}
|
}
|
||||||
@ -24,6 +25,12 @@ export const TreeDepartment = (props: PropInterface) => {
|
|||||||
|
|
||||||
if (JSON.stringify(departments) !== "{}") {
|
if (JSON.stringify(departments) !== "{}") {
|
||||||
const new_arr: Option[] = checkArr(departments, 0);
|
const new_arr: Option[] = checkArr(departments, 0);
|
||||||
|
if (props.type === "no-course") {
|
||||||
|
new_arr.unshift({
|
||||||
|
key: 0,
|
||||||
|
title: "公开课",
|
||||||
|
});
|
||||||
|
}
|
||||||
setTreeData(new_arr);
|
setTreeData(new_arr);
|
||||||
} else {
|
} else {
|
||||||
const new_arr: Option[] = [
|
const new_arr: Option[] = [
|
||||||
@ -33,6 +40,12 @@ export const TreeDepartment = (props: PropInterface) => {
|
|||||||
children: [],
|
children: [],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
if (props.type === "no-course") {
|
||||||
|
new_arr.unshift({
|
||||||
|
key: 0,
|
||||||
|
title: "公开课",
|
||||||
|
});
|
||||||
|
}
|
||||||
setTreeData(new_arr);
|
setTreeData(new_arr);
|
||||||
}
|
}
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
@ -89,6 +89,7 @@ export const CoursePage = () => {
|
|||||||
children: (
|
children: (
|
||||||
<div className="float-left">
|
<div className="float-left">
|
||||||
<TreeDepartment
|
<TreeDepartment
|
||||||
|
type="no-course"
|
||||||
text={"部门"}
|
text={"部门"}
|
||||||
onUpdate={(keys: any, title: any) => {
|
onUpdate={(keys: any, title: any) => {
|
||||||
setDepIds(keys);
|
setDepIds(keys);
|
||||||
|
@ -183,6 +183,7 @@ export const MemberPage: React.FC = () => {
|
|||||||
<div className="tree-main-body">
|
<div className="tree-main-body">
|
||||||
<div className="left-box">
|
<div className="left-box">
|
||||||
<TreeDepartment
|
<TreeDepartment
|
||||||
|
type=""
|
||||||
text={"部门"}
|
text={"部门"}
|
||||||
onUpdate={(keys: any, title: any) => {
|
onUpdate={(keys: any, title: any) => {
|
||||||
setDepIds(keys);
|
setDepIds(keys);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user