线上课新建无章节课时选择逻辑优化

This commit is contained in:
禺狨 2023-03-17 12:26:49 +08:00
parent 0460da6974
commit e2dba07641
3 changed files with 8 additions and 1 deletions

View File

@ -56,6 +56,7 @@ export const SelectResource = (props: PropsInterface) => {
closable={false}
onCancel={() => {
setSelectKeys([]);
setSelectVideos([]);
props.onCancel();
}}
open={props.open}

View File

@ -89,7 +89,12 @@ export const UploadVideoSub = (props: PropsInterface) => {
};
//重置选中的key
useEffect(() => {
setCheckedList(props.defaultCheckedList);
const arr = [...props.defaultCheckedList];
setCheckedList(arr);
if (arr.length === 0) {
setIndeterminate(false);
setCheckAll(false);
}
}, [props.defaultCheckedList]);
// 加载列表

View File

@ -164,6 +164,7 @@ export const CourseCreate: React.FC<PropInterface> = ({ open, onCancel }) => {
setChapterType(e.target.value);
setChapters([]);
setHours([]);
setTreeData([]);
},
onCancel() {
form.setFieldsValue({