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

This commit is contained in:
禺狨
2023-03-17 12:18:17 +08:00
parent 60aa433589
commit 0460da6974
6 changed files with 155 additions and 47 deletions

View File

@@ -12,8 +12,9 @@ interface VideoItem {
}
interface PropsInterface {
defaultKeys: any[];
open: boolean;
onSelected: (arr: any[], label: any[]) => void;
onSelected: (arr: any[], videos: any[]) => void;
onCancel: () => void;
}
@@ -21,7 +22,7 @@ export const SelectResource = (props: PropsInterface) => {
const [refresh, setRefresh] = useState(true);
const [tabKey, setTabKey] = useState(1);
const [selectKeys, setSelectKeys] = useState<any>([]);
const [selectLabel, setSelectLabel] = useState<any>([]);
const [selectVideos, setSelectVideos] = useState<any>([]);
const items: TabsProps["items"] = [
{
@@ -31,11 +32,11 @@ export const SelectResource = (props: PropsInterface) => {
<div className="float-left">
<UploadVideoSub
label="视频"
defaultCheckedList={[]}
defaultCheckedList={props.defaultKeys}
open={refresh}
onSelected={(arr: any[], label: any[]) => {
onSelected={(arr: any[], videos: any[]) => {
setSelectKeys(arr);
setSelectLabel(label);
setSelectVideos(videos);
}}
/>
</div>
@@ -60,7 +61,7 @@ export const SelectResource = (props: PropsInterface) => {
open={props.open}
width={800}
maskClosable={false}
onOk={() => props.onSelected(selectKeys, selectLabel)}
onOk={() => props.onSelected(selectKeys, selectVideos)}
>
<Row>
<Tabs defaultActiveKey="1" items={items} onChange={onChange} />