From d375ed8b0261d0ef08e0488b58a6748e6910a37f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=A2=E6=80=9D?= Date: Fri, 8 Apr 2022 15:32:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B8=AE=E5=8A=A9=E4=B8=AD=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/glcc/apply/index.jsx | 1 - src/glcc/help/index.jsx | 62 ++++++++++++++++++++++++++++++++++++++++ src/glcc/help/index.scss | 26 +++++++++++++++++ src/glcc/index.jsx | 18 ++++++++++-- 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 src/glcc/help/index.jsx create mode 100644 src/glcc/help/index.scss diff --git a/src/glcc/apply/index.jsx b/src/glcc/apply/index.jsx index 47bfc21c..ee5134d0 100644 --- a/src/glcc/apply/index.jsx +++ b/src/glcc/apply/index.jsx @@ -6,7 +6,6 @@ import './index.scss'; import TextArea from 'antd/lib/input/TextArea'; const Option = Select.Option; function Apply(props) { - console.log(props); const {form, qzDetail, enrollStatus, setReload, current_user, history} = props; const {getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form; const [imageUrl, setImageUrl] = useState(undefined); diff --git a/src/glcc/help/index.jsx b/src/glcc/help/index.jsx new file mode 100644 index 00000000..cea6ffa7 --- /dev/null +++ b/src/glcc/help/index.jsx @@ -0,0 +1,62 @@ +import React , { useCallback, useEffect , useState } from 'react'; +import { Breadcrumb, Button, Form, Icon, Input, Select, Upload } from 'antd'; +import {classify} from '../static'; +import { wikiPages, getWiki } from '../../forge/Wiki/api'; +import Axios from 'axios'; +import './index.scss'; +import TextArea from 'antd/lib/input/TextArea'; +const Option = Select.Option; +function Help(props) { + const [fileArrInit, setFileArrInit] = useState(null); + const [checkItem, setCheckItem] = useState({}); + const [itemDetail, setItemDetail] = useState({}); + + // 获取仓库wiki列表 + useEffect(()=>{ + wikiPages({ + owner: 'innov', + repo: 'PiggyMetrics22', + projectId: '1158' + }).then(res => { + if (res && res.message === "200" && Array.isArray(res.data)) { + setFileArrInit(res.data); + if (res.data.length) { + setCheckItem(res.data[0]); + }; + } else { + setFileArrInit([]); + } + }); + }, []) + + // 获取选择wiki详情 + useEffect(() => { + checkItem.name && getWiki({ + owner: 'innov', + repo: 'PiggyMetrics22', + pagename: checkItem.name, + projectId: '1158' + }).then(res => { + if (res && res.message === "200") { + setItemDetail(res.data); + } else { + showNotification("加载失败") + } + }); + }, [checkItem]); + + return( +
+
+
+ 帮助文档 + {fileArrInit && fileArrInit.map(item => { + // onClick={() => { setCheckItem(item) }} checkItem.name + return { setCheckItem(item) }}>{item.name}})} +
+
+
+
+ ) +} +export default Help; \ No newline at end of file diff --git a/src/glcc/help/index.scss b/src/glcc/help/index.scss new file mode 100644 index 00000000..3acb0888 --- /dev/null +++ b/src/glcc/help/index.scss @@ -0,0 +1,26 @@ +.glcc_help{ + background-image:linear-gradient(180deg,#ebf2ff 0%,#f2f4ff 100%); + padding: 30px 0 120px; + min-height: 85vh; + .help_main{ + width: 1200px; + margin: 0 auto; + display: flex; + } + .menuList{ + display: flex; + flex-direction: column; + width: 16%; + padding: 20px 0 25px 25px; + background-color:#f3f8ff; + border:1px solid; + border-color:#ffffff; + margin-right: 40px; + } + .wiki_title{ + cursor: pointer; + &:hover, &.active{ + color:#466aff; + } + } +} \ No newline at end of file diff --git a/src/glcc/index.jsx b/src/glcc/index.jsx index 76508eb4..8b0953d1 100644 --- a/src/glcc/index.jsx +++ b/src/glcc/index.jsx @@ -13,16 +13,21 @@ import Loading from "../Loading"; import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC"; -{/* 任务管理审核 */} +// 任务管理审核 const Home = Loadable({ loader: () => import("./home"), loading: Loading, }); -{/* 开源夏令营报名页面 */} +// 开源夏令营报名页面 const Apply = Loadable({ loader: () => import("./apply"), loading: Loading, }); +// 开源夏令营报名页面 +const Help = Loadable({ + loader: () => import("./help"), + loading: Loading, +}); const Glcc = (propsF) => { @@ -30,13 +35,20 @@ const Glcc = (propsF) => { return (
- + {/* 开源夏令营报名页面 */} ( )} > + {/* 帮助中心 */} + ( + + )} + > {/* 首页 */}