diff --git a/src/index.less b/src/index.less index fdebc69..b129536 100644 --- a/src/index.less +++ b/src/index.less @@ -58,6 +58,10 @@ code { margin-left: 15px; } +.ml-120 { + margin-left: 120px; +} + .mr-16 { margin-right: 16px; } diff --git a/src/pages/course/compenents/create.tsx b/src/pages/course/compenents/create.tsx index b64af07..33ee5a0 100644 --- a/src/pages/course/compenents/create.tsx +++ b/src/pages/course/compenents/create.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from "react"; import { Space, - Switch, + Radio, Button, Drawer, Form, @@ -30,6 +30,8 @@ export const CourseCreate: React.FC = ({ open, onCancel }) => { const [departments, setDepartments] = useState([]); const [categories, setCategories] = useState([]); const [thumb, setThumb] = useState(""); + const [type, setType] = useState("open"); + const [chapterType, setChapterType] = useState(0); useEffect(() => { getParams(); @@ -42,6 +44,9 @@ export const CourseCreate: React.FC = ({ open, onCancel }) => { thumb: "", dep_ids: [], category_ids: [], + type: "open", + desc: "", + hasChapter: 0, }); setThumb(""); }, [form, open]); @@ -109,6 +114,14 @@ export const CourseCreate: React.FC = ({ open, onCancel }) => { console.log("Failed:", errorInfo); }; + const getType = (e: any) => { + setType(e.target.value); + }; + + const getChapterType = (e: any) => { + setChapterType(e.target.value); + }; + return ( <> = ({ open, onCancel }) => { placeholder="请选择课程分类" /> + + + 公开课 + 部门课 + + = ({ open, onCancel }) => { )} + + + + + + 无章节 + 有章节 + + + {chapterType === 0 && ( + +
+ +
+
+ )}