diff --git a/config/routes/competitions.ts b/config/routes/competitions.ts index 26bd5d800..821e9f550 100644 --- a/config/routes/competitions.ts +++ b/config/routes/competitions.ts @@ -11,6 +11,28 @@ export const Competitions = { //竞赛首页 path: '/competitions/exports', component: '@/pages/Competitions/Exports/', + },{ + path: '/competitions/2024/information/:id', + component: '@/pages/metting/information/detail', + }, + { + path: '/competitions/2024', + component: '@/pages/metting/banner', + routes: [ + { + path: '/competitions/2024', + component: '@/pages/metting/home', + },{ + path: '/competitions/2024/organization', + component: '@/pages/metting/organization', + },{ + path: '/competitions/2024/track/:id', + component: '@/pages/metting/track', + },{ + path: '/competitions/2024/information', + component: '@/pages/metting/information', + } + ] }, { //竞赛首页 diff --git a/config/routes/index.ts b/config/routes/index.ts index c5096bdcc..a0b2f057c 100644 --- a/config/routes/index.ts +++ b/config/routes/index.ts @@ -1,264 +1,14 @@ -import { Paperlibrary } from "./paperlibrary"; -import { Paths } from './path'; -import { Classrooms } from './classroom'; import { Competitions } from './competitions'; -import { Forums } from './forums'; -import { Problemset } from './problemset'; -import { Shiuns } from './shixuns'; -import { Users } from './users'; -import { Question } from './question'; -import { Engineering } from './engineering'; +import { Metting } from './metting'; const routes = [ - // { path: '/detail', component: '@/pages/Editor' }, { path: "/", component: "@/layouts/index", routes: [ - // Paperlibrary, - // Paths, - // Classrooms, Competitions, - // Forums, - // Problemset, - // Shiuns, - // Users, - // Question, - // Engineering, - // { - // path: '/educoder-demo', - // exact: true, - // component: '@/pages/Demo/index', - // }, - // { - // path: '/otherlogin', - // exact: true, - // component: '@/pages/User/OtherLogin', - // }, - // { - // path: '/otherloginqq', - // exact: true, - // component: '@/pages/User/QQLogin', - // }, - // { - // path: '/otherloginstart', - // exact: true, - // component: '@/pages/User/WechatLogin', - // }, - // { - // path: '/tasks/:taskId', - // exact: true, - // component: '@/pages/tasks/index', - // }, - // { - // path: '/tasks/:identifier/jupyter/', - // exact: true, - // component: '@/pages/tasks/Jupyter', - // }, - // { - // path: '/myproblems/:id/record-detail/:submitId', - // exact: true, - // component: '@/pages/MyProblem/RecordDetail', - // }, - // { - // path: '/myproblems/:id', - // exact: true, - // component: '@/pages/MyProblem/index', - // }, - // { - // path: '/login', - // component: '@/layouts/user', - // routes: [ - // { - // path: '/login', - // component: '@/pages/User/Login', - // }, - // ] - // }, - // { - // path: '/user', - // component: '@/layouts/user', - // routes: [ - // { - // path: '/user/login', - // component: '@/pages/User/Login', - // }, - // { - // path: '/user/register', - // component: '@/pages/User/Register', - // }, - // { - // path: '/user/reset-password', - // component: '@/pages/User/ResetPassword', - // }, - // ] - // }, - - // { - // path: '/account', - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { - // path: '/account/:username', - // component: '@/pages/Account', - // routes: [ - // { - // path: '/account/profile', - // component: '@/pages/Account/Profile/index', - // }, - // { - // path: '/account/profile/edit', - // component: '@/pages/Account/Profile/Edit/index', - // }, - // { - // path: '/account/certification', - // component: '@/pages/Account/Certification/index', - // }, - // { - // path: '/account/secure', - // component: '@/pages/Account/Secure/index', - // }, - // { - // path: '/account/binding', - // component: '@/pages/Account/Binding/index', - // }, - // { - // path: '/account/Results', - // component: '@/pages/Account/Results/index', - // }, - // // { - // // path: '/account/teach-group', - // // component: '@/pages/Account/TeachGroup/index', - // // }, - // ], - // }, - // ], - // }, - // { - // path: "/ch/:id", - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { - // path: "/ch/rest/edit/:categoryId/:id", - // // component:"@/pages/RestFul", - // component: "@/pages/RestFul/Edit/index", - // exact: true, - // }, { - // path: "/ch/rest/", - // exact: true, - // component: "@/pages/RestFul" - // }, { - // path: "/ch/rest/:id", - // component: "@/pages/RestFul", - // exact: true, - // } - // ] - // }, - - // { - // path: '/order', - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { - // path: '/order', - // component: '@/pages/User/Detail/Order/index', - // }, - // { - // path: '/order/:courseId/information', - // component: '@/pages/User/Detail/Order/pages/orderInformation/index', - // }, - // { - // path: '/order/:courseId/pay', - // component: '@/pages/User/Detail/Order/pages/orderPay/index', - // }, - // { - // path: '/order/:orderNum/result', - // component: '@/pages/User/Detail/Order/pages/result/index', - // }, - // ], - // }, - // { - // path: '/colleges', - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { - // path: '/colleges/:id/statistics', - // component: '@/pages/Colleges/index', - // }, - // ], - // }, - // { - // path: '/help', - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { - // path: '/help/:id', - // component: '@/pages/Help/Index', - // }, - // ], - // }, - // { - // path: '/messages', - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { - // path: '/messages/:userId/user_tidings', - // component: '@/pages/Messages/Tidings', - // }, - // { - // path: '/messages/:userId/private_messages', - // component: '@/pages/Messages/Private', - // }, - // { - // path: '/messages/:userId/message_detail', - // component: '@/pages/Messages/Detail', - // } - // ], - // }, - // { - // path: '/video', - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { - // path: '/video/:videoId', - // component: '@/pages/Video/Detail/[id]', - // } - // ], - // }, - // { - // path: "/terminal", - // component: '@/pages/Terminal/' - // }, - // { path: '/detail', component: '@/pages/Editor' }, - // { - // path: '/', - // component: '@/layouts/SimpleLayouts', - // routes: [ - // { path: '/', exact: true, component: '@/pages/index' }, - // { path: '/api/*', component: '@/pages/Api', exact: true }, - // { path: '/search', exact: true, component: '@/pages/Search/index' }, - // { path: '/moop_cases', exact: true, component: '@/pages/MoopCases/index' }, - // { path: '/moop_cases/new', exact: true, component: '@/pages/MoopCases/FormPanel' }, - // { path: '/moop_cases/:caseId', exact: true, component: '@/pages/MoopCases/InfoPanel' }, - // { path: '/moop_cases/:caseId/edit', exact: true, component: '@/pages/MoopCases/FormPanel' }, - // { path: '/moop_cases/:caseId/publish-success', exact: true, component: '@/pages/MoopCases/Success' }, - // // { path: "/randompaper", exact: true, component: "@/pages/Paperlibrary/Random/Add/index" }, - // { path: "/randompaper", exact: true, component: "@/pages/Paperlibrary/Random/AddAndEdit/index" }, - // { path: "/randompaper/edit/:id", exact: true, component: "@/pages/Paperlibrary/Random/AddAndEdit/index" }, - // // { path: "/randompaper/edit/:id", exact: true, component: "@/pages/Paperlibrary/Random/Edit/index" }, - // { path: "/randompaper/detail/:id", exact: true, component: "@/pages/Paperlibrary/Random/Detail/index" }, - // { path: '/403', component: '@/pages/HttpStatus/403' }, - // { path: '/500', component: '@/pages/HttpStatus/500' }, - // { path: '/404', component: '@/pages/HttpStatus/404' }, - // { path: '/iwce', component: '@/pages/HttpStatus/HpcCourse' }, - // { path: '/iwce/:itemname', component: '@/pages/HttpStatus/HpcCourse' }, - // { path: '/hpc-course', component: '@/pages/HttpStatus/HpcCourse' }, - // { path: '/user_agents', component: '@/pages/HttpStatus/UserAgents' }, - // { path: '/three', component: '@/pages/Three' }, - // { component: '@/pages/HttpStatus/404' } - // ], - // } + // Metting ] }, ] diff --git a/config/routes/metting.ts b/config/routes/metting.ts new file mode 100644 index 000000000..505ceda7b --- /dev/null +++ b/config/routes/metting.ts @@ -0,0 +1,29 @@ +export const Metting = { + path: '/2024', + component: '@/layouts/SimpleLayouts', + routes: [ + { + path: '/2024/information/:id', + component: '@/pages/metting/information/detail', + }, + { + path: '/2024', + component: '@/pages/metting/banner', + routes: [ + { + path: '/2024', + component: '@/pages/metting/home', + },{ + path: '/2024/organization', + component: '@/pages/metting/organization', + },{ + path: '/2024/track/:id', + component: '@/pages/metting/track', + },{ + path: '/2024/information', + component: '@/pages/metting/information', + } + ] + } + ], + } \ No newline at end of file diff --git a/package.json b/package.json index ab76bbe01..9847a9a83 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "animate.css": "4.1.1", "antd": "4.6.1", "array-move": "3.0.1", + "axios": "^1.6.8", "checkapi.js": "^0.1.2", "code-prettify": "0.1.0", "codemirror": "5.58.2", diff --git a/public/font/YouSheBiaoTiHei-2.ttf b/public/font/YouSheBiaoTiHei-2.ttf new file mode 100644 index 000000000..3729151a2 Binary files /dev/null and b/public/font/YouSheBiaoTiHei-2.ttf differ diff --git a/src/components/RenderHtml/index.tsx b/src/components/RenderHtml/index.tsx index c11bfc16b..852d8979f 100755 --- a/src/components/RenderHtml/index.tsx +++ b/src/components/RenderHtml/index.tsx @@ -5,7 +5,7 @@ import marked, { cleanToc, getMathExpressions, resetMathExpressions, - lines, + lines } from '@/utils/marked'; import 'code-prettify'; import Hls from 'hls.js'; @@ -37,21 +37,8 @@ export default ({ }: IProps) => { let str = String(value); const [data, setData] = useState("") - + const html = useMemo(() => { - try { - const reg = /\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g; - const reg2 = /\"\/api\/attachments\/|\"\/attachments\/download\//g; - const reg3 = /\(\s+\/files\/uploads\/|\(\/files\/uploads\//g; - str = str.replace(reg, "(" + ENV.API_SERVER + "/api/attachments/") - .replace(reg2, '"' + ENV.API_SERVER + "/api/attachments/") - .replace(reg3, '"' + ENV.API_SERVER + "/files/uploads/") - .replaceAll("http://video.educoder", "https://video.educoder") - .replaceAll("http://www.educoder.net/api", "https://data.educoder.net/api") - .replaceAll("https://www.educoder.net/api", "https://data.educoder.net/api") - .replace(/\r\n/g,"\n") - str = str.replace(new RegExp("(? { + getDirList().then((res) => { + if (res && res.rows.length > 0) { + let idList = {} + res.rows.map(e => { + idList[e.name] = e.id + }) + setDirList(idList); + } + }); + getBaseInfo().then(result => { + setMainInfo(result.data); + }).catch(console.error()) + }, []); + + return { + dirList,mainInfo + }; +}; \ No newline at end of file diff --git a/src/pages/Colleges/index.less b/src/pages/Colleges/index.less deleted file mode 100755 index c4f2f155f..000000000 --- a/src/pages/Colleges/index.less +++ /dev/null @@ -1,215 +0,0 @@ -@import '../../global.less'; - -.bg { - background: rgba(250, 250, 250, 1); - margin-bottom: 80px; -} - -.header { - height: 240px; - .flex_box_container(); - flex-direction: row; - justify-content: center; - background-image: url('../../assets/images/statistics.jpg'); - background-size: cover; - background-position: center; - background-repeat: no-repeat; - - div[class~='ant-row'] { - width: 100%; - } -} - -.headerContent { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - max-width: 1300px; - width: 1300px; - height: 100%; -} - -.headTitle { - flex: 1 1; - display: flex; - align-items: center; - color: #4cacff; - font-size: 32px; -} - -.headItemTitle { - color: #989898; - font-size: 14px; - margin-bottom: 10px; -} - -.headItemValue { - font-size: 24px; - color: #fff; - margin-bottom: 10px; -} - -.wrap { - width: 1300px; - background-color: #fff; - margin: 0px auto; - margin-top: 30px; - - ul[class~='ant-pagination'] { - width: 100%; - text-align: center; - } - - [class~='ant-table-row'] { - [class~='ant-table-cell'] { - color: #05101a; - } - } -} - -.basicTitle { - line-height: 1.2; - padding: 2rem 1.25rem; - border-bottom: unset; - background: #fff; - font-size: 1.5rem; - font-weight: 500; -} - -.basicHead { - background: #fff; - display: flex; - flex-direction: row; - align-items: center; - width: 100%; - - p { - width: 217px; - text-align: center; - font-size: 16px; - height: 48px; - line-height: 48px; - color: #686868; - background: #f5f5f5; - border-top: 1px solid #ebebeb; - margin-top: 0; - margin-bottom: 0px; - } -} - -.basicContent { - background: #fff; - display: flex; - flex-direction: row; - align-items: center; -} - -.basicItem { - width: 217px; - text-align: center; - height: 100px; - line-height: 100px; - background: #ffffff; - border-top: 1px solid #ebebeb; - border-bottom: 1px solid #ebebeb; - color: #000000; - font-size: 24px; -} - -.basicItemText { - color: #000000; - margin-left: 5px; - font-size: 16px; -} - -.courseLoading { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - height: 500px; -} - -.maxWidth220 { - max-width: 220px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -.maxWidth340 { - max-width: 340px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -.maxWidth175 { - max-width: 175px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -.maxWidth225 { - max-width: 225px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -.maxWidth255 { - max-width: 255px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -.maxWidth105 { - max-width: 105px; - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; - cursor: default; -} - -.colorFFC { - color: #ffc107; -} - -.colorBlack { - color: rgb(5, 16, 26); -} - -.colorGreen { - color: rgb(23, 162, 184); -} - -.color4CA { - color: #4cacff; -} - -.rankLeft { - width: 63%; -} - -.rankRight { - width: 37%; -} - -.flexRow { - display: flex; - flex-direction: row; -} diff --git a/src/pages/Colleges/index.tsx b/src/pages/Colleges/index.tsx deleted file mode 100755 index 58cbab365..000000000 --- a/src/pages/Colleges/index.tsx +++ /dev/null @@ -1,549 +0,0 @@ -import React, { FC, useEffect, useState } from 'react'; -import { - ShixunsDetailModelState, - GlobalSettingModelState, - ConnectProps, - Loading, - connect, - Dispatch, - useParams -} from 'umi'; -import { Row, Col, Spin, Table ,Pagination} from "antd"; -import NoData from '@/components/NoData'; -import { - getCollegesStatistics, getShixunReportCount, getShixunTime, getCourseStatistics, - getTeacherRanking, getStudentRanking, getShixunChart, getStudentHot -} from '@/service/colleges'; -import { - teacherRankingColums, studentRankingColums, - getTeacherRankingEchartOption, getStudentRankingEchartOption -} from './utils'; -import ReactEcharts from "echarts-for-react"; -import styles from "./index.less"; -import { setDocumentTitle } from '@/utils/util' - -interface PageProps extends ConnectProps { - shixunsDetail: ShixunsDetailModelState; - globalSetting: GlobalSettingModelState; - loading: boolean; - dispatch: Dispatch; -} - -const CollegesPage: FC = ({ - shixunsDetail, - globalSetting, - loading, - dispatch, - ...props -}) => { - const params = useParams(); - const [headData, setHeadData] = useState({}); - const [shixunReportCount, setShixunReportCount] = useState(); - const [shixunTime, setShixunTime] = useState(); - const [courseStatistics, setCourseStatistics] = useState(); - const [teacherRanking, setTeacherRanking] = useState(); - const [studentRanking, setStudentRanking] = useState(); - const [shixunChartData, setShixunChartData] = useState(); - const [shixunChartDataName, setshixunChartDataName] = useState(); - const [studentHotValue, setStudentHotValue] = useState(); - const [studentHotName, setStudentHotName] = useState(); - const [page, setPage] = useState(1); - const [isLoadingCourse, setIsLoadingCourse] = useState(false); - const [isLoadingTeacher, setIsLoadingTeacher] = useState(false); - const [isLoadingStudent, setIsLoadingStudent] = useState(false); - - useEffect(() => { - setDocumentTitle('学院统计') - if (!params.id) { - return; - } - - getHeadData(); - getShixunReportCountData(); - getShixunTimeData(); - getTeacherRankingData(1, 10); - getStudentRankingData(1, 10); - getShixunChartData(); - getStudentHotData(); - getCourseStatisticsData(1, 10); - - - }, [params.id]); - - - - - - const getHeadData = async () => { - const res = await getCollegesStatistics({ id: params.id }); - setDocumentTitle(res?.school || '头歌实践教学平台') - setHeadData(res || {}); - } - - const getShixunReportCountData = async () => { - const res = await getShixunReportCount({ id: params.id }); - setShixunReportCount(res?.shixun_report_count || 0); - } - - const getShixunTimeData = async () => { - const res = await getShixunTime({ id: params.id }); - setShixunTime(res?.shixun_time || 0); - } - - const getCourseStatisticsData = async (page: number, per_page: number) => { - setIsLoadingCourse(true); - const res = await getCourseStatistics({ id: params.id, page, per_page,...params }).catch(e => setIsLoadingCourse(false)); - setIsLoadingCourse(false); - setCourseStatistics(res || []); - } - - const getTeacherRankingData = async (page: number, per_page: number) => { - setIsLoadingTeacher(true); - const res = await getTeacherRanking({ id: params.id, page, per_page }).catch(e => setIsLoadingTeacher(false)); - setIsLoadingTeacher(false); - setTeacherRanking(res || []); - } - - const getStudentRankingData = async (page: number, per_page: number) => { - setIsLoadingStudent(true); - const res = await getStudentRanking({ id: params.id, page, per_page }).catch(e => setIsLoadingStudent(false)); - setIsLoadingStudent(false); - setStudentRanking(res || []); - } - - const getShixunChartData = async () => { - const res = await getShixunChart({ id: params.id }); - setShixunChartData(res?.data || []); - setshixunChartDataName(res?.names || []); - } - - const getStudentHotData = async () => { - const res = await getStudentHot({ id: params.id }); - setStudentHotValue(res?.values || []); - setStudentHotName(res?.names || []); - } - - const courseStatisticsColums: any = [ - { - title: '名称', - dataIndex: 'name', - key: 'name', - align: 'center', - className: styles.maxWidth220, - render: (text: any, record: any) => ( - - { - record.name - } - - ) - }, - { - title: '管理教师', - dataIndex: 'teachers', - key: 'teachers', - align: 'center', - className: styles.maxWidth340, - render: (text: any, record: any) => ( - - { - record.teachers - } - - ) - }, - { - title: '评测次数', - dataIndex: 'times', - key: 'evaluating_count', - align: 'center', - sorter: true, - showSorterTooltip: false, - sortOrder:params.sort_name === "evaluating_count" ? (params.sort === 2 ? "descend" : "ascend") : null, - className: styles.maxWidth175, - render: (text: any, record: any) => ( - - { - record.evaluating_count - } - - ), - }, - { - title: '学生', - key: 'student_count', - dataIndex: 'student', - align: 'center', - sorter: true, - showSorterTooltip: false, - sortOrder:params.sort_name === "student_count" ? (params.sort === 2 ? "descend" : "ascend") : null, - className: styles.maxWidth225, - render: (text: any, record: any) => ( - - { - record.student_count - } - - ) - }, - { - title: '实训作业', - dataIndex: 'training', - key: 'shixun_work_count', - align: 'center', - sorter: true, - showSorterTooltip: false, - sortOrder:params.sort_name === "shixun_work_count" ? (params.sort === 2 ? "descend" : "ascend") : null, - render: (text: any, record: any) => ( - - { - record.shixun_work_count - } - - ) - - }, - { - title: '资源', - dataIndex: 'resources', - key: 'attachments_count', - align: 'center', - sorter: true, - showSorterTooltip: false, - sortOrder:params.sort_name === "attachments_count" ? (params.sort === 2 ? "descend" : "ascend") : null, - render: (text: any, record: any) => ( - - - - { - record?.attachments_count - } - - ), - }, - { - title: '帖子', - dataIndex: 'posts', - key: 'message_count', - align: 'center', - sorter: true, - showSorterTooltip: false, - sortOrder:params.sort_name === "message_count" ? (params.sort === 2 ? "descend" : "ascend") : null, - render: (text: any, record: any) => ( - - { - record.message_count - } - - ) - }, - { - title: '其它任务', - dataIndex: 'othertasks', - key: 'other_work_count', - align: 'center', - sorter: true, - showSorterTooltip: false, - sortOrder:params.sort_name === "other_work_count" ? (params.sort === 2 ? "descend" : "ascend") : null, - render: (text: any, record: any) => ( - - { - record.other_work_count - } - - ) - }, - { - title: '状态', - dataIndex: 'states', - key: 'states', - align: 'center', - render: (text: any, record: any) => ( - - { - record.is_end ? - "已结束" : - "正在进行" - } - - ) - }, - { - title: '最新活跃时间', - dataIndex: 'timemy', - key: 'activity_time', - align: 'center', - sorter: true, - showSorterTooltip: false, - sortOrder:params.sort_name === "activity_time" ? (params.sort === 2 ? "descend" : "ascend") : null, - render: (text: any, record: any) => ( - - { - record.activity_time - } - - ) - }, - ]; - - return
-
-
-
{headData?.school}
- - -

教师

-

{headData?.teachers_count || 0}

- - -

学生

-

{headData?.students_count || 0}

- - -

课堂

-

{headData?.courses_count || 0}

- - -

共建实训

-

{headData?.shixuns_count || 0}

- -
-
-
- -
-
基本使用情况
-
-

教师

-

学生

-

课堂

-

共建实训

-

实训报告

-

学员实战时间

-
-
-
- { - headData?.teachers_count || headData?.teachers_count === 0 ? - <> - {headData?.teachers_count} - - : - - } -
-
- { - headData?.students_count || headData?.students_count === 0 ? - <> - {headData?.students_count} - - : - - } -
-
- { - headData?.courses_count || headData?.courses_count === 0 ? - <> - {headData?.courses_count} - - : - - } -
-
- { - headData?.shixuns_count || headData?.shixuns_count === 0 ? - <> - {headData?.shixuns_count} - - : - - } -
-
- { - shixunReportCount || shixunReportCount === 0 ? - <> - {shixunReportCount} - - : - - } -
-
- { - shixunTime || shixunTime === 0 ? - <> - {shixunTime} - 分钟 - : - - } -
-
-
- -
-
课堂
- { - !courseStatistics && -
- -
- } - { - courseStatistics && - ( - courseStatistics?.courses?.length ? - { - params.sort_name=c?.columnKey; - if (c.order === 'ascend') params['sort'] = 1; - if (c.order === 'descend') params['sort'] = 2; - if (!c.order) { - params['sort'] = 1 - }; - setPage(1); - getCourseStatisticsData(1,10); - }} - pagination={false} - // pagination={{ - // current: page, - // pageSize: 10, - // showQuickJumper: true, - // showSizeChanger: false, - // total: courseStatistics?.course_count, - // onChange: (page, pageSize) => { - // setPage(page); - // getCourseStatisticsData(page, 10); - // } - // }} - /> : - - - ) - } - { - setPage(page); - getCourseStatisticsData(page, 10); - }} - /> - - -
-
-
教师排名
- { - !teacherRanking && -
- -
- } - { - teacherRanking && - ( - teacherRanking?.teachers?.length ? -
: - - ) - } - -
-
在线实训情况
- { - !shixunChartData && -
- -
- } - { - shixunChartData && - ( - shixunChartData?.length ? - : - - ) - } -
- - -
-
-
学生排名
- { - !studentRanking && -
- -
- } - { - studentRanking && - ( - studentRanking?.teachers?.length ? -
: - - ) - } - -
-
最热评测
- { - !studentHotName && -
- -
- } - { - studentHotName && - ( - studentHotName?.length ? - : - - ) - } -
- - -}; - -export default connect(({ - shixunsDetail, - loading, - globalSetting -}: { - shixunsDetail: ShixunsDetailModelState; - loading: Loading; - globalSetting: GlobalSettingModelState; -}) => ({ - shixunsDetail, - globalSetting, - loading: loading.models.index, -}))(CollegesPage); diff --git a/src/pages/Colleges/utils.tsx b/src/pages/Colleges/utils.tsx deleted file mode 100644 index adabb7e6d..000000000 --- a/src/pages/Colleges/utils.tsx +++ /dev/null @@ -1,351 +0,0 @@ -import React from 'react'; -import ENV from '@/utils/env'; -import styles from './index.less'; - - - -export const teacherRankingColums: any = [ - { - title: '排名', - dataIndex: 'ranking', - key: 'ranking', - align: 'center', - render: (text: any, record: any, index: number) => ( - index + 1 - ) - }, - { - title: '姓名', - dataIndex: 'name', - key: 'name', - align: 'center', - className: styles.maxWidth105, - render: (text: any, record: any) => ( - - { - record.name - } - - ) - }, - { - title: '管理课堂', - dataIndex: 'classroom', - key: 'classroom', - align: 'center', - className: styles.maxWidth175, - render: (text: any, record: any) => ( - - { - record.course_count - } - - ), - }, - { - title: '已发布实训作业', - key: 'assignment', - dataIndex: 'assignment', - align: 'center', - className: styles.maxWidth255, - render: (text: any, record: any) => ( - - { - record.shixun_work_count - } - - ) - }, - { - title: '未发布实训作业', - dataIndex: 'released', - key: 'released', - align: 'center', - render: (text: any, record: any) => ( - - { - record.un_shixun_work_count - } - - ) - - }, - { - title: '学生数', - dataIndex: 'studentnumber', - key: 'studentnumber', - align: 'center', - render: (text: any, record: any) => ( - - { - record.student_count - } - - ), - }, - { - title: '完成率', - dataIndex: 'completionrate', - key: 'completionrate', - align: 'center', - render: (text: any, record: any) => ( - - { - record.complete_rate + "%" - } - - ) - }, - { - title: '发布实训', - dataIndex: 'releasetraining', - key: 'releasetraining', - align: 'center', - render: (text: any, record: any) => ( - - { - record.publish_shixun_count - } - - ) - } -]; - -const renderStudentRanking = (key: number) => { - const image = `${ENV.IMG_SERVER}/images/educoder/competition/${key}.png`; - const mapping: any = { - 1: , - 2: , - 3: , - } - - return mapping[key] || key; -} - -export const studentRankingColums: any = [ - { - title: '排名', - dataIndex: 'ranking', - key: 'ranking', - align: 'center', - className: "edu-txt-center font-14", - width: '100px', - render: (text: any, record: any, index: number) => ( - - { - renderStudentRanking(index + 1) - } - - ) - }, - { - title: '姓名', - dataIndex: 'name', - key: 'name', - align: 'center', - className: styles.maxWidth105, - render: (text: any, record: any) => ( - - { - record.name - } - - ) - }, - { - title: '学号', - dataIndex: 'studentid', - key: 'studentid', - align: 'center', - className: styles.maxWidth175, - render: (text: any, record: any) => ( - - { - record.student_id - } - - ), - }, - { - title: '完成实训', - key: 'training', - dataIndex: 'training', - align: 'center', - className: styles.maxWidth225, - render: (text: any, record: any) => ( - - { - record.shixun_count - } - - ) - }, - { - title: '在学实训', - dataIndex: 'learning', - key: 'learning', - align: 'center', - render: (text: any, record: any) => ( - - { - record.study_shixun_count - } - - ) - - }, - { - title: '金币', - dataIndex: 'goldcoin', - key: 'goldcoin', - align: 'center', - render: (text: any, record: any) => ( - - { - record.grade - } - - ), - }, - { - title: '经验值', - dataIndex: 'empirical', - key: 'empirical', - align: 'center', - render: (text: any, record: any) => ( - - { - record.experience - } - - ) - }, -]; - -export const getTeacherRankingEchartOption = (data: any[] = [], dataName: any[] = []) => { - return { - tooltip: { - trigger: 'item', - formatter: "{d}%
" - }, - legend: { - bottom: 50, - left: 'center', - data: dataName - }, - series: [ - { - type: 'pie', - radius: '65%', - center: ['50%', '35%'], - selectedMode: 'single', - data: data, - itemStyle: { - emphasis: { - shadowBlur: 10, - shadowOffsetX: 0, - shadowColor: 'rgba(0, 0, 0, 0.5)' - } - } - } - ] - } -} - -export const getStudentRankingEchartOption = (names: any[] = [], values: any[] = []) => { - const colorList = ['#962e66', '#623363', '#CCCCCC', '#9A9A9A', '#FF8080', '#FF80C2', '#B980FF', '#80B9FF', '#6FE9FF', '#4DE8B4', '#F8EF63', '#FFB967']; - - return { - backgroundColor: '#fff', - grid: { - left: '3%', - right: '8%', - bottom: '15%', - containLabel: true - }, - - tooltip: { - show: "true", - trigger: 'item', - formatter: '{c0}', - backgroundColor: 'rgba(0,0,0,0.7)', // 背景 - padding: [8, 10], //内边距 - extraCssText: 'box-shadow: 0 0 3px rgba(255, 255, 255, 0.4);', //添加阴影 - axisPointer: { // 坐标轴指示器,坐标轴触发有效 - type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' - } - }, - xAxis: { - type: 'value', - axisTick: { - show: false - }, - axisLine: { - show: true, - lineStyle: { - color: '#CCCCCC' - } - }, - splitLine: { - show: false, - lineStyle: { - color: '#CCCCCC' - } - }, - axisLabel: { - textStyle: { - color: '#656565', - fontWeight: 'normal', - fontSize: '12' - }, - formatter: '{value}' - } - }, - yAxis: { - type: 'category', - axisLine: { - lineStyle: { - color: '#cccccc' - } - }, - splitLine: { - show: false - }, - axisTick: { - show: false - }, - splitArea: { - show: false - }, - axisLabel: { - inside: false, - textStyle: { - color: '#656565', - fontWeight: 'normal', - fontSize: '12' - } - }, - data: names - }, - series: [{ - name: '', - type: 'bar', - itemStyle: { - normal: { - show: true, - color: function (params: any) { - return colorList[params.dataIndex] - }, - barBorderRadius: 50, - borderWidth: 0, - borderColor: '#333' - } - }, - barGap: '0%', - barCategoryGap: '50%', - data: values - } - - ] - } -} \ No newline at end of file diff --git a/src/pages/Competitions/Index/index.tsx b/src/pages/Competitions/Index/index.tsx index 22217b4ae..f7f4a25ea 100755 --- a/src/pages/Competitions/Index/index.tsx +++ b/src/pages/Competitions/Index/index.tsx @@ -89,7 +89,7 @@ const competitionsIndexPage: FC = ({ // getHomeNotice(); dispatch({ type: 'competitions/getList', - payload: { ...competitions.listParams}, + payload: { ...competitions.listParams,external:"gitlink"}, }); }, [competitions.name]); useEffect(() => { @@ -412,6 +412,7 @@ const competitionsIndexPage: FC = ({ competitions.listParams.page = 1; competitions.listParams.category = v; competitions.listParams.page = 1; + competitions.listParams.external = "gitlink"; dispatch({ type: 'competitions/getList', payload: { ...competitions.listParams }, diff --git a/src/pages/MoopCases/FormPanel/MoopForm.tsx b/src/pages/MoopCases/FormPanel/MoopForm.tsx deleted file mode 100644 index 75d0e37e6..000000000 --- a/src/pages/MoopCases/FormPanel/MoopForm.tsx +++ /dev/null @@ -1,186 +0,0 @@ -import React, { useEffect, useState } from 'react' -import { Input, Form, Button, Checkbox, Upload, message, Modal } from 'antd' -import { InboxOutlined } from '@ant-design/icons' -import ENV from '@/utils/env' -import { Tag } from '../index' -import MarkdownEditor from '@/components/markdown-editor' - -const CheckboxGroup = Checkbox.Group -const { Dragger } = Upload - -function getBase64(img: any, callback: any) { - const reader = new FileReader() - reader.addEventListener('load', () => callback(reader.result)) - reader.readAsDataURL(img) -} - -interface IMoopCase { - callback: any - tags: Array - initialValues: any - removeAttachment: (id: any) => Promise -} - -export default ({ callback, tags = [], initialValues = {}, removeAttachment }: IMoopCase) => { - const [uploadUrl, setUploadUrl] = useState('') - const [form] = Form.useForm() - function onSubmit(values: any) { - const { cover_id, attachment_ids, ...rest } = values - callback({ - ...rest, - cover_id: cover_id?.map((item: any) => item.response ? item.response.id : item.uid)[cover_id?.length -1], - attachment_ids: attachment_ids ? attachment_ids?.map((item: any) => item.response ? item.response.id : item.uid) : [] - }) - } - - function normFile(e) { - if (Array.isArray(e)) { - return e - } - return e && e.fileList - } - const uploadProps = { - multiple: true, - beforeUpload: (file: any) => { - const isLt150M = file.size / 1024 / 1024 < 100 - if (!isLt150M) { - message.error('该文件无法上传。超过文件大小限制(100MB),建议上传到百度云等其它共享工具里,然后再txt文档里给出链接以及共享密码并上传') - return isLt150M - } - }, - action: `${ENV.API_SERVER}/api/attachments.json`, - onRemove: (file: any) => { - Modal.confirm({ - centered: true, - okText: '确定', - cancelText: '取消', - content: '是否确认删除?', - onOk: () => { - return removeAttachment(file.response ? file.response.id : file.uid) - }, - onCancel: () => { - return false - } - }) - } - } - - function onChangeCoverUrl(info: any) { - if (info.file.status === 'done') { - getBase64(info.file.originFileObj, (imageUrl: string) => - setUploadUrl(imageUrl) - ) - } - } - - const uploadCoverProps = { - showUploadList: false, - withCredentials:true, - action: `${ENV.API_SERVER}/api/attachments.json`, - - onChange: onChangeCoverUrl - } - - useEffect(() => { - if (initialValues.title) { - form.setFieldsValue(initialValues) - if(initialValues.cover_id.length>0){ - setUploadUrl( ENV.IMG_SERVER + initialValues.cover_id[0].url) - } - } - }, [initialValues]) - - - return ( -
- 简明扼要介绍文档/视频所包含的主要的内容

} - rules={[{ required: true, message: '请输入标题' }]} - > - -
- -
- - - - - - -
- - - - {tags.map(t => {t.name} )} - - - - - 是否申请发布 - - - - - - - - -

上传附件

-

从我的电脑选择要上传的文档:按住CTRL可以上传多份文档。单个文件最大限制:100MB

-
-
- - - - {uploadUrl ? : } - - - -
-

审核说明

-

平台管理员将对每天新上传的文档进行审核,审核通过的文档将公开显示,否则将私有化或移除

-
- -
-

温馨提示

-
    -
  • 1.请勿上传已设置加密口令的文档资源;
  • -
  • 2.可以上传符合教学案例标准的文档资料,如 - 案例入库标准 案例使用说明书以及其他资料等,上传支持的文件最大容量:100MB;
  • -
  • 3.请确保上传内容无侵权或违反国家关于互联网政策的不良行为;
  • -
  • 4.请使用Chrome,Firefox,Safari,IE11(及以上版本)浏览器;
  • -
-
- - - - - - - ) -} diff --git a/src/pages/MoopCases/FormPanel/index.less b/src/pages/MoopCases/FormPanel/index.less deleted file mode 100644 index 525f1cf52..000000000 --- a/src/pages/MoopCases/FormPanel/index.less +++ /dev/null @@ -1,22 +0,0 @@ -.moop-panel { - width: 1200px; - margin: 0 auto; - background: #fff; - padding: 30px; - - .tip { - margin-top: 10px; - color: #ccc; - } - - .upload-cover { - width: 120px; - height: 90px; - display: flex; - flex-flow: column nowrap; - justify-content: center; - border: 1px dashed #ccc; - font-size: 24px; - margin-bottom: 10px; - } -} diff --git a/src/pages/MoopCases/FormPanel/index.tsx b/src/pages/MoopCases/FormPanel/index.tsx deleted file mode 100644 index 0b498c81d..000000000 --- a/src/pages/MoopCases/FormPanel/index.tsx +++ /dev/null @@ -1,147 +0,0 @@ -import React, { useEffect, useReducer } from 'react' -import { Spin } from 'antd' -import '../InfoPanel/index.less' -import './index.less' - -import { Tag } from '../index' - -import { Link, useParams, useHistory } from 'umi' -import MoopForm from './MoopForm' -import { getMoopCase, getLibraryTags, removeAttachment, addMoopCase, updateMoopCase } from './service' - -interface IState { - loading: boolean - data: any - tags: Array -} - -const initialState: IState = { - loading: false, - data: {}, - tags: [] -} - -enum Types { - GET_DATA, - SET_LOADING, - GET_TAGS -} - -function reducer(state: IState, action: any) { - switch (action.type) { - case Types.GET_DATA: - return { ...state, ...action.payload } - case Types.GET_TAGS: - return { ...state, tags: action.payload } - case Types.SET_LOADING: - return { ...state, loading: action.payload } - default: - throw new Error() - } -} - -export default () => { - const { caseId } = useParams() - const history = useHistory() - const [state, dispatch] = useReducer(reducer, initialState) - const { loading, tags, data } = state - - useEffect(() => { - async function init() { - const response = await getLibraryTags() - dispatch({ - type: Types.GET_TAGS, - payload: response.library_tags - }) - } - init() - }, []) - - useEffect(() => { - let didCancel = false - async function init() { - dispatch({ type: Types.SET_LOADING, payload: false }) - let response = await getMoopCase(caseId) - const { author_name, author_school_name, content, cover, attachments, status, title, tags } = response - if (!didCancel) { - if (response.status === 404) { - history.push('/moop_cases') - } else { - dispatch({ - type: Types.GET_DATA, - payload: - { - data: { - title, - author_name, - author_school_name, - content, - tag_ids: tags.map((item: any) => item.id), - publish: status === 'published', - attachment_ids: attachments.map((item: any) => { - return { - uid: item.id, - id: item.id, - name: item.title, - url: item.url, - filesize: item.filesize, - status: 'done' - } - }), - cover_id:cover?.id?[{ - uid: cover?.id, - id: cover?.id, - name: cover?.title, - url: cover?.url, - filesize: cover?.filesize, - status: 'done' - }]:[], - }, - loading: false - } - }) - } - } - } - if (!didCancel && caseId) { - init() - } - return () => { - didCancel = true - } - }, [caseId]) - - async function onUpdateCase(values: any) { - if (caseId) { - await updateMoopCase(caseId, values) - history.push(`/moop_cases/${caseId}/publish-success`) - } else { - const { id } = await addMoopCase(values) - if (id) { - history.push(`/moop_cases/${id}/publish-success`) - } - } - } - - const moopFormProps = { - initialValues: data, - tags, - removeAttachment, - callback: onUpdateCase - } - return ( - -
-
- 教学案例 > - 新建 -
-
-

上传教学案例

- 返回 -
- -
-
- ) -} \ No newline at end of file diff --git a/src/pages/MoopCases/FormPanel/service.ts b/src/pages/MoopCases/FormPanel/service.ts deleted file mode 100644 index 733d05cc4..000000000 --- a/src/pages/MoopCases/FormPanel/service.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { get, post, del, put } from '@/utils/fetch' - -export function getMoopCase(id: number) { - return get(`libraries/${id}.json`) -} - -export function getLibraryTags() { - return get('library_tags.json') -} - -export async function removeAttachment(id: number) { - const response = await del(`attachments/${id}.json`) - return response.status === 0 -} - -export function addMoopCase(params: any) { - return post(`libraries.json`, params) -} - -export function updateMoopCase(id: number, params: any) { - return put(`libraries/${id}.json`, params) -} \ No newline at end of file diff --git a/src/pages/MoopCases/InfoPanel/index.less b/src/pages/MoopCases/InfoPanel/index.less deleted file mode 100644 index b78aa9325..000000000 --- a/src/pages/MoopCases/InfoPanel/index.less +++ /dev/null @@ -1,119 +0,0 @@ -.moop-info { - width: 1200px; - margin: 0 auto; - - .crumb { - margin: 10px 0 20px 0; - line-height: 20px; - } - - h2 { - font-size: 22px; - line-height: 40px; - display: flex; - flex-flow: row nowrap; - align-items: center; - } - - .title { - overflow: hidden; - display: flex; - flex-flow: row nowrap; - align-items: center; - justify-content: space-between; - - a { - font-size: 14px; - text-align: right; - } - } -} - -.moop-info-body { - padding: 30px; - background: #fff; - - .attachment { - list-style: none; - margin: 10px 0 0 0; - padding: 0; - - .iconfont { - color: #29bd8b; - margin-right: 10px; - } - - a { - display: flex; - flex-flow: row nowrap; - align-items: center; - color: rgba(0, 0, 0, 0.65); - - span { - margin-right: 10px; - } - } - } - - .sum { - width: 100%; - color: #999; - display: flex; - flex-flow: row nowrap; - align-items: center; - font-size: 14px; - - span:first-child { - flex: 1 0 auto; - } - - span { - margin-right: 15px; - } - } - - .desc { - font-size: 16px; - flex: 1 0 auto; - - .flex-container > span { - flex: 1 0 auto; - } - } -} - -.moop-sub-title { - display: flex; - flex-flow: row nowrap; - align-items: center; - - img { - border-radius: 25px; - margin-right: 15px; - } - - margin-bottom: 10px; -} - -.praise { - width: 70px; - height: 70px; - background-color: #4cacff; - border-radius: 50%; - color: #fff; - text-align: center; - margin: 20px auto; - cursor: pointer; - line-height: 22px; - border: 0px solid transparent; - outline: none; - display: block; - - span { - display: block; - } - - &:disabled { - background: #bcd1e3; - } -} diff --git a/src/pages/MoopCases/InfoPanel/index.tsx b/src/pages/MoopCases/InfoPanel/index.tsx deleted file mode 100644 index 837be53ed..000000000 --- a/src/pages/MoopCases/InfoPanel/index.tsx +++ /dev/null @@ -1,161 +0,0 @@ -import React, { useReducer, useEffect } from 'react' -import { Spin, Button, Popconfirm } from 'antd' -import { useParams, Link, useHistory } from 'umi' -import { get, post, del } from '@/utils/fetch' -import { Tag } from '../index' -import Env from '@/utils/env' -import RenderHtml from '@/components/RenderHtml' -import './index.less' -import '../label.css' - -interface State { - data: any, -} - -const initialState: State = { - data: undefined, -} - -export enum Types { - GET_DATA = 'get-data', - PRAISE = 'on-praise' -} - -function reducer(state: State, action: any) { - switch (action.type) { - case Types.GET_DATA: - return { ...state, data: action.payload } - case Types.PRAISE: - return { ...state, data: action.payload } - default: - throw new Error() - } -} - -export default () => { - const [state, dispatch] = useReducer(reducer, initialState) - const { data } = state - const { caseId } = useParams() - const history = useHistory() - - useEffect(() => { - let didCancel = false - async function init() { - const response = await get(`libraries/${caseId}.json`) - if (!didCancel) { - if (response.status === 404) { - history.push('/moop_cases') - } else { - - dispatch({ - type: Types.GET_DATA, - payload: response, - }) - } - } - } - if (!didCancel) { - init() - } - return () => { - didCancel = true - } - }, [caseId]) - - async function onPraise() { - await post(`praise_tread/like.json`, { - object_id: caseId, - object_type: "library" - }) - let rs = { ...data } - rs.operation.user_praised = true - rs.praise_count += 1 - - dispatch({ - type: Types.PRAISE, - payload: rs - }) - } - - async function onDeleteCase() { - await del(`/libraries/${caseId}.json`) - history.push('/moop_cases') - } - - return ( - - {data ? -
-
- 教学案例 > - {data.title} -
-
-

- {data.title} - {data.tags?.map((tag: Tag, index: number) => - {tag.name} - )} -

- 返回 -
-
- -
- cover -
-
- {data.creator?.name} - {data.operation?.can_editable ? - - - - : null} - {data.operation?.can_deletable ? - - - - : null} -
-
- {data.creator?.school_name} - 编码:{data.uuid} - 发布时间:{data.published_at} -
-
-
-

作者:{`${data.author_name} / ${data.author_school_name}`}

- - - -
-
: null} -
- ) -} \ No newline at end of file diff --git a/src/pages/MoopCases/Success/index.less b/src/pages/MoopCases/Success/index.less deleted file mode 100644 index 20e013d41..000000000 --- a/src/pages/MoopCases/Success/index.less +++ /dev/null @@ -1,28 +0,0 @@ -.moop-case-success { - width: 1200px; - height: 570px; - margin: 20px auto 40px auto; - background: #fff; - display: flex; - flex-flow: column nowrap; - align-items: center; - justify-content: center; - text-align: center; - - .notice { - margin: 20px auto; - color: #999; - font-size: 16px; - } - - p { - font-size: 24px; - margin: 0; - font-weight: bold; - color: #333; - } - - img { - margin-bottom: 20px; - } -} diff --git a/src/pages/MoopCases/Success/index.tsx b/src/pages/MoopCases/Success/index.tsx deleted file mode 100644 index 26253a9fe..000000000 --- a/src/pages/MoopCases/Success/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react' -import OkUrl from './ok.png' -import { Button } from 'antd' -import { Link, useParams } from 'umi' -import './index.less' - -export default () => { - const { caseId } = useParams() - return ( -
- ok -

恭喜!

-

提交成功

-
- 平台正在审核您的申请,审核结果将以平台消息的形势通知您 -
-
- - -
-
- ) -} \ No newline at end of file diff --git a/src/pages/MoopCases/Success/ok.png b/src/pages/MoopCases/Success/ok.png deleted file mode 100644 index 9282ef4d0..000000000 Binary files a/src/pages/MoopCases/Success/ok.png and /dev/null differ diff --git a/src/pages/MoopCases/index.less b/src/pages/MoopCases/index.less deleted file mode 100644 index 9462f8083..000000000 --- a/src/pages/MoopCases/index.less +++ /dev/null @@ -1,134 +0,0 @@ -@import '../../global.less'; -.moop-case { - // img { - // display: block; - // max-width: 100%; - // } - - .banner { - height: 300px; - overflow: hidden; - .flex_box_container(); - .flex_box_center(); - img { - height: 300px; - } - } - - .moop-title { - display: flex; - flex-flow: row nowrap; - align-items: center; - justify-content: space-between; - background-color: #fff; - border-bottom: 1px solid #eeeeee; - padding: 20px 30px; - - span { - color: #333; - font-size: 18px; - } - } - - .moop-main { - width: 1200px; - margin: 20px auto; - } - - .btn-ghost { - padding: 0px 10px; - color: #4cacff; - border: 1px solid #4cacff; - border-radius: 4px; - } - - .moop-search { - width: 300px; - height: 40px; - } - - .search-input-container { - padding: 20px 30px; - background-color: #fff; - display: flex; - flex-flow: row nowrap; - align-items: center; - justify-content: space-between; - - a { - color: #05101a; - margin-right: 30px; - line-height: 20px; - font-size: 16px; - - &.active { - color: #4cacff; - } - } - } -} - -.search-footer { - padding-bottom: 30px; - width: 1200px; - margin: 0 auto; - display: flex; - flex-flow: column nowrap; - justify-content: center; - text-align: center; -} - -.case-list { - width: 1200px; - margin: 20px auto 0 auto; - list-style: none; - padding: 0; - display: flex; - flex-flow: column nowrap; - - a { - display: flex; - flex-flow: row nowrap; - background: #fff; - padding: 20px 30px; - } - - h2 { - font-size: 22px; - line-height: 40px; - display: flex; - flex-flow: row nowrap; - align-items: center; - } - - img { - border-radius: 4px; - margin-right: 15px; - } - - .info { - flex: 1 0 auto; - } - - li { - margin-bottom: 20px; - } - - .detail { - display: flex; - color: #333; - flex-flow: row nowrap; - justify-content: space-between; - align-items: center; - line-height: 20px; - font-size: 14px; - } - - .sum { - color: #ccc; - - span { - margin-left: 20px; - } - } -} diff --git a/src/pages/MoopCases/index.tsx b/src/pages/MoopCases/index.tsx deleted file mode 100644 index adcb8cda7..000000000 --- a/src/pages/MoopCases/index.tsx +++ /dev/null @@ -1,236 +0,0 @@ -import React, { useEffect, useReducer,FC } from 'react' -import { get } from '@/utils/fetch' -import './index.less' -import './label.css' -import { Spin, Input, Pagination } from 'antd' -import { - GlobalSettingModelState, - ConnectProps, - connect, - Link, - UserModelState, -} from 'umi'; -import Env from '@/utils/env' -import { isLogin } from '@/utils/authority' -import bgUrl from './teach-case-bg.jpg'; -const Search = Input.Search - -interface PageProps extends Partial { - user: UserModelState; - globalSetting: GlobalSettingModelState; -} - -type State = { - loading: boolean, - page: number, - count: number, - list: any, - type: string, - keyword: string, -} - -export type Tag = { id: number, name: string } - -const initialState: State = { - loading: false, - type: 'all', - page: 1, - count: 0, - list: [], - keyword: '' -} - -export enum Types { - GET_LIST, - CHANGE_KEYWORD, - CHANGE_PAGE, - CHANGE_TYPE, - SET_LOADING -} - -function reducer(state: State, action: any) { - switch (action.type) { - case Types.GET_LIST: - return { ...state, ...action.payload } - case Types.CHANGE_PAGE: - return { ...state, page: action.payload } - case Types.CHANGE_KEYWORD: - return { ...state, ...action.payload } - case Types.CHANGE_TYPE: - return { ...state, ...action.payload } - case Types.SET_LOADING: - return { ...state, loading: action.payload } - default: - throw new Error() - } -} - -const MoopCases: FC = ({ - user, - globalSetting, - dispatch - }) => { -// const MoopCases = () => { - const [state, setState] = useReducer(reducer, initialState) - const { loading, page, list, keyword, type, count } = state - - //出现页面右侧悬浮按钮 - useEffect(() => { - dispatch({ - type: 'globalSetting/onlyShowBackTopToggle', - payload: false - }); - return () => { - dispatch({ - type: 'globalSetting/onlyShowBackTopToggle', - payload: true - }); - } - }, []) - - useEffect(() => { - let didCancel = false - async function init() { - setState({ - type: Types.SET_LOADING, - payload: true, - }) - const response = await get(`libraries.json`, { - keyword, - page, - type, - }) - const { libraries, count } = response - if (!didCancel) { - setState({ - type: Types.GET_LIST, - payload: { - count, - list: libraries, - loading: false, - }, - }) - } - } - if (!didCancel) { - init() - } - return () => { - didCancel = true - } - }, [page, keyword, type]) - - function onSetKeyword(value: string) { - setState({ - type: Types.CHANGE_KEYWORD, payload: { - keyword: value, - page: 1, - } - }) - } - - function onChangeType(e: React.MouseEvent): void { - setState({ type: Types.CHANGE_TYPE, payload: { type: (e.target as any).id, page: 1 } }) - } - - function onPageChange(value: number) { - document.body.scrollIntoView() - setState({ - type: Types.CHANGE_PAGE, - payload: value, - }) - } - - return ( -
-
- bg -
-
-
- 教学案例 - 发布案例 -
-
-
- 全部 - {isLogin() ? - 我的 : null - } -
- -
- -
- - - - -
- {count > 20 ? - : null - } -
-
- ) -} - -function CaseList({ data }: { data: any }) { - return ( - - ) -} - - - -export default connect( - ({ - user, - globalSetting, - }: { - user: UserModelState; - globalSetting: GlobalSettingModelState; - }) => ({ - user, - globalSetting, - }), -)(MoopCases); diff --git a/src/pages/MoopCases/label.css b/src/pages/MoopCases/label.css deleted file mode 100644 index 8c1de8c06..000000000 --- a/src/pages/MoopCases/label.css +++ /dev/null @@ -1,28 +0,0 @@ -[class^='label-'] { - cursor: pointer; - line-height: 20px; - height: 20px; - padding: 0 9px; - width: 68px; - text-align: center; - border-radius: 9px; - font-size: 12px; - margin-left: 10px; - color: #fff; -} - -.label-0 { - background: #fc2b6a; -} - -.label-1 { - background: #ff781b; -} - -.label-2 { - background: #4cacff; -} - -.label-3 { - background: #36c53c; -} \ No newline at end of file diff --git a/src/pages/MoopCases/teach-case-bg.jpg b/src/pages/MoopCases/teach-case-bg.jpg deleted file mode 100644 index eef1f7ce6..000000000 Binary files a/src/pages/MoopCases/teach-case-bg.jpg and /dev/null differ diff --git a/src/pages/Terminal/index.tsx b/src/pages/Terminal/index.tsx deleted file mode 100644 index 4337ed151..000000000 --- a/src/pages/Terminal/index.tsx +++ /dev/null @@ -1,113 +0,0 @@ -import React, { FC, useEffect, useState } from 'react'; -import { - ClassroomModelState, - GlobalSettingModelState, - ConnectProps, - Loading, - connect, - Dispatch, -} from 'umi'; -import { Pagination, Skeleton, Button } from 'antd'; -import { ClassroomListItems } from '@/components/EcListItems/Classroom'; -import XtermPanel from '@/pages/tasks/xterm-panel'; -import VncPanel from '@/pages/tasks/vnc-view/vnc-panel'; -import '@/pages/tasks/vnc-view/index.less'; -import mediator from '@/components/mediator'; -import Fetch from '@/utils/fetch'; -import ENV from '@/utils/env'; -import { getDataSets } from '@/service/task'; -interface PageProps extends ConnectProps { - classroomList: ClassroomModelState; - globalSetting: GlobalSettingModelState; - loading: boolean; - dispatch: Dispatch; -} - -const ClassroomListPage: FC = ({ - classroomList, - globalSetting, - loading, - dispatch, - ...props -}) => { - const [sshConfigData, setSshConfigData] = useState({}) - const [taskData, setTaskData] = useState({"st":0,"discusses_count":0,"game_count":4,"record_consume_time":null,"prev_game":null,"next_game":"cfwqv7lsi5pj","praise_count":0,"user_praise":false,"time_limit":9,"tomcat_url":"http://121.40.224.66","is_teacher":true,"myshixun_manager":true,"game":{"id":2192586,"myshixun_id":576993,"user_id":1,"created_at":"2021-03-16T20:38:10.000+08:00","updated_at":"2021-03-16T21:28:37.000+08:00","status":0,"final_score":0,"challenge_id":11829,"open_time":"2021-03-16T20:38:12.000+08:00","identifier":"pcf9t4w6vrnz","answer_open":0,"end_time":null,"retry_status":0,"resubmit_identifier":null,"test_sets_view":false,"picture_path":null,"accuracy":null,"modify_time":"2020-07-20T15:04:34.000+08:00","star":0,"cost_time":847,"evaluate_count":0,"answer_deduction":0,"play_time":null,"play_sign":0,"extend_score":null,"score_radio":0.0,"exericse_evaluate_count":0,"exercise_finished_at":null,"homework_common_answer_open":false},"challenge":{"id":11829,"shixun_id":5207,"subject":"元组使用:这份菜单能修改吗?","position":1,"task_pass":"[TOC]\n\n---\n####任务描述\n\n元组看起来犹如列表,但元组使用圆括号`()`而不是`[]`来标识,而且列表的元素可以修改,但元组的元素不能修改。本关介绍元组的常见使用方法以及元组和列表的使用区别。下面用饭店菜单的例子来说明列表和元组使用的应用场景。\n\n现在有一个餐馆要向每个包厢都投放两份菜单,菜单上有4种菜名,我们想将两个菜单上最后一道菜名互换一下,也想快速知道改变后的两份菜单上单词首字母最大的菜名。而我们首先需要判断该用列表的方法还是元组的方法实现这个目标。\n\n为了实现这个目标,我们需要先学习元组的相关使用知识以及元组与列表的区别。\n\n####相关知识\n\n#####元组与列表\n元组与列表很相似,两者之间的差别在于,列表在初始化后其中的元素还可以进行增删改等操作,但是元组在初始化后其中的元素不能进行更改,列表在赋值时使用方括号`[]`,而元组在赋值时使用小括号`()`。因为元组具有不可变的特性,所以在能用元组替代列表的地方最好都使用元组,这样代码更安全。\n\n#####创建元组\n元组创建很简单,只需要在括号`()`中添加元素,元素之间用逗号隔开。元组中只包含单个元素时,需要在该元素后面添加逗号,例如:\n\n`menu1 = ('meat','fish','chicken')`\n`menu2 = ('meat',)`\n**![,](/api/attachments/386428)**\n#####访问元组\n元组和列表一样,可以使用下标索引来访问元组中的值,例如:\n\n```python\nmenu = ('meat','fish','chicken','carrot')\nprint(menu[0])\nprint(menu[1:3])\n```\n\n输出结果:\n\n`meat`\n`('fish', 'chicken')`\n\n#####修改元组\n\n元组中的元素值是不可以修改的,如果强行修改会报错,例如如果我们想修改元组`menu`中的某个值:\n\n```python\nmenu = ('meat','fish','chicken','carrot')\nmenu[0] = 'pizza'\nprint(menu[0])\n```\n\n输出结果:\n\n`TypeError: 'tuple' object does not support item assignment`\n\n系统会自动报错,元组中的元素值不支持修改。\n\n#####元组内置函数\n\n元组和列表一样,都有一些内置函数方便编程。例如:\n\n`len(tuple)`:计算元组中元素个数。\n\n`max(tuple)`:返回元组中元素的最大值。\n\n`min(tuple)`:返回元组中元素的最小值。\n\n`tuple(seq)`:将列表转换为元组。\n\n元组中的元素是不能改变的,它也没有`append()`,`insert()`这样的方法。但其他获取元素的方法和列表是一样的。\n\n####编程要求\n\n本关的编程任务是补全`src/Step1/menu_test.py`文件的代码内容,实现如下功能:\n\n- 将输入的菜单menu_list转换为元组类型\n- 打印输出生成的元组\n- 打印输出元组中首字母最大的元素\n\n本关涉及的代码文件`src/Step1/menu_test.py`的代码框架如下:\n\n```python\n# coding=utf-8\n\n# 创建并初始化munu_list列表\nmenu_list = []\nwhile True:\n\ttry:\n\t\tfood = input()\n\t\tmenu_list.append(food)\n\texcept:\n\t\tbreak\n\n# 请在此添加代码,对menu_list进行元组转换以及元组计算等操作,并打印输出元组及元组最大的元素\n###### Begin ######\n\n\n\n\n####### End #######\n```\n\n####测试说明\n\n本关的测试文件是`src/Step1/menu_test.py`,测试过程如下:\n\n1. 平台自动编译并运行`menu_test.py`,并以标准输入方式提供测评输入;\n3. 平台获取程序的输出,然后将其与预期输出对比,如果一致则测试通过;否则测试失败。\n\n以下是平台对`src/Step1/menu_test.py`的样例测试集:\n\n测试输入:\n`beef`\n`veal`\n`lamb`\n`pork`\n预期输出:\n`('beef', 'veal', 'lamb', 'pork')`\n`veal`\n\n测试输入:\n`duck`\n`broth`\n`fish`\n`macaroni`\n预期输出:\n`('duck', 'broth', 'fish', 'macaroni')`\n`macaroni`\n\n开始你的任务吧,祝你成功!\n\n如果你希望成功,以恒心为良友,以经验为参谋,以小心为兄弟,以希望为哨兵。\n\n![](/api/attachments/171251)","score":100,"path":"src/step1/menu_test.py","difficulty":1,"st":0,"web_route":null,"modify_time":"2020-07-20T15:04:34.000+08:00","exec_time":9,"praises_count":0,"ignore_space":1,"open_rank":"CLOSE","hide_answer":false,"disable_copy":false},"shixun":{"id":5207,"name":"Python元组与字典入门","user_id":1,"gpid":null,"visits":17,"created_at":"2021-03-15T11:18:22.000+08:00","updated_at":"2021-03-16T20:38:08.000+08:00","status":0,"language":"Python3.6","authentication":false,"identifier":"pmrfko5h","trainee":1,"major_id":635,"webssh":0,"homepage_show":false,"hidden":false,"fork_from":3028,"can_copy":false,"modify_time":"2017-10-11T09:45:02.000+08:00","reset_time":"2017-10-11T09:45:02.000+08:00","publish_time":"2019-08-02T11:30:27.000+08:00","closer_id":null,"end_time":null,"git_url":"eduforge/afvk9r35-1","myshixuns_count":1,"challenges_count":4,"use_scope":0,"mirror_script_id":null,"image_text":null,"show_code_dir":false,"task_pass":false,"exec_time":145,"test_set_permission":true,"sigle_training":false,"hide_code":false,"multi_webssh":false,"excute_time":null,"repo_name":"innov/pmrfko5h20210315111822","averge_star":5.0,"opening_time":null,"users_count":1,"forbid_copy":false,"pod_life":0,"code_edit_permission":false,"laboratory_id":null,"vip":false,"is_jupyter":false,"public":0,"is_wechat_support":true,"to_be_built":false,"prebuild_click_count":0,"display_git_address":false,"delete_user_id":null,"sticky":0},"myshixun":{"id":576993,"shixun_id":5207,"is_public":true,"user_id":1,"gpid":null,"created_at":"2021-03-16T20:38:10.000+08:00","updated_at":"2021-03-16T21:28:39.000+08:00","status":0,"identifier":"ln7i95zmef","commit_id":"c170e4ad0cb670cd610754f374af5f35974f4f8a","modify_time":"2017-10-11T09:45:02.000+08:00","reset_time":"2017-10-11T09:45:02.000+08:00","system_tip":false,"git_url":null,"onclick_time":"2021-03-16T20:38:10.000+08:00","repo_name":"innov/ln7i95zmef20210316203810","hidden":false,"reset_repository_user_id":null},"rank_name":null,"windows_vnc":true,"user":{"user_id":1,"login":"innov","name":"99999","grade":368953,"identity":1,"image_url":"avatars/User/1?t=1593675434","school":"","user_url":"/users/innov"},"tpm_modified":false,"tpm_cases_modified":false,"mirror_name":["Python3.6"],"has_answer":true,"mirror_description":["##### 适用场景\r\n程序设计、网络爬虫、图像处理、大数据、人工智能\r\n##### 包含的热门库\r\nbasemap;beautifulsoup4;Django;Flask;Keras;matplotlib;numpy;opencv;pip;PyMySQL;Scrapy;tensorflow;torch;pandas;tensorboard;requests;scikit-learn\r\n##### 已安装库列表:\r\nabsl-py;asn1crypto;astor;attrs;Automat;backcall;baidu-aip;basemap;beautifulsoup4;bleach;blinker;blis;bokeh;boto;boto3;botocore;cachetools;catalogue;certifi;cffi;chardet;click;constantly;crypto;cryptography;cssselect;cssutils;cycler;cymem;Cython;decorator;Django;dlib;dnspython;docutils;dominate;dpkt;dyNET;EasyProcess;et-xmlfile;ExifRead;face-recognition;face-recognition-models;ffmpeg;Flask;Flask-Bootstrap;Flask-Mail;Flask-SQLAlchemy;Flask-WTF;fonttools;gast;gensim;gpt-2-simple;graphviz;grpcio;h5py;html5lib;hyperlink;idna;importlib-metadata;incremental;IPy;ipython;ipython-genutils;itsdangerous;jdcal;jedi;jieba;Jinja2;jmespath;JPype1;Keras;Keras-Applications;Keras-Preprocessing;kiwisolver;lightgbm;llvmlite;lxml;Markdown;MarkupSafe;matplotlib;mpmath;murmurhash;mysql-connector;mysqlclient;Naked;networkx;nltk;numba;numpy;olefile;opencv-contrib-python;opencv-python;openpyxl;packaging;pandas;parsel;parso;patsy;pexpect;pickleshare;Pillow;pip;plac;popen;premailer;preshed;prettytable;prompt-toolkit;protobuf;psutil;ptyprocess;py4j;pyasn1;pyasn1-modules;PyAudio;pycparser;pycryptodome;pycurl;PyDispatcher;pydub;pyecharts;PyExecJS;Pygments;pygraphviz;pyhanlp;pymongo;PyMySQL;pyOpenSSL;pyparsing;PyPDF2;pyproj;pyquery;pyshp;pyspark;python-dateutil;python-docx;pyttsx3;pytz;PyVirtualDisplay;PyYAML;queuelib;regex;requests;rsa;s3transfer;scapy;scikit-learn;scipy;Scrapy;seaborn;selenium;service-identity;setuptools;shellescape;simplejson;six;smart-open;snapshot-phantomjs;snownlp;soupsieve;spacy;SQLAlchemy;srsly;statsmodels;sympy;tensorboard;tensorflow;tensorflow-tensorboard;termcolor;thinc;toposort;torch;torchvision;tornado;tqdm;traitlets;Twisted;urllib3;visitor;w3lib;wasabi;wcwidth;Werkzeug;wheel;wikipedia;wordcloud;WTForms;xgboost;xlrd;XlsxWriter;xlwt;z3-solver;zipp;zope.interface"],"test_sets":[{"is_public":true,"result":null,"input":"pizza\nch icken\nca rrot\nturkey\nbanana","output":"('piz za', 'chicken', 'carrot', 'turkey', 'banana')\nturkey\n","actual_output":null,"compile_success":null,"ts_time":null,"ts_mem":null},{"is_public":true,"result":null,"input":"potato\r\nagaric\r\nbeet\r\ntomato","output":"('potato', 'agaric', 'beet', 'tomato')\ntomato\n","actual_output":null,"compile_success":null,"ts_time":null,"ts_mem":null},{"is_public":false,"result":null,"input":"Spring Rolls\r\nLobster slices\r\nFried Wonton\r\nFried seaweed\r\nShrimp stoast\r\nWonton soup\r\nshark fin soup","output":"('Spring Rolls', 'Lobster slices', 'Fried Wonton', 'Fried seaweed', 'Shrimp stoast', 'Wonton soup', 'shark fin soup')\nshark fin soup\n","actual_output":null,"compile_success":null,"ts_time":null,"ts_mem":null},{"is_public":false,"result":null,"input":"turkey\r\nduck\r\nagaric\r\nlamb","output":"('turkey', 'duck', 'agaric', 'lamb')\nturkey\n","actual_output":null,"compile_success":null,"ts_time":null,"ts_mem":null},{"is_public":false,"result":null,"input":"Fried seaweed","output":"('Fried seaweed',)\nFried seaweed\n","actual_output":null,"compile_success":null,"ts_time":null,"ts_mem":null}],"allowed_unlock":true,"test_sets_count":null,"sets_error_count":null}) - - const params = props.match.params; - const query = props.location.query; - let total; - useEffect(() => { - // setTimeout(() => { - // setSshConfigData({ - // "host": "172.16.95.1", - // "port": "40468", - // "ws_url": "wss://pre-webssh.educoder.net/ws", - // "username": "root", - // "password": "123123", - // "game_id": 28296, - // "webssh_url": "http://pre-bridge.educoder.net/bridge" - // }) - // },500) - getData(); - }, []); - - useEffect(() => { - if (sshConfigData.host) { - setTimeout(() => { - mediator.publish('create-socket', 1); - - }, 500) - } - }, [sshConfigData]) - // classroomList.courses_count - - const getData = async () => { - if (query.type === 'terminal') { - const res = await Fetch(`/api/myshixuns/${query.taskId || 'f3n9o5xvik'}/open_webssh.json`, { method: "get" }); - setSshConfigData({ ...res }) - } - if (query.type === 'windows') { - - } - } - return ( -
- - { - query.type === 'terminal' && - } - { - query.type !== 'terminal' && - } -
- ); -}; -export default connect( - ({ - classroomList, - loading, - globalSetting, - }: { - classroomList: ClassroomModelState; - loading: Loading; - globalSetting: GlobalSettingModelState; - }) => ({ - classroomList, - globalSetting, - loading: loading.models.classroomList, - }), -)(ClassroomListPage); diff --git a/src/pages/document.ejs b/src/pages/document.ejs index 5411f6937..a2c0a97c0 100755 --- a/src/pages/document.ejs +++ b/src/pages/document.ejs @@ -52,9 +52,6 @@ -
- -
diff --git a/src/pages/metting/api.js b/src/pages/metting/api.js new file mode 100644 index 000000000..bf1c6a36b --- /dev/null +++ b/src/pages/metting/api.js @@ -0,0 +1,113 @@ + +import http from './index' + +import { config } from './info'; + +/** + * 获取基础信息 + * @param {*} params + * @returns + */ +export function getBaseInfo(params) { + return http({ + url: `/api/zone/open/zoneKey/${config.zoneKey}`, + method: 'get', + params + }); +} + +/** + * 获取会议议程主会场(指定新闻列表) + * @param {*} cateId 指定专栏id + * @param {*} params + * @returns + */ +export function getDocList(cateId, params) { + return http({ + url: `/api/cms/doc/open/dir/${cateId}/docList`, + method: 'get', + params + }); +} + +/** + * 获取会议议程分会场(指定新闻列表内容) + * @param {*} cateId 指定专栏id + * @param {*} params + * @returns + */ +export function getSubAgenda(cateId, params) { + return http({ + url: `/api/cms/doc/open/dir/${cateId}/docContentList`, + method: 'get', + params + }); +} + + +/** + * 获取会议指南(专区首页文章列表 + * @returns + */ +export function gethomePageDocList() { + return http({ + url: `/api/cms/doc/open/zone/${config.zoneId}/homePageDocList`, + method: 'get', + }); +} + +/** + * 获取与会嘉宾 + * @returns + */ +export function getMemberList() { + return http({ + url: `/api/zone/open/${config.zoneId}/member/homePageList`, + method: 'get', + }); +} + +/** + * 合作伙伴 + * @returns + */ +export function getPartnerList() { + return http({ + url: `/api/zone/open/${config.zoneId}/partners/list`, + method: 'get', + }); +} + +/** + * 获取组织机构 + * @returns + */ +export function getOrganization(){ + return http({ + url:`/api/zone/open/${config.zoneId}/member/overviewList`, + method: 'get', + }) +} + +/** + * 获取文章详情 + * @param {*} id 文章id + * @returns + */ +export function getDocDetail(id){ + return http({ + url:`/api/cms/doc/open/${id}`, + method: 'get', + }) +} + +/** + * 获取所有栏目列表 + * @returns + */ +export function getDirList(){ + return http({ + url:`/api/cms/doc/open/zone/${config.zoneId}/dirList`, + method: 'get', + }) +} \ No newline at end of file diff --git a/src/pages/metting/banner/index.jsx b/src/pages/metting/banner/index.jsx new file mode 100644 index 000000000..dc5b776c4 --- /dev/null +++ b/src/pages/metting/banner/index.jsx @@ -0,0 +1,21 @@ +import './index.less'; +import MenuBanner from './menu'; +import SubBanner from '../img/subBanner.png'; +import { useModel } from 'umi'; + + +function Banner(props) { + const { mainInfo } = useModel('defaultConfig'); + return( +
+
+
+ +
+
+
+ {props.children} +
+ ) +} +export default Banner; \ No newline at end of file diff --git a/src/pages/metting/banner/index.less b/src/pages/metting/banner/index.less new file mode 100644 index 000000000..44672a2a1 --- /dev/null +++ b/src/pages/metting/banner/index.less @@ -0,0 +1,50 @@ +.bannerContent{ + position: absolute; + bottom: -41px; + width: 100%; + height: 76px; + .banners{ + width: 1200px; + margin:0px auto; + height: 100%; + background-color: #fff; + padding:0px 40px; + border-radius: 12px; + display: flex; + align-items: center; + box-shadow: 0px 0px 7px rgba(0, 0, 0, 0.09); + a{ + img{ + margin-right: 18px; + } + font-weight: bold; + font-size: 16px; + color: #252B3A; + padding-right: 100px; + &.active{ + color: #6233DE; + } + } + } +} +.mainroot{ + background: url('../img/back.png') no-repeat; + background-size: 100% 100%; + .mainBanner{ + padding-bottom: 41px; + width: 100%; + .header { + width: 100%; + text-align: center; + color: #ffffff; + position: relative; + font-size: 15px; + width: 100%; + &>img{ + width: 100%; + max-height: 300px; + object-fit: cover; + } + } + } +} \ No newline at end of file diff --git a/src/pages/metting/banner/menu.jsx b/src/pages/metting/banner/menu.jsx new file mode 100644 index 000000000..090f04293 --- /dev/null +++ b/src/pages/metting/banner/menu.jsx @@ -0,0 +1,30 @@ + +import './index.less'; +import { useState , useEffect } from 'react'; +import {useLocation , Link} from 'umi'; +import { menu } from '../info'; + +function Menu(props) { + const location = useLocation(); + + const matchItem = (item) => { + if(location.pathname.indexOf("/track/")>-1){ + return item.indexOf("/track/") > -1 + }else{ + return item === location.pathname + } + } + + return( +
    + { + menu && menu?.length > 0 && menu.map((i,k)=>{ + return( + {i.name} + ) + }) + } +
+ ) +} +export default Menu; diff --git a/src/pages/metting/home/index.jsx b/src/pages/metting/home/index.jsx new file mode 100644 index 000000000..32e438bf1 --- /dev/null +++ b/src/pages/metting/home/index.jsx @@ -0,0 +1,212 @@ +import { useRef, useState, useEffect } from 'react'; +import { + Link , useModel +}from 'umi'; +import './index.less'; +import { getBaseInfo, getPartnerList , gethomePageDocList , getDocDetail } from '../api.js'; +import Left from '../img/left.png'; +import Right from '../img/right.png'; +import Arrow from '../img/arrow.png'; +import ArrowPurple from '../img/arrowPurple.png'; +import Diamond from '../img/liu.png'; +import Number1 from '../img/number1.png'; +import Number2 from '../img/number2.png'; +import Number3 from '../img/number3.png'; +import Team from '../img/team.png'; +import trackBack from '../img/track.png'; +import trackBack2 from '../img/track2.png'; +import Dynamics from '../img/dynamics.png'; +import Dynamicsicon from '../img/dynamicsicon.png'; + + +function Home(){ + const [ partner, setPartner ] = useState([]); + const [newsList, setNewsList] = useState([]); + const [ visits , setVisits ] = useState(0); + const { mainInfo } = useModel('defaultConfig'); + + useEffect(()=>{ + getPartner(); + getNewsList(); + getVisit(); + },[]) + + // 获取浏览次数 + const getVisit=()=>{ + getDocDetail(656).then(res=>{ + res && setVisits(res?.data?.visits); + }).catch(console.error()) + } + + + // 合作单位 + const getPartner = () => { + getPartnerList().then(res => { + setPartner(res.rows); + }).catch(console.error()) + } + // 资讯 + const getNewsList = () => { + gethomePageDocList().then(res => { + setNewsList(res.rows) + }) + } + return( +
+ {/*
+ +
*/} +
+

赛事简介

+

EVENT INTRODUCTION

+
{mainInfo.introductionContent}
+ {/* 立即报名 */} +
    +
  • + {visits} +
    + 浏览次数 +
  • +
  • + 0 +
    + 报名人数 +
  • +
  • + 1000,000 +
    + 奖金总数 +
  • +
+
+
+

大赛流程

+

COMPETITION PROCESS

+
    +
  • +

    热身赛

    +

    正式比赛前的预备赛事,帮助选手熟悉流程和参赛项目

    +

    2024年 5月16日-6月30日

    +
  • +
  • +

    初 赛

    +

    完成整体赛事后的线上选拔出三等奖及入围一、二等奖的优秀团队

    +

    2024年 7月1日-8月31日

    +
  • +
  • +

    决 赛

    +

    通过线下的现场演示/答辩,最终决出一、二等奖的胜者

    +

    2024年 9月1日-9月20日

    +
  • +
+
+
+

大赛赛道

+

COMPETITION TRACK

+
+
  • + +
    +
    +

    贡献:开源项目贡献赛道

    +

    参赛队伍解决开源项目疑修,提交代码,创新应用并移植工具,凭贡献获奖。

    +
    + 查看详情 + ¥ 69,000 +
    +
  • +
  • + +
    +
    +

    挑战:开源任务挑战赛道

    +

    根据指定任务汇聚优秀算法和解决方案,可持续优化更新,结合性能和效果评奖。

    +
    + 查看详情 + ¥ 69,000 +
    +
  • +
  • + +
    +
    +

    教学:开源案例教学赛道

    +

    在线汇聚高校实践教学案例,助力实践教学创新,依据案例质量与应用成效评奖。

    +
    + 查看详情 + ¥ 69,000 +
    +
  • +
  • + +
    +
    +

    评注:开源代码评注赛道

    +

    研读开源项目代码,撰写技术评注、代码注释及缺陷报告,按数量、质量及贡献评奖。

    +
    + 查看详情 + ¥ 69,000 +
    +
  • +
    +
    +
    +

    赛事动态

    +

    EVENT DYNAMICS

    + { + newsList && newsList.length > 0 && +
    +
      + { newsList.map((i, k) => { + return k < 3 ? +
    • +

      { i.name }

      +

      + {i.publishTime} + 查看详情 +

      +
    • + : '' + })} +
    +
    + +
    +
    + } + 更多资讯 +
    +
    +

    合作伙伴

    +

    PARTNERS

    +
    + { + partner.map((e, k) => { + return ( + e.zonePartnersList.length > 0 && e.typeName.indexOf("高校") === -1 ? +
    +
    + { e.typeName } +
    +
    + { + e.zonePartnersList.map((i, subK) => { + return +
    + +
    +
    + }) + } +
    +
    + :'' + ) + }) + } +
    +
    +
    + ) +} +export default Home; \ No newline at end of file diff --git a/src/pages/metting/home/index.less b/src/pages/metting/home/index.less new file mode 100644 index 000000000..220dae876 --- /dev/null +++ b/src/pages/metting/home/index.less @@ -0,0 +1,427 @@ +.page.headpage { + display: flex; + flex-direction: column; + align-items: center; + position: relative; + .banner { + height: 100vh; + width: 100%; + position: relative; + img { + width: 100%; + height: 100%; + // object-fit: cover; + } + } + .part{ + text-align: center; + width: 1200px; + } + .homeMaintitle{ + font-size: 48px; + position: relative; + margin:54px auto 0px; + width: 224px; + img{ + width: 12px; + position: absolute; + &:first-child{ + left: -12px; + } + &:last-child{ + bottom: 0px; + } + } + span{ + margin:0px 22px; + font-family: YouSheBiaoTiHei; + } + text-align: center; + } + .homeSubtitle{ + margin-top: 12px; + text-align: center; + span{ + font-size: 16px; + font-family: YouSheBiaoTiHei; + background: -webkit-linear-gradient(76deg, rgba(24,163,168,0.77) 0%, #2E89FF 51%, rgba(158,3,127,0.77) 100%); + background: linear-gradient(76deg, rgba(24,163,168,0.77) 0%, #2E89FF 51%, rgba(158,3,127,0.77) 100%); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; /* 针对WebKit浏览器 */ + color: transparent; /* 兼容其他浏览器 */ + letter-spacing: 2px; + font-weight: 400; + } + } + .homeDesc{ + width: 1200px; + font-weight: 400; + font-size: 16px; + color: #040E29; + line-height: 40px; + letter-spacing: 1px; + margin-top: 34px; + text-align: left; + text-indent: 2em; + } + .applicationBtn{ + margin-top:20px; + height: 44px; + line-height: 44px; + background: linear-gradient( 103deg, #5950F3 0%, #6B16CA 100%); + border-radius: 5px 5px 5px 5px; + padding:0px 24px; + color: #fff; + font-weight: 400; + font-size: 20px; + display: inline-block; + img{ + margin:0px 0px 4px 15px; + } + } + .numbersData{ + display: flex; + padding:50px 0px; + position: relative; + &::before{ + content: ""; + height: 3px; + background: linear-gradient( 103deg, #5950F3 0%, #6B16CA 100%); + left: calc(1200px / 6 + 10px); + right: calc(1200px / 6 - 10px); + position: absolute; + top:50%; + margin-top: 3.5px; + } + li{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + flex: 1; + span.number{ + font-family: YouSheBiaoTiHei; + font-weight: 400; + font-size: 28px; + color: #040E29; + line-height: 40px; + em{ + font-size: 50px; + background: -webkit-linear-gradient(103deg, #5950F3 0%, #6B16CA 100%); + background: linear-gradient( 103deg, #5950F3 0%, #6B16CA 100%); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; /* 针对WebKit浏览器 */ + color: transparent; /* 兼容其他浏览器 */ + margin-right:12px; + padding:0px 10px; + font-style: normal; + } + } + span.btn{ + width: 140px; + height: 50px; + line-height: 46px; + background: #F6F7FA; + box-shadow: 0px 0px 10px 1px rgba(7,70,165,0.11); + border-radius: 9px 9px 9px 9px; + border: 2px solid #FFFFFF; + font-weight: bold; + font-size: 20px; + color: #040E29; + text-align: center; + } + &>.line{ + margin:40px 0px 27px; + width: 100%; + position: relative; + text-align: center; + height: 20px; + img{ + position: absolute; + margin-left: -12px; + } + } + } + } + .team{ + display: flex; + margin-top: 67px; + width: 100%; + margin-bottom: 10px; + li{ + height: 198px; + padding:20px 30px; + box-sizing: border-box; + background: #F6F7FA; + box-shadow: 0px 0px 10px 1px rgba(7,70,165,0.11); + border-radius: 22px 22px 22px 22px; + border: 2px solid #FFFFFF; + flex: 1; + width: 0; + margin-right: 80px; + transition: 0.2s; + &:last-child{ + margin-right: 0px; + } + &:hover{ + transform: translateY(-8px); + } + .t-title{ + display: flex; + align-items: center; + margin-bottom: 10px; + span{ + display: block; + margin-right: auto; + font-weight: bold; + font-size: 20px; + color: #040E29; + line-height: 40px; + } + } + .t-desc{ + font-weight: 400; + font-size: 15px; + color: #040E29; + line-height: 26px; + text-align: left; + margin-bottom: 18px; + word-break: break-all; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + } + .t-time{ + font-weight: 400; + font-size: 15px; + color: #4C2795; + text-align: left; + } + } + } + .track{ + margin-top: 18px; + display: flex; + flex-wrap: wrap; + width: 1200px; + margin-bottom: 42px; + li{ + list-style-type: none; + height: 175px; + margin: 39px 40px 0px 0px; + background: linear-gradient( 92deg, #9356E4 0%, #5D3E9A 100%); + border-radius: 12px; + box-sizing: border-box; + color: #fff; + text-align: left; + width:calc( 50% - 20px); + font-weight: 400; + font-size: 15px; + color: #FFFFFF; + line-height: 28px; + position: relative; + .backimg{ + position: absolute; + right: 0; + height: 100%; + z-index: 0; + width: 80%; + } + &:nth-child(2n){ + margin-right: 0px; + } + &:nth-child(2){ + background: linear-gradient( 92deg, #4779EC 0%, #11317A 100%); + } + &:nth-child(3){ + background: linear-gradient( 92deg, #088592 0%, #0D569C 100%); + } + &:nth-child(4){ + background: linear-gradient( 92deg, #736CF0 0%, #3C1E85 100%); + } + .trackContent{ + display: flex; + align-items: center; + position: absolute; + z-index: 1; + width: 100%; + height: 100%; + padding:28px 27px 28px 39px ; + .money{ + font-weight: 400; + font-size: 36px; + color: #FFFFFF; + line-height: 40px; + height: 40px; + letter-spacing: 2px; + font-family:'Alimama ShuHeiTi'; + width: 194px; + text-align: right; + } + .tracktitle{ + font-weight: 400; + font-size: 22px; + color: #FFFFFF; + line-height: 38px; + height: 38px; + margin-bottom: 22px; + span{ + font-weight: bold; + font-size: 26px; + } + } + .applicationBtn{ + background: #fff; + color: #6233DE; + margin-left: 32px; + display: none; + margin-top: 0px; + } + &:hover{ + .applicationBtn{display: block;} + .money{display: none;} + } + } + } + } + .flex1{ + flex: 1; + } + .dynamics{ + display: flex; + max-width: 1200px; + margin-top:60px; + justify-content: space-between; + .dynamicsNews{ + width: 40%; + display: flex; + flex-direction: column; + justify-content: space-between; + li{ + background: #F6F7FA; + box-shadow: 0px 0px 10px 1px rgba(7,70,165,0.11); + border-radius: 13px; + border: 2px solid #FFFFFF; + text-align: left; + padding:22px 12px 18px 38px; + .uper{ + font-weight: 400; + font-size: 16px; + color: #040E29; + line-height: 26px; + height: 48px; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + img{ + margin-right: 10px; + float: left; + margin-top:3px ; + } + } + .under{ + display: flex; + align-items: center; + font-weight: 400; + font-size: 14px; + color: #040E29; + height: 20px; + margin-bottom: 0px; + .applicationBtn{ + height: 36px; + line-height: 36px; + font-weight: 400; + font-size: 15px; + padding:0px 11px; + margin-left: auto; + margin-top: 0px; + opacity: 0; + transition: 0.8s; + img{ + margin-bottom: 2px; + } + } + } + &:hover .applicationBtn{ + opacity: 1; + } + } + } + .dynamicsImg{ + width: calc( 60% - 32px); + img{ + width: 100%; + object-fit: cover; + } + border-radius: 2px; + } + } + .partner-content { + margin-top: 10px; + margin-bottom: 50px; + .partner-type { + width:fit-content; + .type-title { + line-height: 28px; + font-weight: bold; + font-size: 20px; + color: #151313; + letter-spacing: 5px; + margin-bottom: 30px; + text-align: left; + span{ + position: relative; + &::before{ + position: absolute; + left: 0px; + height: 2px; + width: 32px; + content: ""; + bottom:-7px; + background: linear-gradient( 90deg, #5374B4 0%, #853CB8 100%); + } + } + } + .type-content { + display: flex; + flex-wrap: wrap; + div { + margin-right: 42px; + padding: 6px; + background-color:#ffffff; + border-radius:4px; + box-shadow:0px 0px 6px rgba(28, 48, 175, 0.03); + height: 83px; + width: 163px; + line-height: 1; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 35px; + border:1px solid #fff; + &:hover{ + border-color: #6233DE; + } + } + a{ + &:nth-child(6n) div{ + margin-right: 0px; + } + } + img { + max-height: 55px; + max-width: 130px; + } + } + } + } + .hoverBtn:hover{ + opacity: 0.77; + } +} \ No newline at end of file diff --git a/src/pages/metting/img/arrow.png b/src/pages/metting/img/arrow.png new file mode 100644 index 000000000..a5149c3ac Binary files /dev/null and b/src/pages/metting/img/arrow.png differ diff --git a/src/pages/metting/img/arrowPurple.png b/src/pages/metting/img/arrowPurple.png new file mode 100644 index 000000000..cc31ad6ab Binary files /dev/null and b/src/pages/metting/img/arrowPurple.png differ diff --git a/src/pages/metting/img/back.png b/src/pages/metting/img/back.png new file mode 100644 index 000000000..285a722d7 Binary files /dev/null and b/src/pages/metting/img/back.png differ diff --git a/src/pages/metting/img/banner.png b/src/pages/metting/img/banner.png new file mode 100644 index 000000000..52f88680e Binary files /dev/null and b/src/pages/metting/img/banner.png differ diff --git a/src/pages/metting/img/dynamics.png b/src/pages/metting/img/dynamics.png new file mode 100644 index 000000000..4a81cb854 Binary files /dev/null and b/src/pages/metting/img/dynamics.png differ diff --git a/src/pages/metting/img/dynamicsicon.png b/src/pages/metting/img/dynamicsicon.png new file mode 100644 index 000000000..f76f2359a Binary files /dev/null and b/src/pages/metting/img/dynamicsicon.png differ diff --git a/src/pages/metting/img/empty.png b/src/pages/metting/img/empty.png new file mode 100644 index 000000000..78cd5b7fd Binary files /dev/null and b/src/pages/metting/img/empty.png differ diff --git a/src/pages/metting/img/info-title-bg.png b/src/pages/metting/img/info-title-bg.png new file mode 100644 index 000000000..049d708c3 Binary files /dev/null and b/src/pages/metting/img/info-title-bg.png differ diff --git a/src/pages/metting/img/information-detail-bg.png b/src/pages/metting/img/information-detail-bg.png new file mode 100644 index 000000000..cd4612ec5 Binary files /dev/null and b/src/pages/metting/img/information-detail-bg.png differ diff --git a/src/pages/metting/img/left.png b/src/pages/metting/img/left.png new file mode 100644 index 000000000..32ccd37cf Binary files /dev/null and b/src/pages/metting/img/left.png differ diff --git a/src/pages/metting/img/liu.png b/src/pages/metting/img/liu.png new file mode 100644 index 000000000..de3df1304 Binary files /dev/null and b/src/pages/metting/img/liu.png differ diff --git a/src/pages/metting/img/logo.png b/src/pages/metting/img/logo.png new file mode 100644 index 000000000..eb1b4f32c Binary files /dev/null and b/src/pages/metting/img/logo.png differ diff --git a/src/pages/metting/img/logo1-color.png b/src/pages/metting/img/logo1-color.png new file mode 100644 index 000000000..03720ce18 Binary files /dev/null and b/src/pages/metting/img/logo1-color.png differ diff --git a/src/pages/metting/img/logo1.png b/src/pages/metting/img/logo1.png new file mode 100644 index 000000000..cc3d2288b Binary files /dev/null and b/src/pages/metting/img/logo1.png differ diff --git a/src/pages/metting/img/logo2-color.png b/src/pages/metting/img/logo2-color.png new file mode 100644 index 000000000..8d526f968 Binary files /dev/null and b/src/pages/metting/img/logo2-color.png differ diff --git a/src/pages/metting/img/logo2.png b/src/pages/metting/img/logo2.png new file mode 100644 index 000000000..1552a5608 Binary files /dev/null and b/src/pages/metting/img/logo2.png differ diff --git a/src/pages/metting/img/logo3-color.png b/src/pages/metting/img/logo3-color.png new file mode 100644 index 000000000..08eaace44 Binary files /dev/null and b/src/pages/metting/img/logo3-color.png differ diff --git a/src/pages/metting/img/logo3.png b/src/pages/metting/img/logo3.png new file mode 100644 index 000000000..87e1b6e73 Binary files /dev/null and b/src/pages/metting/img/logo3.png differ diff --git a/src/pages/metting/img/logo4-color.png b/src/pages/metting/img/logo4-color.png new file mode 100644 index 000000000..642b0814e Binary files /dev/null and b/src/pages/metting/img/logo4-color.png differ diff --git a/src/pages/metting/img/logo4.png b/src/pages/metting/img/logo4.png new file mode 100644 index 000000000..941b23cbd Binary files /dev/null and b/src/pages/metting/img/logo4.png differ diff --git a/src/pages/metting/img/number1.png b/src/pages/metting/img/number1.png new file mode 100644 index 000000000..8c209ef58 Binary files /dev/null and b/src/pages/metting/img/number1.png differ diff --git a/src/pages/metting/img/number2.png b/src/pages/metting/img/number2.png new file mode 100644 index 000000000..ec09c98c2 Binary files /dev/null and b/src/pages/metting/img/number2.png differ diff --git a/src/pages/metting/img/number3.png b/src/pages/metting/img/number3.png new file mode 100644 index 000000000..1a6166420 Binary files /dev/null and b/src/pages/metting/img/number3.png differ diff --git a/src/pages/metting/img/orz1.png b/src/pages/metting/img/orz1.png new file mode 100644 index 000000000..ee006cfec Binary files /dev/null and b/src/pages/metting/img/orz1.png differ diff --git a/src/pages/metting/img/orz2.png b/src/pages/metting/img/orz2.png new file mode 100644 index 000000000..f09dfd3a1 Binary files /dev/null and b/src/pages/metting/img/orz2.png differ diff --git a/src/pages/metting/img/qr-bg.png b/src/pages/metting/img/qr-bg.png new file mode 100644 index 000000000..e97428f92 Binary files /dev/null and b/src/pages/metting/img/qr-bg.png differ diff --git a/src/pages/metting/img/right.png b/src/pages/metting/img/right.png new file mode 100644 index 000000000..b86ab518e Binary files /dev/null and b/src/pages/metting/img/right.png differ diff --git a/src/pages/metting/img/search.png b/src/pages/metting/img/search.png new file mode 100644 index 000000000..a8df2eed0 Binary files /dev/null and b/src/pages/metting/img/search.png differ diff --git a/src/pages/metting/img/subBanner.png b/src/pages/metting/img/subBanner.png new file mode 100644 index 000000000..0ac096730 Binary files /dev/null and b/src/pages/metting/img/subBanner.png differ diff --git a/src/pages/metting/img/team.png b/src/pages/metting/img/team.png new file mode 100644 index 000000000..a80de9429 Binary files /dev/null and b/src/pages/metting/img/team.png differ diff --git a/src/pages/metting/img/track.png b/src/pages/metting/img/track.png new file mode 100644 index 000000000..e65c8a7b8 Binary files /dev/null and b/src/pages/metting/img/track.png differ diff --git a/src/pages/metting/img/track2.png b/src/pages/metting/img/track2.png new file mode 100644 index 000000000..4f611adf0 Binary files /dev/null and b/src/pages/metting/img/track2.png differ diff --git a/src/pages/metting/img/views.png b/src/pages/metting/img/views.png new file mode 100644 index 000000000..f204baf09 Binary files /dev/null and b/src/pages/metting/img/views.png differ diff --git a/src/pages/metting/img/组 7@2x.png b/src/pages/metting/img/组 7@2x.png new file mode 100644 index 000000000..453b85071 Binary files /dev/null and b/src/pages/metting/img/组 7@2x.png differ diff --git a/src/pages/metting/index.js b/src/pages/metting/index.js new file mode 100644 index 000000000..7822fadd6 --- /dev/null +++ b/src/pages/metting/index.js @@ -0,0 +1,41 @@ +import axios from 'axios'; +import { message , notification } from 'antd'; + +function beforeFetch(){ + if (window.location.href.indexOf('localhost') < 0) { + axios.defaults.withCredentials = true; + } + + const service = axios.create({ + baseURL: 'https://gateway.gitlink.org.cn', + timeout: 1800000, // 请求超时时间 + }); + + service.interceptors.response.use( + response => { + const res = response||{}; + if(res && res.data && res.data.code === 404){ + message.error("错误链接!"); + window.location.href = '/nopage'; + return Promise.reject('error'); + }else if(res && res.data && res.data.code === 500){ + message.error(res.data.msg); + return Promise.reject('error'); + }else{ + return response.data; + } + }, + error => { + console.log(error); + // notification.open({ + // message: "提示", + // description: error.message, + // }); + // return Promise.reject(error); + } + ) + return service; +} + +const service = beforeFetch(); +export default service; \ No newline at end of file diff --git a/src/pages/metting/info.js b/src/pages/metting/info.js new file mode 100644 index 000000000..e125665f3 --- /dev/null +++ b/src/pages/metting/info.js @@ -0,0 +1,54 @@ + +export const menu = [ + { + name: '首页', + link: '/competitions/2024', + }, + { + name: '组织架构', + link: '/competitions/2024/organization', + }, + { + name: '赛事安排', + link: '/competitions/2024/track/633', + }, + { + name: '赛事动态', + link: '/competitions/2024/information', + } + ] + + export const defaultPage = { + '/register': 300, + '/contact': 299 + } + + export const information = { + title: '大会资讯', + desc: '方便您第一时间收集各会议论坛信息,解读大会通知资讯', + category: [ + { + title: '赛事安排', + eng: 'Event arrangement', + anchor: 'forum', + }, + { + title: '赛事动态', + eng: 'Event dynamics', + anchor: 'guide', + }, + { + title: '赛题发布', + eng: 'Competition question release', + anchor: 'notice', + } + ] + } + export const config = { + // zoneKey: 'kydhgw', + // zoneId: 6, + zoneKey:"KYDS7th", + zoneId:11 + } + + export const hidenMemberType = ['与会嘉宾', '院士嘉宾'] \ No newline at end of file diff --git a/src/pages/metting/information/detail.jsx b/src/pages/metting/information/detail.jsx new file mode 100644 index 000000000..b2637bf3f --- /dev/null +++ b/src/pages/metting/information/detail.jsx @@ -0,0 +1,68 @@ +import './index.less' +import RenderHtml from '@/components/RenderHtml' +import { useLocation, useParams } from 'umi'; +import { Base64 } from 'js-base64'; +import { Breadcrumb , Divider } from 'antd'; +import views from '../img/views.png' +import { useEffect } from 'react'; +import { getDocDetail } from '../api' +import { useState } from 'react'; +import { defaultPage } from '../info' + + +function Detail() { + const location = useLocation(); + const { id } = location.pathname.includes('information') ? useParams() : { id: defaultPage[location.pathname] }; + const [ detail, setDetail ] = useState({}); + const [ cmsDir , setCmsDir ] = useState(undefined); + const [ content , setContent]=useState(undefined); + + useEffect(()=>{ + getDetail(); + },[id]) + + const getDetail = () => { + getDocDetail(id).then(res => { + setDetail(res.data); + setCmsDir(res.data.cmsDir); + setContent(Base64.decode(res.data.content)); + }) + } + + + + return
    + { + detail && +
    + { + location.pathname.includes('information') && + { cmsDir && { cmsDir.name } } + 正文 + + } +
    + { + location.pathname.includes('information') && <> +
    +

    { detail.name }

    +
      + { cmsDir &&
    • 发布于{ cmsDir.createdAt }
    • } + { detail.visits &&
    • { detail.visits }
    • } +
    +
    + + + } + { + content ? + + : + 暂无详情~ + } +
    +
    + } +
    +} +export default Detail diff --git a/src/pages/metting/information/index.jsx b/src/pages/metting/information/index.jsx new file mode 100644 index 000000000..434a871ed --- /dev/null +++ b/src/pages/metting/information/index.jsx @@ -0,0 +1,192 @@ +import './index.less' +import { Spin, Divider , Input } from 'antd'; +import { useState , useEffect } from 'react'; +import { information } from '../info'; +import { getDocList } from '../api' +import empty from '../img/empty.png'; +import { useModel , Link } from 'umi'; +import Left from '../img/left.png'; +import Right from '../img/right.png'; +import SubBanner from '../img/subBanner.png'; +import Search from '../img/search.png'; +import { throttle } from '@/utils/mettingUtil'; + +function Information() { + const [ isSpin , setIsSpin ] = useState(false); + const [ informationList , setInformationList ] = useState([]); + const { dirList } = useModel('defaultConfig'); + const [ tabKey , setTabKey ] = useState(0); + const [ positionNum ,setPositionNum ] = useState([]); + const [ showAnchor , setShowAnchor ] = useState(false); + const[ title ,setTitle] = useState(undefined); + const[ searchTitle ,setSearchTitle] = useState(undefined); + + useEffect(()=>{ + if (location.pathname === '/competitions/2024/information') { + window.addEventListener('scroll', throttleHandleScroll); + return ComponentWillUnmount; + } else { + ComponentWillUnmount() + } + },[location.pathname,positionNum]) + + function ComponentWillUnmount() { + window.removeEventListener("scroll", throttleHandleScroll); + } + + + function handleScroll() { + let scrollTop = document.documentElement.scrollTop; //滚动条滚动高度 + setShowAnchor(scrollTop > 362); + if(scrollTop < 362) setTabKey(0); + if(positionNum && positionNum.length>0){ + for(let i=0;i0 && scrollTop <= positionNum[i] && scrollTop > positionNum[i-1] ){ + setTabKey(i); + return; + } + } + } + } + + const throttleHandleScroll = throttle(handleScroll, 100) + + useEffect(()=>{ + if ( JSON.stringify(dirList) !== '{}' ) { + getAllLists(); + } + let anchor = document.getElementsByClassName("anchor"); + if(anchor && anchor.length>1){ + let arr = []; + for(let i=0;i { + setIsSpin(true); + const requestList = []; + information.category.map(e => { + dirList[e.title] && requestList.push(getList(dirList[e.title], e.anchor,searchTitle)) + }) + Promise.all(requestList).then(res => { + let totalList = {} + res.map(e => { + totalList[e.name] = e.list + }) + setInformationList(totalList) + setIsSpin(false) + }) + } + + const getList = (id, name,title) => { + return new Promise((resolve, reject) => { + getDocList(id).then(res => { + let list = res.rows; + list = title ? list.filter(i=>i.name.indexOf(title)>-1 || i.summary.indexOf(title)>-1) : list; + list.forEach(e => { + if (e.publishTime) { + let time = e.publishTime.split('/'); + e.date1 = `${time[0]}年${time[1]}月`; + e.date2 = `${time[2]}日`; + } else { + e.date1 = e.date2 = '-' + } + }) + resolve({ name, list: list }); + }) + }) + } + + const scrollToAnchor = (anchorName) => { + if (anchorName) { + let anchorElement = document.getElementById(anchorName); + if(anchorElement) { anchorElement.scrollIntoView({block: 'start', behavior: 'smooth'}); } + } + } + + return
    + {/* { + information.category && +
    +
    + { + information.category.map((e, k) => { + return
    { scrollToAnchor(e.anchor);setTabKey(k) }} className={`tab-item ${k===tabKey?"active":""}`}>{ e.title }
    + }) + } + { setTitle(e.target.value) } } + onChange={ (e) => { setTitle(e.target.value) } } + onPressEnter={()=>{setSearchTitle(title)}} + placeholder="请搜索文章标题关键词" + suffix={} + style={{width:"213px"}} + /> +
    +
    + } */} +
    + { setTitle(e.target.value) } } + onChange={ (e) => { setTitle(e.target.value) } } + onPressEnter={()=>{setSearchTitle(title)}} + placeholder="请搜索文章标题关键词" + suffix={} + style={{width:"213px"}} + /> +
    + { + information.category && showAnchor && +
    + { + information.category.map((e,k)=>{ + return
  • { scrollToAnchor(e.anchor);}}>{ e.title }
  • + }) + } +
    + } + + { + information.category.map((e) => { + return
    +
    + {/*
    +

    { e.title }

    +

    { e.eng }

    +
    */} +
    +

    { e.title }

    +

    { e.eng.toUpperCase() }

    +
    +
    + { + informationList[e.anchor] && informationList[e.anchor].length > 0 ? informationList[e.anchor].map(( e, k ) => { + return
    +
    { e.date2 }
    +
    +

    { e.date1 }

    + + { e.name } +

    { e.summary }

    + 阅读全文 +
    +
    + }): + + } +
    +
    + }) + } +
    +
    +} + +export default Information \ No newline at end of file diff --git a/src/pages/metting/information/index.less b/src/pages/metting/information/index.less new file mode 100644 index 000000000..8cf186bea --- /dev/null +++ b/src/pages/metting/information/index.less @@ -0,0 +1,280 @@ +.information { + .anchorPart{ + width: 115px; + background-color: #fff; + position: fixed; + box-shadow: 0px 0px 12px 1px rgba(107,136,204,0.06); + border-radius: 4px 4px 4px 4px; + z-index: 11; + padding:12px 0px; + li{ + position: relative; + list-style-type: none; + padding:0px 15px; + height: 45px; + line-height: 45px; + font-weight: 400; + font-size: 15px; + color: #1F2329; + cursor: pointer; + &.active{ + color: #6233DE; + } + &.active::after{ + width: 2px; + height: 29px; + background: linear-gradient( 103deg, #5950F3 0%, #6B16CA 100%); + border-radius: 0px 0px 0px 0px; + left: 0px; + content: ""; + top: 8px; + position: absolute; + } + } + } + .homeMaintitle{ + font-size: 48px; + position: relative; + margin: 0px auto; + width: 224px; + img{ + width: 12px; + position: absolute; + &:first-child{ + left: -12px; + } + &:last-child{ + bottom: 0px; + } + } + span{ + margin:0px 22px; + font-family: YouSheBiaoTiHei; + } + text-align: center; + } + .ant-spin-container { + background: url('../img/back.png') no-repeat; + background-size: 100% 100%; + } + .header { + width: 100%; + height: 300px; + text-align: center; + color: #ffffff; + position: relative; + font-size: 15px; + width: 100%; + &>img{ + width: 100%; + height: 300px; + object-fit: cover; + } + // .title { + // font-size: 30px; + // } + // .desc { + // margin-top: 19px; + // opacity: 80%; + // } + + } + .tab { + display: flex; + width: 100%; + height:62px; + background-color:#ffffff; + } + .tabPanel{ + width: 1200px; + display: flex; + justify-content: center; + align-items: center; + margin:35px auto 0px; + position: relative; + height: 32px; + .tab-item { + margin: 0 69px; + cursor: pointer; + height:62px; + line-height:62px; + position: relative; + font-size: 16px; + &.active::after{ + position: absolute; + width: 67px; + height: 2px; + background: linear-gradient( 103deg, #5950F3 0%, #6B16CA 100%); + border-radius: 0px 0px 0px 0px; + content: ""; + left: 50%; + margin-left: -33px; + bottom: 0px; + } + &.active,&:hover{ + color: #6233DE; + } + } + .searchInput{ + position: absolute; + right: 0px; + background-color: #fff; + &:hover,&.ant-input-affix-wrapper:focus{ + border-color: #6233DE!important; + box-shadow: 0 0 0 2px rgba(98, 51, 222, 0.1)!important; + } + } + } + .anchor { + position: absolute; + top: -50px; + } + .content { + width: 1200px; + margin: auto; + position: relative; + padding:50px 0px; + .content-title { + width: 531px; + height: 157px; + background: url('../img/info-title-bg.png') no-repeat; + background-size: 100% 100%; + margin: auto; + display: flex; + flex-direction: column; + align-items: center; + p:first-child { + font-family: Alimama ShuHeiTi; + color: #0e1015; + font-size: 40px; + margin-top: 60px; + } + p:last-child { + font-family:PingFang SC; + color: #0d41c5; + font-size: 15px; + margin-top: 14px; + } + } + .content-wrapper { + .content-item { + display: flex; + margin-bottom: 10px; + .item-left { + font-family: PingFang SC; + font-weight: 700; + color: #6233DE; + font-size: 24px; + margin-right: 30px; + flex-shrink: 0; + } + .item-right { + flex: 1; + .time { + color: #5F6577; + font-size: 14px; + margin-bottom: 10px; + } + .item-title { + font-weight: 700; + color: #252b3a; + font-size: 18px; + margin-top: 20px; + display: block; + &:hover{ + color: #6233DE; + } + } + .item-desc { + color: #49454F; + font-size: 16px; + line-height: 32px; + margin-top: 20px; + white-space: pre-wrap; + } + .read-more { + float: right; + color: #6233DE; + font-size: 15px; + margin-top: 10px; + display: flex; + span{ + transition: 0.2s; + display: block; + } + &:hover>span { + transform: translateX(3px); + } + } + } + } + } + } +} +.detail{ + background: url('../img/information-detail-bg.png') no-repeat; + background-size: 100% 100%; + width: 100%; + flex-grow: 1; + padding-bottom: 60px; + .detail-content { + width: 1200px; + margin: 0px auto; + padding: 30px 0px; + } + .ant-breadcrumb { + a { + color: #0d41c5; + } + } + .detail-info{ + background-color:#fefefe; + border-radius:4px; + box-shadow:0px 0px 15px rgba(30, 47, 162, 0.06); + padding:30px 35px 50px; + margin-top: 28px; + .info-text-main{ + .info-name{ + color:#1f2329; + font-size:22px; + line-height: 30px; + margin-bottom: 14px!important; + word-break: break-all; + } + .info-ul-value{ + display: flex; + align-items: center; + li{ + color:#4c5876; + height: 20px; + line-height: 20px; + margin-right: 25px; + display: flex; + align-items: center; + img { + margin-right: 5px; + } + } + } + } + } + + +} + +.homeSubtitle{ + margin-top: 12px; + text-align: center; + span{ + font-size: 16px; + font-family: YouSheBiaoTiHei; + background: -webkit-linear-gradient(76deg, rgba(24,163,168,0.77) 0%, #2E89FF 51%, rgba(158,3,127,0.77) 100%); + background: linear-gradient(76deg, rgba(24,163,168,0.77) 0%, #2E89FF 51%, rgba(158,3,127,0.77) 100%); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; /* 针对WebKit浏览器 */ + color: transparent; /* 兼容其他浏览器 */ + letter-spacing: 2px; + font-weight: 400; + } +} \ No newline at end of file diff --git a/src/pages/metting/memberitem/index.jsx b/src/pages/metting/memberitem/index.jsx new file mode 100644 index 000000000..0db32f287 --- /dev/null +++ b/src/pages/metting/memberitem/index.jsx @@ -0,0 +1,21 @@ +import { Tooltip } from 'antd' +import './index.less' + +function MemberItem(props) { + const { className, data } = props + + return
    + { + data.name && <> + + { data.name } + +

    { data.introduction }

    +
    +
    + + } +
    +} + +export default MemberItem \ No newline at end of file diff --git a/src/pages/metting/memberitem/index.less b/src/pages/metting/memberitem/index.less new file mode 100644 index 000000000..b13262be5 --- /dev/null +++ b/src/pages/metting/memberitem/index.less @@ -0,0 +1,45 @@ +.member-item { + width: 200px; + height: 315px; + position: relative; + display: flex; + flex-direction: column; + align-items: center; + border-bottom: 1.5px solid linear-gradient(90deg,#08428e 0%,#019765 100%); + margin-bottom: 35px; + .head-img { + width: 200px; + height: 250px; + border: 2px solid #ffffff; + object-fit: cover; + background-color: #B6B6BB; + } + span { + position: absolute; + font-weight: bold; + color: #ffffff; + font-size: 18px; + bottom: 78px; + left: -40px; + width:84px; + line-height: 29px; + background-image:url('../img/orz1.png'); + background-size: 100% 100%; + text-align: center; + padding: 0 10px; + } + p { + margin-top: 15px; + color: #252b3a; + font-size: 15px; + line-height: 1.5; + text-align: center; + } + .line { + position: absolute; + bottom: -5px; + width: 100%; + height: 1.5px; + background: linear-gradient( 103deg, #5950F3 0%, #6B16CA 100%); + } +} \ No newline at end of file diff --git a/src/pages/metting/organization/index.jsx b/src/pages/metting/organization/index.jsx new file mode 100644 index 000000000..05defbaf9 --- /dev/null +++ b/src/pages/metting/organization/index.jsx @@ -0,0 +1,149 @@ +import './index.less' +import { Spin } from 'antd'; +import React,{ useState , useEffect } from 'react'; +import MemberItem from '../memberitem' +import { getOrganization , getPartnerList , getDocList , getDocDetail } from '../api.js'; +import { hidenMemberType } from '../info'; +import { Base64 } from 'js-base64'; +import RenderHtml from '@/components/RenderHtml' +import orz2 from '../img/orz2.png'; +import Logo from '../img/logo.png'; +import Team from '../img/team.png'; +import Left from '../img/left.png'; +import Right from '../img/right.png'; + +function Organization() { + const [ isSpin , setIsSpin ] = useState(false); + const [ organization, setOrganization ] = useState([]) + const [ partner, setPartner ] = useState([]); + const [ orz , setOrz ] = useState([]); + + useEffect(()=>{ + getList(); + getPartner(); + Init(); + },[]) + + const getPartner = () => { + getPartnerList().then(res => { + let rows = res?.rows.length > 0 ? res?.rows.filter(i=>i.typeName.includes("高校")):[]; + setPartner(rows); + }).catch(console.error()) + } + + const getList = () => { + setIsSpin(true); + getOrganization().then(res => { + let rows = res?.rows; + rows = rows.map(i=>{ + let members= i.zoneMemberList && i.zoneMemberList.length>0 ? i.zoneMemberList.filter(e=>e.memberLevel !== "主席"):i.zoneMemberList; + return {...i,unPresident:members.length>0?members.map(e=>{return e.name}):[]} + }) + setOrganization(rows); + setIsSpin(false); + }) + } + + const Init=()=>{ + getDocList(658).then(res => { + if( res?.rows?.length > 0){ + let arr = []; + for(let i=0;i{ + setOrz(res) + }) + } + }) + } + const getDetailForId = (id) => { + return new Promise((resolve, reject) => { + getDocDetail(id).then(res => { + let detail = res.data; + resolve({detail:detail}); + }) + }) + } + + + return
    +
    + +
    + +
    + CCF开源发展委员会是一个致力于推动开源文化、技术、教育和产业发展的专业组织。重点聚焦共同打造开源、开放、中立的产学研协同开源创新服务平台,探索建立CCF开源项目孵化机制,培育原始开源创新项目,依托CCF联接科教资源、产业资源和社会资源等,形成产、教、研联动的开源创新模式,推动CCF开源品牌建设和开源社区运营,为CCF会员乃至全球开源创新实践者提供高水平的开源创新服务,助力我国开源生态建设的发展。 +
    +
    +
    +

    组织架构

    +

    ORGANIZARIONAL STRUCTURE

    + + {/* { + organization && organization.length > 0 && organization.map((i, k) => { + if (!hidenMemberType.includes(i.typeName)) { + return
    +

    { i.typeName }

    +

    {subtitle[k]}

    +

    { i.typeIntroduction }

    + { + i.zoneMemberList && i.zoneMemberList.length > 0 &&
    + { + i.zoneMemberList.map(( e, subK ) => { + return e.memberLevel === "主席" && + }) + } +
    + } + { + i.unPresident && i.unPresident.length>0 &&

    {i.typeName}委员:{ i.unPresident.join("、")}

    + } +
    + } + }) + } */} + { + orz && orz.length > 0 && orz.map((i,k)=>{ + let detail = i.detail; + return( + <> +

    {detail.name}

    +
    + { + detail.content ? + + : + "" + } +
    + + ) + }) + } +
    + { + partner?.length > 0 ? +
    +

    合作高校

    +

    PARTNERS

    +
    + { + partner.map((i,k)=>{ + return i.zonePartnersList && i.zonePartnersList.length >0 ? i.zonePartnersList.map((e,key)=>{ + return( + + ) + }) + :"" + }) + } +
    +
    + :"" + } +
    +} + +export default Organization \ No newline at end of file diff --git a/src/pages/metting/organization/index.less b/src/pages/metting/organization/index.less new file mode 100644 index 000000000..651d149d1 --- /dev/null +++ b/src/pages/metting/organization/index.less @@ -0,0 +1,203 @@ +.organization { + width: 100%; + margin: auto; + display: flex; + flex-direction: column; + align-items: center; + min-height: 100vh; + position: relative; + padding-bottom: 60px; + .ant-spin-nested-loading { + width: 1200px; + } + .homeMaintitle{ + font-size: 48px; + position: relative; + margin-bottom: 0px; + img{ + width: 12px; + position: absolute; + &:first-child{ + left: -12px; + } + &:last-child{ + bottom: 0px; + } + } + span{ + margin:0px 22px; + font-family: YouSheBiaoTiHei; + } + text-align: center; + } + .homeSubtitle{ + margin-top: 12px; + text-align: center; + span{ + font-size: 16px; + font-family: YouSheBiaoTiHei; + background: -webkit-linear-gradient(76deg, rgba(24,163,168,0.77) 0%, #2E89FF 51%, rgba(158,3,127,0.77) 100%); + background: linear-gradient(76deg, rgba(24,163,168,0.77) 0%, #2E89FF 51%, rgba(158,3,127,0.77) 100%); + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; /* 针对WebKit浏览器 */ + color: transparent; /* 兼容其他浏览器 */ + letter-spacing: 2px; + font-weight: 400; + } + } + .back-img { + width: 100%; + img{ + width: 100%; + height: 300px; + object-fit: cover; + } + } + .orzLogo{ + padding-top:48px; + text-align: center; + .orzDesc{ + position: relative; + width: 1200px; + min-height: 170px; + margin-top: 30px; + &>img{ + position: absolute; + left: 0px; + top:-18px; + z-index: 1; + } + .descCon{ + position: absolute; + background: #F6F7FA; + box-shadow: 0px 0px 10px 1px rgba(7,70,165,0.11); + border-radius: 10px 10px 10px 10px; + border: 2px solid #FFFFFF; + padding:20px 50px 20px 110px; + line-height: 34px; + text-align: left; + left: 50px; + text-align: justify; + font-size: 15px; + color: #040E29; + img{ + float: left; + margin-right: 8px; + margin-top: 3px; + } + } + } + } + .orzTitle{ + font-family: YouSheBiaoTiHei; + font-weight: 400; + font-size: 38px; + color: #0A0A0A; + letter-spacing: 3px; + margin-bottom: 0px; + } + .module { + display: flex; + flex-direction: column; + margin-top: 24px; + background: #F6F7FA; + box-shadow: 0px 0px 10px 1px rgba(7,70,165,0.11); + border-radius: 22px; + padding:20px 40px; + margin-bottom: 35px; + border: 2px solid #FFFFFF; + .module-title { + display: flex; + align-items: center; + font-family:Alimama ShuHeiTi; + color:#0e1015; + font-size:34px; + margin-bottom: 30px; + span { + margin: 0 30px; + position: relative; + &::after { + content: ""; + position: absolute; + bottom: -3px; + left: -10px; + opacity: 9%; + width: 100%; + height: 11px; + background-color: #0d41c5; + } + } + img { + width: 48px; + height: 21px; + &:last-child { + transform: rotate(180deg); + } + } + } + .module-desc { + color: #252b3a; + font-size: 15px; + margin-bottom: 37px; + line-height: 1.8; + } + .module-content { + display: flex; + flex-wrap: wrap; + .module-item { + margin-right: 55px; + margin-left: 55px; + margin-bottom: 32px; + &:nth-child(4n) { + margin-right: 0px; + } + } + } + } + .ant-carousel{ + width: 1200px; + } + .membersSub{ + width: 100%; + font-weight: bold; + font-size: 20px; + color: #040E29; + line-height: 40px; + img{ + float: left; + margin: 5px 10px 0px 0px; + } + } + .partnersLogo{ + display: flex!important; + flex-wrap: wrap; + margin-top: 54px; + width: 1200px; + a{ + margin-right: 42px; + padding: 6px; + background-color: #ffffff; + border-radius: 4px; + box-shadow: 0px 0px 6px rgba(28, 48, 175, 0.03); + height: 83px; + width: 163px; + line-height: 1; + display: flex; + align-items: center; + justify-content: center; + margin-bottom: 35px; + border:1px solid #fff; + &:hover{ + border-color: #6233DE; + } + &:nth-child(6n){ + margin-right: 0px; + } + img{ + max-height: 55px; + max-width: 130px; + } + } + } +} \ No newline at end of file diff --git a/src/pages/metting/track/index.jsx b/src/pages/metting/track/index.jsx new file mode 100644 index 000000000..c90578c19 --- /dev/null +++ b/src/pages/metting/track/index.jsx @@ -0,0 +1,112 @@ +import './index.less' +import { useState , useEffect } from 'react'; +import RenderHtml from '@/components/RenderHtml'; +import { useParams , Link } from 'umi'; +import { getDocDetail } from '../api'; +import { Base64 } from 'js-base64'; +import { throttle } from '@/utils/mettingUtil'; + +function Track(props) { + const [ tabKey , setTabKey ] = useState(0); + const [ content , setContent]=useState(undefined); + const [ dealContent , setDealContent]=useState(undefined); + const [ showAnchor , setShowAnchor ] = useState(false); + const [ anchor , setAnchor ] = useState(false); + const [ menu , setMenu]=useState([]); + const { id } = useParams(); + + useEffect(()=>{ + if (location.pathname.indexOf('/competitions/2024/track')>-1) { + window.addEventListener('scroll', throttleHandleScroll); + return ComponentWillUnmount; + } else { + ComponentWillUnmount() + } + },[location.pathname]) + + function ComponentWillUnmount() { + window.removeEventListener("scroll", throttleHandleScroll); + } + function handleScroll() { + let scrollTop = document.documentElement.scrollTop; //滚动条滚动高度 + setShowAnchor(scrollTop > 320); + if(scrollTop < 320){setAnchor("")} + } + const throttleHandleScroll = throttle(handleScroll, 100) + + useEffect(()=>{ + if(id){ + setTabKey(id); + getDetail(); + } + },[id]) + + + const getDetail = () => { + getDocDetail(id).then(res => { + let content = Base64.decode(res.data.content); + setContent(content); + }) + } + + const scrollToAnchor = (anchorName) => { + if (anchorName) { + let anchorElement = document.getElementById(anchorName); + if(anchorElement) { setAnchor(anchorName);anchorElement.scrollIntoView({block: 'start', behavior: 'smooth'}); } + } + } + useEffect(() => { + if(content){ + let c = content; + const hTagsRegex = /(.*?)<\/h\1>/g; + let match; + let list = []; + while ((match = hTagsRegex.exec(content))) { + list.push({level:+match[1],id:match[3]}) + c = c.replace(`${match[0]}`, `
    ${match[0]}`); + } + setMenu(list); + setDealContent(c); + } + }, [content]); + return( +
    +
    +
    + 开源项目贡献赛道 + 开源任务挑战赛道 + 开源案例教学赛道 + 开源代码评注赛道 +
    +
    +
    + {/*
    +

    { detail.name }

    +
      + { cmsDir &&
    • 发布于{ cmsDir.createdAt }
    • } + { detail && detail.visits &&
    • { detail.visits }
    • } +
    +
    + */} + { + menu?.length > 0 && showAnchor ? + + :"" + } + { + dealContent ? + + : + 暂无详情~ + } +
    +
    + ) +} +export default Track; \ No newline at end of file diff --git a/src/pages/metting/track/index.less b/src/pages/metting/track/index.less new file mode 100644 index 000000000..5a92ef733 --- /dev/null +++ b/src/pages/metting/track/index.less @@ -0,0 +1,103 @@ +.track{ + padding-bottom: 40px; + position: relative; +.tabPanel{ + text-align: center; + padding:35px 0px 0px; +} +.tab { + width: 1200px; + margin:0px auto; + display: flex; + align-items: center; + padding-left:40px; + .tab-item { + margin-right: 78px; + font-weight: 400; + font-size: 17px; + cursor: pointer; + position: relative; + color: #040E29; + border-radius: 4px; + padding:0px 10px; + height: 32px; + line-height: 32px; + &.active{ + color: #fff; + background: linear-gradient( 103deg, #5950F3 0%, #6B16CA 100%); + } + } + } + .detail-info{ + width: 1200px; + border-radius:4px; + box-shadow:0px 0px 15px rgba(30, 47, 162, 0.06); + padding:30px 35px 50px; + margin:28px auto 0px; + background-color: #fff; + .menuPanel{ + position: fixed; + background-color: #fff; + border-radius: 4px; + width: 200px; + max-height: 320px; + overflow-y: auto; + padding:12px 0px; + box-shadow: 0px 0px 12px 1px rgba(107, 136, 204, 0.06); + li{ + position: relative; + &.active::before{ + position: absolute; + left: 0px; + top: 0px; + height: 100%; + width: 2px; + content: ""; + background: linear-gradient(103deg, #5950F3 0%, #6B16CA 100%); + } + &.active,&:hover{ + a{ + color: #6B16CA; + } + } + a{ + font-size: 14px; + height: 28px; + line-height: 28px; + font-weight: 400; + font-size: 15px; + color: #1F2329; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + max-width: 145px; + display: block; + } + } + } + .info-text-main{ + .info-name{ + color:#1f2329; + font-size:22px; + line-height: 30px; + margin-bottom: 14px!important; + word-break: break-all; + } + .info-ul-value{ + display: flex; + align-items: center; + li{ + color:#4c5876; + height: 20px; + line-height: 20px; + margin-right: 25px; + display: flex; + align-items: center; + img { + margin-right: 5px; + } + } + } + } + } +} \ No newline at end of file diff --git a/src/utils/fetch.ts b/src/utils/fetch.ts index be520d453..9df96756c 100755 --- a/src/utils/fetch.ts +++ b/src/utils/fetch.ts @@ -172,8 +172,6 @@ export default function request(url: string, option: any, flag?: boolean) { Authorization:token } } - console.log("1:",url); - console.log("2:",newOptions.headers); const expirys = options.expirys && 60 /** diff --git a/src/utils/marked.ts b/src/utils/marked.ts index 95d1e1964..f39a0176e 100755 --- a/src/utils/marked.ts +++ b/src/utils/marked.ts @@ -72,7 +72,7 @@ export function getTocContent() { const tokenizer = { heading(src: string) { - const cap = headingRegex.exec(src) + const cap = headingRegex.exec(src); if (cap) { return { type: 'heading', diff --git a/src/utils/mettingUtil.js b/src/utils/mettingUtil.js new file mode 100644 index 000000000..e65cdc4f2 --- /dev/null +++ b/src/utils/mettingUtil.js @@ -0,0 +1,13 @@ + +export function throttle(fn, delay){ + let timer = null; // 使用定时器实现 + return function (){ + let _this = this; // 当前 this 保存,以免后续处理中 this 丢失 + if(!timer){ + fn.apply(_this, arguments); + timer = setTimeout(function (){ + timer = null; + }, delay); + } + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 97fa4f3a5..8ec18ce08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4682,6 +4682,15 @@ aws4@^1.8.0: resolved "https://registry.npmmirror.com/aws4/-/aws4-1.12.0.tgz#ce1c9d143389679e253b314241ea9aa5cec980d3" integrity sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg== +axios@^1.6.8: + version "1.6.8" + resolved "https://registry.npmmirror.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66" + integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ== + dependencies: + follow-redirects "^1.15.6" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babel-core@7.0.0-bridge.0: version "7.0.0-bridge.0" resolved "https://registry.npmmirror.com/babel-core/-/babel-core-7.0.0-bridge.0.tgz#95a492ddd90f9b4e9a4a1da14eb335b87b634ece" @@ -8001,7 +8010,7 @@ flv.js@1.5.0: es6-promise "^4.2.5" webworkify "^1.5.0" -follow-redirects@^1.0.0: +follow-redirects@^1.0.0, follow-redirects@^1.15.6: version "1.15.6" resolved "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b" integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA== @@ -8070,6 +8079,15 @@ form-data@^3.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.npmmirror.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + form-data@~2.3.2: version "2.3.3" resolved "https://registry.npmmirror.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" @@ -13395,6 +13413,11 @@ proxy-addr@~2.0.5, proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + prr@~1.0.1: version "1.0.1" resolved "https://registry.npmmirror.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"