import { useEffect, useState } from "react"; import { Row, Modal, Tabs } from "antd"; import styles from "./index.module.less"; import { UploadCoursewareSub } from "../../compenents"; import type { TabsProps } from "antd"; interface PropsInterface { defaultKeys: any[]; open: boolean; onSelected: (arr: any[], videos: any[]) => void; onCancel: () => void; } export const SelectAttachment = (props: PropsInterface) => { const [refresh, setRefresh] = useState(true); const [tabKey, setTabKey] = useState(1); const [selectKeys, setSelectKeys] = useState([]); const [selectVideos, setSelectVideos] = useState([]); useEffect(() => { setRefresh(!refresh); }, [props.open]); const items: TabsProps["items"] = [ { key: "1", label: `课件`, children: (
{ setSelectKeys(arr); setSelectVideos(videos); }} />
), }, ]; const onChange = (key: string) => { setTabKey(Number(key)); }; return ( <> { setSelectKeys([]); setSelectVideos([]); props.onCancel(); }} open={props.open} width={800} maskClosable={false} onOk={() => { props.onSelected(selectKeys, selectVideos); setSelectKeys([]); setSelectVideos([]); }} > ); };