From ff9effc515fb20abae048be83fbe8c4364620d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Wed, 23 Oct 2019 14:08:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.css | 53 ++++ .../Competitioncommon/CompetitionCommon.js | 249 ++++++++++++++++++ .../src/modules/competitions/Competitions.js | 10 +- 3 files changed, 307 insertions(+), 5 deletions(-) create mode 100644 public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css new file mode 100644 index 000000000..af1f40aba --- /dev/null +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.css @@ -0,0 +1,53 @@ +.teamsLayout{background: transparent !important;} +.teamsLayout .teamsLayoutitle{ + font-size:18px; + font-family:PingFangSC-Semibold,PingFang SC; + font-weight:600; + color:rgba(5,16,26,1); + line-height:25px; + margin-top: 10px; + margin-bottom: 10px; +} +.teamsLayoutTable .ant-table-bordered .ant-table-thead > tr > th, .ant-table-bordered .ant-table-tbody > tr > td { + border-right: 1px solid transparent !important; +} + +.teamsLayoutTable .ant-table-body .ant-table-thead > tr> th:nth-last-child(1){ + border-right: 1px solid #e8e8e8 !important; +} + +.teamsLayoutTable .ant-table-body .ant-table-tbody > tr> td:nth-last-child(1){ + border-right: 1px solid #e8e8e8 !important; +} + +.teamsLayoutTable .ant-table-bordered .ant-table-thead > tr > th{ + background:#EEEEEE; + font-size: 14px; + font-family: PingFangSC-Regular,PingFang SC; + font-weight: 400; + color: rgba(102,102,102,1); + line-height: 20px; +} + +.teamsLayoutTable .ant-table-bordered .ant-table-tbody > tr > th{ + background:#EEEEEE; + font-size:14px; + font-family:PingFangSC-Regular,PingFang SC; + font-weight:400; + color:rgba(5,16,26,1); + line-height:20px; +} + +.teamsLayout .mt40{ + margin-top: 40px !important; +} + +.teamsLayoutheji{ + color: #878787; + font-size: 16px; +} + +.teamsLayoucolor-orange { + color: #ff6800!important; + font-size: 16px; +} \ No newline at end of file diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index e69de29bb..9789841c8 100644 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -0,0 +1,249 @@ +import React, { Component } from 'react'; +import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col} from 'antd'; +import axios from 'axios'; + +import NoneData from "../../courses/shixunHomework/shixunHomework"; + +import './CompetitionCommon.css'; +const { Header, Footer, Sider, Content } = Layout; + +class CompetitionCommon extends Component{ + constructor(props) { + super(props) + this.state={ + shixundata: undefined, + coursedata:undefined, + } + } + + componentDidMount(){ + window.document.title = '竞赛'; + + this.getshixundata(); + this.getcoursedata(); + } + + getshixundata=()=>{ + const Url =`/competitions/${"gcc-course-2019"}/competition_teams/${"2007"}/shixun_detail.json`; + // axios.get(Url).then((response) => { + // if(response.status===200){ + // console.log(response) + // } + // }) + // .catch(function (error) { + // console.log(error); + // }); + + + let data={ + shixuns: [ + { + creator: "黄井泉", // 创建者 + shixun_name: "单链表的学习与应用(I)", // 实训名称 + shixun_identifier: "mnf6b7z3", + forked: false, // false:原创 + myshixuns_count: 179, // 学习人数 + forked_myshixun_count: 0, // 被fork发布的学习人数 + valid_count: 82, // 有效作品数 + score: 1320 // 应用值 + } + ], + shixun_count: 1, // 实训总计 + total_myshixun_count: 179, // 学习人数总计 + total_forked_myshixun_count: 0, // 被fork发布的学习人数总计 + total_valid_count: 82, // 有效作品数总计 + total_shixun_score: 1320 // 应用值总计 + } + + + let newarr=data.shixuns; + + let newobj={ + creator:"合计:", + shixun_name:data.shixun_count, + myshixuns_count:data.total_myshixun_count, + forked_myshixun_count:data.total_forked_myshixun_count, + valid_count:data.total_valid_count, + score:data.total_shixun_score + } + newarr.push(newobj) + + this.setState({ + shixundata:newarr + }) + + } + + getcoursedata=()=>{ + const Url =`/competitions/${"gcc-course-2019"}/competition_teams/${"2007"}/course_detail.json`; + // axios.get(Url).then((response) => { + // if(response.status===200){ + // console.log(response) + // } + // }) + // .catch(function (error) { + // console.log(error); + // }); + + let data={ + courses: [ + { + creator: "周海芳", // 创建者 + creator_login: "Nancy", // login + course_name: "大学计算机基础2018年秋季", + course_id: 1502, + students_count: 122, // 学生数量 + shixun_homework_count: 8, // 发布的实训作业数量 + valid_count: 977, // 有效作品数 + score: 29810 // 应用值 + } + ], + total_course_count: 1, // 课堂总计 + total_students_count: 122, // 学生数总计 + total_shixun_homework_count: 8, // 实训作业数总计 + total_valid_count: 977, // 有效作品数总计 + total_course_score: 29810 // 应用值总计 + } + + + let newarr=data.courses; + + let newobj={ + creator:"合计:", + course_name:data.total_course_count, + students_count:data.total_students_count, + shixun_homework_count:data.total_shixun_homework_count, + valid_count:data.total_valid_count, + score:data.total_course_score + } + newarr.push(newobj) + + this.setState({ + coursedata:newarr + }) + + } + + render() { + + const shixuncolumns = [ + { + title: '创建者', + dataIndex: 'creator', + key: 'creator', + render: (text, record) =>