diff --git a/apps/admin/src/assets/less/common.less b/apps/admin/src/assets/less/common.less index 0c80805..f84ca28 100644 --- a/apps/admin/src/assets/less/common.less +++ b/apps/admin/src/assets/less/common.less @@ -24,3 +24,16 @@ ul { font-family: "bs"; src: url("./backset.woff"); } + +.bs-scrollbar { + &::-webkit-scrollbar { + width: 14px; + height: 4px; + } + &::-webkit-scrollbar-thumb { + border: 4px solid transparent; + background-clip: padding-box; + border-radius: 7px; + background-color: #d2d2d2; + } +} diff --git a/apps/admin/src/layout/index.less b/apps/admin/src/layout/index.less index 063b7ad..7719caa 100644 --- a/apps/admin/src/layout/index.less +++ b/apps/admin/src/layout/index.less @@ -1,17 +1,50 @@ -.logo { - float: left; - width: 120px; - height: 31px; - margin: 16px 24px 16px 0; - display: flex; - align-items: center; - color: #fff; - svg { - width: 22px; +.container { + height: 100%; + background: #f1f1f1; + header { + padding: 0 24px; + display: flex; + align-items: center; + position: fixed; + top: 0; + left: 0; + right: 0; + height: 46px; + background: #001529; + z-index: 19; + + .logo { + width: 320px; + display: flex; + align-items: center; + color: #fff; + svg { + width: 22px; + } + span { + padding-left: 10px; + font-family: "bs"; + font-size: 16px; + } + } } - span { - padding-left: 10px; - font-family: "bs"; - font-size: 16px; + aside { + position: fixed; + left: 0; + top: 46px; + bottom: 0; + width: 200px; + } + main { + position: fixed; + left: 200px; + right: 0; + top: 46px; + bottom: 0; + overflow-y: auto; + .view { + width: 1120px; + margin: 0 auto; + } } } diff --git a/apps/admin/src/layout/index.tsx b/apps/admin/src/layout/index.tsx index 0e7b04e..b6a4a06 100644 --- a/apps/admin/src/layout/index.tsx +++ b/apps/admin/src/layout/index.tsx @@ -50,8 +50,8 @@ const Index: React.FC = () => { }; return ( - -
+
+
{ items={navMenus} onClick={onClickNavMenuItem} /> -
- +
+ +
+
+ + {[...navRoutes, ...sideMenuRoutes].map((router) => ( + }> + {} + + } + /> + ))} + 404} /> + +
+
+ ); }; diff --git a/apps/admin/src/view/Course/Create/Appendix.tsx b/apps/admin/src/view/Course/Create/Appendix.tsx deleted file mode 100644 index 3dc89ff..0000000 --- a/apps/admin/src/view/Course/Create/Appendix.tsx +++ /dev/null @@ -1,5 +0,0 @@ -const Appendix = () => { - return
附件
; -}; - -export default Appendix; diff --git a/apps/admin/src/view/Course/Create/Appendix/index.tsx b/apps/admin/src/view/Course/Create/Appendix/index.tsx new file mode 100644 index 0000000..2501f97 --- /dev/null +++ b/apps/admin/src/view/Course/Create/Appendix/index.tsx @@ -0,0 +1,10 @@ +interface IProps { + onChange?: Function; + styles?: React.CSSProperties; +} + +const Appendix = (props: IProps) => { + return
附件
; +}; + +export default Appendix; diff --git a/apps/admin/src/view/Course/Create/BasicForm/index.less b/apps/admin/src/view/Course/Create/BasicForm/index.less index 45b7cb2..49741eb 100644 --- a/apps/admin/src/view/Course/Create/BasicForm/index.less +++ b/apps/admin/src/view/Course/Create/BasicForm/index.less @@ -3,7 +3,7 @@ background-size: cover; background-position: center; border-radius: 6px; - height: 100%; + height: 360px; .mask { position: absolute; left: 50%; @@ -14,16 +14,19 @@ color: #fff; text-align: center; margin: 0; + letter-spacing: 2px; &.title { background: rgba(0, 0, 0, 0.7); font-size: 22px; padding: 10px; line-height: 1.5; + border-radius: 6px 6px 0 0; } &.summary { background: rgba(0, 0, 0, 0.3); padding: 6px; line-height: 1.4; + border-radius: 0 0 6px 6px; } } } diff --git a/apps/admin/src/view/Course/Create/BasicForm/index.tsx b/apps/admin/src/view/Course/Create/BasicForm/index.tsx index 2d0c298..7892c31 100644 --- a/apps/admin/src/view/Course/Create/BasicForm/index.tsx +++ b/apps/admin/src/view/Course/Create/BasicForm/index.tsx @@ -1,34 +1,24 @@ import { InboxOutlined } from "@ant-design/icons"; -import { - Card, - Col, - Form, - Input, - message, - Row, - Upload, - UploadProps, -} from "antd"; -import { useState } from "react"; +import { Col, Form, Input, message, Row, Upload, UploadProps } from "antd"; +import { useEffect, useState } from "react"; import "./index.less"; const { Dragger } = Upload; -const { Meta } = Card; interface IProps { onChange: Function; + styles?: React.CSSProperties; } const BasicForm = (props: IProps) => { const [preview, setPreivew] = useState({ coverUrl: "", - title: "标题", - summary: "摘要", + title: "", + summary: "", }); const [form] = Form.useForm(); - const onValuesChange = (_: any, all: any) => { + const onValuesChange = (_: any, all: any) => setPreivew((p) => ({ ...p, ...all })); - }; const coverDragger: UploadProps = { name: "file", @@ -53,36 +43,12 @@ const BasicForm = (props: IProps) => { }, }; + useEffect(() => props.onChange(preview), [preview]); + return ( -
- - -
- - -

- -

-

点击或拖拽文件到此区域上传

-

支持单个或批量上传

-
-
- - - - - - -
- - +
+ +
{ }} >
-

