mirror of
https://github.com/PlayEdu/backend
synced 2025-12-25 17:49:30 +08:00
线上课新建无章节课时选择逻辑优化
This commit is contained in:
@@ -190,6 +190,20 @@ export const CourseCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
|
||||
}
|
||||
};
|
||||
|
||||
const transHour = (arr: any) => {
|
||||
setHours(arr);
|
||||
const data = [...treeData];
|
||||
const newArr: any = [];
|
||||
for (let i = 0; i < arr.length; i++) {
|
||||
data.map((item: any) => {
|
||||
if (item.rid === arr[i]) {
|
||||
newArr.push(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
setTreeData(newArr);
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Drawer
|
||||
@@ -415,6 +429,9 @@ export const CourseCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
|
||||
onRemoveItem={(id: number) => {
|
||||
delHour(id);
|
||||
}}
|
||||
onUpdate={(arr: any[]) => {
|
||||
transHour(arr);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user