From 52a1920507ef2e249b02c27a64037cc0fe5437df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A6=BA=E7=8B=A8?= <18119604035@163.com> Date: Wed, 15 Mar 2023 18:18:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E6=96=B0=E5=BB=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=8C=96=E5=88=9D=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.less | 4 ++ src/pages/course/compenents/create.tsx | 58 +++++++++++++++++++++++++- 2 files changed, 60 insertions(+), 2 deletions(-) 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 && ( + +
+ +
+
+ )}