{preview.title}

-

{preview.summary}

+

{!preview.title ? "标题" : preview.title}

+

+ {!preview.summary ? "摘要" : preview.summary}{" "} +

+ + + +

+ +

+

上传课程封面图

+

点击或拖拽文件到此处

+
+ + +
+ + + + + + +
+ +
); }; diff --git a/apps/admin/src/view/Course/Create/Chatpter/index.tsx b/apps/admin/src/view/Course/Create/Chatpter/index.tsx new file mode 100644 index 0000000..ff2fbc2 --- /dev/null +++ b/apps/admin/src/view/Course/Create/Chatpter/index.tsx @@ -0,0 +1,10 @@ +interface IProps { + onChange?: Function; + styles?: React.CSSProperties; +} + +const Chatpter = (props: IProps) => { + return
123
; +}; + +export default Chatpter; diff --git a/apps/admin/src/view/Course/Create/MediaBind.tsx b/apps/admin/src/view/Course/Create/MediaBind.tsx deleted file mode 100644 index 570af27..0000000 --- a/apps/admin/src/view/Course/Create/MediaBind.tsx +++ /dev/null @@ -1,5 +0,0 @@ -const MediaBind = () => { - return
123
; -}; - -export default MediaBind; diff --git a/apps/admin/src/view/Course/Create/index.less b/apps/admin/src/view/Course/Create/index.less index 8b3790a..ac3c6c1 100644 --- a/apps/admin/src/view/Course/Create/index.less +++ b/apps/admin/src/view/Course/Create/index.less @@ -1,6 +1,5 @@ .create-course { - display: flex; - flex-direction: column; + padding: 24px 0; .content { padding: 20px 0; flex: 1; diff --git a/apps/admin/src/view/Course/Create/index.tsx b/apps/admin/src/view/Course/Create/index.tsx index e64763d..bd31d38 100644 --- a/apps/admin/src/view/Course/Create/index.tsx +++ b/apps/admin/src/view/Course/Create/index.tsx @@ -1,5 +1,7 @@ import { Button, + Card, + Col, Form, Input, InputNumber, @@ -11,28 +13,27 @@ import { import { useState } from "react"; import Appendix from "./Appendix"; import BasicForm from "./BasicForm"; +import Chatpter from "./Chatpter"; import "./index.less"; -import MediaBind from "./MediaBind"; const CourseCreate = () => { const [current, setCurrent] = useState(0); + const [course, setCourse] = useState({ + basicInfo: {}, + }); - const onBasicFormChange = (form: any) => { - console.log(form); - }; + const onBasicFormChange = (form: any) => + setCourse((p) => ({ ...p, basicInfo: form })); const steps = [ { title: "基本信息", - content: , }, { - title: "媒体资源", - content: , + title: "章节", }, { title: "附件", - content: , }, ]; @@ -40,45 +41,40 @@ const CourseCreate = () => { return (
- -
{steps[current].content}
-
- - {current < steps.length - 1 && ( - - )} - {current === steps.length - 1 && ( - - )} -
- {/*
- - - - - - - -
*/} + + +
+ + + +
+
+ {current > 0 && ( + + )} + {current < steps.length - 1 && ( + + )} + {current === steps.length - 1 && ( + + )} +
+
); }; diff --git a/apps/admin/src/view/Course/Library/index.tsx b/apps/admin/src/view/Course/Library/index.tsx index 4640fb0..16857ae 100644 --- a/apps/admin/src/view/Course/Library/index.tsx +++ b/apps/admin/src/view/Course/Library/index.tsx @@ -48,7 +48,9 @@ const Library = () => { {record.name} {record.m3u8SubStreamList.map((item: any, index: number) => ( - {item} + + {item} + ))} @@ -160,7 +162,7 @@ const Library = () => { }); return ( -
+ @@ -197,7 +199,7 @@ const Library = () => { /> -
+ ); };