forked from Gitlink/forgeplus-react
文件移除
This commit is contained in:
parent
af5c671fcb
commit
d80c703173
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import Cards from '../Component/MemberCards';
|
||||
import Cards from '../../Component/MemberCards';
|
||||
|
||||
export default (()=>{
|
||||
return(
|
|
@ -0,0 +1,50 @@
|
|||
import React , { useState } from 'react';
|
||||
import { Box , Long , Short , Gap , Banner , WhiteBack } from '../../Component/layout';
|
||||
import Title from '../../Component/Title';
|
||||
import Setnav from '../../Component/Setnav';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const Div = styled.div`{
|
||||
padding:18px 30px;
|
||||
}`
|
||||
export default (props)=>{
|
||||
const pathname = props.location.pathname;
|
||||
const organizeId = props.match.params.organizeId;
|
||||
|
||||
function returnActive (pathname){
|
||||
let a = 0;
|
||||
if(pathname === `/organize/${organizeId}/setting/member`){
|
||||
a = 1;
|
||||
}else if(pathname === `/organize/${organizeId}/setting/group`){
|
||||
a = 2;
|
||||
}else if(pathname === `/organize/${organizeId}/setting/hooks`){
|
||||
a = 3;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
const active = returnActive(pathname);
|
||||
const array = {list:[
|
||||
{name:'基本设置',icon:"icon-base",href:`/organize/${organizeId}/setting`},
|
||||
{name:'团队成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${organizeId}/setting/member`},
|
||||
{name:'团队项目管理',icon:"icon-zuzhixiangmu",href:`/organize/${organizeId}/setting/group`},
|
||||
],
|
||||
active
|
||||
}
|
||||
return(
|
||||
<Box>
|
||||
<Short>
|
||||
<Setnav header={<Title>团队设置</Title>} nav={array}></Setnav>
|
||||
</Short>
|
||||
<Long>
|
||||
<Gap>
|
||||
<WhiteBack>
|
||||
<Banner>团队项目管理</Banner>
|
||||
<Div>
|
||||
|
||||
</Div>
|
||||
</WhiteBack>
|
||||
</Gap>
|
||||
</Long>
|
||||
</Box>
|
||||
)
|
||||
}
|
|
@ -1,8 +1,8 @@
|
|||
import React , {useState} from 'react';
|
||||
import { Button } from 'antd';
|
||||
import styled from 'styled-components';
|
||||
import { Box , Short , Long , Gap , WhiteBack , AlignCenterBetween } from '../Component/layout';
|
||||
import Tabs from '../Component/Tabs';
|
||||
import { Box , Short , Long , Gap , WhiteBack , AlignCenterBetween } from '../../Component/layout';
|
||||
import Tabs from '../../Component/Tabs';
|
||||
|
||||
import Memberlist from './GroupDetailMember';
|
||||
import Grouplist from './GroupDetailProject';
|
|
@ -1,6 +1,6 @@
|
|||
import React , { forwardRef , useCallback } from 'react';
|
||||
import { Form , Input , Radio , Checkbox , Switch , Button } from 'antd';
|
||||
import { Banner , WhiteBack , AlignCenter , Cancel } from '../Component/layout';
|
||||
import { Banner , WhiteBack , AlignCenter , Cancel } from '../../Component/layout';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const TextArea = Input.TextArea;
|
|
@ -16,11 +16,11 @@ const New = Loadable({
|
|||
loading: Loading,
|
||||
});
|
||||
const DetailIndex = Loadable({
|
||||
loader: () => import("./Detail"),
|
||||
loader: () => import("./Sub/Detail"),
|
||||
loading: Loading,
|
||||
});
|
||||
const SubDetail = Loadable({
|
||||
loader: () => import("./SubDetail"),
|
||||
loader: () => import("./Sub/SubDetail"),
|
||||
loading: Loading,
|
||||
});
|
||||
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
||||
|
@ -34,6 +34,12 @@ export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(
|
|||
return <SubDetail {...props} />
|
||||
}}
|
||||
></Route>
|
||||
<Route
|
||||
path="/organize/:organizeId/member/:memberId/setting"
|
||||
render={(props) => {
|
||||
return <DetailIndex {...props} />
|
||||
}}
|
||||
></Route>
|
||||
<Route
|
||||
path="/organize/:organizeId/member"
|
||||
render={(props) => {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import React, { forwardRef , useCallback } from 'react';
|
||||
import { Form , Input , Cascader , Radio ,Checkbox , Divider , Button } from 'antd';
|
||||
import { WhiteBack , FlexAJ } from '../Component/layout';
|
||||
import Title from '../Component/Title';
|
||||
import { WhiteBack , FlexAJ } from '../../Component/layout';
|
||||
import Title from '../../Component/Title';
|
||||
import styled from 'styled-components';
|
||||
import { locData } from "../Utils/locData";
|
||||
import { locData } from "../../Utils/locData";
|
||||
const TextArea = Input.TextArea;
|
||||
|
||||
const Div = styled.div`{
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { WhiteBack , Banner , Blueline } from '../Component/layout';
|
||||
import { WhiteBack , Banner , Blueline } from '../../Component/layout';
|
||||
import styled from 'styled-components';
|
||||
|
||||
const SpanName = styled.span`{
|
|
@ -0,0 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
export default ()=>{
|
||||
return(
|
||||
<div>管理web钩子:可以与组织设置部分的管理web钩子页面公用</div>
|
||||
)
|
||||
}
|
|
@ -1,11 +1,11 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Box , Long , Short , Gap } from '../Component/layout';
|
||||
import Title from '../Component/Title';
|
||||
import Setnav from '../Component/Setnav';
|
||||
import { Box , Long , Short , Gap } from '../../Component/layout';
|
||||
import Title from '../../Component/Title';
|
||||
import Setnav from '../../Component/Setnav';
|
||||
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../Loading";
|
||||
import Loading from "../../../Loading";
|
||||
|
||||
|
||||
const Group = Loadable({
|
||||
|
@ -20,6 +20,10 @@ const Common = Loadable({
|
|||
loader: () => import("./TeamSettingCommon"),
|
||||
loading: Loading,
|
||||
});
|
||||
const Hooks = Loadable({
|
||||
loader: () => import("./TeamSettingHooks"),
|
||||
loading: Loading,
|
||||
});
|
||||
export default (( props )=>{
|
||||
const pathname = props.location.pathname;
|
||||
const organizeId = props.match.params.organizeId;
|
||||
|
@ -30,15 +34,17 @@ export default (( props )=>{
|
|||
a = 1;
|
||||
}else if(pathname === `/organize/${organizeId}/setting/group`){
|
||||
a = 2;
|
||||
}else if(pathname === `/organize/${organizeId}/setting/hooks`){
|
||||
a = 3;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
const active = returnActive(pathname);
|
||||
const array = {list:[
|
||||
{name:'基本设置',icon:"icon-base",href:""},
|
||||
{name:'组织成员管理',icon:"icon-zuzhichengyuan",href:""},
|
||||
{name:'组织团队管理',icon:"icon-zuzhixiangmu",href:""},
|
||||
{name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:""}
|
||||
{name:'基本设置',icon:"icon-base",href:`/organize/${organizeId}/setting`},
|
||||
{name:'组织成员管理',icon:"icon-zuzhichengyuan",href:`/organize/${organizeId}/setting/member`},
|
||||
{name:'组织团队管理',icon:"icon-zuzhixiangmu",href:`/organize/${organizeId}/setting/group`},
|
||||
{name:'管理web钩子',icon:"icon-zhongqingdianxinicon10",href:`/organize/${organizeId}/setting/hooks`}
|
||||
],
|
||||
active
|
||||
}
|
||||
|
@ -50,6 +56,12 @@ export default (( props )=>{
|
|||
<Long>
|
||||
<Gap>
|
||||
<Switch>
|
||||
<Route
|
||||
path="/organize/:organizeId/setting/hooks"
|
||||
render={() => (
|
||||
<Hooks {...props} />
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/organize/:organizeId/setting/group"
|
||||
render={() => (
|
|
@ -1,10 +1,10 @@
|
|||
import React, { useState } from 'react';
|
||||
import { WhiteBack , Blueline , AlignCenter , FlexAJ } from '../Component/layout';
|
||||
import { WhiteBack , Blueline , AlignCenter , FlexAJ } from '../../Component/layout';
|
||||
import { Menu , Table , Pagination , Icon , Tooltip } from 'antd';
|
||||
import Sort from '../Component/Sort';
|
||||
import Title from '../Component/Title';
|
||||
import Search from '../Component/Search';
|
||||
import SearchUser from '../Component/SearchUser';
|
||||
import Sort from '../../Component/Sort';
|
||||
import Title from '../../Component/Title';
|
||||
import Search from '../../Component/Search';
|
||||
import SearchUser from '../../Component/SearchUser';
|
||||
import styled from 'styled-components';
|
||||
import { getImageUrl } from 'educoder';
|
||||
|
|
@ -1,18 +1,22 @@
|
|||
import React , { useEffect , useState } from 'react';
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../Loading";
|
||||
import Loading from "../../../Loading";
|
||||
|
||||
import Cards from '../Component/Cards';
|
||||
import Cards from '../../Component/Cards';
|
||||
|
||||
import './Index.scss';
|
||||
import '../Index.scss';
|
||||
|
||||
const DetailIndex = Loadable({
|
||||
loader: () => import("./List"),
|
||||
loader: () => import("../List"),
|
||||
loading: Loading,
|
||||
});
|
||||
const Setting = Loadable({
|
||||
loader: () => import("./TeamSettingIndex"),
|
||||
loader: () => import("../Setting/TeamSettingIndex"),
|
||||
loading: Loading,
|
||||
});
|
||||
const GroupSetting = Loadable({
|
||||
loader: () => import("../Group/GroupDetailSetting"),
|
||||
loading: Loading,
|
||||
});
|
||||
export default ((props)=>{
|
||||
|
@ -25,6 +29,12 @@ export default ((props)=>{
|
|||
img={`https://dss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=4193840146,2109186388&fm=26&gp=0.jpg`}
|
||||
/>
|
||||
<Switch {...props}>
|
||||
<Route
|
||||
path="/organize/:organizeId/member/:memberId/setting"
|
||||
render={(props) => {
|
||||
return <GroupSetting {...props} />
|
||||
}}
|
||||
></Route>
|
||||
<Route
|
||||
path="/organize/:organizeId/setting"
|
||||
render={(props) => {
|
|
@ -1,25 +1,25 @@
|
|||
import React from 'react';
|
||||
import { Route, Switch , Link } from "react-router-dom";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../Loading";
|
||||
import './Index.scss';
|
||||
import Loading from "../../../Loading";
|
||||
import '../Index.scss';
|
||||
|
||||
import Cards from '../Component/Cards';
|
||||
import Cards from '../../Component/Cards';
|
||||
|
||||
const GroupNew = Loadable({
|
||||
loader: () => import("./GroupNew"),
|
||||
loader: () => import("../Group/GroupNew"),
|
||||
loading: Loading,
|
||||
});
|
||||
const Group = Loadable({
|
||||
loader: () => import("./TeamGroup"),
|
||||
loader: () => import("../TeamGroup"),
|
||||
loading: Loading,
|
||||
});
|
||||
const Member = Loadable({
|
||||
loader: () => import("./TeamMember"),
|
||||
loader: () => import("../TeamMember"),
|
||||
loading: Loading,
|
||||
});
|
||||
const GroupDetails = Loadable({
|
||||
loader: () => import("./GroupDetails"),
|
||||
loader: () => import("../Group/GroupDetails"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
|
@ -1,163 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import competition from './comcss/competition.css';
|
||||
import {getImageUrl} from 'educoder';
|
||||
// 团队竞赛报名大图
|
||||
class CompetitionMaxImg extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
GetenrollmentAPI: undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
|
||||
}
|
||||
|
||||
componentDidUpdate = (prevProps) => {
|
||||
if (prevProps.GetenrollmentAPI != this.props.GetenrollmentAPI) {
|
||||
this.setState({
|
||||
GetenrollmentAPI: this.props.GetenrollmentAPI,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
let {type, pint} = this.props;
|
||||
return (
|
||||
<div>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
|
||||
`
|
||||
}
|
||||
</style>
|
||||
{
|
||||
type === 1 || type === 2 ?
|
||||
<div className="registrationback"
|
||||
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
|
||||
>
|
||||
<p className="registrationbackp1">在线竞赛平台</p>
|
||||
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台,</p>
|
||||
<p className="registrationbackp3">提供企业级工程实训,以实现工程化专业教学的自动化和智能化。</p>
|
||||
<div className="registrationbackp2button">
|
||||
<div className="registbut1">
|
||||
<p onClick={() => this.props.Jointheteam()}>加入战队</p>
|
||||
</div>
|
||||
<div className="registbut2">
|
||||
<p onClick={() => this.props.Createateam()}>创建战队</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
type === 3 ?
|
||||
|
||||
<div className="registrationback"
|
||||
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
|
||||
>
|
||||
<p className="registrationbackp1">在线竞赛平台</p>
|
||||
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台,</p>
|
||||
<p className="registrationbackp3">提供企业级工程实训,以实现工程化专业教学的自动化和智能化。</p>
|
||||
<div className="registrationbackp2button">
|
||||
<div className="registbut1">
|
||||
<p onClick={() => this.props.Jointheteam()}>加入战队</p>
|
||||
</div>
|
||||
<div className="registbut2">
|
||||
<p onClick={() => this.props.Createateam()}>创建战队</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
type === 4 || type === 5 ?
|
||||
|
||||
<div className="registrationback"
|
||||
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}
|
||||
>
|
||||
<p className="registrationbackp1">在线竞赛平台</p>
|
||||
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台,</p>
|
||||
<p className="registrationbackp3">提供企业级工程实训,以实现工程化专业教学的自动化和智能化。</p>
|
||||
<div className="registrationbackp2button">
|
||||
<div className="registbut1">
|
||||
<p onClick={() => this.props.Jointheteam()}>加入战队</p>
|
||||
</div>
|
||||
<div className="registbut2">
|
||||
<p onClick={() => this.props.Createateam()}>创建战队</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
: type === 6 ?
|
||||
<div className="registrationback"
|
||||
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
|
||||
<p className="registrationbackp1">在线竞赛平台</p>
|
||||
<p className="registrationbackp2">在线竞赛平台是一个面向计算机类的互联网IT教育和实战平台,</p>
|
||||
<p className="registrationbackp3">提供企业级工程实训,以实现工程化专业教学的自动化和智能化。</p>
|
||||
<div className="registrationbackp2button">
|
||||
{
|
||||
pint === 1 ?
|
||||
<div className="registbut1" onClick={() => this.props.Personalregistration()}>
|
||||
<p onClick={() => this.props.Personalregistration()}>立即报名</p>
|
||||
</div>
|
||||
: pint === 2 ?
|
||||
<div className="personreg1">
|
||||
<p>已报名</p>
|
||||
</div>
|
||||
:
|
||||
<div className="personreg1">
|
||||
<p>报名已截止</p>
|
||||
</div>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
<div className="registrationback"
|
||||
style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default CompetitionMaxImg;
|
||||
|
||||
// // type3
|
||||
// /*<div className="registrationback"*/
|
||||
// /* style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>*/
|
||||
// /* <p className="registrationbackp1">Educoder竞赛平台</p>*/
|
||||
// /* <p className="registrationbackp4">高校智能课堂与综合实训平台</p>*/
|
||||
// /* <div className="registrationbackp2button2">*/
|
||||
// /* <div className="registbut11">*/
|
||||
// /* <p onClick={() => this.props.Jointheteam()}>加入战队</p>*/
|
||||
// /* </div>*/
|
||||
// /* <div className="registbut22">*/
|
||||
// /* <p onClick={() => this.props.Createateam()}>创建战队</p>*/
|
||||
// /* </div>*/
|
||||
//
|
||||
// /* </div>*/
|
||||
// /*</div>*/
|
||||
//
|
||||
//
|
||||
// // type === 4 || type === 5
|
||||
// // <div className="registrationback1"
|
||||
// // style={{"background": `url(${getImageUrl(`images/educoder/competitions/tipregistit.jpg`)})`}}>
|
||||
// // <p className="registrationbackp11">Educoder竞赛平台</p>
|
||||
// // <p className="registrationbackp22">高校智能课堂与综合实训平台</p>
|
||||
// // <div className="registrationbackp2button3">
|
||||
// // <div className="registbut111">
|
||||
// // <p onClick={() => this.props.Jointheteam()}>加入战队</p>
|
||||
// // </div>
|
||||
// // <div className="registbut222">
|
||||
// // <p onClick={() => this.props.Createateam()}>创建战队</p>
|
||||
// // </div>
|
||||
// //
|
||||
// // </div>
|
||||
// // </div>
|
|
@ -1,50 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
import competition from './comcss/competition.css';
|
||||
import {Checkbox, Table, Pagination, Menu, Icon} from "antd";
|
||||
import {getImageUrl} from 'educoder';
|
||||
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
|
||||
class RegisListview extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="reglistviewdivs">
|
||||
<div className="reglistviewdivss " style={{
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
justifyContent: " space-around",
|
||||
alignItems: "center",
|
||||
background: `url(${getImageUrl(`images/educoder/competitions/Rectanglex.png`)})`,
|
||||
height: "50px",
|
||||
backgroundPosition: "center",
|
||||
backgroundSize: "110% 100%",
|
||||
}}>
|
||||
<p className=" "
|
||||
style={{fontSize: "16px", color: "#05101A", width: "79px", textAlign: "center"}}>创建者</p>
|
||||
<p className=" "
|
||||
style={{fontSize: "16px", color: "#05101A", width: "160px", textAlign: "center"}}>战队名称</p>
|
||||
<p className=" "
|
||||
style={{fontSize: "16px", color: "#05101A", width: "487px", textAlign: "center"}}>战队成员</p>
|
||||
<p className=" "
|
||||
style={{fontSize: "16px", color: "#05101A", width: "134px", textAlign: "center"}}>学校</p>
|
||||
<p className=" "
|
||||
style={{fontSize: "16px", color: "#05101A", width: "151px", textAlign: "center"}}>时间</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RegisListview;
|
|
@ -1,170 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
|
||||
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
|
||||
import competition from './comcss/competition.css';
|
||||
import {Button} from 'antd';
|
||||
|
||||
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
|
||||
class RegisListviewdata extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
item: undefined
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
////console.log("RegisListviewdata");
|
||||
////console.log(this.props.item)
|
||||
this.setState({
|
||||
item: this.props.item
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
getotiku = (url) => {
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
|
||||
render() {
|
||||
const {item} = this.props;
|
||||
return (
|
||||
|
||||
<div>
|
||||
{
|
||||
item !== undefined ?
|
||||
<div className={"yslborderbottom"}>
|
||||
<div className="regitem22">
|
||||
|
||||
<div className="regitemimg1 ">
|
||||
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
|
||||
|
||||
</img>
|
||||
<a className="maxnamewidth78" title={item.creator.name} style={{
|
||||
color: "#999999", fontSize: "14px",
|
||||
width: "78px",
|
||||
textAlign: "center"
|
||||
}}>{item.creator.name}</a>
|
||||
</div>
|
||||
<div style={{
|
||||
marginTop: "29px",
|
||||
marginLeft: "37px",
|
||||
width: "160px",
|
||||
textAlign: "center",
|
||||
}} className="textsize maxnamewidth160">
|
||||
{
|
||||
this.props.admin?
|
||||
this.props.admin===true?
|
||||
<a className="maxnamewidth160" title={item.name} style={{
|
||||
fontSize: "16px",
|
||||
width: "160px",
|
||||
textAlign: "center",
|
||||
cursor:"pointer"
|
||||
}}
|
||||
onClick={()=>this.getotiku(`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`)}
|
||||
>{item.name}</a>
|
||||
: <p className="maxnamewidth160" style={{
|
||||
color: "#05101A",
|
||||
fontSize: "16px",
|
||||
width: "160px",
|
||||
textAlign: "center"
|
||||
}}>{item.name}</p>
|
||||
: <p className="maxnamewidth160" style={{
|
||||
color: "#05101A",
|
||||
fontSize: "16px",
|
||||
width: "160px",
|
||||
textAlign: "center"
|
||||
}}>{item.name}</p>
|
||||
}
|
||||
</div>
|
||||
<div style={{
|
||||
marginLeft: "37px",
|
||||
display: "flex",
|
||||
flexDirection: "initial",
|
||||
width: "487px"
|
||||
}}>
|
||||
|
||||
{
|
||||
item && item.team_members.map((item, index) => {
|
||||
return (
|
||||
|
||||
index === 0 ?
|
||||
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 1 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 2 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 3 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 4 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 5 ?
|
||||
<div>
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
<img className="regitemimgs22"
|
||||
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
|
||||
</img>
|
||||
</div>
|
||||
: ""
|
||||
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
<div style={{
|
||||
marginLeft: "41px",
|
||||
width: "134px",
|
||||
marginTop: "29px",
|
||||
textAlign: "center",
|
||||
}} className="maxnamewidth134">
|
||||
<a className="maxnamewidth134" title={item.school_name} style={{
|
||||
color: "#05101A",
|
||||
fontSize: "16px",
|
||||
textAlign: "center"
|
||||
}}>{item.school_name}</a>
|
||||
</div>
|
||||
<div style={{
|
||||
marginLeft: "37px",
|
||||
width: "151px",
|
||||
marginTop: "29px",
|
||||
|
||||
}}>
|
||||
<p style={{
|
||||
color: "#999999",
|
||||
fontSize: "16px",
|
||||
textAlign: "center"
|
||||
}}>{item.created_at}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
: ""
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RegisListviewdata;
|
|
@ -1,34 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import competition from './comcss/competition.css';
|
||||
import {getImageUrl} from 'educoder';
|
||||
// 团队竞赛报名无报名子组件
|
||||
class RegisNodata extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="bootom">
|
||||
<div className="bootomimg" style={{
|
||||
height: "80px",
|
||||
width: "125px",
|
||||
marginTop: "107px",
|
||||
background: `url(${getImageUrl(`images/educoder/competitions/Noentry.jpg`)})`,
|
||||
backgroundPosition: "center",
|
||||
backgroundSize: "110% 100%",
|
||||
}}>
|
||||
|
||||
</div>
|
||||
<p className="bootomtext">暂无战队参与报名哦,赶紧来成为第一个挑战的吧~</p>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RegisNodata;
|
File diff suppressed because it is too large
Load Diff
|
@ -1,75 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
import competition from './comcss/competition.css';
|
||||
import {Checkbox, Input, Table, Pagination, Menu, Icon} from "antd";
|
||||
|
||||
const Search = Input.Search;
|
||||
|
||||
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
|
||||
class RegistrationSearch extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
keywords: ""
|
||||
}
|
||||
}
|
||||
|
||||
setdatafunsval = (e) => {
|
||||
this.setState({
|
||||
keywords: e.target.value
|
||||
})
|
||||
|
||||
};
|
||||
setdatafuns = (value) => {
|
||||
//console.log("setdatafuns点击了搜索");
|
||||
//console.log(value);
|
||||
this.setState({
|
||||
keywords: value
|
||||
})
|
||||
this.props.RegistrationSearchvalue(value);
|
||||
};
|
||||
|
||||
myonPressEnter = (e) => {
|
||||
//console.log("点击了回车setdatafunsval点击了搜索");
|
||||
//console.log(e.target.value);
|
||||
this.props.RegistrationSearchvalue(e.target.value);
|
||||
}
|
||||
render() {
|
||||
return (
|
||||
<div className="searchhead">
|
||||
|
||||
<Search
|
||||
className="packinputs"
|
||||
value={this.state.keywords}
|
||||
enterButton={<span>搜索</span>}
|
||||
onInput={(e) => this.setdatafunsval(e)}
|
||||
onSearch={(value) => this.setdatafuns(value)}
|
||||
onPressEnter={(e) => this.myonPressEnter(e)}
|
||||
/>
|
||||
|
||||
<p style={{
|
||||
width: "583px",
|
||||
color: "#07140E",
|
||||
fontSize: '16px',
|
||||
marginTop: " 7px",
|
||||
marginLeft: "300px",
|
||||
textAlign: "right",
|
||||
lineHeight: " 24px"
|
||||
}}>战队总数:<span
|
||||
style={{color: "#459BE5", fontSize: "16px"}}>{this.props.count}</span><span
|
||||
style={{marginLeft: "5px", marginRight: "15px",}}>个</span> 参赛总人数:<span
|
||||
style={{color: "#459BE5"}}>{this.props.members_count}</span><span
|
||||
style={{marginLeft: "5px"}}>人</span></p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default RegistrationSearch;
|
|
@ -1,84 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
import {SnackbarHOC, WordsBtn, getImageUrl} from 'educoder';
|
||||
import {TPMIndexHOC} from '../tpm/TPMIndexHOC';
|
||||
import competition from './comcss/competition.css';
|
||||
import {Button} from 'antd';
|
||||
import RegisListviewdata from "./RegisListviewdata";
|
||||
|
||||
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
|
||||
class Registrationitem extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
let {item} = this.props;
|
||||
return (
|
||||
<div className="yslborderbottom">
|
||||
{
|
||||
item !== undefined ?
|
||||
<div className="regitem2">
|
||||
<div className="perregitemimg1 ">
|
||||
<img className="personregitemimg" src={getImageUrl("images/" + item.creator.image_url)}>
|
||||
|
||||
</img>
|
||||
</div>
|
||||
<div className="" style={{
|
||||
marginTop: "19px",
|
||||
marginLeft: "54px",
|
||||
display: "flex",
|
||||
flexDirection: "initial",
|
||||
}}>
|
||||
<p className="" style={{
|
||||
color: "#05101A",
|
||||
fontSize: "16px",
|
||||
width: "160px",
|
||||
textAlign: "center"
|
||||
}}>{item.creator.name}</p>
|
||||
{
|
||||
item.manage_permission === true ?
|
||||
<p className="" style={{
|
||||
color: "#459BE5",
|
||||
fontSize: "16px",
|
||||
textAlign: "center",
|
||||
marginLeft: "25px",
|
||||
}}>已报名</p>
|
||||
:
|
||||
""
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
<div className="" style={{
|
||||
marginLeft: "632px",
|
||||
width: "151px",
|
||||
marginTop: "19px",
|
||||
marginRight: "35px",
|
||||
}}>
|
||||
<p style={{
|
||||
color: "#999999",
|
||||
fontSize: "16px",
|
||||
textAlign: "center",
|
||||
}}>{item.created_at}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
: ""
|
||||
}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default Registrationitem;
|
|
@ -1,900 +0,0 @@
|
|||
/*All*/
|
||||
.borders {
|
||||
border: 0.5px solid;
|
||||
}
|
||||
|
||||
.borders2 {
|
||||
border: 1px solid #D9D9D9;
|
||||
}
|
||||
|
||||
.newMainybot {
|
||||
padding-bottom: 0px !important;
|
||||
}
|
||||
/*All*/
|
||||
/*Registration.js*/
|
||||
/*.registrationback {*/
|
||||
/* height: 368px;*/
|
||||
/* width: 1200px;*/
|
||||
/* border: 0.5px solid;*/
|
||||
/* display: flex;*/
|
||||
/* display: -webkit-flex;*/
|
||||
/* flex-direction: column;*/
|
||||
/* align-items: center;*/
|
||||
/* background:url(../../../../../images/regis/tipregistit.jpg)*/
|
||||
|
||||
/*}*/
|
||||
|
||||
.registrationbackcenter {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/*.registrationback1 {*/
|
||||
/* height: 368px;*/
|
||||
/* width: 1200px;*/
|
||||
/* border: 0.5px solid;*/
|
||||
/* display: flex;*/
|
||||
/* flex-direction: column;*/
|
||||
/* background:url(../../../../../images/regis/tipregistit.jpg)*/
|
||||
/*}*/
|
||||
|
||||
.registrationbackp1 {
|
||||
color: #ffffff;
|
||||
font-size: 42px;
|
||||
margin-top: 80px;
|
||||
line-height: 42px;
|
||||
font-weight: bold;
|
||||
|
||||
}
|
||||
|
||||
.registrationbackp11 {
|
||||
color: #ffffff;
|
||||
font-size: 48px;
|
||||
margin-top: 71px;
|
||||
line-height: 48px;
|
||||
font-weight: bold;
|
||||
margin-left: 251px;
|
||||
|
||||
}
|
||||
|
||||
.registrationbackp2 {
|
||||
color: #ffffff;
|
||||
font-size: 18px;
|
||||
margin-top: 16px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.registrationbackp22 {
|
||||
margin-left: 251px;
|
||||
color: #ffffff;
|
||||
font-size: 36px;
|
||||
margin-top: 25px;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.registrationbackp3 {
|
||||
color: #ffffff;
|
||||
font-size: 18px;
|
||||
line-height: 20px;
|
||||
margin-top: 7px;
|
||||
}
|
||||
|
||||
.registrationbackp4 {
|
||||
color: #ffffff;
|
||||
font-size: 26px;
|
||||
margin-top: 25px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.registrationbackp5 {
|
||||
color: #ffffff;
|
||||
font-size: 26px;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
|
||||
.registrationbackp2button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 36px;
|
||||
}
|
||||
|
||||
.registrationbackp2button2 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
.registrationbackp2button3 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 44px;
|
||||
margin-left: 251px;
|
||||
|
||||
}
|
||||
|
||||
.registbut1 {
|
||||
margin-right: 46px;
|
||||
text-align: center;
|
||||
background: #0BDEE6;
|
||||
border-radius: 10px;
|
||||
height: 54px;
|
||||
width: 156px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer
|
||||
|
||||
}
|
||||
|
||||
.personreg1 {
|
||||
margin-right: 46px;
|
||||
text-align: center;
|
||||
background: #C3C1C1;
|
||||
height: 54px;
|
||||
width: 156px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.registbut11 {
|
||||
margin-right: 46px;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
color: #ffffff;
|
||||
height: 48px;
|
||||
width: 156px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
border: 1px;
|
||||
border-style: solid;
|
||||
border-color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.registbut111 {
|
||||
margin-right: 46px;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
height: 41px;
|
||||
width: 146px;
|
||||
font-size: 16px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
border: 2px;
|
||||
border-style: solid;
|
||||
border-color: #ffffff;
|
||||
|
||||
}
|
||||
|
||||
.registbut1 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #ffffff;
|
||||
line-height: 54px;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.registbut11 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 48px;
|
||||
|
||||
}
|
||||
|
||||
.registbut22 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.registbut2 p {
|
||||
line-height: 54px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
color: #ffffff;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
cursor: pointer
|
||||
|
||||
}
|
||||
|
||||
.personreg1 p {
|
||||
color: #ffffff;
|
||||
font-size: 20px;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.registbut111 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 38px;
|
||||
}
|
||||
|
||||
.registbut222 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
line-height: 38px;
|
||||
|
||||
}
|
||||
|
||||
.registbut2 {
|
||||
text-align: center;
|
||||
color: #05101A;
|
||||
font-size: 20px;
|
||||
background: #F8EC25;
|
||||
height: 54px;
|
||||
width: 156px;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.registbut22 {
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
height: 48px;
|
||||
width: 156px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
border: 1px;
|
||||
border-style: solid;
|
||||
border-color: #ffffff;
|
||||
}
|
||||
|
||||
.registbut222 {
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
height: 41px;
|
||||
width: 146px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
border: 2px;
|
||||
border-style: solid;
|
||||
border-color: #ffffff;
|
||||
}
|
||||
|
||||
.bootom {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.bootomimg {
|
||||
height: 80px;
|
||||
width: 125px;
|
||||
margin-top: 107px;
|
||||
|
||||
}
|
||||
|
||||
.bootomtext {
|
||||
color: #999999;
|
||||
font-size: 16px;
|
||||
margin-top: 33px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*Registration.js*/
|
||||
|
||||
/*Registrationitem.js*/
|
||||
/*横向*/
|
||||
.regitem {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
margin-top: 44px;
|
||||
}
|
||||
|
||||
.myregitem11 {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
|
||||
.regitem22 {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
margin-top: 27px;
|
||||
margin-bottom: 19px;
|
||||
}
|
||||
|
||||
.yslborderbottom {
|
||||
border-bottom: 1px solid #EDEDED;
|
||||
}
|
||||
|
||||
.registrationback {
|
||||
height: 368px;
|
||||
width: 1200px;
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.registrationback1 {
|
||||
height: 368px;
|
||||
width: 1200px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.regitem2 {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
padding-bottom: 18px;
|
||||
margin-top: 19px;
|
||||
|
||||
}
|
||||
|
||||
/*垂直*/
|
||||
.regitemimg1 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 17px;
|
||||
}
|
||||
|
||||
.perregitemimg1 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-left: 26px;
|
||||
|
||||
}
|
||||
|
||||
.regitemimg2 {
|
||||
height: 78px;
|
||||
width: 78px;
|
||||
background-color: transparent;
|
||||
margin-bottom: 9px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.personregitemimg {
|
||||
height: 64px;
|
||||
width: 64px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
|
||||
.regitemimg2 p {
|
||||
border: 0.5px solid;
|
||||
color: #999999;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.regitemimgs {
|
||||
width: 69px;
|
||||
height: 69px;
|
||||
margin-top: 3px;
|
||||
background-color: transparent;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
|
||||
.regitemimgs2 {
|
||||
margin-top: 16px;
|
||||
width: 49px;
|
||||
height: 51px;
|
||||
margin-left: 25px;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
|
||||
.regitemimgs22 {
|
||||
margin-top: 27px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-left: 20px;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
|
||||
.regitemimgs222 {
|
||||
margin-top: 12px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
margin-left: 20px;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
|
||||
.regitemimgs3 {
|
||||
/* border: 0.5px solid; */
|
||||
height: 22px;
|
||||
width: 22px;
|
||||
font-size: 21px !important;
|
||||
margin-top: 19px;
|
||||
color: #1C91E8;
|
||||
}
|
||||
|
||||
.regitemimgs4 {
|
||||
width: 156px;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.regitemimgs444 {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
margin-top: 18px;
|
||||
}
|
||||
.regitemimgs5 {
|
||||
margin-left: 10px;
|
||||
text-align: center;
|
||||
background: #ffffff;
|
||||
height: 40px;
|
||||
width: 72px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px;
|
||||
border-style: solid;
|
||||
border-color: #459BE5;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.regitemimgs555 {
|
||||
margin-left: 33px;
|
||||
text-align: center;
|
||||
background: #ffffff;
|
||||
height: 40px;
|
||||
width: 72px;
|
||||
color: #459be5;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px;
|
||||
border-style: solid;
|
||||
border-color: #459BE5;
|
||||
cursor: pointer
|
||||
}
|
||||
|
||||
.regitemimgs555 p {
|
||||
line-height: 39px;
|
||||
color: #459be5;
|
||||
}
|
||||
.regitemimgs6 {
|
||||
|
||||
text-align: center;
|
||||
background: #ffffff;
|
||||
height: 40px;
|
||||
width: 72px;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 1px;
|
||||
cursor: pointer;
|
||||
border-style: solid;
|
||||
border-color: #459BE5;
|
||||
}
|
||||
|
||||
.regitemimgs5 p {
|
||||
color: #459BE5;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
line-height: 39px;
|
||||
}
|
||||
|
||||
.regitemimgs6 p {
|
||||
color: #459BE5;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
line-height: 39px;
|
||||
|
||||
}
|
||||
|
||||
/*Registrationitem.js*/
|
||||
|
||||
/*RegistrationSearch.js*/
|
||||
.searchhead {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
margin-top: 24px;
|
||||
|
||||
}
|
||||
|
||||
.packinputs button {
|
||||
background: #459BE5;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.packinputs {
|
||||
width: 317px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
|
||||
/*RegistrationSearch.js*/
|
||||
.reglistviewdiv {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
margin-top: 25px;
|
||||
}
|
||||
|
||||
/*RegisListview.js*/
|
||||
.reglistviewdivs {
|
||||
margin-top: 25px;
|
||||
|
||||
}
|
||||
|
||||
.reglistviewdivss {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
|
||||
}
|
||||
|
||||
.reglistviewdivss2 {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
|
||||
}
|
||||
|
||||
.reglistviewdivss2c {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.reglistviewdivss2p {
|
||||
width: 90px;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.reglistviewdivss4p {
|
||||
width: 90px;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.reglistviewdivss5p {
|
||||
width: 110px;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.reglistviewdivss33p {
|
||||
width: 25px;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
.reglistviewdivss333p {
|
||||
width: 31px;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
.reglistviewdivss3p {
|
||||
width: 31px;
|
||||
font-size: 12px;
|
||||
color: #666666;
|
||||
text-align: center;
|
||||
|
||||
}
|
||||
|
||||
reglistviewdivs2 {
|
||||
margin-top: 27px;
|
||||
|
||||
}
|
||||
|
||||
/*RegisListview.js*/
|
||||
|
||||
|
||||
/*RegisListviewdata.js*/
|
||||
.reglistimg1 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
}
|
||||
|
||||
.reglistimg2 {
|
||||
border: 0.5px solid;
|
||||
height: 78px;
|
||||
width: 78px;
|
||||
}
|
||||
|
||||
/*RegisListviewdata.js*/
|
||||
|
||||
|
||||
/*PersonModal.js*/
|
||||
.yslanswerList {
|
||||
|
||||
}
|
||||
|
||||
.yslanswerList li {
|
||||
|
||||
}
|
||||
|
||||
.yslanswerList li:hover {
|
||||
background-color: #F6F4F4;
|
||||
}
|
||||
.permaindiv {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
|
||||
.demo-loading-container {
|
||||
position: absolute;
|
||||
bottom: 40px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.demo-infinite-container {
|
||||
border-radius: 2px;
|
||||
overflow: auto;
|
||||
height: 215px;
|
||||
width: 485px;
|
||||
|
||||
}
|
||||
|
||||
.demo-infinite-containerdiv {
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.demo-infinite-containerdiv2 {
|
||||
margin-top: 24px;
|
||||
|
||||
}
|
||||
|
||||
.backgroundspersondiv {
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.cpersondiv1 {
|
||||
height: 161px;
|
||||
width: 410px;
|
||||
}
|
||||
|
||||
.demo-infinite-container2 {
|
||||
border-radius: 2px;
|
||||
overflow: auto;
|
||||
height: 161px;
|
||||
width: 410px;
|
||||
|
||||
}
|
||||
|
||||
.demo-infinite-container33 {
|
||||
border-radius: 2px;
|
||||
height: 161px;
|
||||
width: 410px;
|
||||
|
||||
}
|
||||
.cpersondiv1Items {
|
||||
color: #05101A;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.personbut1 {
|
||||
background: #F2F2F2;
|
||||
border-color: #F2F2F2;
|
||||
margin-right: 26px;
|
||||
width: 120px;
|
||||
height: 38px;
|
||||
color: #4A4A4A;
|
||||
font-size: 16px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.personbut1 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
color: #4A4A4A;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.personbut2 {
|
||||
background: #459BE5;
|
||||
border-color: #459BE5;
|
||||
margin-right: 26px;
|
||||
width: 120px;
|
||||
height: 38px;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.personbut2 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*PersonModal.js*/
|
||||
|
||||
|
||||
/*PersonalModalteam.js*/
|
||||
.personaldiv {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.personaldivbutt1 {
|
||||
|
||||
background: #F2F2F2;
|
||||
border-color: #F2F2F2;
|
||||
margin-right: 23px;
|
||||
width: 100px;
|
||||
height: 38px;
|
||||
color: #4A4A4A;
|
||||
font-size: 16px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.personaldivbutt1 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
color: #666666;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.personaldivbutt2 {
|
||||
background: #459BE5;
|
||||
border-color: #459BE5;
|
||||
width: 100px;
|
||||
height: 38px;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
border-radius: 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.personaldivbutt2 p {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
color: #ffffff;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.task-btn-orange {
|
||||
background: #4CACFF !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
|
||||
.task-btn {
|
||||
cursor: pointer;
|
||||
display: inline-block;
|
||||
border: none;
|
||||
padding: 0 12px;
|
||||
letter-spacing: 1px;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
/*PersonalModalteam.js*/
|
||||
|
||||
|
||||
/*文字长度限制*/
|
||||
.maxnamewidth100 {
|
||||
max-width: 100px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.maxnamewidth78 {
|
||||
width: 78px !important;
|
||||
max-width: 78px !important;
|
||||
min-width: 78px !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
.maxnamewidth85 {
|
||||
max-width: 85px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.maxnamewidth90 {
|
||||
max-width: 90px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.maxnamewidth110 {
|
||||
max-width: 110px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
|
||||
.maxnamewidth160 {
|
||||
width: 160px !important;
|
||||
min-width:160px !important;
|
||||
max-width: 160px !important;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.maxnamewidth134 {
|
||||
max-width: 134px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
/*文字长度限制?*/
|
||||
|
||||
|
||||
.textsize{
|
||||
width: 160px !important;
|
||||
min-width: 160px !important;
|
||||
max-width: 160px !important;
|
||||
text-align: center;
|
||||
}
|
|
@ -1,59 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {getImageUrl} from 'educoder';
|
||||
import {Modal, Input, Spin, Tooltip, Icon, Dropdown, Button} from 'antd';
|
||||
import axios from 'axios';
|
||||
import competition from '../comcss/competition.css';
|
||||
import Registrationitem from "../Registrationitem";
|
||||
import InfiniteScroll from 'react-infinite-scroller';
|
||||
// import PersonModaltion from "./PersonModaltion";
|
||||
const {Search} = Input;
|
||||
|
||||
//退出战队
|
||||
class ExittheteamModel extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {}
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const {
|
||||
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
|
||||
} = this.state;
|
||||
//Modal
|
||||
//keyboard是否支持键盘 esc 关闭
|
||||
//closable 是否显示右上角的关闭按钮
|
||||
//底部内容,当不需要默认底部按钮时,可以设为 footer={null}
|
||||
//destroyOnClose 关闭时销毁 Modal 里的子元素
|
||||
//centered 垂直居中展示 Modal
|
||||
//visible 弹出框是否显示
|
||||
|
||||
return (
|
||||
|
||||
<Modal
|
||||
keyboard={false}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
title={this.props.messageexit}
|
||||
centered={true}
|
||||
visible={this.props.messageexitol === undefined ? false : this.props.messageexitol}
|
||||
width="480px"
|
||||
>
|
||||
|
||||
<div className="task-popup-content">
|
||||
<div className="task-popup-text-center font-14">{this.props.exitintpermessages}</div>
|
||||
</div>
|
||||
<div className="task-popup-submit clearfix">
|
||||
<a className="pop_close task-btn mb10 mr40 colorFFF"
|
||||
onClick={() => this.props.Exittheteam(false)}>取消</a>
|
||||
<a className="task-btn task-btn-orange fr" onClick={() => this.props.Exittheteam(true)}>确定</a>
|
||||
</div>
|
||||
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default ExittheteamModel;
|
|
@ -1,63 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {getImageUrl} from 'educoder';
|
||||
import {Modal, Input, Spin, Tooltip, Icon, Dropdown, Button} from 'antd';
|
||||
import axios from 'axios';
|
||||
import competition from '../comcss/competition.css';
|
||||
import Registrationitem from "../Registrationitem";
|
||||
import InfiniteScroll from 'react-infinite-scroller';
|
||||
// import PersonModaltion from "./PersonModaltion";
|
||||
const {Search} = Input;
|
||||
|
||||
class MessagePersonModal extends React.Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {}
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const {
|
||||
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
|
||||
} = this.state;
|
||||
//Modal
|
||||
//keyboard是否支持键盘 esc 关闭
|
||||
//closable 是否显示右上角的关闭按钮
|
||||
//底部内容,当不需要默认底部按钮时,可以设为 footer={null}
|
||||
//destroyOnClose 关闭时销毁 Modal 里的子元素
|
||||
//centered 垂直居中展示 Modal
|
||||
//visible 弹出框是否显示
|
||||
|
||||
return (
|
||||
|
||||
<Modal
|
||||
keyboard={false}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
title={this.props.messagePer}
|
||||
centered={true}
|
||||
visible={this.props.messagePerbool === undefined ? false : this.props.messagePerbool}
|
||||
width="480px"
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
}}
|
||||
>
|
||||
<div style={{width: "100%", textAlign: "center"}}
|
||||
className="task-popup-text-center font-16 ">{this.props.intpermessages}</div>
|
||||
<div style={{textAlign: "center", marginTop: "30px"}}
|
||||
className="task-popup-text-center task-btn task-btn-orange"
|
||||
onClick={() => this.props.messagePerboolbuton()}>确认
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default MessagePersonModal;
|
File diff suppressed because it is too large
Load Diff
|
@ -1,50 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {
|
||||
BrowserRouter as Router,
|
||||
Route,
|
||||
Switch
|
||||
} from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import moment from 'moment';
|
||||
import competition from './comcss/competition.css';
|
||||
import {Checkbox, Table, Pagination, Menu, Icon} from "antd";
|
||||
// 团队竞赛报名无报名子组件团队 在线竞赛 > 全国高校计算机大赛-项目挑战>
|
||||
|
||||
class PersonModaltion extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="reglistviewdivs">
|
||||
<div className="reglistviewdivss " style={{
|
||||
width: "100%",
|
||||
display: "flex",
|
||||
justifyContent: " space-around",
|
||||
alignItems: "center",
|
||||
height: "50px",
|
||||
backgroundPosition: "center",
|
||||
backgroundSize: "110% 100%",
|
||||
backgroundColor: "#E0E0E0",
|
||||
}}>
|
||||
<p className="borders"
|
||||
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>姓名</p>
|
||||
<p className="borders"
|
||||
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>角色</p>
|
||||
<p className="borders"
|
||||
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>单位</p>
|
||||
<p className="borders"
|
||||
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>其他</p>
|
||||
<p className="borders"
|
||||
style={{fontSize: "16px", color: "#05101A", textAlign: "center"}}>操作</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default PersonModaltion;
|
|
@ -1,146 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {getImageUrl} from 'educoder';
|
||||
import {Modal, Input, Spin, Tooltip, Icon, Dropdown, Button} from 'antd';
|
||||
import axios from 'axios';
|
||||
import competition from '../comcss/competition.css';
|
||||
import Registrationitem from "../Registrationitem";
|
||||
import InfiniteScroll from 'react-infinite-scroller';
|
||||
// import PersonModaltion from "./PersonModaltion";
|
||||
const {Search} = Input;
|
||||
|
||||
//立即申请试用
|
||||
class PersonalModalteam extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
yslzxueshiskmcdm1: "",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Tmoconfirmto = () => {
|
||||
try {
|
||||
if (this.state.yslzxueshiskmcdm1) {
|
||||
if (this.state.yslzxueshiskmcdm1.length === 0) {
|
||||
this.props.showNotification(`请输入您的邀请码`);
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
let url = `/competitions/${this.props.match.params.identifier}/competition_teams/join.json`;
|
||||
axios.post(url, {
|
||||
invite_code: this.state.yslzxueshiskmcdm1
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
if (result.data) {
|
||||
try {
|
||||
if (result.data.status === 0) {
|
||||
this.props.showNotification(`报名成功,预祝您夺得桂冠`);
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
this.props.Tmoconfirm(true)
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
studentsonChange = (e) => {
|
||||
this.setState({
|
||||
yslzxueshiskmcdm1: e.target.value,
|
||||
});
|
||||
|
||||
}
|
||||
render() {
|
||||
const {
|
||||
addonAfter, test, test3, Numberofteammentors, Thecurrentnumber, person1, person2
|
||||
} = this.state;
|
||||
//Modal
|
||||
//keyboard是否支持键盘 esc 关闭
|
||||
//closable 是否显示右上角的关闭按钮
|
||||
//底部内容,当不需要默认底部按钮时,可以设为 footer={null}
|
||||
//destroyOnClose 关闭时销毁 Modal 里的子元素
|
||||
//centered 垂直居中展示 Modal
|
||||
//visible 弹出框是否显示
|
||||
|
||||
return (
|
||||
|
||||
<Modal
|
||||
keyboard={false}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
title="加入战队"
|
||||
centered={true}
|
||||
visible={this.props.tmodalsTypes === undefined ? false : this.props.tmodalsTypes}
|
||||
width="600px"
|
||||
>
|
||||
|
||||
<div className="personaldiv">
|
||||
<div style={{
|
||||
display: "flex",
|
||||
flexDirection: "initial",
|
||||
marginTop: "10px",
|
||||
}}>
|
||||
<p style={{
|
||||
width: "67px",
|
||||
fontSize: "16px",
|
||||
color: '#05101A',
|
||||
height: "40px",
|
||||
lineHeight: "40px",
|
||||
}}>
|
||||
邀请码:
|
||||
</p>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.yslzxueshiskmcdm1 {
|
||||
height: 40px !important;
|
||||
width: 329px !important;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<Input className={"yslzxueshiskmcdm1"} value={this.state.yslzxueshiskmcdm1}
|
||||
onChange={(e) => this.studentsonChange(e)} placeholder="请输入您的邀请码"/>
|
||||
|
||||
</div>
|
||||
|
||||
<div style={{
|
||||
marginTop: "48px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
paddingBottom: "12px",
|
||||
|
||||
}}>
|
||||
<div style={{
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
width: "100%"
|
||||
}}>
|
||||
<div className="personaldivbutt1">
|
||||
<p onClick={() => this.props.Tmoconfirm(false)}>取消</p>
|
||||
</div>
|
||||
<div className="personaldivbutt2">
|
||||
<p onClick={() => this.Tmoconfirmto()}>确定</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default PersonalModalteam;
|
|
@ -1,97 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {SnackbarHOC, WordsBtn} from 'educoder';
|
||||
import {TPMIndexHOC} from '../../tpm/TPMIndexHOC';
|
||||
import competition from '../comcss/competition.css';
|
||||
import {Button, Pagination,} from 'antd';
|
||||
import CompetitionMaxImg from '../CompetitionMaxImg';
|
||||
import Registrationitem from '../Registrationitem';
|
||||
|
||||
// 团队竞赛报名无报名
|
||||
class PersonalCompetit extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
loadingstate: false,
|
||||
page: 1,
|
||||
limit: 20,
|
||||
type: 6,
|
||||
pint: 1,
|
||||
test: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20],
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
paginationonChangestwo = (pageNumber) => {
|
||||
this.setState({
|
||||
page: pageNumber,
|
||||
loadingstate: true,
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
const {test, page, limit, type, pint} = this.state;
|
||||
const listItems = test.map((item, index) =>
|
||||
<Registrationitem></Registrationitem>
|
||||
);
|
||||
return (
|
||||
<div className="newMain clearfix ">
|
||||
<div className={"educontent mb20"} style={{width: "1200px", marginTop: "26px"}}>
|
||||
<div className="educontent mb20 ">
|
||||
<p className="clearfix mb20 mt10">
|
||||
<a className="btn colorgrey fl hovercolorblue ">在线竞赛</a>
|
||||
<span className="color-grey-9 fl ml3 mr3">></span>
|
||||
<a
|
||||
className=" btn colorgrey fl hovercolorblue ">全国高校计算机大赛-项目挑战</a>
|
||||
<span className="color-grey-9 fl ml3 mr3">></span>
|
||||
<WordsBtn className="fl">报名</WordsBtn>
|
||||
</p>
|
||||
</div>
|
||||
{/*大图*/}
|
||||
{
|
||||
type === 6 ?
|
||||
<CompetitionMaxImg type={type} pint={pint}></CompetitionMaxImg>
|
||||
:
|
||||
""
|
||||
}
|
||||
{
|
||||
pint === 1 || pint === 3 ?
|
||||
<div style={{
|
||||
marginTop: "22px"
|
||||
}}>
|
||||
<p>参赛总人数:<span style={{color: "#459BE5"}}>132</span><span style={{marginLeft: "5px"}}>人</span></p>
|
||||
</div>
|
||||
: ""}
|
||||
|
||||
{/*列表*/}
|
||||
{
|
||||
pint === 1 || pint === 3 ?
|
||||
<div
|
||||
style={{
|
||||
marginTop: "31px"
|
||||
}}
|
||||
>
|
||||
{
|
||||
listItems
|
||||
}
|
||||
|
||||
</div>
|
||||
: ""}
|
||||
{
|
||||
pint === 1 || pint === 3 ?
|
||||
<div className="edu-txt-center ysyslxh mt56 " style={{marginBottom: "192px",}}>
|
||||
<Pagination showQuickJumper current={page}
|
||||
onChange={this.paginationonChangestwo} pageSize={limit}
|
||||
total={30}></Pagination>
|
||||
</div>
|
||||
: ""
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default SnackbarHOC()(TPMIndexHOC(PersonalCompetit));
|
|
@ -1,402 +0,0 @@
|
|||
import React from 'react';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import { message, Tooltip } from 'antd';
|
||||
// 点击按钮复制功能
|
||||
function jsCopy(s) {
|
||||
var e = document.getElementById(s);
|
||||
e.select();
|
||||
document.execCommand("Copy");
|
||||
codesuccess()
|
||||
}
|
||||
|
||||
function codesuccess() {
|
||||
message.success('复制成功');
|
||||
};
|
||||
// 团队竞赛报名无报名子组件团队 竞赛报名-已创建战队
|
||||
class PersonalCompetititem extends React.Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { key, item, type, mode } = this.props;
|
||||
return (
|
||||
<div>
|
||||
{
|
||||
item !== undefined || item !== null ? <div className={"yslborderbottom"}>
|
||||
<div
|
||||
className={this.props.index === undefined || this.props.index === null ? "myregitem11" : this.props.index === 0 ? "regitem" : "myregitem11"}
|
||||
style={{
|
||||
marginBottom: "19px",
|
||||
}}>
|
||||
<div className="regitemimg1 ">
|
||||
<img className="regitemimg2" src={getImageUrl("images/" + item.creator.image_url)}>
|
||||
|
||||
</img>
|
||||
<a className="maxnamewidth78" title={item.creator.name} style={{
|
||||
color: "#999999",
|
||||
fontSize: "14px",
|
||||
width: "78px",
|
||||
textAlign: "center"
|
||||
|
||||
}}>{item.creator.name}</a>
|
||||
</div>
|
||||
<div className=" maxnamewidth160" style={{
|
||||
marginTop: "29px",
|
||||
marginLeft: "37px",
|
||||
width: "160px",
|
||||
textAlign: "center"
|
||||
}} >
|
||||
<a className="maxnamewidth160" title={item.name} style={{
|
||||
|
||||
color: "#05101A",
|
||||
fontSize: "16px",
|
||||
width: "160px",
|
||||
textAlign: "center"
|
||||
}}>{item.name}</a>
|
||||
</div>
|
||||
{this.props.type === 5 || this.props.type === 2 ?
|
||||
(this.props.mode === 3 ?
|
||||
<div style={{
|
||||
marginLeft: "37px",
|
||||
display: "flex",
|
||||
flexDirection: "initial",
|
||||
width: "340px"
|
||||
}}>
|
||||
{
|
||||
item && item.team_members.map((item, index) => {
|
||||
return (
|
||||
|
||||
index === 0 ?
|
||||
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 1 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 2 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 3 ?
|
||||
<div>
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
|
||||
<img className="regitemimgs222"
|
||||
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
|
||||
|
||||
</img>
|
||||
</div>
|
||||
: ""
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
:
|
||||
<div className=" " style={{
|
||||
marginLeft: "37px",
|
||||
display: "flex",
|
||||
flexDirection: "initial",
|
||||
width: "487px"
|
||||
}}>
|
||||
{
|
||||
item && item.team_members.map((item, index) => {
|
||||
return (
|
||||
|
||||
index === 0 ?
|
||||
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 1 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 2 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 3 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 4 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 5 ?
|
||||
<div>
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
|
||||
<img className="regitemimgs222"
|
||||
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
|
||||
|
||||
</img>
|
||||
</div>
|
||||
: ""
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</div>
|
||||
)
|
||||
:
|
||||
<div className=" " style={{
|
||||
marginLeft: "37px",
|
||||
display: "flex",
|
||||
flexDirection: "initial",
|
||||
width: "487px"
|
||||
}}>
|
||||
{
|
||||
item && item.team_members.map((item, index) => {
|
||||
return (
|
||||
|
||||
index === 0 ?
|
||||
<img className="regitemimgs" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 1 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 2 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 3 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 4 ?
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
: index === 5 ?
|
||||
<div>
|
||||
<img className="regitemimgs2" src={getImageUrl("images/" + item.image_url)}>
|
||||
|
||||
</img>
|
||||
|
||||
<img className="regitemimgs222"
|
||||
src={getImageUrl(`images/educoder/competitions/pexjiazai.png`)}>
|
||||
|
||||
</img>
|
||||
</div>
|
||||
: ""
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</div>
|
||||
}
|
||||
<div style={this.props.type === 5 || this.props.type === 2 ?
|
||||
(this.props.mode === 3 ?
|
||||
|
||||
{
|
||||
marginLeft: "37px",
|
||||
}
|
||||
:
|
||||
{
|
||||
marginLeft: "18px",
|
||||
}
|
||||
)
|
||||
: {
|
||||
marginLeft: "16px",
|
||||
}}>
|
||||
<div style={{ marginTop: "23px", width: '140px' }}>
|
||||
<span style={{
|
||||
color: "#05101A",
|
||||
fontSize: "16px",
|
||||
}}>邀请码:</span>
|
||||
<span
|
||||
style={{
|
||||
|
||||
color: "#05101A",
|
||||
fontSize: "16px",
|
||||
}}>{item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code}</span>
|
||||
</div>
|
||||
<div style={{
|
||||
overflow: 'hidden',
|
||||
height: "1px",
|
||||
width: "1px"
|
||||
}}>
|
||||
<input id={"copy_invite_code" + this.props.index}
|
||||
value={item.invite_code === null || item.invite_code === undefined ? "" : item.invite_code} />
|
||||
</div>
|
||||
</div>
|
||||
{item.invite_code === null || item.invite_code === undefined ?
|
||||
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
|
||||
style={{
|
||||
marginLeft: "18px",
|
||||
}}
|
||||
>
|
||||
</i>
|
||||
:
|
||||
<Tooltip placement="bottom" title={"复制邀请码"}>
|
||||
<i className="regitemimgs3 iconfont icon-fuzhi1 font-14 font-n"
|
||||
style={{
|
||||
marginLeft: "18px",
|
||||
}}
|
||||
onClick={() => {
|
||||
jsCopy("copy_invite_code" + this.props.index)
|
||||
}}
|
||||
>
|
||||
</i>
|
||||
</Tooltip>
|
||||
}
|
||||
|
||||
{
|
||||
this.props.type === 5 ?
|
||||
(this.props.mode === 3 ?
|
||||
<div className="regitemimgs444"
|
||||
style={{
|
||||
marginLeft: "32px",
|
||||
}}
|
||||
>
|
||||
<div className="regitemimgs555">
|
||||
<a
|
||||
href={`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
|
||||
style={{
|
||||
color: "#459be5",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
lineHeight: "39px",
|
||||
}}>战队详情</a>
|
||||
</div>
|
||||
<div className="regitemimgs555"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, true)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Createateamedit(item)}>
|
||||
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, false)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
:
|
||||
<div className="regitemimgs444"
|
||||
style={{
|
||||
marginLeft: "32px",
|
||||
}}
|
||||
>
|
||||
|
||||
<div className="regitemimgs5"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, true)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Createateamedit(item)}>
|
||||
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, false)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
: this.props.type === 2 ?
|
||||
(this.props.mode === 3 ?
|
||||
<div className="regitemimgs444 "
|
||||
style={{
|
||||
marginLeft: "32px",
|
||||
}}
|
||||
>
|
||||
<div className="regitemimgs555">
|
||||
<a
|
||||
href={`/competitions/${this.props.match.params.identifier}/competition_teams/${item.id}`}
|
||||
style={{
|
||||
color: "#459be5",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
lineHeight: "39px",
|
||||
}}>战队详情</a>
|
||||
</div>
|
||||
<div className="regitemimgs555"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, true)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Createateamedit(item)}>
|
||||
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, false)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
<div className="regitemimgs444 "
|
||||
style={{
|
||||
marginLeft: "32px",
|
||||
}}
|
||||
>
|
||||
<div className="regitemimgs5"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, true)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, true)}>删除战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "block" } : { display: "none" }}
|
||||
onClick={() => this.props.Createateamedit(item)}>
|
||||
<p onClick={() => this.props.Createateamedit(item)}>编辑战队</p>
|
||||
</div>
|
||||
<div className="regitemimgs6"
|
||||
style={item.manage_permission === true ? { display: "none" } : { display: "block" }}
|
||||
onClick={() => this.props.Exittheteamshow(item.id, false)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
:
|
||||
this.props.type === 3 ?
|
||||
<div className="regitemimgs4"
|
||||
style={{
|
||||
marginLeft: "32px",
|
||||
}}
|
||||
>
|
||||
|
||||
<div className="regitemimgs6" onClick={() => this.props.Exittheteamshow(item.id, false)}>
|
||||
<p onClick={() => this.props.Exittheteamshow(item.id, false)}>退出战队</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
:
|
||||
""
|
||||
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
: ""
|
||||
}
|
||||
</div>
|
||||
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default PersonalCompetititem;
|
|
@ -1,225 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Menu, Icon, List, Avatar,Row, Col,Tag,Pagination,Alert} from 'antd';
|
||||
import {getImageUrl} from 'educoder';
|
||||
import axios from 'axios';
|
||||
import './Competitionsindex.css';
|
||||
import NoneData from "../../courses/coursesPublic/NoneData";
|
||||
import LoadingSpin from '../../../common/LoadingSpin';
|
||||
|
||||
class CompetitionsIndex extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
current: 'all',
|
||||
datas:undefined,
|
||||
page:1,
|
||||
category:undefined
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
let{category,page}=this.state;
|
||||
this.getdata(category,page)
|
||||
}
|
||||
|
||||
getdata=(category,page)=>{
|
||||
const Url =`/competitions.json`;
|
||||
axios.get(Url,{params:{
|
||||
category:category,
|
||||
page:page,
|
||||
per_page:15,
|
||||
}
|
||||
}).then((response) => {
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
datas:response.data.competitions,
|
||||
count:response.data.count,
|
||||
})
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
handleClick = e => {
|
||||
this.setState({
|
||||
current: e.key,
|
||||
datas:undefined
|
||||
});
|
||||
let{category,page}=this.state;
|
||||
this.getdata(e.key,page)
|
||||
};
|
||||
|
||||
PaginationCourse=(pageNumber)=>{
|
||||
let {category}=this.state;
|
||||
this.setState({
|
||||
page: pageNumber,
|
||||
})
|
||||
this.getdata(category,pageNumber);
|
||||
}
|
||||
|
||||
render() {
|
||||
let {datas,page,count}=this.state;
|
||||
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div className="clearfix">
|
||||
<div>
|
||||
<div className="clearfix">
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.courses-head{
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
background-image: url(${getImageUrl(this.props.mygetHelmetapi && this.props.mygetHelmetapi.competition_banner_url === null ?`images/educoder/competitions/courses.jpg`:this.props.mygetHelmetapi&&this.props.mygetHelmetapi.competition_banner_url)});
|
||||
background-color: #081C4B;
|
||||
background-position: center;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<div className="courses-head pr Competitionshead ">
|
||||
<div className="edu-txt-center pathNavLine">
|
||||
<div className="inline path-nav"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="competitionstitle mb20">
|
||||
<div className="competitionstitle2">
|
||||
<Menu onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal">
|
||||
<Menu.Item key="all" className={"competitionmr50"}>
|
||||
<span className={"competitionsvalue"}>全部</span>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="nearly_published" className={"competitionmr50"}>
|
||||
<span className={"competitionsvalue"}>即将发布</span>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="progressing" className={"competitionmr50"}>
|
||||
<span className={"competitionsvalue"}>进行中</span>
|
||||
</Menu.Item>
|
||||
<Menu.Item key="ended" className={"competitionmr50"}>
|
||||
<span className={"competitionsvalue"}>往期比赛</span>
|
||||
</Menu.Item>
|
||||
</Menu>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className={"educontent clearfix mtf10 CompetitionsIndex mb20"}>
|
||||
|
||||
{datas===undefined?"":datas.length===0?"":<List
|
||||
itemLayout="vertical"
|
||||
size="large"
|
||||
dataSource={datas&&datas}
|
||||
renderItem={(item,key) => (
|
||||
<a target="_blank" href={item.competition_status==="ended"?`/competitions/${item.identifier}`:item.competition_status==="nearly_published"?item.permission.editable==true?`/competitions/${item.identifier}`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}`:null}
|
||||
className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
|
||||
item.permission.editable==true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}
|
||||
>
|
||||
|
||||
<div className={"CompetitionsList"} >
|
||||
{item.competition_status==="nearly_published"?
|
||||
item.permission.editable==true?"":<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>:""}
|
||||
{/*<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div>*/}
|
||||
{/*{item.description===null||item.description===undefined||item.description===""?<style>*/}
|
||||
{/*{*/}
|
||||
{/*`*/}
|
||||
{/*// .CompetitionsIndex .ant-list-vertical .ant-list-item-action{*/}
|
||||
{/*// margin-top:50px;*/}
|
||||
{/*// }*/}
|
||||
{/*`*/}
|
||||
{/*}*/}
|
||||
{/*</style>:""}*/}
|
||||
<img className={"competitonimg"}
|
||||
src={item.competition_status==="ended"?getImageUrl(`images/educoder/competitions/groups1.png`):item.competition_status==="nearly_published"?getImageUrl(`images/educoder/competitions/groups2.png`):item.competition_status==="progressing"?getImageUrl(`images/educoder/competitions/groups3.png`):""} />
|
||||
<List.Item
|
||||
key={key}
|
||||
actions={[
|
||||
<span>竞赛时间: {item.start_time}~{item.end_time}</span>,
|
||||
<span>报名截止时间:{item.enroll_end_time}</span>,
|
||||
]}
|
||||
extra={
|
||||
<div className={"pt50"} style={{"width":'314px'}}>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexdadels">奖金</div>
|
||||
</Col>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexdadels">浏览数</div>
|
||||
</Col>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexdadels">报名数</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexbottomvalue">¥{item.bonus}</div>
|
||||
</Col>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexbottomvalue">{item.competition_status==="nearly_published"?"--":item.visits_count}</div>
|
||||
</Col>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexbottomvalue">{item.competition_status==="nearly_published"?"--":item.member_count}</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<List.Item.Meta
|
||||
title={<a className={item.competition_status==="ended"?"competitionstitlesshou":item.competition_status==="nearly_published"?
|
||||
item.permission.editable==true?"competitionstitlesshou":"endedfont":"competitionstitlesshou"}>
|
||||
<a target="_blank" className={"competitionstitles"}
|
||||
href={item.competition_status==="ended"?`/competitions/${item.identifier}`:item.competition_status==="nearly_published"? item.permission.editable==true?`/competitions/${item.identifier}`:null:item.competition_status==="progressing"?`/competitions/${item.identifier}`:null}
|
||||
>{item.name}{item.sub_title===null?"":`——${item.sub_title}`}</a>
|
||||
{/*<span>{item.sub_title===null?"":*/}
|
||||
{/*<Tag className="competitionsrelative" color="#87d068">{item.sub_title}</Tag>}*/}
|
||||
{/*</span>*/}
|
||||
</a>}
|
||||
/>
|
||||
<span className={"span666"}>{item.description}</span>
|
||||
</List.Item>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
/>}
|
||||
|
||||
{datas===undefined?"":count===undefined?"":count >15 ?<div className="mb40 edu-txt-center padding20-30"
|
||||
>
|
||||
|
||||
<Pagination
|
||||
showQuickJumper
|
||||
defaultCurrent={1}
|
||||
pageSize={15}
|
||||
total={count===undefined?"":count}
|
||||
current={page}
|
||||
onChange={this.PaginationCourse}
|
||||
/>
|
||||
|
||||
</div>:""}
|
||||
|
||||
{
|
||||
datas===undefined?<LoadingSpin/>:datas && datas.length===0? <NoneData></NoneData>:""
|
||||
}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CompetitionsIndex;
|
|
@ -1,163 +0,0 @@
|
|||
.teamsLayout{background: transparent !important;}
|
||||
|
||||
.competitionstitle{
|
||||
height:50px !important;
|
||||
border-radius: 6px;
|
||||
background: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.competitionstitle2{
|
||||
height:50px !important;
|
||||
margin-left: 30px !important;
|
||||
background: #fff;
|
||||
width: 1200px;
|
||||
}
|
||||
.CompetitionsList{
|
||||
position: relative;
|
||||
/*max-height: 210px;*/
|
||||
}
|
||||
.competitonimg{
|
||||
position: absolute;
|
||||
right: -5px;
|
||||
width: 80px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
.ant-menu-horizontal {
|
||||
border-bottom:none !important;
|
||||
}
|
||||
|
||||
|
||||
.competitionsvalue{
|
||||
font-size: 16px;
|
||||
font-family: PingFangSC-Medium,PingFangSC;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.competitionmr50 {
|
||||
margin-right: 50px !important;
|
||||
}
|
||||
|
||||
.CompetitionsIndex .ant-list-item{
|
||||
background: #fff !important;
|
||||
margin-top: 20px;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.CompetitionsIndex .ant-list-item{
|
||||
padding:25px;
|
||||
}
|
||||
|
||||
.CompetitionsIndex .ant-list-item-meta-title{
|
||||
height:28px;
|
||||
font-size:28px;
|
||||
font-family:PingFangSC-Regular,PingFangSC;
|
||||
font-weight:400;
|
||||
color:rgba(5,16,26,1);
|
||||
line-height:28px;
|
||||
}
|
||||
|
||||
.CompetitionsIndex .ant-list-vertical .ant-list-item-meta{
|
||||
margin-bottom: 20px !important;
|
||||
}
|
||||
|
||||
.CompetitionsIndex .ant-list-vertical .ant-list-item-action {
|
||||
margin-top: 20px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.CompetitionsIndex .ant-list-item-action-split{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.CompetitionsIndexdadels{
|
||||
font-family: PingFangSC-Regular,PingFangSC;
|
||||
font-weight: 400;
|
||||
color: #777777;
|
||||
margin-bottom: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.CompetitionsIndexbottomvalue{
|
||||
font-size: 24px;
|
||||
font-family: ArialMT;
|
||||
color: rgba(5,16,26,1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.CompetitionsIndex .gutter-row{
|
||||
/*margin-right:20px;*/
|
||||
width: 33%;
|
||||
}
|
||||
|
||||
.pt50{
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
.competitionstitles{
|
||||
max-width: 789px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
margin-right: 15px;
|
||||
color:#000 !important;
|
||||
}
|
||||
|
||||
.competitionsrelative{
|
||||
position: absolute;
|
||||
top: 28px;
|
||||
}
|
||||
|
||||
.CompetitionsList:hover{
|
||||
/*box-shadow: 0 2px 6px rgba(51,51,51,.09);*/
|
||||
box-shadow:3px 4px 10px 2px rgba(229,229,229,0.5);
|
||||
opacity: 1;
|
||||
border-radius: 2px;
|
||||
}
|
||||
.endedfont{
|
||||
color:#000 !important;
|
||||
}
|
||||
.CompetitionsListzhezhao{
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 1206px;
|
||||
height: 100%;
|
||||
z-index: 10000;
|
||||
display: none;
|
||||
background: rgba(0,0,0,0.33);
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 22px;
|
||||
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
flex-direction: column;
|
||||
}
|
||||
.CompetitionsList:hover .CompetitionsListzhezhao{
|
||||
display: block;
|
||||
display: flex;
|
||||
}
|
||||
.competitionstitlesshou:hover a{
|
||||
cursor: pointer;
|
||||
color: #1c91e8 !important;
|
||||
}
|
||||
|
||||
.competitionstitlesshou{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
|
||||
.Competitionshead{
|
||||
background-color: #2d28ba !important;
|
||||
background-position: center !important;
|
||||
background-position: 50% !important;
|
||||
background-repeat: no-repeat !important;
|
||||
}
|
||||
|
||||
.span666{
|
||||
color:#666666 !important;
|
||||
}
|
|
@ -1,53 +0,0 @@
|
|||
.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;
|
||||
}
|
|
@ -1,267 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Tooltip} from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
|
||||
|
||||
import './Competitionteams.css';
|
||||
const { Content } = Layout;
|
||||
|
||||
class Competitionteams extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
shixundata: undefined,
|
||||
coursedata:undefined,
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
if(this.props.match.params.identifier!=null){
|
||||
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
|
||||
axios.get(url).then((response) => {
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
data:response.data,
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
this.getshixundata();
|
||||
this.getcoursedata();
|
||||
}
|
||||
|
||||
getshixundata=()=>{
|
||||
|
||||
const Url =`/competitions/${this.props.match.params.identifier}/competition_teams/${this.props.match.params.competition_team_id}/shixun_detail.json`;
|
||||
axios.get(Url).then((response) => {
|
||||
if(response.status===200){
|
||||
// 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 data=response.data;
|
||||
|
||||
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
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
getcoursedata=()=>{
|
||||
const Url =`/competitions/${this.props.match.params.identifier}/competition_teams/${this.props.match.params.competition_team_id}/course_detail.json`;
|
||||
|
||||
axios.get(Url).then((response) => {
|
||||
if(response.status===200){
|
||||
// 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 data=response.data;
|
||||
|
||||
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
|
||||
})
|
||||
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
let {data}=this.state;
|
||||
const shixuncolumns = [
|
||||
{
|
||||
title: '创建者',
|
||||
dataIndex: 'creator',
|
||||
key: 'creator',
|
||||
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoutheji":""}>{text}</div>,
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'shixun_name',
|
||||
key: 'shixun_name',
|
||||
render: (text, record) =>
|
||||
<div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}{record.forked===true?<Badge count={"原创"} style={{ backgroundColor: '#459BE5' }} />:""}</div>,
|
||||
},
|
||||
{
|
||||
title: '学习人数',
|
||||
dataIndex: 'myshixuns_count',
|
||||
key: 'myshixuns_count',
|
||||
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
|
||||
},
|
||||
{
|
||||
title: '被fork发布的学习人数',
|
||||
dataIndex: 'forked_myshixun_count',
|
||||
key: 'forked_myshixun_count',
|
||||
render: (text, record) =>
|
||||
<Tooltip placement="bottom" title={"fork该实训产生的新实训,学习总人数"}>
|
||||
<div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>
|
||||
</Tooltip>,
|
||||
},
|
||||
{
|
||||
title: '有效作品数',
|
||||
dataIndex: 'valid_count',
|
||||
key: 'valid_count',
|
||||
render: (text, record) =>
|
||||
<Tooltip placement="bottom" title={"至少完成了1个关卡"}>
|
||||
<div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>
|
||||
</Tooltip>,
|
||||
},
|
||||
{
|
||||
title: '应用值',
|
||||
dataIndex: 'score',
|
||||
key: 'score',
|
||||
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
|
||||
},
|
||||
];
|
||||
|
||||
const coursecolumns = [
|
||||
{
|
||||
title: '创建者',
|
||||
dataIndex: 'creator',
|
||||
key: 'creator',
|
||||
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoutheji":""}>{text}</div>,
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'course_name',
|
||||
key: 'course_name',
|
||||
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
|
||||
},
|
||||
{
|
||||
title: '学生数量',
|
||||
dataIndex: 'students_count',
|
||||
key: 'students_count',
|
||||
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
|
||||
},
|
||||
{
|
||||
title: '发布的实训作业数量',
|
||||
dataIndex: 'shixun_homework_count',
|
||||
key: 'shixun_homework_count',
|
||||
render: (text, record) =>
|
||||
<div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>
|
||||
,
|
||||
},
|
||||
{
|
||||
title: '有效作品数',
|
||||
dataIndex: 'valid_count',
|
||||
key: 'valid_count',
|
||||
render: (text, record) =>
|
||||
<Tooltip placement="bottom" title={"至少完成了1个关卡"}>
|
||||
<div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>
|
||||
</Tooltip>,
|
||||
},
|
||||
{
|
||||
title: '应用值',
|
||||
dataIndex: 'score',
|
||||
key: 'score',
|
||||
render: (text, record) => <div className={record.creator==="合计:"?"teamsLayoucolor-orange":""}>{text}</div>,
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
// console.log(this.state.shixundata)
|
||||
return (
|
||||
|
||||
<div className={"educontent clearfix mt20 "}>
|
||||
<Breadcrumb separator=">">
|
||||
<Breadcrumb.Item><Link to={"/competitions"}>{data&&data.name}</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item><Link to={`/competitions/${this.props.match.params.identifier}/enroll`}>报名</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item>战队详情</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
|
||||
<Layout className={"teamsLayout"}>
|
||||
|
||||
<Content className={"teamsLayoutitle"}>实训项目</Content>
|
||||
<Content className={"teamsLayoutContent"}>
|
||||
<Table className="teamsLayoutTable" columns={shixuncolumns} dataSource={this.state.shixundata} bordered pagination={false}/>
|
||||
</Content>
|
||||
<Content className={"teamsLayoutitle mt40"}>教学课堂</Content>
|
||||
<Content className={"teamsLayoutContents"}>
|
||||
<Table className="teamsLayoutTable" columns={coursecolumns} dataSource={this.state.coursedata} bordered pagination={false}/>
|
||||
</Content>
|
||||
|
||||
</Layout>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default Competitionteams;
|
|
@ -1,438 +0,0 @@
|
|||
.teamsLayout{background: transparent !important;}
|
||||
|
||||
.teamsLayout .ant-layout-sider{
|
||||
background: transparent !important;
|
||||
flex: 0 0 180px !important;
|
||||
max-width: 180px !important;
|
||||
min-width: 180px !important;
|
||||
width: 180px !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;
|
||||
}
|
||||
|
||||
.CompetitionCommonbanner{
|
||||
padding: 20px;
|
||||
background:rgba(255,255,255,1);
|
||||
box-shadow:3px 2px 12px 2px rgba(0,0,0,0.05);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.CompetitionCommonbannerfont{
|
||||
height:100%;
|
||||
width: 365px !important;
|
||||
line-height: 34px;
|
||||
}
|
||||
|
||||
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(1){
|
||||
max-height:100px;
|
||||
font-size:25px;
|
||||
font-weight:400;
|
||||
color:rgba(5,16,26,1);
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(2){
|
||||
max-height: 70px;
|
||||
font-size:16px;
|
||||
font-weight:400;
|
||||
/*color:rgba(155,155,155,1);*/
|
||||
color:#05101A;
|
||||
}
|
||||
|
||||
.CompetitionCommonbannerfont .competitionbannerdiv:nth-child(3){
|
||||
max-height: 70px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
/*color: rgba(155,155,155,1);*/
|
||||
color:#05101A;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.Competitioncolor9b{
|
||||
color: #9B9B9B;
|
||||
}
|
||||
|
||||
.Competitioncolor77{
|
||||
color: #777777;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.Competitioncolor516{
|
||||
font-size:24px;
|
||||
color:rgba(5,16,26,1);
|
||||
}
|
||||
|
||||
.Competitionfontsize22{
|
||||
font-size:22px;
|
||||
font-weight:500;
|
||||
color:rgba(255,255,255,1);
|
||||
}
|
||||
|
||||
.Competitionfontsize16{
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: rgba(102,102,102,1);
|
||||
}
|
||||
|
||||
.ant-layout-sider {
|
||||
position: relative;
|
||||
min-width: 0;
|
||||
background: #001529;
|
||||
-webkit-transition: all 0.2s;
|
||||
-o-transition: all 0.2s;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.CompetitionMenu .ant-menu-item::after {
|
||||
left: 0px !important;
|
||||
right: auto;
|
||||
border-right: 5px solid #4CACFF;
|
||||
}
|
||||
|
||||
.CompetitionMenu .ant-menu-item{
|
||||
height: 30px;
|
||||
line-height: 30px;
|
||||
background:none;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.CompetitionMenu .ant-menu-item:not(:last-child){
|
||||
margin-bottom: 40px;
|
||||
background: transparent;
|
||||
color:#666;
|
||||
}
|
||||
|
||||
.CompetitionMenu .ant-menu-item{
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.CompetitionMenu .ant-menu-item-selected {
|
||||
color: rgba(76,172,255,1) !important;
|
||||
}
|
||||
|
||||
.CompetitionMenu{
|
||||
width: 145px;
|
||||
background: #fff;
|
||||
border: 1px solid rgba(239,239,239,1);
|
||||
padding-top: 20px;
|
||||
padding-bottom: 40px !important;
|
||||
}
|
||||
|
||||
.teamsLayoutleft{
|
||||
background: transparent !important;
|
||||
}
|
||||
|
||||
.Competitioncharts{
|
||||
font-size: 24px;
|
||||
color: rgba(5,16,26,1);
|
||||
}
|
||||
.Competitionfirst{
|
||||
width:233px;
|
||||
height:298px;
|
||||
background:rgba(250,250,250,1);
|
||||
box-shadow:0px 2px 8px 2px rgba(255,134,34,0.5);
|
||||
border-radius:5px;
|
||||
}
|
||||
.Competitionsecondary{
|
||||
width:234px;
|
||||
height:298px;
|
||||
background:rgba(250,250,250,1);
|
||||
box-shadow:0px 3px 5px 0px rgba(254,190,154,1);
|
||||
border-radius:5px;
|
||||
}
|
||||
|
||||
.Competitionthird{
|
||||
width: 234px;
|
||||
height: 298px;
|
||||
background: rgba(250,250,250,1);
|
||||
box-shadow: 0px 4px 5px 0px rgba(200,200,202,1);
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.Competition399{
|
||||
height:399px;
|
||||
}
|
||||
|
||||
.Competitiontransparent table{
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.Commonimg{
|
||||
position: absolute;
|
||||
right: -5px;
|
||||
width:93px;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.Competitionthirdbox{
|
||||
width:234px;
|
||||
height:167px;
|
||||
background:rgba(223,223,225,1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.Competitionfirstbox{
|
||||
width:233px;
|
||||
height:167px;
|
||||
background:rgba(255,231,160,1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.Competitionsecondarybox{
|
||||
width:234px;
|
||||
height:167px;
|
||||
background:rgba(253,230,217,1);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.rankingimg{
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50% !important;
|
||||
box-shadow: 0px 0px 12px rgba(0,0,0,0.2);
|
||||
border: 2px solid #459BE5;
|
||||
}
|
||||
|
||||
.Competitioncenter{
|
||||
text-align: center;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
|
||||
.jinshaifont{
|
||||
font-size: 16px;
|
||||
color: rgba(5,16,26,1);
|
||||
margin-top: 13px !important;
|
||||
}
|
||||
|
||||
.Competitionthird .ant-card-body {
|
||||
padding: 12px;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
/*.Competitionthird .ant-card-meta-title{*/
|
||||
/*margin-bottom: 0px !important;*/
|
||||
/*}*/
|
||||
|
||||
.Competitionfirst .ant-card-body {
|
||||
padding: 12px;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.Competitionsecondary .ant-card-body {
|
||||
padding: 12px;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
.center{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.rankfonttop{
|
||||
font-size:14px;
|
||||
color:rgba(102,102,102,1);
|
||||
}
|
||||
|
||||
.rankfontmid{
|
||||
font-size:18px;
|
||||
color:rgba(102,102,102,1);
|
||||
}
|
||||
|
||||
.rankfontbottom{
|
||||
font-size:26px;
|
||||
color:rgba(165,91,41,1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.rankfontbottoms{
|
||||
font-size:28px;
|
||||
color:rgba(165,91,41,1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.Competitionuserimg{
|
||||
width: 64px;
|
||||
height: 63px;
|
||||
border-radius: 50%;
|
||||
border: 2px solid #459BE5;
|
||||
}
|
||||
|
||||
.CompetitionsListzhezhao{
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 1206px;
|
||||
height: 100%;
|
||||
z-index: 10000;
|
||||
display: none;
|
||||
background: rgba(0,0,0,0.33);
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
font-size: 22px;
|
||||
|
||||
}
|
||||
|
||||
.relative{position: relative;}
|
||||
|
||||
.relative:hover .CompetitionsListzhezhao{
|
||||
display: block;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.image_urlbox{
|
||||
width: 790px;
|
||||
height: 340px;
|
||||
}
|
||||
|
||||
.CompetitionContents{
|
||||
background: #fff !important;
|
||||
padding: 40px;
|
||||
box-shadow: 3px 2px 12px 2px rgba(0,0,0,0.05);
|
||||
border: 1px solid rgba(239,239,239,1);
|
||||
}
|
||||
|
||||
.rankbeicenter{
|
||||
text-align: center;
|
||||
}
|
||||
.rankbei{
|
||||
font-size: 16px;
|
||||
color: rgba(119,119,119,1);
|
||||
|
||||
}
|
||||
|
||||
.youranklist{
|
||||
background: rgba(226,241,255,1);
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
padding-left: 20px;
|
||||
}
|
||||
|
||||
.ranknames{
|
||||
font-size: 16px;
|
||||
color: rgba(62,62,62,1);
|
||||
}
|
||||
|
||||
.ranknameslast{
|
||||
font-size:16px;
|
||||
color:rgba(12,158,254,1);
|
||||
}
|
||||
|
||||
.textleft{
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.textright{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.userranksclass{
|
||||
text-align: left;
|
||||
width: 18%;
|
||||
padding-left: 12px;
|
||||
margin-right: 28px;
|
||||
}
|
||||
|
||||
.Commonimgbox{
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.CompetitionCommonbannerfont{
|
||||
width: 350px !important;
|
||||
margin-left:10px;
|
||||
}
|
||||
|
||||
.color000{
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.cursorpointer{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.rankfonttop{
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap
|
||||
}
|
||||
|
||||
.usernamebox{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
max-width: 100px;
|
||||
display: inherit;
|
||||
}
|
||||
|
||||
.competimgabsolute{
|
||||
position: absolute;
|
||||
left: 72px;
|
||||
bottom: -10px;
|
||||
}
|
||||
.competimgabsolute .ant-badge-count{
|
||||
box-shadow: none !important;
|
||||
}
|
||||
|
||||
.competimgabsoluteijmg{
|
||||
position: absolute;
|
||||
left: -11px;
|
||||
bottom: 0px;
|
||||
}
|
|
@ -1,548 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Breadcrumb,Layout,Table, Divider, Tag,Badge,Row, Col,Button, Menu, Icon} from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import axios from 'axios';
|
||||
import {markdownToHTML,getImageUrl} from 'educoder';
|
||||
import CompetitionContents from './CompetitionCommonChild/CompetitionContents';
|
||||
import CompetitionContentsChart from './CompetitionCommonChild/CompetitionContentsChart';
|
||||
import CompetitionContentsMd from './CompetitionCommonChild/CompetitionContentsMd';
|
||||
import CompetitionContentspdf from './CompetitionCommonChild/CompetitionContentspdf';
|
||||
|
||||
import './CompetitionCommon.css';
|
||||
|
||||
const {Sider } = Layout;
|
||||
|
||||
class CompetitionCommon extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
data: undefined,
|
||||
bannerdata: undefined,
|
||||
module_type: undefined,
|
||||
mdContentdata: undefined,
|
||||
chart_rules: undefined,
|
||||
Competitionedittype: false,
|
||||
chartdata: undefined,
|
||||
has_url: false,
|
||||
signupdata: undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
if(this.props.match.params.identifier!=null){
|
||||
this.getbannerdata();
|
||||
// this.setState({
|
||||
// thiskeys:this.props.location.search.replace('?menu=', '')
|
||||
// })
|
||||
// let url=`/competitions/${this.props.match.params.identifier}.json`;
|
||||
// axios.get(url).then((response) => {
|
||||
// if(response.status===200){
|
||||
// this.setState({
|
||||
// bannerdata:response.data
|
||||
// })
|
||||
// }
|
||||
// }).catch((error) => {
|
||||
// //console.log(error)
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate = (prevProps) => {
|
||||
if (prevProps.user != this.props.user) {
|
||||
|
||||
//console.log("componentDidUpdatess");
|
||||
//console.log(this.props.user);
|
||||
if (this.props.user && this.props.user.login != "") {
|
||||
const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`;
|
||||
axios.get((zul)).then((result) => {
|
||||
if (result) {
|
||||
if (result.data) {
|
||||
this.setState({
|
||||
signupdata: result.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
////console.log(error);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//获取头部信息
|
||||
getbannerdata=()=>{
|
||||
// let menuid=this.props.location.search.replace('?menu=', '');
|
||||
let query=this.props.location&&this.props.location.search;
|
||||
const types = query.split('&')
|
||||
const menuid = types[0].split('?menu=')
|
||||
let url=`/competitions/${this.props.match.params.identifier}/common_header.json`;
|
||||
axios.get(url).then((response) => {
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
data: response.data,
|
||||
thiskeys: menuid[1] === undefined || menuid[1] === "" ? response.data.competition_modules[0].id : menuid[1],
|
||||
mode: response.data.mode
|
||||
})
|
||||
if(menuid[1]===undefined||menuid[1]===""){
|
||||
this.getrightdata(
|
||||
response.data.competition_modules[0].id,
|
||||
response.data.competition_modules[0].module_type,
|
||||
response.data.competition_modules[0].module_url,
|
||||
response.data.competition_modules[0].has_url
|
||||
)
|
||||
}else{
|
||||
let newlist=response.data.competition_modules;
|
||||
newlist.map((item,key)=>{
|
||||
if(`${item.id}`===`${menuid[1]}`){
|
||||
this.getrightdata(
|
||||
item.id,
|
||||
item.module_type,
|
||||
item.module_url,
|
||||
item.has_url
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
//console.log(error)
|
||||
})
|
||||
|
||||
//this.props.user 有可能为空
|
||||
|
||||
if (this.props.user && this.props.user.login != "") {
|
||||
const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`;
|
||||
axios.get((zul)).then((result) => {
|
||||
if (result) {
|
||||
if (result.data) {
|
||||
this.setState({
|
||||
signupdata: result.data
|
||||
})
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
////console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
getrightdatas=(e)=>{
|
||||
let keys = parseInt(e.key);
|
||||
this.getlistdata(keys)
|
||||
this.props.history.replace(`?menu=${keys}`);
|
||||
}
|
||||
|
||||
getlistdata=(keys,listkey)=>{
|
||||
|
||||
let{data}=this.state;
|
||||
this.setState({
|
||||
thiskeys:keys
|
||||
})
|
||||
data&&data.competition_modules.map((item,key)=>{
|
||||
if(item.module_type!="enroll") {
|
||||
if (keys === item.id) {
|
||||
this.getrightdata(item.id, item.module_type, item.module_url, item.has_url, listkey)
|
||||
return
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
getnewchartdata=(typeid,tabkey)=>{
|
||||
if(typeid==="chart"){
|
||||
let url=`/competitions/${this.props.match.params.identifier}/chart_rules.json`;
|
||||
axios.get(url)
|
||||
.then((response) => {
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
chart_rules:response.data,
|
||||
tabkey: tabkey === undefined ? response.data.stages[0].id === null ? "0" : `${response.data.stages[0].id}` : tabkey
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
}).catch((error) => {
|
||||
//console.log(error)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
getrightdata=(id,typeid,module_url,has_url,listkey)=>{
|
||||
|
||||
// if(typeid==="enroll"){
|
||||
// this.props.history.replace(`/competitions/${this.props.match.params.identifier}/enroll`);
|
||||
// return
|
||||
// }
|
||||
|
||||
this.getnewchartdata(typeid, listkey)
|
||||
|
||||
if(has_url===false){
|
||||
let url=`${module_url}`;
|
||||
axios.get(url).then((response) => {
|
||||
if(response.status===200){
|
||||
|
||||
if(typeid==="chart"){
|
||||
this.setState({
|
||||
chartdata:response.data
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
mdContentdata:response.data
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}).catch((error) => {
|
||||
//console.log(error)
|
||||
})
|
||||
}else{
|
||||
if (module_url.substring(0, 7) == 'http://' || module_url.substring(0, 8) == 'https://') {
|
||||
// window.location.href= module_url
|
||||
window.open(module_url)
|
||||
}else{
|
||||
window.open(`https://${module_url}`)
|
||||
// window.location.href=;
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
this.setState({
|
||||
module_id:id,
|
||||
module_type:typeid,
|
||||
has_url:has_url
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Competitionedit=()=>{
|
||||
this.setState({
|
||||
Competitionedittype: true
|
||||
})
|
||||
}
|
||||
|
||||
hideCompetitionedit=()=>{
|
||||
this.setState({
|
||||
Competitionedittype:false
|
||||
})
|
||||
|
||||
}
|
||||
newgotocourse=(url)=>{
|
||||
if(this.props.checkIfLogin()===false){
|
||||
this.props.showLoginDialog()
|
||||
return
|
||||
}
|
||||
if(this.props.checkIfProfileCompleted()===false){
|
||||
this.props.showProfileCompleteDialog()
|
||||
return
|
||||
}
|
||||
window.open(url);
|
||||
|
||||
}
|
||||
|
||||
gotocourse=(url)=>{
|
||||
if(this.props.checkIfLogin()===false){
|
||||
this.props.showLoginDialog()
|
||||
return
|
||||
}
|
||||
if(this.props.checkIfProfileCompleted()===false){
|
||||
this.props.showProfileCompleteDialog()
|
||||
return
|
||||
}
|
||||
|
||||
if(url===undefined){
|
||||
let {data,signupdata}=this.state;
|
||||
// if(signupdata.enrolled===true){
|
||||
// this.props.history.replace(`/classrooms/${data.course_id}`);
|
||||
// }else{ }
|
||||
|
||||
if (data.member_of_course === true) {
|
||||
// this.props.history.replace(`/classrooms/${data.course_id}`);
|
||||
window.open(`/classrooms/${data.course_id}`)
|
||||
} else {
|
||||
// 以学生身份调用加入课堂 进入课堂首页
|
||||
let url = "/classrooms/apply_to_join_course.json"
|
||||
axios.post(url, {
|
||||
invite_code: data.invite_code,
|
||||
student: 1
|
||||
}
|
||||
).then((response) => {
|
||||
if (response.data.status === 0) {
|
||||
// this.props.history.replace();
|
||||
this.getbannerdata()
|
||||
window.open(`/classrooms/${data.course_id}`);
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
if (url === "personal") {
|
||||
let urls = `/competitions/${this.props.match.params.identifier}/enroll`;
|
||||
this.Personalregistration(urls)
|
||||
} else {
|
||||
window.open(url);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Personalregistration = (urls) => {
|
||||
|
||||
let {signupdata} = this.state;
|
||||
|
||||
if (signupdata.enroll_ended === true) {
|
||||
//已截止
|
||||
this.props.showNotification(`报名已截止`);
|
||||
return;
|
||||
}
|
||||
if (signupdata.enrolled === true) {
|
||||
this.props.showNotification(`你已经报名,不能重复报名!`);
|
||||
return;
|
||||
}
|
||||
const url = `/competitions/${this.props.match.params.identifier}/competition_teams.json`;
|
||||
axios.post(url).then((response) => {
|
||||
if (response) {
|
||||
if (response.data) {
|
||||
this.props.showNotification(`报名成功,预祝您夺得桂冠!`);
|
||||
// this.props.history.replace(urls);
|
||||
this.getbannerdata()
|
||||
window.open(urls)
|
||||
}
|
||||
}
|
||||
}).catch((error) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Competitioncallback=(key)=>{
|
||||
this.setState({
|
||||
tabkey:key
|
||||
})
|
||||
let url=`/competitions/${this.props.match.params.identifier}/charts.json`;
|
||||
axios.get(url,{params:{
|
||||
stage_id:key===0||key===null?undefined:key
|
||||
}}).then((response) => {
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
chartdata:response.data
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
//console.log(error)
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
let {data, module_type, Competitionedittype, signupdata} = this.state;
|
||||
|
||||
return (
|
||||
data===undefined?"":<div className={"educontent clearfix mt20 "}>
|
||||
|
||||
<Breadcrumb separator=">">
|
||||
<Breadcrumb.Item><Link to={"/competitions"}>在线竞赛</Link></Breadcrumb.Item>
|
||||
<Breadcrumb.Item>{data && data.name}</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
|
||||
<div className={"mt10 relative"}>
|
||||
|
||||
<Row className={"CompetitionCommonbanner"}>
|
||||
{data.competition_status === "nearly_published" ?
|
||||
data && data.permission.editable === true ? "" :
|
||||
<div className={"CompetitionsListzhezhao"}>即将发布 敬请期待</div> : ""}
|
||||
<img className={"Commonimg"}
|
||||
src={data.competition_status === "ended" ? getImageUrl(`images/educoder/competitions/groups1.png`) : data.competition_status === "nearly_published" ? getImageUrl(`images/educoder/competitions/groups2.png`) : data.competition_status === "progressing" ? getImageUrl(`images/educoder/competitions/groups3.png`) : ""}/>
|
||||
<Col span={15} className={"Commonimgbox"}>
|
||||
<img className={"image_urlbox"}
|
||||
src={data === undefined ? getImageUrl(`images/educoder/competitions/mainbanner.jpg`) : data.avatar_url === null ? getImageUrl(`images/educoder/competitions/mainbanner.jpg`) : getImageUrl(data.avatar_url)}/>
|
||||
</Col>
|
||||
<Col className={"CompetitionCommonbannerfont"} span={9}>
|
||||
|
||||
<Col
|
||||
className={data && data.name.length > 15 ? "competitionbannerdiv mt30" : "competitionbannerdiv mt30"}>{data && data.name}</Col>
|
||||
|
||||
<Col className={"competitionbannerdiv mt10"}>
|
||||
<Col className={"Competitioncolor9b"}>竞赛时间:<span
|
||||
className={"color000"}>{data && data.start_time}~{data && data.end_time}</span></Col>
|
||||
{/*<Col></Col>*/}
|
||||
</Col>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.ant-col-6{
|
||||
width: 30%;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<Col className={"competitionbannerdiv mt10"}>
|
||||
<Row gutter={16}>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">奖金</div>
|
||||
</Col>
|
||||
<Col className="gutter-row ml20 rankbeicenter" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">浏览数</div>
|
||||
</Col>
|
||||
<Col className="gutter-row rankbeicenter" span={6}>
|
||||
<div className="gutter-box CompetitionsIndexdadels Competitioncolor77">报名数</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col className="gutter-row" span={6}>
|
||||
<div
|
||||
className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">¥{data && data.bonus}</div>
|
||||
</Col>
|
||||
<Col className="gutter-row ml20 rankbeicenter" span={6}>
|
||||
<div
|
||||
className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516">{data.competition_status === "nearly_published" ? "--" : data && data.visits_count}</div>
|
||||
</Col>
|
||||
<Col className="gutter-row rankbeicenter" span={6}>
|
||||
|
||||
{data.competition_status === "ended" ?
|
||||
<div className={data.mode === 2 ?data.member_of_course==true?"gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer":"gutter-box CompetitionsIndexbottomvalue Competitioncolor516":"gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer"}
|
||||
// 已结束onClick={data.competition_status === "nearly_published" ? "" : () => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
|
||||
onClick={ data.mode === 2 ?data.member_of_course==true?() => this.newgotocourse(`/classrooms/${data.course_id}`):"":() => this.newgotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
|
||||
>{data && data.member_count}</div>
|
||||
:data.competition_status === "nearly_published" ?
|
||||
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516"
|
||||
// onClick={data.competition_status === "nearly_published" ? "" : () => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}
|
||||
>{"--"}</div> :
|
||||
data.competition_status === "progressing" ?
|
||||
data.mode === 2 ?
|
||||
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer" onClick={() => this.gotocourse()}>{data && data.member_count}</div> : signupdata && signupdata.personal === true ?
|
||||
<div className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer" onClick={() => this.gotocourse("personal")}>{data && data.member_count}</div> : <div
|
||||
className="gutter-box CompetitionsIndexbottomvalue Competitioncolor516 cursorpointer"
|
||||
onClick={() => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}>{data && data.member_count}</div>
|
||||
:""}
|
||||
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
|
||||
{data.competition_status === "ended" ? <style>
|
||||
{
|
||||
`
|
||||
.Competitionfontsize22{
|
||||
height: 50px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style> : <style>
|
||||
{
|
||||
`
|
||||
.Competitionfontsize22{
|
||||
height: 50px;
|
||||
background: rgba(76,172,255,1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>}
|
||||
<Col className={"competitionbannerdiv mt20"}>
|
||||
{data.competition_status === "ended" ?
|
||||
<Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
|
||||
已结束
|
||||
</Button> : data.enroll_end === true ?
|
||||
<Button type="primary" block className={"Competitionfontsize22"} disabled={true}>
|
||||
{data.competition_status === "nearly_published" ? "未发布" : "报名截止"}
|
||||
</Button> :
|
||||
data.competition_status === "progressing" ?
|
||||
<Button type="primary" block className={"Competitionfontsize22"}>
|
||||
{data.mode === 2 ?
|
||||
<a onClick={() => this.gotocourse()}>立即报名</a> : signupdata && signupdata.personal === true ?
|
||||
<a onClick={() => this.gotocourse("personal")}>立即报名</a> : <a
|
||||
onClick={() => this.gotocourse(`/competitions/${this.props.match.params.identifier}/enroll`)}>立即报名</a>}
|
||||
</Button>:""}
|
||||
</Col>
|
||||
<Col
|
||||
className={"mt10 Competitionfontsize16"}>{data && data.enroll_end_time === null ? "" : `报名截止时间:${data && data.enroll_end_time}`}</Col>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.CompetitionMenu .ant-menu-item a{
|
||||
overflow:hidden;
|
||||
text-overflow:ellipsis;
|
||||
white-space:nowrap
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<Layout className={'teamsLayout mt40'}>
|
||||
<Sider>
|
||||
<Menu mode="inline" className="CompetitionMenu" selectedKeys={[`${this.state.thiskeys}`]}
|
||||
onClick={(e) => this.getrightdatas(e)}>
|
||||
{data && data.competition_modules.map((item, key) => {
|
||||
if (item.module_type != "enroll") {
|
||||
return (
|
||||
<Menu.Item key={item.id}>
|
||||
{/*{item.has_url===false?<span*/}
|
||||
{/*// onClick={()=>this.getrightdata(item.id,item.module_type,item.module_url,item.has_url)}*/}
|
||||
{/*>{item.name}</span>:<a*/}
|
||||
{/*// target="_blank"*/}
|
||||
{/*href={item.module_url}*/}
|
||||
{/*// onClick={()=>this.getrightdata(item.id,item.module_type)}*/}
|
||||
{/*>{item.name}</a>}*/}
|
||||
<a title={item.name}>{item.name}</a>
|
||||
</Menu.Item>
|
||||
)
|
||||
}
|
||||
})}
|
||||
</Menu>
|
||||
|
||||
{/*<Menu mode="inline" className="CompetitionMenu" onClick={(e)=>this.isdownloadpdf(e)}>*/}
|
||||
{/*<Menu.Item>*/}
|
||||
{/*<a>证书下载</a>*/}
|
||||
{/*</Menu.Item>*/}
|
||||
{/*</Menu>*/}
|
||||
</Sider>
|
||||
|
||||
{module_type === "certificate" ? "" : <Layout className={"teamsLayoutleft CompetitionContents mb30"}>
|
||||
{this.state.module_type === "chart" ? Competitionedittype === false ? <CompetitionContentsChart
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
Competitionedit={() => this.Competitionedit()}
|
||||
Competitioncallback={(e) => this.Competitioncallback(e)}
|
||||
/> : "" : Competitionedittype === false ? <CompetitionContents
|
||||
Competitionedit={() => this.Competitionedit()}
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/> : ""}
|
||||
{/*<CompetitionContentsChart*/}
|
||||
{/*{...this.props}*/}
|
||||
{/*{...this.state}*/}
|
||||
{/*/>*/}
|
||||
{Competitionedittype === true ? <CompetitionContentsMd
|
||||
hideCompetitionedit={() => this.hideCompetitionedit()}
|
||||
getlistdata={(keys, listkey) => this.getlistdata(keys, listkey)}
|
||||
Competitioncallback={(e) => this.Competitioncallback(e)}
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/> : ""}
|
||||
</Layout>}
|
||||
|
||||
{module_type === "certificate" ? <Layout className={"teamsLayoutleft CompetitionContents mb30"}>
|
||||
<CompetitionContentspdf
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/>
|
||||
</Layout> : ""}
|
||||
</Layout>
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CompetitionCommon;
|
|
@ -1,45 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import {Button,Layout} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {markdownToHTML,getImageUrl,AttachmentList} from 'educoder';
|
||||
|
||||
|
||||
const { Header, Footer, Sider, Content } = Layout;
|
||||
class CompetitionContents extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
hash:undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
this.props.MdifHasAnchorJustScorll();
|
||||
}
|
||||
|
||||
render() {
|
||||
let {mdContentdata, data} = this.props;
|
||||
//mdhash滚动
|
||||
this.props.MdifHasAnchorJustScorll();
|
||||
return (
|
||||
|
||||
<div className={"fr"}>
|
||||
{data && data.permission.editable === true ? this.props.Competitionedittype === false ? this.props.has_url === false ?
|
||||
<Button className={"fr"} type="primary" ghost onClick={() => this.props.Competitionedit()}>
|
||||
编辑
|
||||
</Button>:"":"":""}
|
||||
<div className={this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?"mt50 mb100 ":"mb100 "}>
|
||||
<Content className={"markdown-body"} dangerouslySetInnerHTML={{__html: markdownToHTML(mdContentdata===undefined?"":mdContentdata.md_content===undefined||mdContentdata.md_content===null?"":mdContentdata.md_content).replace(/▁/g, "▁▁▁")}}>
|
||||
</Content>
|
||||
|
||||
<div className={"mt30"}>
|
||||
<AttachmentList {...this.props} {...this.state} attachments={mdContentdata===undefined?[]:mdContentdata.attachments===undefined?[]:mdContentdata.attachments}></AttachmentList>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CompetitionContents;
|
|
@ -1,423 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd';
|
||||
import {markdownToHTML,getImageUrl,getRandomNumber} from 'educoder';
|
||||
import axios from 'axios';
|
||||
|
||||
const { Content } = Layout;
|
||||
const { TabPane } = Tabs;
|
||||
const { Meta } = Card;
|
||||
|
||||
class CompetitionContents extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
personal:undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
let url=`/competitions/${this.props.match.params.identifier}/competition_staff.json`;
|
||||
axios.get(url)
|
||||
.then((response) => {
|
||||
if(response.status===200){
|
||||
console.log(response)
|
||||
this.setState({
|
||||
personal:response.data.personal
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
this.props.MdifHasAnchorJustScorll();
|
||||
}
|
||||
|
||||
derivefun=(url)=>{
|
||||
axios.get(url).then((response)=>{
|
||||
if(response === undefined){
|
||||
return
|
||||
}
|
||||
if(response.data.status&&response.data.status===-1){
|
||||
this.props.showNotification(response.data.message);
|
||||
}else if(response.data.status&&response.data.status===-2){
|
||||
// if(response.data.message === "100"){
|
||||
// // 已超出文件导出的上限数量(100 ),建议:
|
||||
//
|
||||
// this.setState({
|
||||
// DownloadType:true,
|
||||
// DownloadMessageval:100
|
||||
// })
|
||||
// }else {
|
||||
// //因附件资料超过500M
|
||||
// this.setState({
|
||||
// DownloadType:true,
|
||||
// DownloadMessageval:500
|
||||
// })
|
||||
// }
|
||||
this.props.showNotification(response.data.message);
|
||||
}else {
|
||||
// this.props.showNotification(`正在下载中`);
|
||||
// window.open("/api"+url, '_blank');
|
||||
this.props.slowDownload(url);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
});
|
||||
}
|
||||
render() {
|
||||
this.props.MdifHasAnchorJustScorll();
|
||||
const operations = <div>
|
||||
<Button className={"fr"} type="primary" ghost onClick={()=>this.props.Competitionedit()}>编辑</Button>
|
||||
<Button className={"fr mr20"} type="primary" ghost>
|
||||
<a onClick={()=>this.derivefun(`/competitions/${this.props.match.params.identifier}/charts.xlsx?${getRandomNumber(true)}`)}>导出</a>
|
||||
</Button>
|
||||
</div>
|
||||
const columns = [
|
||||
{
|
||||
title: 'usersum',
|
||||
dataIndex: 'usersum',
|
||||
key: 'name',
|
||||
render: text => <span className={"color-blue"}>{text}</span>,
|
||||
},
|
||||
{
|
||||
title: 'userimg',
|
||||
dataIndex: 'userimg',
|
||||
key: 'userimg',
|
||||
render: (text, record) =>(
|
||||
<a href={`/users/${record.user_login}`} target={"_blank"} className="color-dark">
|
||||
<div className={"relativef"}>
|
||||
<img className={"Competitionuserimg mb10"} src={getImageUrl(`images/${record.userimg===null?`avatars/User/0?1442652658`:record.userimg}`)}/>
|
||||
<div className={"competimgabsoluteijmg"}><Badge count={record.competition_prize} style={{ backgroundColor: '#459BE5' }} title={record.competition_prize}/></div>
|
||||
</div>
|
||||
</a>),
|
||||
},
|
||||
{
|
||||
title: 'username',
|
||||
dataIndex: 'username',
|
||||
key: 'username',
|
||||
render: text => <span title={text} title={text}>{text}</span>,
|
||||
},
|
||||
{
|
||||
title: 'school',
|
||||
dataIndex: 'school',
|
||||
key: 'school',
|
||||
render: text => <span title={text} title={text}>{text}</span>,
|
||||
},
|
||||
{
|
||||
title: 'spendtime',
|
||||
dataIndex: 'spendtime',
|
||||
key: 'spendtime',
|
||||
render: text => <span>{text}</span>,
|
||||
},
|
||||
{
|
||||
title: 'score',
|
||||
dataIndex: 'score',
|
||||
key: 'score',
|
||||
render: text => <span className={"color-blue"}>{text}</span>,
|
||||
},
|
||||
];
|
||||
|
||||
const datas = [];
|
||||
let {chart_rules, chartdata, data} = this.props;
|
||||
let {personal}=this.state;
|
||||
|
||||
if(this.props&&this.props.mode!=1){
|
||||
|
||||
columns.some((item,key)=> {
|
||||
if (item.title === "spendtime") {
|
||||
columns.splice(key, 1)
|
||||
return true
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
|
||||
let list={
|
||||
usersum:key+1,
|
||||
userimg:item.user_image,
|
||||
username:personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name,
|
||||
school:item.school_name,
|
||||
spendtime:item.spend_time,
|
||||
score:item.score<50?"< 50 分":item.score,
|
||||
user_login:item.user_login,
|
||||
competition_prize:item.competition_prize
|
||||
}
|
||||
datas.push(list)
|
||||
})}
|
||||
|
||||
// console.log(this.props&&this.props.mode)
|
||||
// console.log(columns)
|
||||
|
||||
return (
|
||||
<div>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.ant-tabs-nav .ant-tabs-tab{
|
||||
font-size: 20px;
|
||||
margin: 0 10px 0 0;
|
||||
}
|
||||
.ant-badge{
|
||||
width:90px;
|
||||
}
|
||||
.ant-badge sup{
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
{chart_rules === undefined ? "" :
|
||||
<Tabs onChange={(e) => this.props.Competitioncallback(e)} activeKey={this.props.tabkey}
|
||||
tabBarExtraContent={data && data.permission.editable === true ? this.props.Competitionedittype === false ? this.props.has_url === false ? operations : "" : "" : ""}>
|
||||
{chart_rules.stages.map((item,key)=>{
|
||||
return(
|
||||
<TabPane tab={item.name} key={item.id===null?0:item.id}>
|
||||
{chart_rules.rule_contents.map((items,keys)=>{
|
||||
if(item.id===items.competition_stage_id){
|
||||
return(
|
||||
<Content key={keys} className={"markdown-body "} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content===undefined||items.content===null?"":items.content).replace(/▁/g, "▁▁▁")}}></Content>
|
||||
)
|
||||
}else if(item.id===null&&items.competition_stage_id===0){
|
||||
return(
|
||||
<Content key={keys} className={"markdown-body "} dangerouslySetInnerHTML={{__html: markdownToHTML(items.content===undefined||items.content===null?"":items.content).replace(/▁/g, "▁▁▁")}}></Content>
|
||||
)
|
||||
}
|
||||
})}
|
||||
</TabPane>
|
||||
)
|
||||
})}
|
||||
</Tabs>}
|
||||
|
||||
|
||||
<Col className="gutter-row Competitioncharts mt30 mb30">总排名</Col>
|
||||
{chartdata===undefined?"":chartdata.teams.length===0?<Col className="gutter-row Competitioncharts mt30 mb30 rankbeicenter">
|
||||
<img src={getImageUrl(`images/educoder/competitions/trophy.png`)}/>
|
||||
<div className={"rankbei mt10"}>要抓住一切机会,向所有人证明你自己,证明你能够迎接荣耀</div>
|
||||
</Col>:""}
|
||||
<Row calssName={"Competition399"}>
|
||||
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
|
||||
|
||||
|
||||
if(key===1){
|
||||
return(
|
||||
<Col className="mt40" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 2 }}>
|
||||
<Card
|
||||
className={"Competitionthird"}
|
||||
cover={
|
||||
<div className={"Competitionthirdbox center"}>
|
||||
<li className="pr Competitioncenter">
|
||||
<img src={getImageUrl("images/educoder/huangguan-two.png")}/>
|
||||
<div className={"mt10"}>
|
||||
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark ">
|
||||
<div className={"relativef"}>
|
||||
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
|
||||
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div>
|
||||
</div>
|
||||
<p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Meta
|
||||
title={<div className={"center"}>
|
||||
<div className={"rankfonttop"} title={item.school_name}>{item.school_name}</div>
|
||||
{this.props&&this.props.mode===1?<div className={"rankfontmid"}>{item.spend_time}</div>:""}
|
||||
</div>}
|
||||
description={
|
||||
<div className={"rankfontbottom"}>{item.score<50?"< 50 分":item.score}分</div>
|
||||
}
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
|
||||
)
|
||||
}
|
||||
|
||||
})}
|
||||
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
|
||||
if(key===0){
|
||||
return(
|
||||
<Col xs={{ span: 11, offset: 1 }} lg={{ span: 6, offset: 1 }}>
|
||||
<Card
|
||||
className={"Competitionfirst"}
|
||||
cover={
|
||||
<div className={"Competitionfirstbox center"}>
|
||||
<li className="pr Competitioncenter">
|
||||
<img src={getImageUrl("images/educoder/huangguan.png")}/>
|
||||
<div className={"mt10"}>
|
||||
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark">
|
||||
<div className={"relativef"}>
|
||||
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
|
||||
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div>
|
||||
</div>
|
||||
<p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Meta
|
||||
title={<div className={"center"}>
|
||||
<div className={"rankfonttop"} title={item.school_name}>{item.school_name}</div>
|
||||
{this.props&&this.props.mode===1?<div className={"rankfontmid"}>{item.spend_time}</div>:""}
|
||||
</div>}
|
||||
description={
|
||||
<div className={"rankfontbottoms"}>{item.score<50?"< 50 分":item.score}分</div>
|
||||
}
|
||||
|
||||
/>
|
||||
</Card>
|
||||
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
})}
|
||||
{chartdata===undefined?"":chartdata.teams.length===0?"":chartdata.teams.map((item,key)=>{
|
||||
if(key===2){
|
||||
return(
|
||||
<Col className="mt30" xs={{ span: 5, offset: 1 }} lg={{ span: 6, offset: 1 }}>
|
||||
<Card
|
||||
className={"Competitionsecondary "}
|
||||
cover={
|
||||
<div className={"Competitionsecondarybox center"}>
|
||||
<li className=" pr Competitioncenter ">
|
||||
<img src={getImageUrl("images/educoder/huangguan-three.png")}/>
|
||||
<div className={"mt10"}>
|
||||
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark">
|
||||
<div className={"relativef"}>
|
||||
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
|
||||
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} title={item.competition_prize}/></div>
|
||||
</div>
|
||||
<p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<Meta
|
||||
title={<div className={"center"}>
|
||||
<div className={"rankfonttop"} title={item.school_name}>{item.school_name}</div>
|
||||
{this.props&&this.props.mode===1?<div className={"rankfontmid"}>{item.spend_time}</div>:""}
|
||||
</div>}
|
||||
description={
|
||||
<div className={"rankfontbottom"}>{item.score<50?"< 50 分":item.score}分</div>
|
||||
}
|
||||
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
})}
|
||||
|
||||
</Row>
|
||||
{chartdata===undefined?"":chartdata.user_ranks.length===0?"":<div className={"youranklist mt50"}>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.ant-col-9 {
|
||||
width: 35.5%;
|
||||
}
|
||||
.col13{
|
||||
width:13%;
|
||||
text-align:left;
|
||||
}
|
||||
.col24{
|
||||
width: 24%;
|
||||
text-align: left;
|
||||
padding-left: 33px;
|
||||
}
|
||||
.col15{
|
||||
width: 14%;
|
||||
text-align: right;
|
||||
}
|
||||
.col12{
|
||||
width: 12%;
|
||||
text-align: right;
|
||||
}
|
||||
.col10{
|
||||
width: 10%;
|
||||
}
|
||||
.col6{
|
||||
width: 6%;
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
</style>
|
||||
{chartdata.user_ranks.map((item,key)=>{
|
||||
|
||||
return(
|
||||
<Row type="flex" key={key}>
|
||||
<Col span={4} order={1} className={"col13"}>
|
||||
<span className={"ranknames"}>您当前排名:{item.rank}</span>
|
||||
</Col>
|
||||
<Col className="userranksclass" span={3} order={2} className={"col24"}>
|
||||
{personal===undefined||personal===null?item.record_user_name:personal===true?item.user_name:item.team_name}
|
||||
</Col>
|
||||
<Col className="textleft" span={9} order={3}>
|
||||
{/*{item.team_name}*/}
|
||||
</Col>
|
||||
{item.cost_time=== "--"?<Col span={3} order={4} className={"col6"}>
|
||||
{this.props&&this.props.mode===1?item.cost_time:""}
|
||||
</Col>:<Col span={3} order={4} className={"col10"}>
|
||||
{this.props&&this.props.mode===1?item.cost_time:""}
|
||||
</Col>}
|
||||
{item.cost_time=== "--"?<Col className="textright" span={3} order={5} className={"col15"}>
|
||||
<span className={"ranknameslast"}>{item.score<50?"< 50 分":item.score}</span>
|
||||
</Col>:<Col className="textright" span={3} order={5} className={"col12"}>
|
||||
<span className={"ranknameslast"}>{item.score<50?"< 50 分":item.score}</span>
|
||||
</Col>}
|
||||
</Row>
|
||||
)
|
||||
})}
|
||||
</div>}
|
||||
<Row className={"mt20 mb80"}>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.ant-table-tbody > tr > td:nth-last-child(4){
|
||||
overflow: hidden;
|
||||
max-width: 100px;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
.ant-table-tbody > tr > td:nth-last-child(3){
|
||||
overflow: hidden;
|
||||
max-width: 200px;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
cursor: default;
|
||||
}
|
||||
.ant-table-tbody>tr>td, .ant-table-thead>tr>th {
|
||||
padding: 5px;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
{chartdata === undefined ? "" : chartdata.teams.length === 0 ? "" :
|
||||
<Table className="Competitiontransparent" columns={columns} dataSource={datas} showHeader={false}
|
||||
pagination={false}/>}
|
||||
</Row>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CompetitionContents;
|
|
@ -1,232 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import {Button, Card, Row, Col ,Upload,Icon,message,Tabs} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {getUploadActionUrl,getUrl,appendFileSizeToUploadFileAll,appendFileSizeToUploadFile} from 'educoder';
|
||||
import TPMMDEditor from '../../../tpm/challengesnew/TPMMDEditor';
|
||||
const { TabPane } = Tabs;
|
||||
class CompetitionContentsMd extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.contentMdRef = React.createRef();
|
||||
this.state={
|
||||
contentFileList:[],
|
||||
chartmodule_id:undefined
|
||||
}
|
||||
}
|
||||
componentDidUpdate =(prevState)=>{
|
||||
if(prevState!=this.props){
|
||||
this.getchartdata();
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
|
||||
this.getchartdata()
|
||||
}
|
||||
|
||||
getchartdata=()=>{
|
||||
let {mdContentdata,chart_rules}=this.props;
|
||||
|
||||
// is_pdf: false
|
||||
if(this.props.module_type==="chart"){
|
||||
let type=true;
|
||||
if(chart_rules===undefined){
|
||||
|
||||
}else{
|
||||
chart_rules.rule_contents.map((items,keys)=>{
|
||||
|
||||
if(parseInt(this.props.tabkey)===items.competition_stage_id){
|
||||
console.log(items)
|
||||
this.contentMdRef.current.setValue(items.content);
|
||||
this.setState({
|
||||
contentFileList:undefined,
|
||||
chartmodule_id:items.id
|
||||
})
|
||||
type=false;
|
||||
}
|
||||
})
|
||||
|
||||
if(type===true){
|
||||
this.contentMdRef.current.setValue("");
|
||||
this.setState({
|
||||
contentFileList:undefined,
|
||||
chartmodule_id:undefined
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
let contentFileList = mdContentdata===undefined?[]:mdContentdata.attachments===undefined?[]:mdContentdata.attachments.map((item) => {
|
||||
return {
|
||||
id: item.id,
|
||||
uid: item.id,
|
||||
name: appendFileSizeToUploadFile(item),
|
||||
url: item.url,
|
||||
filesize: item.filesize,
|
||||
status: 'done',
|
||||
response:{id: item.id}
|
||||
}
|
||||
})
|
||||
this.setState({
|
||||
contentFileList:contentFileList
|
||||
})
|
||||
this.contentMdRef.current.setValue(mdContentdata===undefined?"":mdContentdata.md_content===undefined?"":mdContentdata.md_content || '')
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
handleContentUploadChange = (info) => {
|
||||
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
||||
let contentFileList = info.fileList;
|
||||
this.setState({ contentFileList: appendFileSizeToUploadFileAll(contentFileList) });
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onAttachmentRemove = (file, stateName) => {
|
||||
if(file.response!=undefined){
|
||||
this.props.confirm({
|
||||
content: '是否确认删除?',
|
||||
|
||||
onOk: () => {
|
||||
this.deleteAttachment(file, stateName)
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
deleteAttachment = (file, stateName) => {
|
||||
// 初次上传不能直接取uid
|
||||
const url = `/attachments/${file.response ? file.response.id : file.uid}.json`
|
||||
axios.delete(url, {
|
||||
})
|
||||
.then((response) => {
|
||||
if (response.data) {
|
||||
const { status } = response.data;
|
||||
if (status == 0) {
|
||||
console.log('--- success')
|
||||
this.props.showNotification(response.data.message);
|
||||
this.setState((state) => {
|
||||
const index = state[stateName].indexOf(file);
|
||||
const newFileList = state[stateName].slice();
|
||||
newFileList.splice(index, 1);
|
||||
return {
|
||||
[stateName]: newFileList,
|
||||
};
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
handleSubmit = () => {
|
||||
let {contentFileList}=this.state;
|
||||
const mdContnet = this.contentMdRef.current.getValue().trim();
|
||||
// if(mdContnet.length>10000){
|
||||
// this.props.showNotification("内容超过10000个字");
|
||||
// return
|
||||
// }
|
||||
let attachment_ids=undefined
|
||||
if(contentFileList!=undefined){
|
||||
attachment_ids= contentFileList.map(item => {
|
||||
return item.response ? item.response.id : item.id
|
||||
})
|
||||
}
|
||||
|
||||
let newstage_id=parseInt(this.props.tabkey)===0||null?undefined:parseInt(this.props.tabkey)
|
||||
let data={}
|
||||
if(this.props.module_type==="chart"){
|
||||
data={
|
||||
md_content_id:this.state.chartmodule_id,
|
||||
competition_module_id:this.props.module_id,
|
||||
stage_id:newstage_id,
|
||||
content:mdContnet,
|
||||
}
|
||||
}else{
|
||||
data={
|
||||
md_content_id:this.props.mdContentdata.md_id,
|
||||
competition_module_id:this.props.mdContentdata.id,
|
||||
content:mdContnet,
|
||||
attachment_ids:attachment_ids
|
||||
}
|
||||
}
|
||||
|
||||
let url=`/competitions/${this.props.match.params.identifier}/update_md_content.json`;
|
||||
axios.post(url,data
|
||||
).then((response) => {
|
||||
if(response.data.status===0){
|
||||
this.props.showNotification(response.data.message);
|
||||
this.props.getlistdata(this.props.thiskeys,this.props.tabkey);
|
||||
this.props.hideCompetitionedit();
|
||||
}else{
|
||||
this.props.showNotification(response.data.message);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
}
|
||||
render() {
|
||||
let {contentFileList}=this.state;
|
||||
let {chart_rules}=this.props;
|
||||
const uploadProps = {
|
||||
width: 600,
|
||||
fileList: contentFileList,
|
||||
multiple: true,
|
||||
// https://github.com/ant-design/ant-design/issues/15505
|
||||
// showUploadList={false},然后外部拿到 fileList 数组自行渲染列表。
|
||||
// showUploadList: false,
|
||||
action: `${getUploadActionUrl()}`,
|
||||
onChange: this.handleContentUploadChange,
|
||||
onRemove: (file) => this.onAttachmentRemove(file, 'contentFileList'),
|
||||
beforeUpload: (file) => {
|
||||
console.log('beforeUpload', file.name);
|
||||
const isLt150M = file.size / 1024 / 1024 < 150;
|
||||
if (!isLt150M) {
|
||||
this.props.showNotification("文件大小必须小于150MB");
|
||||
}
|
||||
return isLt150M;
|
||||
},
|
||||
};
|
||||
// console.log(this.props.tabkey)
|
||||
// console.log(chart_rules)
|
||||
console.log(this.props.mdContentdata)
|
||||
return (
|
||||
<div>
|
||||
{chart_rules===undefined?"":this.props.module_type==="chart"?<Tabs activeKey={this.props.tabkey} onChange={(e)=>this.props.Competitioncallback(e)}>
|
||||
|
||||
{chart_rules.stages.map((item,key)=>{
|
||||
return(
|
||||
<TabPane tab={item.name} key={item.id===null?0:item.id}></TabPane>
|
||||
)
|
||||
})}
|
||||
|
||||
</Tabs>:""}
|
||||
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入内容说明" mdID={'courseContentMD'} refreshTimeout={1500}
|
||||
className="courseMessageMD" initValue={this.state.description}></TPMMDEditor>
|
||||
{this.props.module_type==="chart"?"":<Upload {...uploadProps} className="upload_1 newWorkUpload">
|
||||
<Button className="uploadBtn">
|
||||
<Icon type="upload" /> 上传附件
|
||||
</Button>
|
||||
(单个文件150M以内)
|
||||
</Upload>}
|
||||
|
||||
<div className="clearfix mt30 mb30">
|
||||
{/* htmlType="submit" */}
|
||||
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
|
||||
<a className="defalutCancelbtn fl" onClick={() => this.props.hideCompetitionedit()}>取消</ a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CompetitionContentsMd;
|
|
@ -1,64 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import {Tabs} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {markdownToHTML,getImageUrl,AttachmentList} from 'educoder';
|
||||
import CompetitionContentspdfdownload from './CompetitionContentspdfChild/CompetitionContentspdfdownload';
|
||||
import CompetitionContentspdfpeopledata from './CompetitionContentspdfChild/CompetitionContentspdfpeopledata';
|
||||
// import NoneData from "../../../courses/shixunHomework/shixunHomework";
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
class CompetitionContentspdf extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
Tabskey:"1"
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
let query=this.props.location&&this.props.location.search;
|
||||
const types = query.split('user_id=')
|
||||
if(types[1]===undefined){
|
||||
}else{
|
||||
this.setState({
|
||||
Tabskey:"2"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Competitioncallback=(key)=>{
|
||||
this.setState({
|
||||
Tabskey:key
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
|
||||
return (
|
||||
|
||||
<div className={"fr"}>
|
||||
<div className={"mb100 "}>
|
||||
<Tabs defaultActiveKey="1" onChange={(e) => this.Competitioncallback(e)} activeKey={this.state.Tabskey}>
|
||||
<TabPane tab="获奖证书下载" key="1" >
|
||||
{this.state.Tabskey==="1"?<CompetitionContentspdfdownload
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
Competitioncallback={(e)=>this.Competitioncallback(e)}
|
||||
/>:""}
|
||||
</TabPane>
|
||||
<TabPane tab="完善个人信息" key="2">
|
||||
{this.state.Tabskey==="2"?<CompetitionContentspdfpeopledata
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/>:""}
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CompetitionContentspdf;
|
|
@ -1,290 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import { Button, Layout, Input, Form } from 'antd';
|
||||
import axios from 'axios';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import mycompetotionchild from './mycompetotionchild.css';
|
||||
import { getHiddenName } from "../../../../user/account/AccountBasicEdit";
|
||||
import '../../../../courses/css/Courses.css'
|
||||
|
||||
export const identityMap = { "teacher": "教师", "student": "学生", "professional": "专业人士" }
|
||||
|
||||
class Bankcardnumberverification extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
basicInfo: {},
|
||||
updating: '',
|
||||
secondsFlag: false,
|
||||
seconds: 60,
|
||||
phonebool: false,
|
||||
emailbool: false,
|
||||
formationdata: [],
|
||||
bank_account_editable: false,
|
||||
leader: false,
|
||||
bank_account: undefined,
|
||||
certification: 1
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.document.title = '竞赛';
|
||||
// console.log("3获取用户信息");
|
||||
// console.log(this.props)
|
||||
try {
|
||||
this.props.triggerRef(this);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
console.log(this.props.bank_account);
|
||||
|
||||
//初始化值
|
||||
if (this.props.bank_account) {
|
||||
this.props.form.setFieldsValue({
|
||||
openingbank: this.props.bank_account.bank,
|
||||
subbranch: this.props.bank_account.second_bank,
|
||||
subbranchs: this.props.bank_account.card_no,
|
||||
})
|
||||
this.setState({
|
||||
openingbank: this.props.bank_account.bank,
|
||||
subbranch: this.props.bank_account.second_bank,
|
||||
subbranchs: this.props.bank_account.card_no,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
setdata(bank, second_bank, card_no) {
|
||||
this.props.form.setFieldsValue({
|
||||
openingbank: bank,
|
||||
subbranch: second_bank,
|
||||
subbranchs: card_no,
|
||||
})
|
||||
}
|
||||
componentDidUpdate = (prevProps) => {
|
||||
if (prevProps.bank_account != this.props.bank_account) {
|
||||
|
||||
////console.log("Registration");
|
||||
////console.log("componentDidUpdate");
|
||||
////console.log(this.props.user.admin);
|
||||
try {
|
||||
if (this.props.bank_account) {
|
||||
this.props.form.setFieldsValue({
|
||||
openingbank: this.props.bank_account.bank,
|
||||
subbranch: this.props.bank_account.second_bank,
|
||||
subbranchs: this.props.bank_account.card_no,
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
openingbank: this.props.bank_account.bank,
|
||||
subbranch: this.props.bank_account.second_bank,
|
||||
subbranchs: this.props.bank_account.card_no,
|
||||
})
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
yhBankstrue = () => {
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`;
|
||||
axios.patch(url, {
|
||||
user_id: this.props.userdata.id,
|
||||
bank: values.openingbank,
|
||||
second_bank: values.subbranch,
|
||||
card_no: values.subbranchs
|
||||
})
|
||||
.then((result) => {
|
||||
try {
|
||||
if (result.data.status === 0) {
|
||||
try {
|
||||
// console.log(values.openingbank);
|
||||
// console.log(values.subbranch);
|
||||
// console.log(values.subbranchs);
|
||||
this.props.form.setFieldsValue({
|
||||
openingbank: values.openingbank,
|
||||
subbranch: values.subbranch,
|
||||
subbranchs: values.subbranchs,
|
||||
});
|
||||
this.setState({
|
||||
openingbank: values.openingbank,
|
||||
subbranch: values.subbranch,
|
||||
subbranchs: values.subbranchs,
|
||||
})
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
try {
|
||||
this.props.showNotification(`提交成功,等待审核!`);
|
||||
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
this.props.getdata(this.props.userdata.id);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
try {
|
||||
this.props.GetawardinformationAPI();
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
render() {
|
||||
const { getFieldDecorator } = this.props.form;
|
||||
const { updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account } = this.state
|
||||
return (
|
||||
<div>
|
||||
<div className="flexdirections mt36">
|
||||
<p className="fontcolorsyslhei font-16">签/领/开户行及银行卡号</p>
|
||||
<p className="fontcolorsyslhui font-14 ml11">为保障奖金的及时发放,请队长如实填写你名下的银行卡信息</p>
|
||||
</div>
|
||||
<div className="ml38">
|
||||
<style>{`
|
||||
|
||||
.flexRow {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.flexRow .name {
|
||||
margin-left: 12px;
|
||||
color: #666666;
|
||||
|
||||
text-align: center;
|
||||
flex: 0 0 100px;
|
||||
}
|
||||
.flexRow .description {
|
||||
margin-left: 10px;
|
||||
flex: 1;
|
||||
color: #CDCDCD;
|
||||
}
|
||||
.description span {
|
||||
margin-right: 20px;
|
||||
color: #05101A;
|
||||
}
|
||||
.flexRow .status {
|
||||
width: 100px;
|
||||
color: #28AC7F;
|
||||
text-align: right;
|
||||
}
|
||||
.flexTable .flexTable {
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
}
|
||||
|
||||
.settingFormsy label{
|
||||
color: #666666;
|
||||
font-size: 14px !important ;
|
||||
|
||||
}
|
||||
.settingFormsy input {
|
||||
width: 340px;
|
||||
height: 40px;
|
||||
}
|
||||
.settingFormsy input.validateInput {
|
||||
width: 220px;
|
||||
}
|
||||
.settingFormsy .formItemInline button {
|
||||
width: 110px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.settingFormsy .ant-form-item-label {
|
||||
width: 60px;
|
||||
text-align: left;
|
||||
}
|
||||
.formItemInline .ant-form-explain{
|
||||
position:absolute;
|
||||
bottom:-22px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
}
|
||||
.yslzxueshi .ant-input{
|
||||
height: 40px !important;
|
||||
width: 276px !important
|
||||
}
|
||||
|
||||
// className="ant-col ant-form-item-label"
|
||||
`}</style>
|
||||
<div className="settingFormsy">
|
||||
<React.Fragment>
|
||||
<Form>
|
||||
<Form.Item
|
||||
label="开户行:"
|
||||
className="formItemInline hideRequireTag mb20 mt20"
|
||||
>
|
||||
{getFieldDecorator('openingbank', {
|
||||
rules: [{
|
||||
initialValue: this.state.openingbank,
|
||||
required: true,
|
||||
message: '请输入开户行',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder={`例如:中国工商银行`}></Input>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="支行:"
|
||||
className="formItemInline hideRequireTag mb20 mt20"
|
||||
>
|
||||
{getFieldDecorator('subbranch', {
|
||||
rules: [{
|
||||
initialValue: this.state.subbranch,
|
||||
required: true,
|
||||
message: '请输入支行',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder={`例如:长沙天河支行`}></Input>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="账号:"
|
||||
className="formItemInline hideRequireTag mb20 mt20"
|
||||
>
|
||||
{getFieldDecorator('subbranchs', {
|
||||
rules: [{
|
||||
initialValue: this.state.subbranchs,
|
||||
required: true,
|
||||
message: '请输入账号',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder={`请填写银行卡账号`}></Input>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<div className="flexdirections yslzxueshi ml38 mt34">
|
||||
<p className="fontcolorsyslhui1 font-14 w300 myysllineheight myyslminwidth"></p>
|
||||
<div className="myyslminwidth276 flexdirections">
|
||||
{/*<div className="buttongo mycompitcursor" onClick={()=>this.yhBanksfalse()}><p className="fontwenzi mycompitcursor" >取消</p></div>*/}
|
||||
<Button type="primary" onClick={() => this.yhBankstrue()}>确定</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</Form>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const Bankcardnumberverifications = Form.create({ name: 'Bankcardnumberverification' })(Bankcardnumberverification);
|
||||
|
||||
export default Bankcardnumberverifications;
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
.pdfdownload {
|
||||
max-width: 791px;
|
||||
height: 40px;
|
||||
background: rgba(249, 249, 249, 1);
|
||||
line-height: 40px;
|
||||
padding-left: 15px;
|
||||
}
|
||||
|
||||
.pdfpicture {
|
||||
font-size: 16px;
|
||||
color: rgba(0, 0, 0, 1);
|
||||
}
|
||||
|
||||
.pdfdownloadfont4CACFF {
|
||||
color: #4CACFF !important;
|
||||
}
|
||||
|
||||
.pdfdownloadfont00CC5F {
|
||||
color: #00CC5F;
|
||||
}
|
||||
|
||||
.pdfdownloadfontFF6602 {
|
||||
color: #FF6602;
|
||||
}
|
|
@ -1,215 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import {Button,Layout,Row, Col,Divider,Table} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {getImageUrl,getRandomcode} from 'educoder';
|
||||
import './CompetitionContentspdfdownload.css';
|
||||
// import NoneData from "../../../courses/shixunHomework/shixunHomework";
|
||||
|
||||
|
||||
class CompetitionContentspdfdownload extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
data:undefined,
|
||||
teams:undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
window.document.title = '竞赛';
|
||||
let url=`/competitions/${this.props.match.params.identifier}/prize.json`;
|
||||
let query=this.props.location&&this.props.location.search;
|
||||
const types = query.split('user_id=')
|
||||
let userid;
|
||||
if(types[1]===undefined){
|
||||
userid=this.props.user&&this.props.user.user_id;
|
||||
}else{
|
||||
userid=types[1];
|
||||
}
|
||||
axios.get(url,{params:{
|
||||
user_id:userid,
|
||||
}
|
||||
}).then((response) => {
|
||||
if(response.status===200){
|
||||
|
||||
let datas=response.data.teams;
|
||||
if(datas.length>0){
|
||||
datas.map((item,key)=>{
|
||||
let lista=item.team_members;
|
||||
if(lista.length>0){
|
||||
console.log(lista)
|
||||
lista.map((i,k)=>{
|
||||
i["bank_account"]=item.bank_account;
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
this.setState({
|
||||
data:response.data,
|
||||
teams:datas,
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
|
||||
|
||||
let {data,teams}=this.state;
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '角色',
|
||||
dataIndex: 'type',
|
||||
key: 'type',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.role}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name',
|
||||
key: 'name',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.name}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '实名认证',
|
||||
dataIndex: 'namecertify',
|
||||
key: 'namecertify',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.real_name_auth==="authed"?<span className={"pdfdownloadfont00CC5F"}>已认证</span>:record.real_name_auth==="authing"?<span className={"pdfdownloadfontFF6602"}>待审核</span>:record.real_name_auth==="not_authed"?<span className={"color-red"}>未认证</span>:""}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '职业认证',
|
||||
key: 'certify',
|
||||
dataIndex: 'certify',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.professional_auth==="authed"?<span className={"pdfdownloadfont00CC5F"}>已认证</span>:record.professional_auth==="authing"?<span className={"pdfdownloadfontFF6602"}>待审核</span>:record.professional_auth==="not_authed"?<span className={"color-red"}>未认证</span>:""}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '手机绑定',
|
||||
key: 'mobile',
|
||||
dataIndex: 'mobile',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.phone_binded===true?<span className={"pdfdownloadfont00CC5F"}>已绑定</span>:<span className={"color-red"}>未绑定</span>}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '邮箱绑定',
|
||||
key: 'mail',
|
||||
dataIndex: 'mail',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
{record.email_binded===true?<span className={"pdfdownloadfont00CC5F"}>已绑定</span>:<span className={"color-red"}>未绑定</span>}
|
||||
</span>
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '开户行及银行卡号信息(队长填写)',
|
||||
key: 'idcard',
|
||||
dataIndex: 'idcard',
|
||||
render: (value, record, index) => {
|
||||
if (index === 0&&record.bank_account!=null) {
|
||||
return {
|
||||
children: <span>{record.bank_account.bank + record.bank_account.second_bank + record.bank_account.card_no}</span>,
|
||||
};
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
let people=[ { url: '/api/competitions/xxxxx/certificates/1/personal' },
|
||||
{ url: '/api/competitions/xxxxx/certificates/2/personal' },]
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Row>
|
||||
<Col className={"pdfdownload"}>温馨提示:填写的个人信息经审批后,将提供个人获奖证书下载;团队队员信息全部审批后,将提供团队获奖证书下载。</Col>
|
||||
</Row>
|
||||
|
||||
<Row className={"mt30"}>
|
||||
<Col className={"pdfpicture"}>证书情况</Col>
|
||||
</Row>
|
||||
|
||||
<Row className={"mt30"}>
|
||||
<Col>个人证书:{data&&data.personal_certifications.length===0&&data&&data.all_certified===false?
|
||||
<span><span className={"pdfpicture font-14"}>暂未生成</span> <span className={"ml20"}>原因:<span className={"pdfpicture font-14"}>还未认证个人信息,</span><a className={"pdfdownloadfont4CACFF"} onClick={()=>this.props.Competitioncallback("2")}>立即认证</a></span></span>:
|
||||
data&&data.personal_certifications.length===0&&data&&data.all_certified===true?
|
||||
<span><span className={"pdfpicture font-14"}>暂未生成</span> <span className={"ml20"}>原因:<span className={"pdfpicture font-14"}>组委会未完成证书审批,请稍后</span></span></span>:
|
||||
data&&data.personal_certifications.map((item,key)=>{
|
||||
return(
|
||||
<span className={"mr10"} key={key}>
|
||||
<img src={ getImageUrl(`images/educoder/pdfs.png`)} />
|
||||
<a className={"pdfdownloadfont4CACFF ml10"} href={getRandomcode(item.url)} download=""
|
||||
title="下载" mce_href="#">立即下载</a>
|
||||
</span>
|
||||
)
|
||||
})}</Col>
|
||||
</Row>
|
||||
|
||||
<Row className={"mt30"}>
|
||||
<Col>团队证书:
|
||||
{data&&data.team_certifications.length===0?<span className={"pdfpicture font-14"}>暂未生成</span>
|
||||
:data&&data.team_certifications.map((item,key)=>{
|
||||
return(
|
||||
<span className={"mr10"} key={key}>
|
||||
<img src={ getImageUrl(`images/educoder/pdfs.png`)} />
|
||||
<a className={"pdfdownloadfont4CACFF ml10"} href={getRandomcode(item.url)} download=""
|
||||
title="下载" mce_href="#">立即下载</a>
|
||||
</span>
|
||||
)
|
||||
})}
|
||||
</Col>
|
||||
</Row>
|
||||
<Divider />
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.pdfdownloadTable .ant-table-column-title{
|
||||
color:#000;
|
||||
}
|
||||
.pdfdownloadTable .ant-table-tbody > tr > td{
|
||||
color:#666666;
|
||||
border-bottom: 1px solid transparent;
|
||||
}
|
||||
.pdfdownloadTable .ant-table-thead > tr > th, .ant-table-tbody > tr > td{
|
||||
text-align: center;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
{teams&&teams.map((item,key)=>{
|
||||
return(
|
||||
<Row className={"mt30"} key={key}>
|
||||
<Col className={"pdfpicture mb20"}>{item.name}战队信息填报概况</Col>
|
||||
|
||||
<Table columns={columns} dataSource={item.team_members} className={"pdfdownloadTable"} pagination={false}/>
|
||||
</Row>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</React.Fragment>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default CompetitionContentspdfdownload;
|
|
@ -1,596 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {Button, Layout, Input, Form} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {setmiyah} from 'educoder';
|
||||
import mycompetotionchild from './mycompetotionchild.css';
|
||||
import {getHiddenName} from "../../../../user/account/AccountBasicEdit";
|
||||
import '../../../../courses/css/Courses.css'
|
||||
import RealNameCertificationModal from "../../../../user/modal/RealNameCertificationModal";
|
||||
import Phonenumberverifications from './Phonenumberverification';
|
||||
import Mailboxvalidations from './Mailboxvalidation'
|
||||
import Bankcardnumberverifications from './Bankcardnumberverification'
|
||||
export const identityMap = {"teacher": "教师", "student": "学生", "professional": "专业人士"}
|
||||
|
||||
class CompetitionContentspdfpeopledata extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
basicInfo: {},
|
||||
updating: '',
|
||||
secondsFlag: false,
|
||||
seconds: 60,
|
||||
phonebool: false,
|
||||
emailbool: false,
|
||||
formationdata: [],
|
||||
bank_account_editable: false,
|
||||
leader: false,
|
||||
bank_account: undefined,
|
||||
certification: 1,
|
||||
userdata:undefined
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.document.title = '竞赛';
|
||||
|
||||
|
||||
this.GetawardinformationAPI();
|
||||
let query=this.props.location&&this.props.location.search;
|
||||
const types = query.split('user_id=')
|
||||
let userid;
|
||||
if(types[1]===undefined){
|
||||
userid=this.props.user&&this.props.user.user_id;
|
||||
}else{
|
||||
userid=types[1];
|
||||
}
|
||||
this.getdata(userid);
|
||||
this.GetuseridApi(userid);
|
||||
|
||||
}
|
||||
|
||||
GetuseridApi=(id)=>{
|
||||
//个人信息API 获取个人信息
|
||||
let url = `/users/accounts/${id}.json`;
|
||||
axios.get(url).then((result) => {
|
||||
if (result.data) {
|
||||
console.log("GetuseridApi");
|
||||
console.log(result.data);
|
||||
this.setState({
|
||||
userdata:result.data
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
GetawardinformationAPI = () => {
|
||||
let url = `/competitions/${this.props.match.params.identifier}/prize.json`;
|
||||
let query=this.props.location&&this.props.location.search;
|
||||
const types = query.split('user_id=')
|
||||
let userid;
|
||||
if(types[1]===undefined){
|
||||
userid=this.props.user&&this.props.user.user_id;
|
||||
}else{
|
||||
userid=types[1];
|
||||
}
|
||||
axios.get(url,{params:{
|
||||
user_id:userid,
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result.data) {
|
||||
this.setState({
|
||||
formationdata: result.data.formationdata,
|
||||
bank_account_editable: result.data.bank_account_editable, //队长是否可以编辑
|
||||
leader: result.data.leader, //是否是队长
|
||||
bank_account: result.data.bank_account, //队长银行卡号信息
|
||||
})
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
getdata = (id) => {
|
||||
this.setState({
|
||||
certification: 3
|
||||
})
|
||||
this.GetuseridApi(id);
|
||||
};
|
||||
// 绑定手机
|
||||
onPhoneSubmit = () => {
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
let {id} =this.state.userdata;
|
||||
let reg = /^1\d{10}$/;
|
||||
if (reg.test(values.phone)) {
|
||||
let url = `/users/accounts/${id}/phone_bind.json`
|
||||
axios.post((url), {
|
||||
phone: values.phone,
|
||||
code: values.phoneValidateCode
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
this.props.showNotification("手机号码绑定成功!");
|
||||
this.setState({
|
||||
phonebool: false
|
||||
})
|
||||
this.getdata(this.state.userdata.id);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
this.props.showNotification("请输入有效的11位手机号码");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
// 绑定邮箱
|
||||
onEmailSubmit = () => {
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
let {id} =this.state.userdata;
|
||||
let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
||||
if (reg.test(values.email)) {
|
||||
let url = `/users/accounts/${id}/email_bind.json`
|
||||
axios.post((url), {
|
||||
email: values.email,
|
||||
code: values.emailValidateCode
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
this.props.showNotification("邮箱地址绑定成功!");
|
||||
this.setState({
|
||||
emailbool: false
|
||||
})
|
||||
this.getdata(this.state.userdata.id);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
this.props.showNotification("请输入正确的邮箱地址");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//取消编辑
|
||||
hideUpdating = (i) => {
|
||||
if (i === 1) {
|
||||
this.setState({
|
||||
phonebool: false
|
||||
})
|
||||
} else if (i === 2) {
|
||||
this.setState({
|
||||
emailbool: false
|
||||
})
|
||||
|
||||
} else if (i === 3) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
getCode = (index) => {
|
||||
let url = `/accounts/get_verification_code.json`
|
||||
let login = '';
|
||||
let values = this.props.form.getFieldsValue();
|
||||
if (index == 3) {
|
||||
//绑定手机号码
|
||||
login = values.phone;
|
||||
let reg = /^1\d{10}$/;
|
||||
if (reg.test(login) == false) {
|
||||
this.props.showNotification(`请先输入正确的手机号码`);
|
||||
return;
|
||||
}
|
||||
} else if (index == 4) {
|
||||
// 绑定邮箱
|
||||
login = values.email;
|
||||
let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
||||
if (reg.test(login) == false) {
|
||||
this.props.showNotification(`请先输入正确的邮箱地址`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
let type = index;
|
||||
if (!login) {
|
||||
this.props.showNotification(`请先输入${index == 3 ? "手机号码" : "邮箱地址"}`);
|
||||
return;
|
||||
}
|
||||
let smscode=setmiyah(login)
|
||||
axios.get((url), {
|
||||
params: {
|
||||
login, type,smscode
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
// 倒计时
|
||||
this.setState({
|
||||
secondsFlag: true
|
||||
})
|
||||
this.remainTime();
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码倒计时
|
||||
remainTime = () => {
|
||||
this.setState({
|
||||
seconds: 60
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
let {seconds} = this.state;
|
||||
let s = parseInt(seconds) - 1;
|
||||
if (s > -1) {
|
||||
this.setState({
|
||||
seconds: s
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
secondsFlag: false
|
||||
})
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
phonebools = () => {
|
||||
this.setState({
|
||||
phonebool: true
|
||||
})
|
||||
}
|
||||
|
||||
emailbools = () => {
|
||||
console.log("点击了邮箱");
|
||||
this.setState({
|
||||
emailbool: true
|
||||
})
|
||||
}
|
||||
|
||||
//立即认证
|
||||
checkBasicInfo = (index) => {
|
||||
if (this.state.userdata.base_info_completed == true) {
|
||||
this.showRealNameCertificationModal(index)
|
||||
} else {
|
||||
try {
|
||||
this.props.confirm({
|
||||
okText: `立即完善`,
|
||||
content: `请先完善基本信息`,
|
||||
onOk: () => {
|
||||
this.props.history.push('/account/profile/edit')
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
this.props.history.push(`/account/profile/edit`);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
showRealNameCertificationModal = (index) => {
|
||||
this.setState({
|
||||
certification: index,
|
||||
}, () => {
|
||||
if (index == 1) {
|
||||
this.realNameCertificationModal1.setVisible(true)
|
||||
} else if (index == 2) {
|
||||
this.realNameCertificationModal2.setVisible(true)
|
||||
}
|
||||
})
|
||||
}
|
||||
//绑定银行确认
|
||||
yhBankstrue = () => {
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`;
|
||||
axios.patch(url, {
|
||||
user_id:this.state.userdata.id,
|
||||
bank: values.openingbank,
|
||||
second_bank: values.subbranchs,
|
||||
card_no: values.subbranch
|
||||
})
|
||||
.then((result) => {
|
||||
try {
|
||||
if (result.data.status == 0) {
|
||||
// console.log(JSON.stringify(result));
|
||||
this.props.showNotification(`提交成功`);
|
||||
this.getdata(this.state.userdata.id);
|
||||
this.GetawardinformationAPI();
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
//取消认证弹框
|
||||
onCancel = () => {
|
||||
this.getdata(this.state.userdata.id);
|
||||
|
||||
}
|
||||
|
||||
bindRef = ref => { this.child = ref }
|
||||
//撤销认证
|
||||
Cancellationofapplication = (index) => {
|
||||
let userid;
|
||||
let query=this.props.location&&this.props.location.search;
|
||||
const types = query.split('user_id=')
|
||||
if(types[1]===undefined){
|
||||
userid=this.props.user&&this.props.user.user_id;
|
||||
}else{
|
||||
userid=types[1];
|
||||
}
|
||||
let url = ""
|
||||
if (index === 1) {
|
||||
url = `/users/accounts/${userid}/authentication_apply.json`;
|
||||
} else if (index === 2) {
|
||||
url = `/users/accounts/${userid}/professional_auth_apply.json`;
|
||||
}
|
||||
axios.delete(url)
|
||||
.then((response) => {
|
||||
try {
|
||||
if (response.data.status == 0) {
|
||||
if (index === 1) {
|
||||
this.props.showNotification('撤销实名认证成功')
|
||||
} else if (index === 2) {
|
||||
this.props.showNotification('撤销职业认证成功')
|
||||
}
|
||||
try {
|
||||
this.getdata(this.state.userdata.id);
|
||||
}catch (e) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const admins=this.props.user.admin;
|
||||
if(admins===undefined||admins===null) {
|
||||
admins === false;
|
||||
}
|
||||
const {updating, seconds, secondsFlag,userdata, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state
|
||||
return (
|
||||
<div className="flexdidirectionss mt17">
|
||||
{this.state.certification === 1 &&userdata?
|
||||
|
||||
<RealNameCertificationModal {...this.props} {...this.state} basicInfo={userdata}
|
||||
wrappedComponentRef={(form) => this.realNameCertificationModal1 = form}
|
||||
certification={certification}
|
||||
Getdata={(id) => this.getdata(id)}
|
||||
onCancel={() => this.onCancel()}
|
||||
></RealNameCertificationModal>
|
||||
|
||||
|
||||
: ""}
|
||||
|
||||
{this.state.certification === 2 &&userdata ?
|
||||
<RealNameCertificationModal {...this.props} {...this.state} basicInfo={userdata}
|
||||
wrappedComponentRef={(form) => this.realNameCertificationModal2 = form}
|
||||
certification={certification}
|
||||
Getdata={(id) => this.getdata(id)}
|
||||
onCancel={() => this.onCancel()}
|
||||
|
||||
></RealNameCertificationModal> : ""}
|
||||
<div className="flexdirections ">
|
||||
<p className="fontcolorsyslhei font-16 w98"><span className="fontcolorsysl font-16">*</span><span>实名信息</span>
|
||||
</p>
|
||||
{userdata && userdata.authentication == "uncertified" ?
|
||||
<p className="fontcolorsyslhui font-14 w200">通过实名认证后才能获得证书</p> : ""
|
||||
}
|
||||
{userdata && userdata.authentication == "uncertified" ?
|
||||
<p className="fontcolorsysllan font-14 ml3 mycompitcursor"
|
||||
onClick={() => this.checkBasicInfo(1)}>立即认证</p> : ""
|
||||
}
|
||||
|
||||
</div>
|
||||
<div className="flexdirections ml38 mt23">
|
||||
<p className="fontcolorsyslhui1">姓名:</p>
|
||||
<p className="fontcolorsyslhei flexdirections">{userdata && userdata.name}
|
||||
|
||||
{
|
||||
userdata && userdata.authentication == "uncertified" ? "" :
|
||||
userdata && userdata.authentication == "applying" ?
|
||||
<p className="flexdirections"><p className="iconfont icon-tishi colorgreenorg font-14 ml20"></p><p
|
||||
className="colorgreenorg font-14 ml6">待审核!</p><p
|
||||
className="fontcolorsysllan borcolors font-12 w64 mycompitcursor"
|
||||
onClick={() => this.Cancellationofapplication(1)}>撤销认证</p></p>
|
||||
:
|
||||
<p className="flexdirections">
|
||||
<p className="iconfont icon-wancheng colorgreenlight font-14 ml20"></p><p
|
||||
className="colorgreenlight font-14 ml6">已认证</p>
|
||||
</p>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p className="fontcolorsyslhui1">性别:</p>
|
||||
<p className="fontcolorsyslhei"> {userdata && userdata.gender == 0 ? "男" : "女"}</p>
|
||||
</div>
|
||||
|
||||
<div className="flexdirections mt36 ">
|
||||
<p className="fontcolorsyslhei font-16 w98"><span className="fontcolorsysl font-16">*</span><span>职业信息</span>
|
||||
</p>
|
||||
{
|
||||
userdata && userdata.professional_certification == "uncertified" ?
|
||||
<p className="fontcolorsyslhui font-14 w200">通过职业认证后才能获得证书</p>
|
||||
|
||||
: ""}
|
||||
{
|
||||
userdata && userdata.professional_certification == "uncertified" ?
|
||||
<p className="fontcolorsysllan font-14 ml3 mycompitcursor" onClick={() => this.checkBasicInfo(2)}>立即认证</p>
|
||||
|
||||
: ""}
|
||||
</div>
|
||||
|
||||
<div className="flexdirections ml38 mt23">
|
||||
<p className="fontcolorsyslhui1">职业:</p>
|
||||
<p
|
||||
className="fontcolorsyslhei flexdirections">{userdata && userdata.identity && identityMap[userdata.identity]}
|
||||
{
|
||||
userdata && userdata.professional_certification == "uncertified" ?
|
||||
"" :
|
||||
userdata && userdata.professional_certification == "applying" ?
|
||||
<p className="flexdirections">
|
||||
<p className="iconfont icon-tishi colorgreenorg font-14 ml20"></p><p
|
||||
className="colorgreenorg font-14 ml6">待审核!</p><p
|
||||
className="fontcolorsysllan borcolors font-12 w64 mycompitcursor ml6"
|
||||
onClick={() => this.Cancellationofapplication(2)}>撤销认证</p>
|
||||
</p>
|
||||
:
|
||||
<p className="flexdirections">
|
||||
<p className="iconfont icon-wancheng colorgreenlight font-14 ml20"></p><p
|
||||
className="colorgreenlight font-14 ml6">已认证</p>
|
||||
<p className="fontcolorsysllan borcolors font-12 w64 mycompitcursor ml6"
|
||||
onClick={() => this.checkBasicInfo(2)}>重新认证</p>
|
||||
|
||||
</p>
|
||||
}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p
|
||||
className="fontcolorsyslhui1">{userdata && userdata.technical_title ? "职称:" : ""}{userdata && userdata.student_id ? "学号:" : ""}</p>
|
||||
<p className="fontcolorsyslhei">{userdata && (userdata.technical_title || userdata.student_id)}</p>
|
||||
</div>
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p className="fontcolorsyslhui1">学校:</p>
|
||||
<p className="fontcolorsyslhei">{userdata && userdata.school_name}</p>
|
||||
</div>
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p className="fontcolorsyslhui1">院系:</p>
|
||||
<p className="fontcolorsyslhei"> {userdata && userdata.department_name}</p>
|
||||
</div>
|
||||
<div className="flexdirections mt36 ">
|
||||
<p className="fontcolorsyslhei font-16 w98"><span className="fontcolorsysl font-16">*</span><span>联系方式</span>
|
||||
</p>
|
||||
</div>
|
||||
<div className="flexdirections ml38 mt23">
|
||||
<p className="fontcolorsyslhui1 w60 ">手机号:</p>
|
||||
{
|
||||
userdata && userdata.phone ?
|
||||
<p className="fontcolorsyslhei w200 ">{userdata && userdata.phone}</p>
|
||||
:
|
||||
<p className="fontcolorsysljin w200 ">未绑定</p>
|
||||
}
|
||||
<p className="fontcolorsysllan mycompitcursor"
|
||||
onClick={() => this.phonebools()}>{userdata && userdata.phone ? (phonebool === false ? "更换" : "") : (phonebool === false ? "立即绑定" : "")}</p>
|
||||
</div>
|
||||
{/*手机号绑定*/}
|
||||
{
|
||||
phonebool === true &&userdata ?
|
||||
<Phonenumberverifications {...this.props} {...this.state} basicInfo={userdata}
|
||||
hideUpdating={(i) => this.hideUpdating(i)}
|
||||
getdata={(id) => this.getdata(id)}></Phonenumberverifications>
|
||||
: ""
|
||||
}
|
||||
|
||||
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p className="fontcolorsyslhui1 w60">Email:</p>
|
||||
<p className="fontcolorsyslhei w200">{userdata && userdata.mail}</p>
|
||||
<p className="fontcolorsysllan mycompitcursor"
|
||||
onClick={() => this.emailbools()}>{userdata && userdata.mail ? (emailbool === false ? "更换" : "") : (emailbool === false ? "立即绑定" : "")}</p>
|
||||
</div>
|
||||
{
|
||||
emailbool === false ? "" :
|
||||
(
|
||||
userdata?
|
||||
<Mailboxvalidations {...this.props} {...this.state} basicInfo={userdata}
|
||||
hideUpdating={(i) => this.hideUpdating(i)}
|
||||
getdata={(id) => this.getdata(id)}></Mailboxvalidations>
|
||||
:""
|
||||
)
|
||||
}
|
||||
{
|
||||
leader === true ?
|
||||
<div>
|
||||
{
|
||||
bank_account_editable === true ?
|
||||
<Bankcardnumberverifications triggerRef={this.bindRef} {...this.props} {...this.state} basicInfo={userdata}
|
||||
hideUpdating={(i) => this.hideUpdating(i)}
|
||||
getdata={(id) => this.getdata(id)}
|
||||
GetawardinformationAPI={() => this.GetawardinformationAPI()}
|
||||
bank_account={this.state.bank_account}
|
||||
></Bankcardnumberverifications>
|
||||
:
|
||||
admins===true?
|
||||
<Bankcardnumberverifications triggerRef={this.bindRef} {...this.props} {...this.state} basicInfo={userdata}
|
||||
hideUpdating={(i) => this.hideUpdating(i)}
|
||||
getdata={(id) => this.getdata(id)}
|
||||
GetawardinformationAPI={() => this.GetawardinformationAPI()}
|
||||
bank_account={this.state.bank_account}
|
||||
></Bankcardnumberverifications>
|
||||
:
|
||||
<div>
|
||||
<div className="flexdirections mt36">
|
||||
<p className="fontcolorsyslhei font-16">签/领/开户行及银行卡号</p>
|
||||
<p className="fontcolorsyslhui font-14 ml11">为保障奖金的及时发放,请队长如实填写你名下的银行卡信息</p>
|
||||
</div>
|
||||
{
|
||||
bank_account && bank_account ?
|
||||
<div>
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p className="fontcolorsyslhui1 w56">开户行:</p>
|
||||
<p className="fontcolorsyslhei">{bank_account && bank_account.bank}</p>
|
||||
</div>
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p className="fontcolorsyslhui1 w56" style={{textAlign: "right"}}>支行:</p>
|
||||
<p className="fontcolorsyslhei">{bank_account && bank_account.second_bank}</p>
|
||||
</div>
|
||||
<div className="flexdirections ml38 mt19">
|
||||
<p className="fontcolorsyslhui1 w56" style={{textAlign: "right"}}>账号:</p>
|
||||
<p className="fontcolorsyslhei"> {bank_account && bank_account.card_no}</p>
|
||||
</div>
|
||||
</div>
|
||||
:
|
||||
""
|
||||
}
|
||||
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
:
|
||||
<div>
|
||||
{
|
||||
admins===true?
|
||||
<Bankcardnumberverifications triggerRef={this.bindRef} {...this.props} {...this.state} basicInfo={userdata}
|
||||
hideUpdating={(i) => this.hideUpdating(i)}
|
||||
getdata={(id) => this.getdata(id)}
|
||||
GetawardinformationAPI={() => this.GetawardinformationAPI()}
|
||||
bank_account={this.state.bank_account}
|
||||
></Bankcardnumberverifications>
|
||||
:""
|
||||
}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default CompetitionContentspdfpeopledata;
|
||||
|
|
@ -1,278 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {Button, Layout, Input, Form} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {setmiyah} from 'educoder';
|
||||
import mycompetotionchild from './mycompetotionchild.css';
|
||||
import {getHiddenName} from "../../../../user/account/AccountBasicEdit";
|
||||
import '../../../../courses/css/Courses.css'
|
||||
|
||||
export const identityMap = {"teacher": "教师", "student": "学生", "professional": "专业人士"}
|
||||
|
||||
class Mailboxvalidation extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
basicInfo: {},
|
||||
updating: '',
|
||||
secondsFlag: false,
|
||||
seconds: 60,
|
||||
phonebool: false,
|
||||
emailbool: false,
|
||||
formationdata: [],
|
||||
bank_account_editable: false,
|
||||
leader: false,
|
||||
bank_account: undefined,
|
||||
certification: 1
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.document.title = '竞赛';
|
||||
// console.log("3获取用户信息");
|
||||
// console.log(this.props);
|
||||
}
|
||||
|
||||
|
||||
// 绑定邮箱
|
||||
onEmailSubmit = () => {
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
let {id} = this.props.userdata;
|
||||
let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
||||
if (reg.test(values.email)) {
|
||||
let url = `/users/accounts/${id}/email_bind.json`
|
||||
axios.post((url), {
|
||||
email: values.email,
|
||||
code: values.emailValidateCode
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
this.props.showNotification("邮箱地址绑定成功!");
|
||||
this.hideUpdating(2);
|
||||
this.props.getdata(id);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
this.props.showNotification("请输入正确的邮箱地址");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//取消编辑
|
||||
hideUpdating = (i) => {
|
||||
if (i === 1) {
|
||||
this.props.hideUpdating(1);
|
||||
} else if (i === 2) {
|
||||
this.props.hideUpdating(2);
|
||||
|
||||
|
||||
} else if (i === 3) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
getCode = (index) => {
|
||||
let url = `/accounts/get_verification_code.json`
|
||||
let login = '';
|
||||
let values = this.props.form.getFieldsValue();
|
||||
|
||||
if (index == 3) {
|
||||
//绑定手机号码
|
||||
login = values.phone;
|
||||
let reg = /^1\d{10}$/;
|
||||
if (reg.test(login) == false) {
|
||||
this.props.showNotification(`请先输入正确的手机号码`);
|
||||
return;
|
||||
}
|
||||
} else if (index == 4) {
|
||||
// 绑定邮箱
|
||||
login = values.email;
|
||||
let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
||||
if (reg.test(login) == false) {
|
||||
this.props.showNotification(`请先输入正确的邮箱地址`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
let type = index;
|
||||
if (!login) {
|
||||
this.props.showNotification(`请先输入${index == 3 ? "手机号码" : "邮箱地址"}`);
|
||||
return;
|
||||
}
|
||||
let smscode=setmiyah(login)
|
||||
axios.get((url), {
|
||||
params: {
|
||||
login, type,smscode
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
// 倒计时
|
||||
if(result.data.status===1){
|
||||
this.props.showNotification("验证码已发送,请注意查收");
|
||||
}else if(result.data.status===-2){
|
||||
this.props.showNotification(result.data.message);
|
||||
}
|
||||
|
||||
this.setState({
|
||||
secondsFlag: true
|
||||
})
|
||||
this.remainTime();
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码倒计时
|
||||
remainTime = () => {
|
||||
this.setState({
|
||||
seconds: 60
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
let {seconds} = this.state;
|
||||
let s = parseInt(seconds) - 1;
|
||||
if (s > -1) {
|
||||
this.setState({
|
||||
seconds: s
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
secondsFlag: false
|
||||
})
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
phonebools = () => {
|
||||
this.setState({
|
||||
phonebool: true
|
||||
})
|
||||
}
|
||||
|
||||
emailbools = () => {
|
||||
console.log("点击了邮箱");
|
||||
this.setState({
|
||||
emailbool: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const {getFieldDecorator} = this.props.form;
|
||||
const {updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state
|
||||
console.log(emailbool);
|
||||
return (
|
||||
<div>
|
||||
<style>{`
|
||||
|
||||
.flexRow {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.flexRow .name {
|
||||
margin-left: 12px;
|
||||
color: #666666;
|
||||
|
||||
text-align: center;
|
||||
flex: 0 0 100px;
|
||||
}
|
||||
.flexRow .description {
|
||||
margin-left: 10px;
|
||||
flex: 1;
|
||||
color: #CDCDCD;
|
||||
}
|
||||
.description span {
|
||||
margin-right: 20px;
|
||||
color: #05101A;
|
||||
}
|
||||
.flexRow .status {
|
||||
width: 100px;
|
||||
color: #28AC7F;
|
||||
text-align: right;
|
||||
}
|
||||
.flexTable .flexTable {
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
}
|
||||
|
||||
.settingForm label{
|
||||
color: #666666;
|
||||
font-size: 14px !important ;
|
||||
}
|
||||
.settingForm input {
|
||||
width: 340px;
|
||||
height: 40px;
|
||||
}
|
||||
.settingForm input.validateInput {
|
||||
width: 220px;
|
||||
}
|
||||
.settingForm .formItemInline button {
|
||||
width: 110px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.settingForm .ant-form-item-label {
|
||||
text-align: left;
|
||||
width: 84px;
|
||||
}
|
||||
|
||||
|
||||
.formItemInline .ant-form-explain{
|
||||
position:absolute;
|
||||
bottom:-22px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
}
|
||||
`}</style>
|
||||
<div className="settingForm ml38">
|
||||
<React.Fragment>
|
||||
<Form>
|
||||
<Form.Item
|
||||
label="邮箱地址"
|
||||
className="formItemInline hideRequireTag mb20 mt20"
|
||||
>
|
||||
{getFieldDecorator('email', {
|
||||
rules: [{
|
||||
// initialValue: this.state.cityDefaultValue,
|
||||
required: true,
|
||||
message: basicInfo && basicInfo.mail ? '请输入要更换的新邮箱地址' : '请输入邮箱地址',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder={`${basicInfo && basicInfo.mail ? '请输入要更换的新邮箱地址' : '请输入邮箱地址'}`}></Input>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="邮箱验证码"
|
||||
className="mb20 formItemInline hideRequireTag"
|
||||
>
|
||||
{getFieldDecorator('emailValidateCode', {
|
||||
rules: [{
|
||||
// initialValue: this.state.cityDefaultValue,
|
||||
required: true,
|
||||
message: '请输入邮箱收到的验证码',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="请输入邮箱收到的验证码" className="validateInput"></Input>
|
||||
)}
|
||||
<Button type="primary" disabled={secondsFlag} onClick={() => this.getCode(4)}>
|
||||
{!secondsFlag ? "获取验证码" : `重新发送${seconds}s`}</Button>
|
||||
</Form.Item>
|
||||
|
||||
<div className="mb20" style={{marginLeft: '204px'}}>
|
||||
<Button type="primary" onClick={() => this.onEmailSubmit()}>确定</Button>
|
||||
<Button type="primary grayBtn" style={{marginLeft: '20px'}}
|
||||
onClick={() => this.hideUpdating(2)}>取消</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const Mailboxvalidations = Form.create({name: 'Mailboxvalidation'})(Mailboxvalidation);
|
||||
|
||||
export default Mailboxvalidations;
|
||||
|
|
@ -1,269 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import {Button, Layout, Input, Form} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {setmiyah} from 'educoder';
|
||||
import mycompetotionchild from './mycompetotionchild.css';
|
||||
import {getHiddenName} from "../../../../user/account/AccountBasicEdit";
|
||||
import '../../../../courses/css/Courses.css'
|
||||
import RealNameCertificationModal from "../../../../user/modal/RealNameCertificationModal";
|
||||
|
||||
export const identityMap = {"teacher": "教师", "student": "学生", "professional": "专业人士"}
|
||||
|
||||
class Phonenumberverification extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
updating: '',
|
||||
secondsFlag: false,
|
||||
seconds: 60,
|
||||
phonebool: false,
|
||||
emailbool: false,
|
||||
formationdata: [],
|
||||
bank_account_editable: false,
|
||||
leader: false,
|
||||
bank_account: undefined,
|
||||
certification: 1
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
window.document.title = '竞赛';
|
||||
// console.log("获取用户信息");
|
||||
// console.log(this.props);
|
||||
}
|
||||
|
||||
|
||||
// 绑定手机
|
||||
onPhoneSubmit = () => {
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if (!err) {
|
||||
let {id} = this.props.userdata;
|
||||
let reg = /^1\d{10}$/;
|
||||
if (reg.test(values.phone)) {
|
||||
let url = `/users/accounts/${id}/phone_bind.json`
|
||||
axios.post((url), {
|
||||
phone: values.phone,
|
||||
code: values.phoneValidateCode
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
this.props.showNotification("手机号码绑定成功!");
|
||||
this.props.hideUpdating(1)
|
||||
this.props.getdata(id);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
} else {
|
||||
this.props.showNotification("请输入有效的11位手机号码");
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
//取消编辑
|
||||
hideUpdating = (i) => {
|
||||
if (i === 1) {
|
||||
this.props.hideUpdating(1);
|
||||
} else if (i === 2) {
|
||||
this.props.hideUpdating(2);
|
||||
|
||||
} else if (i === 3) {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
getCode = (index) => {
|
||||
let url = `/accounts/get_verification_code.json`
|
||||
let login = '';
|
||||
let values = this.props.form.getFieldsValue();
|
||||
|
||||
if (index == 3) {
|
||||
//绑定手机号码
|
||||
login = values.phone;
|
||||
let reg = /^1\d{10}$/;
|
||||
if (reg.test(login) == false) {
|
||||
this.props.showNotification(`请先输入正确的手机号码`);
|
||||
return;
|
||||
}
|
||||
} else if (index == 4) {
|
||||
// 绑定邮箱
|
||||
login = values.email;
|
||||
let reg = /^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/;
|
||||
if (reg.test(login) == false) {
|
||||
this.props.showNotification(`请先输入正确的邮箱地址`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
let type = index;
|
||||
if (!login) {
|
||||
this.props.showNotification(`请先输入${index == 3 ? "手机号码" : "邮箱地址"}`);
|
||||
return;
|
||||
}
|
||||
let smscode=setmiyah(login)
|
||||
axios.get((url), {
|
||||
params: {
|
||||
login, type,smscode
|
||||
}
|
||||
}).then((result) => {
|
||||
if (result) {
|
||||
// 倒计时
|
||||
if(result.data.status===1){
|
||||
this.props.showNotification("验证码已发送,请注意查收");
|
||||
}else if(result.data.status===-2){
|
||||
this.props.showNotification(result.data.message);
|
||||
}
|
||||
this.setState({
|
||||
secondsFlag: true
|
||||
})
|
||||
this.remainTime();
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error);
|
||||
})
|
||||
}
|
||||
|
||||
// 获取验证码倒计时
|
||||
remainTime = () => {
|
||||
this.setState({
|
||||
seconds: 60
|
||||
})
|
||||
this.timer = setInterval(() => {
|
||||
let {seconds} = this.state;
|
||||
let s = parseInt(seconds) - 1;
|
||||
if (s > -1) {
|
||||
this.setState({
|
||||
seconds: s
|
||||
})
|
||||
} else {
|
||||
this.setState({
|
||||
secondsFlag: false
|
||||
})
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
phonebools = () => {
|
||||
this.setState({
|
||||
phonebool: true
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
render() {
|
||||
const {getFieldDecorator} = this.props.form;
|
||||
const {updating, seconds, secondsFlag, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account} = this.state
|
||||
const {basicInfo} = this.props
|
||||
console.log(emailbool);
|
||||
return (
|
||||
<div>
|
||||
<style>{`
|
||||
|
||||
.flexRow {
|
||||
padding: 20px 0;
|
||||
}
|
||||
.flexRow .name {
|
||||
margin-left: 12px;
|
||||
color: #666666;
|
||||
|
||||
text-align: center;
|
||||
flex: 0 0 100px;
|
||||
}
|
||||
.flexRow .description {
|
||||
margin-left: 10px;
|
||||
flex: 1;
|
||||
color: #CDCDCD;
|
||||
}
|
||||
.description span {
|
||||
margin-right: 20px;
|
||||
color: #05101A;
|
||||
}
|
||||
.flexRow .status {
|
||||
width: 100px;
|
||||
color: #28AC7F;
|
||||
text-align: right;
|
||||
}
|
||||
.flexTable .flexTable {
|
||||
border-bottom: 1px solid #EBEBEB;
|
||||
}
|
||||
|
||||
.settingForm label{
|
||||
color: #666666;
|
||||
font-size: 14px !important ;
|
||||
}
|
||||
.settingForm input {
|
||||
width: 340px;
|
||||
height: 40px;
|
||||
}
|
||||
.settingForm input.validateInput {
|
||||
width: 220px;
|
||||
}
|
||||
.settingForm .formItemInline button {
|
||||
width: 110px;
|
||||
margin-left: 10px;
|
||||
}
|
||||
.settingForm .ant-form-item-label {
|
||||
text-align: left;
|
||||
width: 84px;
|
||||
}
|
||||
.formItemInline .ant-form-explain{
|
||||
position:absolute;
|
||||
bottom:-22px;
|
||||
left:0px;
|
||||
width:100%;
|
||||
}
|
||||
`}</style>
|
||||
<div className="settingForm ml38">
|
||||
<React.Fragment>
|
||||
<Form>
|
||||
<Form.Item
|
||||
label="你的手机号"
|
||||
className="formItemInline hideRequireTag mb20 mt20"
|
||||
>
|
||||
{getFieldDecorator('phone', {
|
||||
rules: [{
|
||||
// initialValue: this.state.cityDefaultValue,
|
||||
required: true,
|
||||
message: `请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`,
|
||||
}],
|
||||
})(
|
||||
<Input placeholder={`请输入要${basicInfo.phone ? '更换' : '绑定'}的手机号码`}></Input>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="手机验证码"
|
||||
className="mb20 formItemInline hideRequireTag"
|
||||
>
|
||||
{getFieldDecorator('phoneValidateCode', {
|
||||
rules: [{
|
||||
// initialValue: this.state.cityDefaultValue,
|
||||
required: true,
|
||||
message: '请输入手机获取的验证码',
|
||||
}],
|
||||
})(
|
||||
<Input placeholder="请输入手机获取的验证码" className="validateInput"></Input>
|
||||
)}
|
||||
<Button type="primary" disabled={secondsFlag} onClick={() => this.getCode(3)}>
|
||||
{!secondsFlag ? "获取验证码" : `重新发送${seconds}s`}
|
||||
</Button>
|
||||
</Form.Item>
|
||||
|
||||
<div className="mb20" style={{marginLeft: '204px'}}>
|
||||
<Button type="primary" onClick={() => this.onPhoneSubmit()}>确定</Button>
|
||||
<Button type="primary grayBtn" style={{marginLeft: '20px'}}
|
||||
onClick={() => this.hideUpdating(1)}>取消</Button>
|
||||
</div>
|
||||
</Form>
|
||||
</React.Fragment>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
const Phonenumberverifications = Form.create({name: 'Phonenumberverification'})(Phonenumberverification);
|
||||
|
||||
export default Phonenumberverifications;
|
||||
|
|
@ -1,314 +0,0 @@
|
|||
/*垂直布局
|
||||
|
||||
一
|
||||
二
|
||||
三
|
||||
*/
|
||||
.flexdirectionjust {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
|
||||
.directstwebkitflex {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.diredisplayitflex {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/*垂直布局*/
|
||||
/*靠左侧
|
||||
一 二 三 四 五 六 七 八
|
||||
*/
|
||||
.flexdirection {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.flexdirections {
|
||||
display: flex;
|
||||
flex-direction: initial;
|
||||
}
|
||||
|
||||
/*靠左侧
|
||||
*/
|
||||
|
||||
|
||||
/*靠右侧八 七 六 五 四 三 二 一*/
|
||||
.flexdirectionss {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
|
||||
/*垂直布局
|
||||
一
|
||||
二
|
||||
三
|
||||
四
|
||||
*/
|
||||
.flexdidirectionss {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/*垂直布局
|
||||
四
|
||||
三
|
||||
二
|
||||
一
|
||||
*/
|
||||
.flexdidireverses {
|
||||
display: flex;
|
||||
flex-direction: column-reverse;
|
||||
}
|
||||
|
||||
.fontcolorsysl {
|
||||
color: #FF0000
|
||||
}
|
||||
|
||||
.fontcolorsyslhei {
|
||||
color: #000000
|
||||
}
|
||||
|
||||
.fontcolorsyslhui {
|
||||
color: #888888
|
||||
}
|
||||
|
||||
.fontcolorsyslhui1 {
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
.fontcolorsysllan {
|
||||
color: #4CACFF
|
||||
}
|
||||
|
||||
.fontcolorsysljin {
|
||||
color: #DD7600
|
||||
}
|
||||
|
||||
.w200 {
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.w64 {
|
||||
width: 64px;
|
||||
}
|
||||
|
||||
.w60 {
|
||||
width: 60px;
|
||||
}
|
||||
|
||||
.w98 {
|
||||
width: 98px;
|
||||
}
|
||||
|
||||
.myysllineheight {
|
||||
line-height: 40px;
|
||||
}
|
||||
|
||||
.myyslminwidth {
|
||||
min-width: 60px;
|
||||
}
|
||||
|
||||
.myyslminwidth276 {
|
||||
width: 276px;
|
||||
}
|
||||
|
||||
.buttongo {
|
||||
background: #E7E7E7;
|
||||
border: 1px solid #E7E7E7;
|
||||
width: 60px;
|
||||
height: 30px;
|
||||
border-radius: 4px;
|
||||
color: #999999;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.buttongo2 {
|
||||
background: #4CACFF;
|
||||
border: 1px solid #4CACFF;
|
||||
width: 64px;
|
||||
height: 32px;
|
||||
border-radius: 4px;
|
||||
color: #FFFFFF;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.fontwenzi {
|
||||
text-align: center;
|
||||
line-height: 30px;
|
||||
}
|
||||
|
||||
.mt17 {
|
||||
margin-top: 17px;
|
||||
}
|
||||
|
||||
.mt36 {
|
||||
margin-top: 36px;
|
||||
}
|
||||
|
||||
.mt23 {
|
||||
margin-top: 23px;
|
||||
}
|
||||
|
||||
.mt19 {
|
||||
margin-top: 19px;
|
||||
}
|
||||
|
||||
.mt23 {
|
||||
margin-top: 23px;
|
||||
}
|
||||
|
||||
.mt34 {
|
||||
margin-top: 34px;
|
||||
}
|
||||
|
||||
.ml11 {
|
||||
margin-left: 11px;
|
||||
}
|
||||
|
||||
.ml38 {
|
||||
margin-left: 38px;
|
||||
}
|
||||
|
||||
.ml7 {
|
||||
margin-left: 7px;
|
||||
}
|
||||
|
||||
.colorgreenlight {
|
||||
color: #6EC76E
|
||||
}
|
||||
|
||||
.colorgreenorg {
|
||||
color: #FF7300;
|
||||
}
|
||||
|
||||
.borcolors {
|
||||
border: 1px solid #4CACFF;
|
||||
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.mycompitcursor {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.basicForm {
|
||||
background: #fff;
|
||||
padding: 30px;
|
||||
margin-bottom: 10px;
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
min-height: 390px;
|
||||
}
|
||||
|
||||
.basicForm .title {
|
||||
font-size: 16px;
|
||||
padding-left: 30px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.flexTable {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.flexRow {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.mb15 {
|
||||
margin-bottom: 15px !important;
|
||||
}
|
||||
|
||||
/* BUTTOn */
|
||||
.ant-btn {
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
button.ant-btn.ant-btn-primary.grayBtn {
|
||||
background: #CBCBCB;
|
||||
border-color: #CBCBCB;
|
||||
}
|
||||
|
||||
.borderBottom {
|
||||
border-bottom: 1px solid #4CACFF;
|
||||
}
|
||||
|
||||
/* form ---------------- START */
|
||||
.formItemInline {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.formItemInline .ant-form-item-control-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.hideRequireTag .ant-form-item-required:before {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
||||
/* .basicForm .ant-form-item-label {
|
||||
width: 100px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.basicForm .ant-form-item-label label {
|
||||
color: #979797
|
||||
} */
|
||||
|
||||
|
||||
.courseNormalForm .ant-select-show-search {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.courseNormalForm .ant-select-auto-complete.ant-select .ant-input {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.courseNormalForm .ant-select-search__field__mirror {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.courseNormalForm .ant-input-lg {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.courseNormalForm .ant-select-selection--single {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.courseNormalForm .ant-select-auto-complete.ant-select .ant-select-selection--single {
|
||||
height: 40px
|
||||
}
|
||||
|
||||
.courseNormalForm .ant-input-affix-wrapper {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
/* 职业 */
|
||||
.courseNormalForm .ant-select-selection-selected-value {
|
||||
line-height: 38px
|
||||
}
|
||||
|
||||
.courseNormalForm input {
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.w300 {
|
||||
width: 300px;
|
||||
}
|
||||
|
||||
.w56 {
|
||||
width: 56px;
|
||||
}
|
|
@ -1,92 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import { Route, Link, Switch } from "react-router-dom";
|
||||
|
||||
import Loading from '../../Loading';
|
||||
|
||||
import Loadable from 'react-loadable';
|
||||
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
||||
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
|
||||
|
||||
//新版竞赛首页
|
||||
const CompetitionsIndex = Loadable({
|
||||
loader: () => import('./Competitimain/CompetitionsIndex'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
//竞赛详情页
|
||||
const CompetitionCommon=Loadable({
|
||||
loader: () => import('./Competitioncommon/CompetitionCommon'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
|
||||
//战队详情
|
||||
const CompetitionTeams = Loadable({
|
||||
loader: () => import('./Competition_teams/Competitionteams'),
|
||||
loading: Loading,
|
||||
})
|
||||
|
||||
//团队竞赛报名
|
||||
const Registration = Loadable({
|
||||
loader: () => import('../competition/Registration'),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
class Competitions extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
}
|
||||
|
||||
componentDidMount(){
|
||||
|
||||
window.document.title = '竞赛';
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
|
||||
<Switch>
|
||||
|
||||
{/*新版竞赛战队详情*/}
|
||||
<Route path="/competitions/:identifier/competition_teams/:competition_team_id"
|
||||
render={
|
||||
(props) => (<CompetitionTeams {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
|
||||
{/*新版竞赛报名*/}
|
||||
<Route
|
||||
path="/competitions/:identifier/enroll"
|
||||
render={
|
||||
(props) => (<Registration {...this.props} {...props} {...this.state}/>)
|
||||
}
|
||||
/>
|
||||
|
||||
{/*新版竞赛详情页面*/}
|
||||
<Route path="/competitions/:identifier"
|
||||
render={
|
||||
(props) => (<CompetitionCommon {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
{/*新版竞赛首页*/}
|
||||
<Route path="/competitions"
|
||||
render={
|
||||
(props) => (<CompetitionsIndex {...this.props} {...props} {...this.state} />)
|
||||
}
|
||||
></Route>
|
||||
|
||||
</Switch>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CNotificationHOC() (TPMIndexHOC (Competitions)) ;
|
|
@ -1,79 +0,0 @@
|
|||
import React, { useEffect, useState, Fragment } from 'react'
|
||||
import axios from 'axios'
|
||||
import UpgradeModals from '../modals/UpgradeModals'
|
||||
import ShixunCardList from '../../components/shixun-card-list'
|
||||
import { TPMIndexHOC } from '../tpm/TPMIndexHOC'
|
||||
import ListContainer from './list-container'
|
||||
import { SnackbarHOC } from 'educoder'
|
||||
import ShixunPathCard from '../paths/ShixunPathCard'
|
||||
import { Carousel } from 'antd'
|
||||
import { getUrl } from 'educoder'
|
||||
import './index.scss'
|
||||
import NavList from './nav-list'
|
||||
|
||||
function Home({ mygetHelmetapi, user }) {
|
||||
|
||||
const [resource, setResource] = useState({
|
||||
loading: true,
|
||||
data: {},
|
||||
updata: null
|
||||
})
|
||||
|
||||
|
||||
let shixuntype = false
|
||||
let pathstype = false
|
||||
if (mygetHelmetapi) {
|
||||
let shixun = "/shixuns";
|
||||
let paths = "/paths";
|
||||
mygetHelmetapi.navbar.map(item => {
|
||||
var reg = RegExp(item.link)
|
||||
if (shixun.match(reg)) {
|
||||
if (item.hidden === true) {
|
||||
shixuntype = true
|
||||
}
|
||||
}
|
||||
if (paths.match(reg)) {
|
||||
if (item.hidden === true) {
|
||||
pathstype = true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const { loading, updata, data } = resource
|
||||
const { shixuns, subjects, images_url, reps } = data
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
{loading ? null :
|
||||
<div className="shixun-home newMain clearfix">
|
||||
<div className="educontent nav-list-container">
|
||||
<div className="carousel-container">
|
||||
<Carousel autoplay={true}>
|
||||
{images_url.map(item => <a key={item.path} href={item.path}>
|
||||
<img src={getUrl(item.image_url)} alt='banner' />
|
||||
</a>)}
|
||||
</Carousel>
|
||||
</div>
|
||||
{user && user.main_site ? <NavList list={reps} /> : null}
|
||||
</div>
|
||||
{updata ? <UpgradeModals updata={updata} /> : null}
|
||||
{pathstype || subjects.length > 0 ?
|
||||
<ListContainer to="/paths" title='实践课程' titleEn='TRAINING COURSE' >
|
||||
<ShixunPathCard pathList={subjects} />
|
||||
</ListContainer >
|
||||
: null}
|
||||
{
|
||||
(shixuntype || shixuns.length > 0) ?
|
||||
<ListContainer to="/shixuns" title='实训项目' titleEn='DEVELOPMENT COMMUNITY' >
|
||||
<ShixunCardList list={shixuns} />
|
||||
</ListContainer >
|
||||
: null
|
||||
}
|
||||
</div>
|
||||
}
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
|
||||
export default SnackbarHOC()(TPMIndexHOC(Home))
|
|
@ -1,57 +0,0 @@
|
|||
.carousel-container {
|
||||
margin: 30px auto 60px auto;
|
||||
|
||||
img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
.slick-slide {
|
||||
background: #364d79;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-list-container {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.black_nav_list li span a {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.black_nav_list li span a:hover {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.black_nav_list li:hover span a {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.black_nav_span {
|
||||
display: block;
|
||||
margin: 0px 20px;
|
||||
border-bottom: 1px solid #4B4B4B;
|
||||
padding-left: 8px;
|
||||
color: #FAFAFA;
|
||||
}
|
||||
|
||||
.user_navlist_white a {
|
||||
color: #989898 !important;
|
||||
}
|
||||
|
||||
.user_navlist_white .navlistpanel-line .little-titles a {
|
||||
color: #000 !important;
|
||||
}
|
||||
|
||||
|
||||
.user_navlist_white {
|
||||
max-height: 350px !important;
|
||||
overflow-y: auto;
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
import React from 'react'
|
||||
import { Link } from "react-router-dom"
|
||||
|
||||
export default ({ children, title, titleEn, to }) => {
|
||||
return (
|
||||
<div className="clearfix pt20 educontent pr pb20 ">
|
||||
<div className="edu-txt-center">
|
||||
<p className="color-dark edu-txt-center font-24" style={{ lineHeight: '30px' }}>{title}</p>
|
||||
<p className="color-grey-cd font-12">{titleEn}</p>
|
||||
</div>
|
||||
<Link to={to} className="moreitem mr18">更多<i className="fa fa-angle-right ml5"></i></Link>
|
||||
<div className="square-list clearfix">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,44 +0,0 @@
|
|||
import React from 'react'
|
||||
import { Link } from 'react-router-dom'
|
||||
import { getImageUrl } from 'educoder'
|
||||
|
||||
export default ({ list }) => {
|
||||
return (
|
||||
<div className="user_navlist">
|
||||
<div className="user_navlist_black">
|
||||
<ul className="black_nav_list">
|
||||
{list.map(item =>
|
||||
<li className="welcome_shixun_index" data-type="rep" key={item.id}>
|
||||
<span className="black_nav_span clearfix font-12">
|
||||
<Link to={"/shixuns?id=" + item.id + "&type=rep"}>
|
||||
{item.name}
|
||||
</Link>
|
||||
<img src={getImageUrl("images/educoder/icon/downarrowsmall-right.svg")} className="fr mt15 transform-90" />
|
||||
</span>
|
||||
<ul className="user_navlist_white" >
|
||||
{
|
||||
item.sub_repertoires.map((i) => {
|
||||
return (
|
||||
<div className="clearfix mt20 mb5 pb10 navlistpanel-line" key={i.id}>
|
||||
<div className="little-title clearfix welcome_shixun_index little-titles" data-type="sub">
|
||||
<Link to={"/shixuns?id=" + i.id + "&type=sub&palce=" + item.id}> {i.name} </Link>
|
||||
</div>
|
||||
{
|
||||
i.tags.map((t, e) => {
|
||||
return (
|
||||
<Link className="welcome_shixun_index" to={"/shixuns?id=" + t.id + "&type=tag&palce=" + item.id} data-type="tag" key={t.id}>{t.name}</Link>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
|
@ -1,610 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
|
||||
import { Redirect } from 'react-router';
|
||||
|
||||
import { BrowserRouter as Router, Route, Link, Switch } from "react-router-dom";
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
||||
|
||||
import SiderBar from '../tpm/SiderBar';
|
||||
|
||||
import UpgradeModals from '../modals/UpgradeModals';
|
||||
|
||||
import { SnackbarHOC , getImageUrl, getcdnImageUrl,configShareForIndex} from 'educoder';
|
||||
|
||||
import { Slider ,Rating} from "@icedesign/base";
|
||||
|
||||
import './home.css';
|
||||
|
||||
import {Tooltip,Spin} from 'antd';
|
||||
|
||||
const $ = window.$;
|
||||
|
||||
class ShixunsHome extends Component {
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
homedatalist:undefined,
|
||||
hometypepvisible:true
|
||||
}
|
||||
}
|
||||
componentDidMount(){
|
||||
configShareForIndex()
|
||||
const upsystem=`/users/system_update.json`;
|
||||
axios.get(upsystem).then((response)=>{
|
||||
if(response.data){
|
||||
let updata=response.data;
|
||||
this.setState({
|
||||
updata:updata
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
console.log(error);
|
||||
})
|
||||
let url=`/home/index.json`;
|
||||
axios.get(url).then((response)=> {
|
||||
if(response.status===200){
|
||||
this.setState({
|
||||
homedatalist:response.data,
|
||||
hometypepvisible:false
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
// console.log(error)
|
||||
});
|
||||
}
|
||||
|
||||
bannaronmousemove=()=>{
|
||||
$("#bannerrightimg").show();
|
||||
$("#bannerleftimg").show();
|
||||
}
|
||||
|
||||
bannaronmouseout=()=>{
|
||||
$("#bannerrightimg").hide();
|
||||
$("#bannerleftimg").hide();
|
||||
}
|
||||
render() {
|
||||
|
||||
let {homedatalist,hometypepvisible} = this.state;
|
||||
|
||||
const arrowStylel = {
|
||||
left: "-76px",
|
||||
width: "76px",
|
||||
textAlign: "left",
|
||||
height: "100%",
|
||||
cursor: "pointer"
|
||||
};
|
||||
|
||||
const arrowStyler = {
|
||||
right: "-120px",
|
||||
width: "76px",
|
||||
textAlign: "left",
|
||||
height: "100%",
|
||||
cursor: "pointer"
|
||||
};
|
||||
const noneStyler={
|
||||
display: "none"
|
||||
}
|
||||
const CustomNextArrow = props => {
|
||||
return (
|
||||
<div {...props} id="bannerright" style={arrowStyler}>
|
||||
<img id="bannerrightimg" style={noneStyler} src={"/images/educoder/banner-right.png"} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const CustomPrevArrow = props => {
|
||||
return (
|
||||
<div {...props} id="bannerleft" style={arrowStylel}>
|
||||
<img id="bannerleftimg" style={noneStyler} src={"/images/educoder/banner-left.png"} />
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
let homedatalistreps;
|
||||
|
||||
if(homedatalist!=undefined){
|
||||
homedatalistreps=[];
|
||||
homedatalist.reps.map((item,key)=>{
|
||||
homedatalistreps.push(item)
|
||||
})
|
||||
|
||||
}
|
||||
const MyRate = ({ defaultValue, ...rest }) => {
|
||||
let myValue = defaultValue;
|
||||
return <Rating {...rest} value={myValue} />;
|
||||
};
|
||||
|
||||
let shixuntype=false;
|
||||
let pathstype=false;
|
||||
if(this.props&&this.props.mygetHelmetapi!=null){
|
||||
let shixun="/shixuns";
|
||||
let paths="/paths";
|
||||
this.props.mygetHelmetapi.navbar.map((item,key)=>{
|
||||
var reg = RegExp(item.link);
|
||||
if(shixun.match(reg)){
|
||||
if(item.hidden===true){
|
||||
shixuntype=true
|
||||
}
|
||||
}
|
||||
if(paths.match(reg)){
|
||||
if(item.hidden===true){
|
||||
pathstype=true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix backFAFAFA shixunsHome">
|
||||
{this.state.updata===undefined?"":<UpgradeModals
|
||||
{...this.state}
|
||||
/>}
|
||||
<Spin spinning={hometypepvisible} size="large" style={{marginTop:'15%'}}>
|
||||
{/*懒加载*/}
|
||||
|
||||
{/*<SiderBar/>*/}
|
||||
<div className="clearfix">
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.shixunsHome .educontent {
|
||||
width: 1250px;
|
||||
}
|
||||
.banners{
|
||||
overflow: hidden;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<div className="clearfix edu-back-white pb40 pt30 mb20 banners" id="index-top" onMouseMove={this.bannaronmousemove} onMouseOut={this.bannaronmouseout}>
|
||||
<div className="educontent pr educontentSlider" style={{"width":'1200px'}}>
|
||||
{homedatalist===undefined?"":
|
||||
<Slider
|
||||
nextArrow={<CustomNextArrow />}
|
||||
prevArrow={<CustomPrevArrow />}
|
||||
autoplay
|
||||
autoplaySpeed={5000}
|
||||
animation={false}
|
||||
pauseOnHover={true}
|
||||
style={{width:"100%"}}
|
||||
arrowPos="outer">
|
||||
{homedatalist.images_url.map((item, index) => (
|
||||
<div key={index} className="slider-img-wrapper">
|
||||
<a href={item.path}>
|
||||
<img src={getcdnImageUrl(item.image_url)} />
|
||||
</a>
|
||||
</div>
|
||||
))}
|
||||
</Slider>
|
||||
}
|
||||
{this.props.user&&this.props.user.main_site===true?<div className="user_navlist">
|
||||
<div className="user_navlist_black">
|
||||
<ul className="black_nav_list">
|
||||
{homedatalist === undefined ? "" :homedatalistreps.map((item,key)=>{
|
||||
return(
|
||||
<li className="welcome_shixun_index" data-id="1" data-type="rep" key={key}>
|
||||
<span className="black_nav_span clearfix font-12">
|
||||
<Link to={"/shixuns?id="+item.id+"&type=rep"}>
|
||||
{item.name}
|
||||
</Link>
|
||||
<img
|
||||
src={getcdnImageUrl("images/educoder/icon/downarrowsmall-right.svg")}
|
||||
className="fr mt15 transform-90"/>
|
||||
</span>
|
||||
<ul className="user_navlist_white" >
|
||||
{
|
||||
item.sub_repertoires.map((i,k)=>{
|
||||
return(
|
||||
<div className="clearfix mt20 mb5 pb10 navlistpanel-line" key={k}>
|
||||
<div className="little-title clearfix welcome_shixun_index little-titles"
|
||||
data-id="1" data-rep-id="1" data-type="sub"
|
||||
>
|
||||
<Link to={"/shixuns?id="+i.id+"&type=sub&palce="+item.id}>
|
||||
{i.name}
|
||||
</Link>
|
||||
</div>
|
||||
{
|
||||
i.tags.map((t,e)=>{
|
||||
return(
|
||||
<Link className="welcome_shixun_index"
|
||||
data-id="1" data-rep-id="1" data-sub-id="1"
|
||||
to={"/shixuns?id="+t.id+"&type=tag&palce="+item.id}
|
||||
data-type="tag" key={e}>{t.name}</Link>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
)
|
||||
})
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
)
|
||||
})
|
||||
|
||||
}
|
||||
</ul>
|
||||
</div>
|
||||
</div>:""}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
{/*实训路径*/}
|
||||
{pathstype===true||homedatalist===undefined?"":homedatalist.subjects.length===0?"":<div className="clearfix pt20 educontent pr pb20">
|
||||
<div className="edu-txt-center">
|
||||
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实践课程</p>
|
||||
<p className="color-grey-cd font-12">TRAINING COURSE</p>
|
||||
</div>
|
||||
<Link to={"/paths"} className="moreitem mr18">更多<i className="fa fa-angle-right ml5"></i></Link>
|
||||
|
||||
<div className="square-list clearfix" style={{'width':'100%','padding-left':'25px'}}>
|
||||
|
||||
|
||||
{homedatalist===undefined?"":homedatalist.subjects.map((item,key)=>{
|
||||
if(key<8)
|
||||
return(
|
||||
<div className="square-Item" key={key} id={item.id} style={{'width':'286px','margin-right': '20px'}}>
|
||||
|
||||
{item.excellent === false ? "" :
|
||||
<div className="tag-orange">
|
||||
<span className="tag-name">开放课程</span>
|
||||
</div>}
|
||||
|
||||
<div className="tag-green">
|
||||
<span className="tag-name"> {item.tag_name}</span>
|
||||
{/*<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>*/}
|
||||
</div>
|
||||
|
||||
<div className={item.power === false ? "closeSquare" : "none"}>
|
||||
<img src={getcdnImageUrl("images/educoder/icon/lockclose.svg")}
|
||||
className="mt80 mb25"/>
|
||||
<p className="font-14 color-white">非试用内容,需要授权</p>
|
||||
</div>
|
||||
|
||||
<Link to={"/paths/" + item.id}
|
||||
target="_blank"
|
||||
className="square-img">
|
||||
<img src={getcdnImageUrl(item.image_url)}/>
|
||||
</Link>
|
||||
|
||||
<div className="square-main">
|
||||
<p className="task-hide">
|
||||
<Link to={"/paths/" + item.id}
|
||||
target="_blank"
|
||||
title={item.name}
|
||||
className="justify color-grey-name">
|
||||
{item.name}
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<p className="clearfix mt8 font-12 color-grey-B4">
|
||||
<Tooltip placement="bottom" title={"章节"}>
|
||||
<span className="mr10 fl squareIconSpan">
|
||||
<i className="iconfont icon-zhangjie1 fl mr3 iconfontzhangjie"></i>{item.stages_count}
|
||||
</span>
|
||||
</Tooltip>
|
||||
|
||||
{/*<Tooltip placement="bottom" title={"实训"}>*/}
|
||||
{/*<span className="mr10 fl squareIconSpan">*/}
|
||||
{/*<i className="iconfont icon-daima fl mr3 iconfontshixundaibeijing"></i>{item.shixuns_count}*/}
|
||||
{/*</span>*/}
|
||||
{/*</Tooltip>*/}
|
||||
|
||||
<Tooltip placement="bottom" title={"学习人数"}>
|
||||
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":"block"}}>
|
||||
<i className="iconfont icon-chengyuan fl mr3" ></i>{item.members_count}
|
||||
</span>
|
||||
</Tooltip>
|
||||
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
|
||||
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>}
|
||||
|
||||
{/*精选实训 改为 开发社区*/}
|
||||
{shixuntype===true||homedatalist===undefined?"":homedatalist.shixuns.length===0?"":<div className="clearfix pt20 educontent pr pb20 mb20">
|
||||
<div className="edu-txt-center">
|
||||
<p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>实训项目</p>
|
||||
<p className="color-grey-cd font-12">DEVELOPMENT COMMUNITY</p>
|
||||
</div>
|
||||
<Link to={"/shixuns"} className="moreitem mr18">更多<i className="fa fa-angle-right ml5"></i></Link>
|
||||
|
||||
<div className="square-list clearfix" style={{'width':'100%','padding-left':'25px'}}>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.taglistleft{
|
||||
position: absolute;
|
||||
left: 10px;
|
||||
bottom: 118px;
|
||||
}
|
||||
|
||||
.square-Item:nth-child(4n+0) {
|
||||
margin-right: 25px;
|
||||
}
|
||||
.tag-org{
|
||||
position: absolute;
|
||||
left: 0px;
|
||||
top: 20px;
|
||||
}
|
||||
.tag-org-name{
|
||||
width:66px;
|
||||
height:28px;
|
||||
background:#FF6802;
|
||||
width:66px;
|
||||
height:28px;
|
||||
border-radius:0px 20px 20px 0px;
|
||||
}
|
||||
.tag-org-name-test{
|
||||
width:45px;
|
||||
height:23px;
|
||||
font-size:14px;
|
||||
color:#FFFFFF;
|
||||
line-height:19px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
.intermediatecenter{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
{homedatalist===undefined?"":homedatalist.shixuns.map((item,key)=>{
|
||||
return(
|
||||
<div className="square-Item" key={key} id={item.id} style={{'width':'286px','margin-right': '20px'}}>
|
||||
|
||||
<div className="tag-green taglistleft">
|
||||
<span className="tag-name"> {item.tag_name}</span>
|
||||
{/*<img style={{display:item.tag_name===null?"none":'block'}} src={require(`./tag2.png`)}/>*/}
|
||||
</div>
|
||||
{
|
||||
item.is_jupyter===true?
|
||||
<div className="tag-org">
|
||||
<p className="tag-org-name intermediatecenter"> <span className="tag-org-name-test">Jupyter</span></p>
|
||||
{/*<img style={{display:'block',height: '28px'}} src={require(`./shixunCss/tag2.png`)}/>*/}
|
||||
</div>
|
||||
:""}
|
||||
<div className={item.power === false ? "closeSquare" : "none"}>
|
||||
<img src={getcdnImageUrl("images/educoder/icon/lockclose.svg")}
|
||||
className="mt80 mb25"/>
|
||||
<p className="font-14 color-white">非试用内容,需要授权</p>
|
||||
</div>
|
||||
|
||||
<Link to={"/shixuns/"+item.identifier+"/challenges"}
|
||||
target="_blank"
|
||||
className="square-img">
|
||||
<img src={getcdnImageUrl(item.pic)}/>
|
||||
</Link>
|
||||
|
||||
<div className="square-main">
|
||||
<p className="task-hide">
|
||||
<Link to={"/shixuns/"+item.identifier+"/challenges"}
|
||||
target="_blank"
|
||||
title={item.name}
|
||||
className="justify color-grey-name">
|
||||
{item.name}
|
||||
</Link>
|
||||
</p>
|
||||
|
||||
<p className="clearfix mt8 ml-3">
|
||||
<span className="rateYoStar fl" style={{padding: '0px',height: '20px',lineHeight: '19px',cursor: 'default'}} title="">
|
||||
<MyRate key={key} allowHalf defaultValue={item.score_info===null?5:item.score_info} disabled/>
|
||||
</span>
|
||||
<span className="fl ml25 font-12 color-grey-9 lineh-12 mt4">{item.score_info===null?"5分":item.score_info+"分"}</span>
|
||||
</p>
|
||||
|
||||
<p className="clearfix mt8 font-12 color-grey-B4">
|
||||
|
||||
<Tooltip placement="bottom" title={"关卡"}>
|
||||
<span className="mr10 fl squareIconSpan">
|
||||
<i className="iconfont icon-shixunguanqia fl mr3" ></i>{item.challenges_count}
|
||||
</span>
|
||||
</Tooltip>
|
||||
|
||||
{/*<Tooltip placement="bottom" title={"经验值"}>*/}
|
||||
{/*<span className="mr10 fl squareIconSpan">*/}
|
||||
{/*<i className="iconfont icon-jingyan fl mr3"></i>{item.exp}*/}
|
||||
{/*</span>*/}
|
||||
{/*</Tooltip>*/}
|
||||
|
||||
<Tooltip placement="bottom" title={"学习人数"}>
|
||||
<span className="mr10 fl squareIconSpan" style={{display:item.stu_num===0?"none":"block"}}>
|
||||
<i className="iconfont icon-chengyuan fl mr3"></i>{item.stu_num}
|
||||
</span>
|
||||
</Tooltip>
|
||||
|
||||
<span className="fr color-grey-B3 squareIconSpan">{item.level}</span>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
</div>}
|
||||
|
||||
|
||||
|
||||
{/*导师排行榜*/}
|
||||
{/* { homedatalist !== undefined && homedatalist.teachers !== undefined && (*/}
|
||||
{/* this.props.user&&this.props.user.main_site===true?<div className="pt60 pb60 mb30 mentor-ranking">*/}
|
||||
{/* <div className="educontent">*/}
|
||||
{/* <div className="edu-txt-center">*/}
|
||||
{/* <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>导师排行榜</p>*/}
|
||||
{/* <p className="color-grey-cd font-12">MENTOR RANKING</p>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
{/* <div className="ranking clearfix">*/}
|
||||
{/* <ul className="grade color-dark">*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.teachers.map((item,key)=>{*/}
|
||||
|
||||
{/* if(key===1){*/}
|
||||
{/* return(*/}
|
||||
{/* <li className="mt35 pr" key={key}>*/}
|
||||
{/* <img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url} />*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.teachers.map((item,key)=>{*/}
|
||||
{/* if(key===0){*/}
|
||||
{/* return(*/}
|
||||
{/* <li className="pr" key={key}>*/}
|
||||
{/* <img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url} />*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.teachers.map((item,key)=>{*/}
|
||||
{/* if(key===2){*/}
|
||||
{/* return(*/}
|
||||
{/* <li className="mt35 pr" key={key}>*/}
|
||||
{/* <img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url} />*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
{/* </ul>*/}
|
||||
{/* <br />*/}
|
||||
{/* <ul className="grade mt30">*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.teachers.map((item,key)=>{*/}
|
||||
{/* if(key>2) {*/}
|
||||
{/* return (*/}
|
||||
{/* <li key={key}>*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url}/>*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
|
||||
|
||||
{/* </ul>*/}
|
||||
{/* </div>*/}
|
||||
|
||||
|
||||
{/* </div>*/}
|
||||
{/* </div>:""*/}
|
||||
{/* )}*/}
|
||||
|
||||
{/*程序员排行榜*/}
|
||||
{/*{ homedatalist !== undefined && homedatalist.students !== undefined && (*/}
|
||||
{/* this.props.user&&this.props.user.main_site===true?<div className="pt60 pb60 mb30 pro-ranking">*/}
|
||||
{/* <div className="educontent">*/}
|
||||
{/* <div className="edu-txt-center">*/}
|
||||
{/* <p className="color-dark edu-txt-center font-24" style={{lineHeight: '30px'}}>程序员排行榜</p>*/}
|
||||
{/* <p className="color-grey-cd font-12">PROGRAMMER RANKING</p>*/}
|
||||
{/* </div>*/}
|
||||
{/* <div className="ranking clearfix">*/}
|
||||
{/* <ul className="grade color-dark">*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.students.map((item,key)=>{*/}
|
||||
{/* if(key===1){*/}
|
||||
{/* return(*/}
|
||||
{/* <li className="mt35 pr" key={key}>*/}
|
||||
{/* <img src={getImageUrl("images/educoder/huangguan-two.png")} className="huangguan" />*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url} />*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.students.map((item,key)=>{*/}
|
||||
{/* if(key===0){*/}
|
||||
{/* return(*/}
|
||||
{/* <li className="pr" key={key}>*/}
|
||||
{/* <img src={getImageUrl("images/educoder/huangguan.png")} className="huangguan" />*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url} />*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.students.map((item,key)=>{*/}
|
||||
{/* if(key===2){*/}
|
||||
{/* return(*/}
|
||||
{/* <li className="mt35 pr" key={key}>*/}
|
||||
{/* <img src={getImageUrl("images/educoder/huangguan-three.png")} className="huangguan" />*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url} />*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
{/* </ul>*/}
|
||||
{/* <br />*/}
|
||||
{/* <ul className="grade mt30">*/}
|
||||
{/* {*/}
|
||||
{/* homedatalist===undefined?"":homedatalist.students.map((item,key)=>{*/}
|
||||
{/* if(key>2) {*/}
|
||||
{/* return (*/}
|
||||
{/* <li key={key}>*/}
|
||||
{/* <a href={"/users/"+item.login} className="color-dark">*/}
|
||||
{/* <img src={'/images/'+item.image_url}/>*/}
|
||||
{/* <p className="task-hide rankName mt5">{item.username}</p>*/}
|
||||
{/* </a>*/}
|
||||
{/* </li>*/}
|
||||
{/* )*/}
|
||||
{/* }*/}
|
||||
{/* })}*/}
|
||||
|
||||
|
||||
{/* </ul>*/}
|
||||
{/* </div>*/}
|
||||
{/* </div>*/}
|
||||
{/*</div>:""*/}
|
||||
{/*)}*/}
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default SnackbarHOC() (TPMIndexHOC ( ShixunsHome ));
|
Binary file not shown.
Before Width: | Height: | Size: 1.1 KiB |
|
@ -1,156 +0,0 @@
|
|||
.registrationback{
|
||||
height: 368px;
|
||||
width: 1200px;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.textright{
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.textcenter{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.Osshackathonfont{
|
||||
width: 80px;
|
||||
height: 28px;
|
||||
font-size: 20px;
|
||||
font-weight:600;
|
||||
color: rgba(5,16,26,1);
|
||||
line-height: 28px;
|
||||
}
|
||||
|
||||
.Osshackathonfontlist{
|
||||
width:1188px;
|
||||
font-size:14px;
|
||||
font-weight:400;
|
||||
color:rgba(102,102,102,1);
|
||||
line-height:24px;
|
||||
}
|
||||
.OsshackathonCard{
|
||||
width:1200px;
|
||||
min-height:150px;
|
||||
background:rgba(248,248,248,1);
|
||||
border:1px solid rgba(235,235,235,1);
|
||||
}
|
||||
|
||||
.OsshackathonCardtitle{
|
||||
font-size:24px;
|
||||
font-weight:400;
|
||||
color:rgba(5,16,26,1);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.ant-input::-webkit-input-placeholder{
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.ant-input:-moz-placeholder {
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.ant-input::-moz-placeholder{
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.ant-input:-ms-input-placeholder{
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.Searchant-btn-primary .ant-btn-primary{
|
||||
background: #4CACFF;
|
||||
border-color: #4CACFF;
|
||||
}
|
||||
|
||||
.Searchant-btn-primary .ant-input-group .ant-input{
|
||||
height:42px;
|
||||
}
|
||||
|
||||
.Breadcrumbfont{
|
||||
color:#4CACFF !important;
|
||||
}
|
||||
|
||||
.ant-breadcrumb-separator{
|
||||
color:#BCBCBC;
|
||||
}
|
||||
|
||||
.minheight50px{
|
||||
min-height: 50px;
|
||||
}
|
||||
|
||||
.borderDEDEDE{
|
||||
border-left:1px solid #DEDEDE;
|
||||
}
|
||||
|
||||
.pl80pt6{
|
||||
padding-top: 6px;
|
||||
padding-left: 80px;
|
||||
}
|
||||
|
||||
.OsshackprimaryButton{
|
||||
width: 100%;
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.OsshackprimaryButtonsyle{
|
||||
background: rgba(255,255,255,1) !important;
|
||||
border: 1px solid rgba(76,172,255,1);
|
||||
color: rgba(76,172,255,1);
|
||||
line-height: 16px;
|
||||
border-radius: unset;
|
||||
box-shadow:none;
|
||||
}
|
||||
|
||||
.h45input input{
|
||||
height:45px;
|
||||
}
|
||||
|
||||
.width14bai{
|
||||
width: 14%;
|
||||
}
|
||||
|
||||
.Osshackprimaryfonttop{
|
||||
font-size: 20px;
|
||||
color: rgba(5,16,26,1);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.Osshackathonmodelinput{
|
||||
width: 97% !important;
|
||||
margin-left: 7px;
|
||||
}
|
||||
.Osshackathonmodelinput .ant-input::-webkit-input-placeholder{
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.Osshackathonmodelinput .ant-input::-moz-placeholder{color: #cccccc;font-size:14px;}
|
||||
.Osshackathonmodelinput .ant-input::-webkit-input-placeholder{color: #cccccc;font-size:14px;}
|
||||
.Osshackathonmodelinput .ant-input:-ms-input-placeholder{color: #cccccc;font-size:14px;}
|
||||
.Osshackathonmodelinput .ant-input-group-addon {
|
||||
color: #adadad !important;
|
||||
}
|
||||
|
||||
.iscursor{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.issignup:hover, .issignup:focus {
|
||||
color: #fff !important;
|
||||
background-color: #40a9ff;
|
||||
border-color: #40a9ff;
|
||||
}
|
||||
|
||||
.Osshackathon-btn-primary .ant-btn-primary:hover, .Osshackathon-btn-primary .ant-btn-primary:focus {
|
||||
color: #fff !important;
|
||||
background-color: #40a9ff;
|
||||
border-color: #40a9ff;
|
||||
}
|
|
@ -1,451 +0,0 @@
|
|||
import React, {Component} from 'react';
|
||||
import axios from 'axios';
|
||||
import {SnackbarHOC, WordsBtn,getImageUrl,markdownToHTML} from 'educoder';
|
||||
import {Row, Col,Input,Divider,Card,Button,Pagination,Breadcrumb,Icon,Spin} from 'antd';
|
||||
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
||||
import { CNotificationHOC } from '../courses/common/CNotificationHOC';
|
||||
import Osshackathonmd from './Osshackathonmd';
|
||||
import './Osshackathon.css';
|
||||
import Osshackathonmodel from "./Osshackathonmodel";
|
||||
const { Search } = Input;
|
||||
class Osshackathon extends Component {
|
||||
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state = {
|
||||
page:1,
|
||||
limit:10,
|
||||
search:undefined,
|
||||
data:undefined,
|
||||
hackathonedit:false,
|
||||
Osshackathonmodeltype:false,
|
||||
spinning:false,
|
||||
opentitletype:true,
|
||||
boxoffsetHeigh:0
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
this.getosshackathonlist();
|
||||
window.document.title = '竞赛报名';
|
||||
}
|
||||
|
||||
getosshackathon=(page,limit,search)=>{
|
||||
this.setState({
|
||||
spinning:true
|
||||
})
|
||||
let url=`/osshackathon.json`;
|
||||
axios.get(url,{params:{
|
||||
page:page,
|
||||
limit:limit,
|
||||
search:search,
|
||||
}}).then((result)=>{
|
||||
if(result.status==200){
|
||||
this.setState({
|
||||
data:result.data,
|
||||
spinning:false
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
spinning:false
|
||||
})
|
||||
}
|
||||
}).catch((error)=>{
|
||||
this.setState({
|
||||
spinning:true
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
getosshackathonlist=()=>{
|
||||
let {page,limit,search}=this.state;
|
||||
this.setState({
|
||||
page:1,
|
||||
search:undefined
|
||||
})
|
||||
this.getosshackathon(1,limit,undefined)
|
||||
}
|
||||
|
||||
|
||||
componentDidUpdate = (prevProps,prevState) => {
|
||||
if(prevState.data!=this.state.data){
|
||||
//防止陷入无限循环
|
||||
let box=document.getElementById("Osshackathonfontlists");
|
||||
if(box){
|
||||
this.setState({
|
||||
boxoffsetHeigh:box.offsetHeight
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PaginationTask=(pageNumber)=>{
|
||||
let {hackathonedit}=this.state;
|
||||
if(hackathonedit===true){
|
||||
this.props.showNotification(`请先保存或者关闭编辑状态`);
|
||||
}else {
|
||||
this.setState({
|
||||
page: pageNumber
|
||||
})
|
||||
let {page, limit, search} = this.state;
|
||||
this.getosshackathon(pageNumber, limit, search)
|
||||
}
|
||||
}
|
||||
|
||||
hackathonedit=(id)=>{
|
||||
//管理员编辑title
|
||||
this.setState({
|
||||
hackathonedit:true
|
||||
})
|
||||
}
|
||||
|
||||
hidehackathonedit=()=>{
|
||||
this.setState({
|
||||
hackathonedit:false
|
||||
})
|
||||
}
|
||||
|
||||
Signupentry=(id)=>{
|
||||
// 用户报名
|
||||
if(this.props.checkIfLogin()===false){
|
||||
this.props.showLoginDialog()
|
||||
return
|
||||
}
|
||||
if(this.props.checkIfProfileCompleted()===false){
|
||||
this.props.showProfileCompleteDialog()
|
||||
return
|
||||
}
|
||||
//判断是否绑定邮箱
|
||||
|
||||
if(this.props.user.email===null&&this.props.user.phone===null){
|
||||
this.props.showhideAccountPhoneemailDialog()
|
||||
return
|
||||
}
|
||||
|
||||
this.props.confirm({
|
||||
content: `是否确认报名?`,
|
||||
onOk: () => {
|
||||
this.Signupentrys(id)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
Signupentrys=(id)=>{
|
||||
let url=`/osshackathon/${id}/entry.json`;
|
||||
axios.post(url
|
||||
).then((response) => {
|
||||
if(response.data.status===0){
|
||||
this.getosshackathonlist()
|
||||
this.props.showNotification(`报名成功,预祝您夺得桂冠`);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
editSignupentry=(id,name,description)=>{
|
||||
let {hackathonedit}=this.state;
|
||||
if(hackathonedit===true){
|
||||
this.props.showNotification(`请先保存或者关闭编辑状态`);
|
||||
}else{
|
||||
// 管理员编辑项目
|
||||
this.setState({
|
||||
Osshackathonmodeltype:true
|
||||
})
|
||||
if(id===undefined){
|
||||
this.setState({
|
||||
modelid:undefined,
|
||||
modelname:undefined,
|
||||
modeldescription:undefined
|
||||
})
|
||||
}else{
|
||||
this.setState({
|
||||
modelid:id,
|
||||
modelname:name,
|
||||
modeldescription:description
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
hideeditSignupentry=(id)=>{
|
||||
// 管理员取消项目
|
||||
this.setState({
|
||||
Osshackathonmodeltype:false
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
delSignupentry=(id)=>{
|
||||
// 管理员删除项目
|
||||
let {hackathonedit}=this.state;
|
||||
if(hackathonedit===true){
|
||||
this.props.showNotification(`请先保存或者关闭编辑状态`);
|
||||
}else {
|
||||
this.props.confirm({
|
||||
content: `是否确认删除该项目?`,
|
||||
onOk: () => {
|
||||
this.delSignupentrys(id)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
delSignupentrys=(id)=>{
|
||||
let url=`/osshackathon/${id}.json`;
|
||||
axios.delete(url)
|
||||
.then((response) => {
|
||||
if (response.data.status == 0) {
|
||||
// {"status":1,"message":"删除成功"}
|
||||
this.getosshackathonlist();
|
||||
this.props.showNotification(`删除成功`);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
onsearchvalue=(value)=>{
|
||||
let {hackathonedit}=this.state;
|
||||
if(hackathonedit===true){
|
||||
this.props.showNotification(`请先保存或者关闭编辑状态`);
|
||||
}else {
|
||||
this.setState({
|
||||
search:value
|
||||
})
|
||||
if(value.length>300){
|
||||
this.props.showNotification(`搜索字数大于300个字`);
|
||||
}
|
||||
let {page,limit,search}=this.state;
|
||||
this.getosshackathon(page,limit,value)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
onsetsearchvalue=(e)=>{
|
||||
|
||||
this.setState({
|
||||
search:e.target.value
|
||||
})
|
||||
}
|
||||
|
||||
opentitle=()=>{
|
||||
this.setState({
|
||||
opentitletype:false
|
||||
})
|
||||
}
|
||||
render() {
|
||||
let {page,data,hackathonedit,opentitletype}=this.state;
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix newMainybot">
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.ant-btn-primary{
|
||||
background: #4CACFF;
|
||||
border-color: #4CACFF;
|
||||
}
|
||||
.ant-btn-primary:hover, .ant-btn-primary:focus {
|
||||
color: #4CACFF;
|
||||
background-color: #40a9ff;
|
||||
border-color: #40a9ff;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
|
||||
<div className={"educontent mb60 persmstyle"} style={{width: "1200px", marginTop: "26px"}}>
|
||||
|
||||
<div className="registrationback"
|
||||
style={{"background": `url(${getImageUrl(`images/educoder/competitions/heikesong.jpg`)})`,"height":"360px"}}
|
||||
></div>
|
||||
<Spin spinning={this.state.spinning}>
|
||||
{this.props.user&&this.props.user.admin===true?<Row className={"mt20"}>
|
||||
|
||||
<Col span={6}>
|
||||
<Search
|
||||
className={"Osshackathon-btn-primary"}
|
||||
placeholder="请输入项目名称进行搜索"
|
||||
enterButton="搜索"
|
||||
size="large"
|
||||
value={this.state.search}
|
||||
onInput={(e)=>this.onsetsearchvalue(e)}
|
||||
onSearch={value => this.onsearchvalue(value)}
|
||||
/>
|
||||
</Col>
|
||||
|
||||
<Col span={3} className={"fr textright"}>
|
||||
<div>
|
||||
报名总数:<span className={"color-red"}>{data&&data.hackathon.hackathon_users_count}</span> 个
|
||||
</div>
|
||||
</Col>
|
||||
|
||||
</Row>:""}
|
||||
|
||||
{hackathonedit===true?"":<Row className={"mt20"}>
|
||||
<Col span={6} className={"Osshackathonfont"}>
|
||||
{data&&data.hackathon.name}
|
||||
</Col>
|
||||
{this.props.user&&this.props.user.admin===true?<Col span={3} className={"fr textright"}>
|
||||
<Button type="primary" className={"OsshackprimaryButtonsyle"} onClick={()=>this.hackathonedit(data&&data.hackathon.id)}>编辑</Button>
|
||||
</Col>:""}
|
||||
</Row>}
|
||||
{hackathonedit===true?"": <style>
|
||||
{
|
||||
`
|
||||
.ant-divider-horizontal{
|
||||
margin: 19px 0;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>}
|
||||
|
||||
{hackathonedit===true?"":<Divider />}
|
||||
|
||||
{opentitletype===true?<style>
|
||||
{
|
||||
`
|
||||
.Osshackathonfontlist{
|
||||
max-height: 180px;
|
||||
overflow: hidden;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>:""}
|
||||
{hackathonedit===true?"":<p className={"Osshackathonfontlist mb30"} id={"Osshackathonfontlists"}>
|
||||
{data&&data.hackathon.description===null?"":<div className={"markdown-body"}
|
||||
dangerouslySetInnerHTML={{__html: markdownToHTML(data&&data.hackathon.description).replace(/▁/g, "▁▁▁")}}></div>}
|
||||
</p>}
|
||||
|
||||
{opentitletype===true&&this.state.boxoffsetHeigh===180?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont"}>展开阅读全文<Icon type="down" /></Divider>:""}
|
||||
|
||||
{hackathonedit===true?<Osshackathonmd
|
||||
getosshackathon={()=>this.getosshackathonlist()}
|
||||
hidehackathonedit={()=>this.hidehackathonedit()}
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/>:""}
|
||||
{this.state.Osshackathonmodeltype===true?<Osshackathonmodel
|
||||
getosshackathon={()=>this.getosshackathonlist()}
|
||||
hideeditSignupentry={()=>this.hideeditSignupentry()}
|
||||
{...this.props}
|
||||
{...this.state}
|
||||
/>:""}
|
||||
{this.props.user&&this.props.user.admin===true?<Row className={"mb20 mt30"}>
|
||||
<Col span={8}></Col>
|
||||
<Col span={8}><Button type="primary" className={"OsshackprimaryButton OsshackprimaryButtonsyle"} onClick={()=>this.editSignupentry()}><Icon type="plus" />新建项目</Button></Col>
|
||||
<Col span={8}></Col>
|
||||
</Row>:""}
|
||||
{/*学生身份*/}
|
||||
{
|
||||
this.props.user&&this.props.user.admin===false?data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{
|
||||
return(
|
||||
<Card className={"OsshackathonCard mb20"} key={key}>
|
||||
<Row>
|
||||
<Col span={20} className={"OsshackathonCardtitle"}>
|
||||
{item.name}
|
||||
</Col>
|
||||
|
||||
<Col span={6} className={"fr textright"}>
|
||||
<span style={{"line-height":"30px","margin-right": "30px"}}>报名人数:{item.hack_users_count}</span>
|
||||
{item.entry_info===true?<Button type="primary fr mr20" disabled>
|
||||
已报名
|
||||
</Button>:<Button type="primary fr issignup" onClick={()=>this.Signupentry(item.id)}>立即报名</Button>}
|
||||
</Col>
|
||||
</Row>
|
||||
<p className={"mt20"}>{item.description}</p>
|
||||
</Card>
|
||||
)
|
||||
}):""
|
||||
}
|
||||
|
||||
|
||||
|
||||
{/*教师身份*/}
|
||||
{this.props.user&&this.props.user.admin===true?<style>
|
||||
{
|
||||
`
|
||||
.ant-col-pull-6 {
|
||||
right: 17%;
|
||||
}
|
||||
.ant-col-18 {
|
||||
width: 82%;
|
||||
}
|
||||
.CompetitionsIndexbottomvalue{
|
||||
text-align: center;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>:""}
|
||||
{
|
||||
this.props.user&&this.props.user.admin===true?data&&data.hacks.length==0?"":data&&data.hacks.map((item,key)=>{
|
||||
return(
|
||||
<Card className={"OsshackathonCard mb20"}>
|
||||
<Row>
|
||||
<Col span={20} className={"OsshackathonCardtitle"}>
|
||||
{item.name}
|
||||
</Col>
|
||||
<Col span={4} className={"fr textcenter width14bai"}>
|
||||
<Breadcrumb separator="|">
|
||||
<Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={()=>this.editSignupentry(item.id,item.name,item.description)}>编辑</Breadcrumb.Item>
|
||||
<Breadcrumb.Item className={"Breadcrumbfont iscursor"} onClick={()=>this.delSignupentry(item.id)}>删除</Breadcrumb.Item>
|
||||
</Breadcrumb>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row className={"mt20"}>
|
||||
<Col span={4} push={20} className={"minheight50px borderDEDEDE"}>
|
||||
<div className={"pl80pt6"}>
|
||||
<Row gutter={16}>
|
||||
<Col className="gutter-row" span={15}>
|
||||
<div className="gutter-box Osshackprimaryfonttop">{item.hack_users_count}</div>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col className="gutter-row" span={15}>
|
||||
<div className="gutter-box CompetitionsIndexbottomvalue">报名数</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
</Col>
|
||||
<Col span={18} pull={6} className={"minheight50px ml5"}>
|
||||
{item.description}
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
</Card>
|
||||
)}):""
|
||||
}
|
||||
|
||||
|
||||
{data&&data.hacks_count>10?data&&data.hacks.length===0?"":<div className="mb40 edu-txt-center padding20-30" >
|
||||
<Pagination
|
||||
showQuickJumper
|
||||
defaultCurrent={1}
|
||||
pageSize={10}
|
||||
total={data&&data.hacks_count}
|
||||
current={page}
|
||||
onChange={this.PaginationTask}
|
||||
/>
|
||||
</div>:""}
|
||||
</Spin>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
export default CNotificationHOC() (TPMIndexHOC (Osshackathon)) ;
|
|
@ -1,112 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import {Button, Card, Row, Col ,Upload,Icon,message,Tabs,Form,Input} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {getImageUrl,getUrl} from 'educoder';
|
||||
import TPMMDEditor from '../tpm/challengesnew/TPMMDEditor';
|
||||
class Osshackathonmd extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.contentMdRef = React.createRef();
|
||||
this.state={
|
||||
title_num: 0,
|
||||
title_value: undefined
|
||||
}
|
||||
}
|
||||
componentDidUpdate =(prevState)=>{
|
||||
// if(prevState!=this.props){
|
||||
// let url=`/osshackathon/edit_hackathon.json`;
|
||||
// axios.get(url).then((result)=>{
|
||||
// if(result.status==200){
|
||||
// this.setState({
|
||||
// title_value:result.data.name
|
||||
// })
|
||||
// this.contentMdRef.current.setValue(result.data.description);
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
}
|
||||
componentDidMount(){
|
||||
let url=`/osshackathon/edit_hackathon.json`;
|
||||
axios.get(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
this.setState({
|
||||
title_value:result.data.name
|
||||
})
|
||||
this.contentMdRef.current.setValue(result.data.description === null ? "" : result.data.description);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 输入title
|
||||
changeTitle = (e) => {
|
||||
// title_num: 60 - parseInt(e.target.value.length),
|
||||
this.setState({
|
||||
title_num: e.target.value.length,
|
||||
title_value: e.target.value
|
||||
})
|
||||
|
||||
}
|
||||
handleSubmit = () => {
|
||||
let {title_value}=this.state;
|
||||
const mdContnet = this.contentMdRef.current.getValue().trim();
|
||||
// if(mdContnet.length>10000){
|
||||
// this.props.showNotification("内容超过10000个字");
|
||||
// return
|
||||
// }
|
||||
|
||||
let url=`/osshackathon/update_hackathon.json`;
|
||||
axios.post(url,{
|
||||
name:title_value,
|
||||
description:mdContnet,
|
||||
}
|
||||
).then((response) => {
|
||||
if(response.data.status===0){
|
||||
this.props.getosshackathon()
|
||||
this.props.hidehackathonedit()
|
||||
this.props.showNotification(`提交成功`);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
}
|
||||
render() {
|
||||
|
||||
|
||||
// console.log(this.props.tabkey)
|
||||
// console.log(chart_rules)
|
||||
|
||||
return (
|
||||
<div className={"mt20"}>
|
||||
<Form>
|
||||
<Form.Item label="标题">
|
||||
<Input placeholder="请输入标题"
|
||||
value={this.state.title_value}
|
||||
onInput={this.changeTitle}
|
||||
className="searchView searchViewAfter h45input" style={{"width": "100%"}} maxLength="60"
|
||||
addonAfter={String(this.state.title_value === undefined || this.state.title_value === null ? 0 : this.state.title_value.length) + "/60"}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label="描述">
|
||||
<TPMMDEditor ref={this.contentMdRef} placeholder="请输入描述" mdID={'courseContentMD'} refreshTimeout={1500}
|
||||
className="courseMessageMD"
|
||||
initValue={this.state.description === null ? "" : this.state.description}></TPMMDEditor>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
|
||||
|
||||
|
||||
<div className="clearfix mt30 mb30">
|
||||
<div className={"fr"}>
|
||||
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
|
||||
<a className="defalutCancelbtn fl" onClick={() => this.props.hidehackathonedit()}>取消</ a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default Osshackathonmd;
|
|
@ -1,217 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import {Button, Card, Row, Col ,Upload,Icon,message,Tabs,Form,Input,Modal} from 'antd';
|
||||
import axios from 'axios';
|
||||
import {getImageUrl,getUrl,WordNumberTextarea} from 'educoder';
|
||||
|
||||
class Osshackathonmodel extends Component{
|
||||
constructor(props) {
|
||||
super(props)
|
||||
this.state={
|
||||
title_num: 0,
|
||||
title_value: undefined,
|
||||
Textarea_comment:undefined
|
||||
}
|
||||
}
|
||||
componentDidUpdate =(prevState)=>{
|
||||
// if(prevState!=this.props){
|
||||
// let name=this.props&&this.props.modelname;
|
||||
// let mdvalue=this.props&&this.props.modeldescription;
|
||||
// this.setState({
|
||||
// title_value:name,
|
||||
// Textarea_comment:mdvalue
|
||||
// })
|
||||
// }
|
||||
}
|
||||
componentDidMount(){
|
||||
if(this.props.modelid===undefined){
|
||||
this.setState({
|
||||
title_value:undefined,
|
||||
Textarea_comment:undefined
|
||||
})
|
||||
}else{
|
||||
let url=`/osshackathon/${this.props.modelid}/edit.json`;
|
||||
axios.get(url).then((result)=>{
|
||||
if(result.status==200){
|
||||
this.setState({
|
||||
title_value:result.data.name,
|
||||
Textarea_comment:result.data.description
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
handleSubmit = () => {
|
||||
let {title_value,Textarea_comment}=this.state;
|
||||
// if(mdContnet.length>10000){
|
||||
// this.props.showNotification("内容超过10000个字");
|
||||
// return
|
||||
// }
|
||||
//
|
||||
|
||||
if(this.props.modelid===undefined){
|
||||
let url=`/osshackathon.json`;
|
||||
axios.post(url,{
|
||||
name:title_value,
|
||||
description:Textarea_comment,
|
||||
}
|
||||
).then((response) => {
|
||||
if(response.data.status===0){
|
||||
|
||||
this.props.getosshackathon()
|
||||
this.props.hideeditSignupentry()
|
||||
this.props.showNotification(`提交成功`);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}else{
|
||||
let url=`/osshackathon/${this.props.modelid}.json`
|
||||
axios.put(url,{
|
||||
name:title_value,
|
||||
description:Textarea_comment,
|
||||
}
|
||||
).then((response) => {
|
||||
if(response.data.status===0){
|
||||
|
||||
this.props.getosshackathon()
|
||||
this.props.hideeditSignupentry()
|
||||
this.props.showNotification(`提交成功`);
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
changeTitle=(e)=>{
|
||||
this.setState({
|
||||
title_value:e.target.value,
|
||||
title_num:e.target.value.length,
|
||||
})
|
||||
}
|
||||
|
||||
Textarea_comment=(e)=>{
|
||||
this.setState({
|
||||
Textarea_comment:e.target.value,
|
||||
})
|
||||
}
|
||||
render() {
|
||||
let {textareavaltype}=this.state;
|
||||
// console.log(this.props.tabkey)
|
||||
// console.log(this.props.Osshackathonmodeltype)
|
||||
|
||||
return (
|
||||
<div>
|
||||
|
||||
<style>
|
||||
{
|
||||
`
|
||||
@media (max-width: 2000px) {
|
||||
.WordNumberTextarea{
|
||||
height: 130px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1350px) {
|
||||
.HomeworkModal{
|
||||
top:10px !important;
|
||||
}
|
||||
.WordNumberTextarea{
|
||||
height: 80px !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1250px) {
|
||||
.HomeworkModal{
|
||||
top:0px !important;
|
||||
}
|
||||
|
||||
.WordNumberTextarea{
|
||||
height: 40px !important;
|
||||
}
|
||||
}
|
||||
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<Modal
|
||||
keyboard={false}
|
||||
className={"HomeworkModal"}
|
||||
title={this.props.modelid===undefined?"新建项目":"编辑项目"}
|
||||
visible={this.props.Osshackathonmodeltype}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
>
|
||||
|
||||
<div className={"pd015"}>
|
||||
<style>
|
||||
{
|
||||
`
|
||||
.pd015{
|
||||
padding: 0px 15px 15px 15px;
|
||||
}
|
||||
.font{
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: rgba(5,16,26,1);
|
||||
}
|
||||
.newfont{
|
||||
height: 16px;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
color: rgba(5,16,26,1);
|
||||
line-height: 16px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.Osshackathonmodelinput .ant-input, .ant-input .ant-input-suffix{
|
||||
background: #fff !important;
|
||||
}
|
||||
.Osshackathonmodelinput .ant-input-group-wrapper{
|
||||
width:510px !important;
|
||||
margin-left: 10px;
|
||||
}
|
||||
`
|
||||
}
|
||||
</style>
|
||||
<div className="clearfix">
|
||||
<p className={"font mt10 mb10 ml10"}>
|
||||
名称
|
||||
</p>
|
||||
|
||||
<Input placeholder="请输入项目名称"
|
||||
value={this.state.title_value}
|
||||
onInput={(e)=>this.changeTitle(e)}
|
||||
className={"Osshackathonmodelinput"}
|
||||
style={{"width": "100%"}} maxLength="60"
|
||||
addonAfter={String(this.state.title_value === undefined || this.state.title_value === null ? 0 : this.state.title_value.length) + "/60"}
|
||||
/>
|
||||
|
||||
<p className={"font mt10 mb10 ml10"}>
|
||||
描述
|
||||
</p>
|
||||
|
||||
<WordNumberTextarea
|
||||
placeholder={"请输入项目描述"}
|
||||
onInput={(e)=>this.Textarea_comment(e)}
|
||||
value={this.state.Textarea_comment}
|
||||
maxlength={250}
|
||||
/>
|
||||
|
||||
<li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt20 mb10":"none"}><span>评阅内容至少有一个不为空</span></li>
|
||||
</div>
|
||||
|
||||
<div className={textareavaltype===false?"mt20 clearfix edu-txt-center":"clearfix edu-txt-center mt20"}>
|
||||
<a className="task-btn color-white mr30" onClick={()=>this.props.hideeditSignupentry()}>取消</a>
|
||||
<a className="task-btn task-btn-orange" onClick={()=>this.handleSubmit()}>确定</a>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
export default Osshackathonmodel;
|
|
@ -1,410 +0,0 @@
|
|||
import React, { Component } from 'react';
|
||||
import { SnackbarHOC ,CNotificationHOC} from 'educoder';
|
||||
import {Route,Switch} from 'react-router-dom';
|
||||
import Loadable from 'react-loadable';
|
||||
import Loading from '../../Loading';
|
||||
import axios from 'axios';
|
||||
import { TPMIndexHOC } from '../tpm/TPMIndexHOC';
|
||||
import locale from 'antd/lib/date-picker/locale/zh_CN';
|
||||
import Bottomsubmit from "../modals/Bottomsubmit";
|
||||
import Educationitem from "./Resume/Educationitem"
|
||||
import WorkItem from "./Resume/WorkItem"
|
||||
|
||||
|
||||
|
||||
import { Input ,Form,Radio,Upload,DatePicker,Select,Button,Icon} from 'antd';
|
||||
|
||||
const Option = Select.Option;
|
||||
const RadioGroup=Radio.Group;
|
||||
const TextArea = Input.TextArea;
|
||||
class EditResume extends Component{
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount=()=>{
|
||||
|
||||
}
|
||||
|
||||
|
||||
submit=()=>{
|
||||
this.props.form.validateFieldsAndScroll((err, values) => {
|
||||
if(!err){
|
||||
console.log(values)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
cancel=()=>{
|
||||
if(this.Educationitem){
|
||||
this.Educationitem.cancel() //调用子组件的dream方法
|
||||
}
|
||||
}
|
||||
|
||||
education=(educationarray)=>{
|
||||
console.log(educationarray)
|
||||
}
|
||||
|
||||
workcancel=()=>{
|
||||
if(this.WorkItem){
|
||||
this.WorkItem.cancel() //调用子组件的dream方法
|
||||
}
|
||||
}
|
||||
|
||||
workeducation=(educationarray)=>{
|
||||
console.log(educationarray)
|
||||
}
|
||||
|
||||
|
||||
render(){
|
||||
const {getFieldDecorator} = this.props.form;
|
||||
const uploadButton = (
|
||||
<div>
|
||||
<div className="ant-upload-text">上传照片</div>
|
||||
</div>
|
||||
);
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 3 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 21 },
|
||||
},
|
||||
};
|
||||
|
||||
const props = {
|
||||
name: 'file',
|
||||
action: 'https://www.mocky.io/v2/5cc8019d300000980a055e76',
|
||||
headers: {
|
||||
authorization: 'authorization-text',
|
||||
},
|
||||
onChange(info) {
|
||||
if (info.file.status !== 'uploading') {
|
||||
console.log(info.file, info.fileList);
|
||||
}
|
||||
if (info.file.status === 'done') {
|
||||
//message.success(`${info.file.name} file uploaded successfully`);
|
||||
} else if (info.file.status === 'error') {
|
||||
//message.error(`${info.file.name} file upload failed.`);
|
||||
}
|
||||
},
|
||||
};
|
||||
// const formItemLayoutWithOutLabel = {
|
||||
// wrapperCol: {
|
||||
// xs: { span: 2, offset: 0 },
|
||||
// sm: { span: 22, offset: 4 },
|
||||
// },
|
||||
// };
|
||||
return(
|
||||
<div className="clearfix mt25">
|
||||
<div className="educontent mt10 pb20 w1200s">
|
||||
<Form
|
||||
{...formItemLayout}
|
||||
className="edu-back-white" style={{padding:20,marginBottom:180}}>
|
||||
<Form.Item style={{display:'flex'}} label="姓名">
|
||||
{getFieldDecorator('name', {
|
||||
rules: [{required: true, message: "姓名不能为空"}],
|
||||
})(
|
||||
<Input placeholder="请输入姓名" onChange={this.handleChange} style={{width:400}} maxLength={60} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="性别"
|
||||
style={{display:'flex'}}
|
||||
>
|
||||
{getFieldDecorator('sex', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择性别',
|
||||
}],
|
||||
})(
|
||||
<RadioGroup>
|
||||
<Radio value="0" >男</Radio>
|
||||
<Radio value="1" >女</Radio>
|
||||
</RadioGroup>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label="照片上传"
|
||||
style={{display:'flex'}}
|
||||
|
||||
>
|
||||
<div>
|
||||
<div>只支持JPG格式,大小不要超过500k</div>
|
||||
<Upload
|
||||
action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
|
||||
listType="picture-card"
|
||||
style={{display:'flex'}}
|
||||
onPreview={this.handlePreview}
|
||||
onChange={this.handleChange}
|
||||
>
|
||||
{uploadButton}
|
||||
</Upload>
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="出生日期"
|
||||
style={{display:'flex'}}
|
||||
>
|
||||
{getFieldDecorator('birth_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择出生日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择出生日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item style={{display:'flex'}} label="手机号">
|
||||
{getFieldDecorator('mobile', {
|
||||
rules: [{required: true, message: "不能为空"}],
|
||||
})(
|
||||
<Input placeholder="请输入手机号" style={{width:400}} onChange={this.handleChange} maxLength={60} />
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item style={{display:'flex'}} label="求职意向">
|
||||
{getFieldDecorator('job_position', {
|
||||
rules: [{required: true, message: "请选择期望职位"}],
|
||||
})(
|
||||
<Select style={{ width: 400 }} onChange={this.handleChange}>
|
||||
<Option value="jack">请选择期望职位</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item style={{display:'flex'}} label="工作城市">
|
||||
{getFieldDecorator('city', {
|
||||
rules: [{required: true, message: "请选择期望工作城市"}],
|
||||
})(
|
||||
<Select style={{ width: 400 }} onChange={this.handleChange}>
|
||||
<Option value="jack">请选择期望工作城市</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item style={{display:'flex'}} label="期望薪资">
|
||||
{getFieldDecorator('salary', {
|
||||
rules: [{required: true, message: "请选择期望薪资"}],
|
||||
})(
|
||||
<Select style={{ width: 400 }} onChange={this.handleChange}>
|
||||
<Option value="lucy">请选择期望薪资</Option>
|
||||
</Select>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item style={{display:'flex'}} label="工作性质">
|
||||
{getFieldDecorator('job_category', {
|
||||
rules: [{required: true}],
|
||||
})(
|
||||
<RadioGroup>
|
||||
<Radio value="0" >全职</Radio>
|
||||
<Radio value="1" >兼职</Radio>
|
||||
<Radio value="2" >实习</Radio>
|
||||
|
||||
</RadioGroup>
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label='教育经历'
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<div style={{ display: 'inline-block', width: 'calc(100%)' }}>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('edu_bg', {
|
||||
rules: [{required: true, message: "学历不能为空"}],
|
||||
})(
|
||||
<Input placeholder="请输入学历" style={{width:180}} onChange={this.handleChange} maxLength={60} />
|
||||
)}
|
||||
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}>
|
||||
{getFieldDecorator('edu_category', {
|
||||
rules: [{required: true, message: "学历类型不能为空"}],
|
||||
})(
|
||||
<Input placeholder="请输入学历类型" style={{width:180}} onChange={this.handleChange} maxLength={60} />
|
||||
)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('begin_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择开始日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择开始日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('end_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择结束日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择结束日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator(`school`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
rules: [
|
||||
{
|
||||
required: true, message: "不能为空"
|
||||
},
|
||||
],
|
||||
})(<Input placeholder="请输入学校名称" style={{ width:'60%',marginRight:8 }} />)}
|
||||
</Form.Item>
|
||||
<Educationitem {...this.props} {...this.state} education={this.education} onRef={c=>this.Educationitem=c}/>
|
||||
<Button type="dashed" onClick={this.cancel} style={{ width: '30%' }}>
|
||||
添加教育经历
|
||||
</Button>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label='工作/实习经历'
|
||||
style={{ marginBottom: 0 }}
|
||||
>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('begin_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择开始日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择开始日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('end_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择结束日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择结束日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator(`school`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
rules: [
|
||||
{
|
||||
required: true, message: "不能为空"
|
||||
},
|
||||
],
|
||||
})(<Input placeholder="请输入公司名称" style={{ width:'60%',marginRight:8 }} />)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator(`des`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
rules: [
|
||||
{
|
||||
required: true, message: "不能为空"
|
||||
},
|
||||
],
|
||||
})(<TextArea placeholder="请输入公司描述" rows={4} style={{ width:'60%',marginRight:8 }} />)}
|
||||
</Form.Item>
|
||||
<WorkItem {...this.props} {...this.state} workeducation={this.workeducation} onRef={c=>this.WorkItem=c}/>
|
||||
|
||||
{/* <WorkItem {...this.props} {...this.state} workeducation={this.workeducation} onRef={c=>this.WorkItem=c}/> */}
|
||||
|
||||
<Button type="dashed" onClick={this.workcancel} style={{ width: '30%' }}>
|
||||
添加工作经历
|
||||
</Button>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
label='自我评价'
|
||||
>
|
||||
{getFieldDecorator(`school`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
rules: [
|
||||
{
|
||||
|
||||
},
|
||||
],
|
||||
})(<TextArea rows={4} placeholder="请输入自我评价" style={{ width:'60%',marginRight:8 }} />)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="简历上传"
|
||||
style={{display:'flex'}}
|
||||
|
||||
>
|
||||
<div>
|
||||
<div>(上传简历可以提高应聘成功率)</div>
|
||||
<Upload {...props} className="upload_1 upload_under_markdown_editor">
|
||||
<Button className="uploadBtn">
|
||||
<Icon type="upload" /> 上传简历
|
||||
</Button>
|
||||
<span style={{color:'#E77234',}}>(提示:不超过10MB,扩展名为pdf、doc、docx、ppt、pptx、png、jpg、jpeg)</span>
|
||||
</Upload>
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
</Form>
|
||||
</div>
|
||||
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"确定"}
|
||||
Cohetepaperbool={true}
|
||||
setCohetepaperbool={() => this.props.setnewmyshixunmodelbool(false)}
|
||||
onSubmits={() => this.props.setnewmyshixunmodelbool(false)} url={'/paperlibrary'}></Bottomsubmit>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
const EditResumeForm = Form.create({ name: 'EditResumeForm' })(EditResume);
|
||||
export default CNotificationHOC() (SnackbarHOC() ( TPMIndexHOC(EditResumeForm) )) ;
|
|
@ -1,52 +0,0 @@
|
|||
import React, { Component } from "react";
|
||||
import { Tabs, Divider } from "antd";
|
||||
const dateSplit = (date) => {
|
||||
if (!date) {
|
||||
return "";
|
||||
} else {
|
||||
const dateArr = date.split("-");
|
||||
return `${dateArr[0]}.${dateArr[1]}`;
|
||||
}
|
||||
};
|
||||
class EduExperienceItem extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
edu_bg,
|
||||
edu_category,
|
||||
begin_on,
|
||||
end_on,
|
||||
school,
|
||||
major,
|
||||
} = this.props.data;
|
||||
return (
|
||||
<div className="clearfix mt25">
|
||||
<div style={{ background: "#ffffff" }}>
|
||||
<div style={{ display: "flex" }}>
|
||||
<p style={{ color: "#888888", width: "15%" }}>
|
||||
{dateSplit(begin_on)}——{dateSplit(end_on)}
|
||||
</p>
|
||||
<p style={{ color: "#333333", marginLeft: 120, width: "10%" }}>
|
||||
{school}
|
||||
</p>
|
||||
<p style={{ color: "#333333", marginLeft: 120, width: "10%" }}>
|
||||
{major}
|
||||
</p>
|
||||
<p style={{ color: "#333333", marginLeft: 120, width: "10%" }}>
|
||||
{edu_bg}
|
||||
</p>
|
||||
<p style={{ color: "#333333", marginLeft: 120, width: "10%" }}>
|
||||
{edu_category}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default EduExperienceItem;
|
|
@ -1,173 +0,0 @@
|
|||
import React , { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Form,Input,Icon,DatePicker,Button} from 'antd'
|
||||
import locale from 'antd/lib/date-picker/locale/zh_CN';
|
||||
class Educationitem extends Component{
|
||||
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
//显示 隐藏
|
||||
isdisplay:false,
|
||||
orderid:'',
|
||||
}
|
||||
if(props.onRef){//如果父组件传来该方法 则调用方法将子组件this指针传过去
|
||||
props.onRef(this)
|
||||
}
|
||||
}
|
||||
|
||||
education=(educationarray)=>{
|
||||
this.props.education(educationarray);
|
||||
}
|
||||
|
||||
cancel=()=>{
|
||||
//隐藏列表
|
||||
const isdisplay=this.state.isdisplay;
|
||||
this.setState({
|
||||
isdisplay:!isdisplay
|
||||
})
|
||||
}
|
||||
|
||||
CreateFormManFun=()=>{
|
||||
|
||||
// 创建Form表单
|
||||
|
||||
const CreateFormMan = Form.create()(props => {
|
||||
|
||||
const { dispatch,form} = props;
|
||||
|
||||
const { getFieldDecorator } = form;
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 0 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 24 },
|
||||
},
|
||||
};
|
||||
|
||||
// 提交事件
|
||||
|
||||
const searchMan = () => {
|
||||
|
||||
const {dispatch}=this.props;
|
||||
|
||||
form.validateFields((err, fieldsValue) => {
|
||||
|
||||
if (err) return;
|
||||
this.education(fieldsValue);
|
||||
//console.log(values)
|
||||
// const values = {...};
|
||||
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Form.Item
|
||||
{...formItemLayout}
|
||||
label={'教育经历'}
|
||||
>
|
||||
<div style={{ display: 'inline-block', width: 'calc(100%)' }}>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('edu_bg', {
|
||||
rules: [{required: true, message: "学历不能为空"}],
|
||||
})(
|
||||
<Input placeholder="请输入学历" style={{width:180}} onChange={this.handleChange} maxLength={60} />
|
||||
)}
|
||||
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}>
|
||||
{getFieldDecorator('edu_category', {
|
||||
rules: [{required: true, message: "学历类型不能为空"}],
|
||||
})(
|
||||
<Input placeholder="请输入学历类型" style={{width:180}} onChange={this.handleChange} maxLength={60} />
|
||||
)}
|
||||
</Form.Item>
|
||||
</div>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('begin_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择开始日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择开始日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('end_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择结束日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择结束日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator(`school`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
rules: [
|
||||
{
|
||||
required: true, message: "不能为空"
|
||||
},
|
||||
],
|
||||
})(<Input placeholder="请输入学校名称" style={{ width:'60%',marginRight:8 }} />)}
|
||||
</Form.Item>
|
||||
<div style={{width:'100%',margin:'auto',marginLeft:200}}>
|
||||
<Button type="primary" onClick={searchMan} >
|
||||
保存
|
||||
</Button>
|
||||
<Button type="danger" style={{marginLeft:15}} onClick={this.cancel}>
|
||||
取消
|
||||
</Button>
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
return <CreateFormMan />
|
||||
|
||||
}
|
||||
|
||||
render(){
|
||||
return(
|
||||
<div style={{display:this.state.isdisplay?'':'none'}}>
|
||||
{this.CreateFormManFun()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default Educationitem;
|
|
@ -1,426 +0,0 @@
|
|||
import React, { Component } from "react";
|
||||
import { Divider, Button, Modal, message } from "antd";
|
||||
import EduExperienceItem from "./EduExperienceItem";
|
||||
import WorkExperience from "./WorkExperience";
|
||||
import axios from "axios";
|
||||
import { getImageUrl, getUploadActionUrl } from "educoder";
|
||||
import qs from "qs";
|
||||
import { Link } from "react-router-dom";
|
||||
import Nav from "../util/Nav";
|
||||
class ResumeDetails extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
resumeData: {
|
||||
name: "",
|
||||
sex: "",
|
||||
user_name: "",
|
||||
logo_url: "",
|
||||
mobile: "",
|
||||
age: 0,
|
||||
last_edu_1: "",
|
||||
last_edu_2: "",
|
||||
job_position: [],
|
||||
job_city: [],
|
||||
city: [],
|
||||
salary: "",
|
||||
job_category: "",
|
||||
education: [],
|
||||
experience: [],
|
||||
evaluate: "",
|
||||
attachment_url: "",
|
||||
attachment_name: "",
|
||||
work_year: "",
|
||||
},
|
||||
modalVisible: false,
|
||||
};
|
||||
}
|
||||
componentDidMount() {
|
||||
const { user } = this.props;
|
||||
if (user && !user.profile_completed) {
|
||||
this.setState({
|
||||
modalVisible: true,
|
||||
okText: "立即完善",
|
||||
modalContent: "您需要去完善您的个人资料,才能使用此功能",
|
||||
onOk: () => {
|
||||
this.props.history.push("/account/profile/edit");
|
||||
},
|
||||
// cancelText: "稍后完善",
|
||||
// onCancel:()=>{
|
||||
// this.props.history.push("/");
|
||||
// }
|
||||
});
|
||||
} else {
|
||||
this.fetchResumeDetail();
|
||||
}
|
||||
}
|
||||
fetchResumeDetail = () => {
|
||||
let url;
|
||||
const { id } = qs.parse(this.props.location.search.substr(1));
|
||||
// 带ID的为招聘者查看求职者详情,请求不同的接口,不带id的直接请求用户的简历详情
|
||||
if (id) {
|
||||
url = `/resumes/${id}/preview.json`;
|
||||
} else {
|
||||
url = `/users/resume.json`;
|
||||
}
|
||||
axios
|
||||
.get(url)
|
||||
.then((response) => {
|
||||
if (response.data.status === -2) {
|
||||
this.setState({
|
||||
modalVisible: true,
|
||||
okText: "创建简历",
|
||||
modalContent: "暂无简历,请新建简历",
|
||||
onOk: () => {
|
||||
this.props.history.push("/recruitment/addresume");
|
||||
},
|
||||
cancelText: "取消",
|
||||
onCancel:()=>{
|
||||
this.props.history.push("/");
|
||||
}
|
||||
});
|
||||
// Modal.info({
|
||||
} else {
|
||||
if (url === `/users/resume.json`) {
|
||||
this.setState({
|
||||
resumeData: response.data,
|
||||
});
|
||||
} else {
|
||||
this.setState({
|
||||
resumeData: response.data.user,
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
updateResume = (attachmentId) => {
|
||||
const url = "/users/update_resume.json";
|
||||
const data = {
|
||||
attachment_id: attachmentId,
|
||||
};
|
||||
axios
|
||||
.put(url, data)
|
||||
.then((response) => {
|
||||
console.log(response);
|
||||
if (response.status === 200) {
|
||||
this.fetchResumeDetail();
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
render() {
|
||||
//发布职位权限 跟招聘列表的一样
|
||||
let authJobs = false;
|
||||
if (this.props.user) {
|
||||
const { admin, business, is_teacher, identity } = this.props.user;
|
||||
authJobs = admin || business || is_teacher || identity === "professional";
|
||||
}
|
||||
const search = this.props.location.search.substr(1);
|
||||
const { id, from } = qs.parse(search);
|
||||
//有权限且是跳转过来查看详情的,hasAuth=true ,展示查看简历按钮和职位名称
|
||||
this.hasAuth = authJobs && id;
|
||||
const { resumeData } = this.state;
|
||||
const {
|
||||
name,
|
||||
sex,
|
||||
user_name,
|
||||
logo_url,
|
||||
age,
|
||||
mobile,
|
||||
last_edu_1,
|
||||
last_edu_2,
|
||||
job_position,
|
||||
job_city,
|
||||
city,
|
||||
salary,
|
||||
job_category,
|
||||
education,
|
||||
experience,
|
||||
evaluate,
|
||||
attachment_name,
|
||||
attachment_url,
|
||||
work_year,
|
||||
} = resumeData;
|
||||
const props = {
|
||||
accept: ".pdf,.doc,.docx,.ppt,.pptx,.png,.jpg,.jpeg",
|
||||
name: "file",
|
||||
action: `${getUploadActionUrl()}`,
|
||||
headers: {
|
||||
authorization: "authorization-text",
|
||||
},
|
||||
onChange: (info) => {
|
||||
if (info.file.status !== "uploading") {
|
||||
console.log(info.file, info.fileList);
|
||||
}
|
||||
if (info.file.status === "done") {
|
||||
message.success("上传成功");
|
||||
const { id } = info.file.response;
|
||||
this.updateResume(id);
|
||||
} else if (info.file.status === "error") {
|
||||
//message.error(`${info.file.name} file upload failed.`);
|
||||
}
|
||||
},
|
||||
beforeUpload: (file) => {
|
||||
const isLt10M = file.size / 1024 / 1024 < 10;
|
||||
if (!isLt10M) {
|
||||
message.error("简历大小超过10MB!");
|
||||
}
|
||||
return isLt10M;
|
||||
},
|
||||
};
|
||||
const myNav = (
|
||||
<Nav
|
||||
breadcrunmb={[<Link to="/recruitment">求职招聘</Link>, "我的简历"]}
|
||||
history={this.props.history}
|
||||
back={() => this.props.history.goBack()}
|
||||
/>
|
||||
);
|
||||
return (
|
||||
<div className="clearfix mt25" style={{ marginBottom: 120 }}>
|
||||
{this.hasAuth && (
|
||||
<div>
|
||||
<Nav
|
||||
breadcrunmb={[
|
||||
<Link to="/recruitment?tab=1">职位管理</Link>,
|
||||
<Link
|
||||
to="/"
|
||||
onClick={() => {
|
||||
this.props.history.goBack();
|
||||
}}
|
||||
>
|
||||
投递列表
|
||||
</Link>,
|
||||
"投递者详情",
|
||||
]}
|
||||
history={this.props.history}
|
||||
back={() => this.props.history.goBack()}
|
||||
/>
|
||||
<div
|
||||
className="educontent mt10 pb20 w1200s"
|
||||
style={{ background: "#ffffff", padding: 30 }}
|
||||
>
|
||||
职位名称:{name}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{from && myNav}
|
||||
<div
|
||||
className="educontent pb20 w1200s"
|
||||
style={{ background: "#ffffff", padding: 30, marginTop: 1 }}
|
||||
>
|
||||
<div className="clearfix color-white">
|
||||
{/* src={data && `${getImageUrl('images/'+data.avatar_url)}`} */}
|
||||
<p className="myPhoto mr20 fl">
|
||||
<img
|
||||
alt="头像"
|
||||
src={getImageUrl(logo_url)}
|
||||
style={{ width: 110, height: 110, borderRadius: "50%" }}
|
||||
/>
|
||||
</p>
|
||||
<div className="fl">
|
||||
<p className="clearfix mt20">
|
||||
{/* {data && data.name} */}
|
||||
<span
|
||||
className="task-hide"
|
||||
style={{ maxWidth: "370px", color: "#000000", fontSize: 20 }}
|
||||
>
|
||||
{name || user_name}
|
||||
</span>
|
||||
<span
|
||||
className="task-hide ml30"
|
||||
style={{ maxWidth: "370px", color: "#000000" }}
|
||||
>
|
||||
{mobile}
|
||||
</span>
|
||||
{/*{*/}
|
||||
{/*data && is_current == false && data.identity =="学生" ? "" : */}
|
||||
{/*<span className="userpost"><label>{data && data.identity}</label></span>*/}
|
||||
{/*}*/}
|
||||
</p>
|
||||
<div
|
||||
className="mt20"
|
||||
style={{ display: "flex", color: "#888888" }}
|
||||
>
|
||||
<div className="mr5">{sex}</div>|
|
||||
<div className="ml5 mr5">{age}岁</div>|
|
||||
<div className="ml5 mr5">{last_edu_1}</div>
|
||||
<div className="ml5 mr5">
|
||||
{work_year ? `| ${work_year}年工作经验` : ""}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="fr">
|
||||
<span className="fl mt35 ml60">
|
||||
{this.hasAuth ? (
|
||||
<div>
|
||||
<Button
|
||||
style={{
|
||||
backgroundColor: "#4CADFF",
|
||||
color: "#ffffff",
|
||||
display: attachment_url ? "block" : "none",
|
||||
}}
|
||||
size="large"
|
||||
href={attachment_url}
|
||||
target="_blank"
|
||||
>
|
||||
下载附件简历
|
||||
</Button>
|
||||
<div
|
||||
onMouseOver={() => this.setState({ mouseover: true })}
|
||||
onMouseLeave={() => this.setState({ mouseover: false })}
|
||||
style={{
|
||||
display: !attachment_url ? "inline-block" : "none",
|
||||
marginRight: 30,
|
||||
color: this.state.mouseover ? "#a5a5a5" : null,
|
||||
cursor: "default",
|
||||
}}
|
||||
>
|
||||
求职者未上传简历
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<Link
|
||||
style={{ color: "#4CADFF", marginRight: 30 }}
|
||||
to="/recruitment/editresume"
|
||||
>
|
||||
<i
|
||||
className="iconfont icon-bianji3 mr5"
|
||||
style={{ color: "#4CACFF" }}
|
||||
></i>
|
||||
编辑
|
||||
</Link>
|
||||
)}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
className="educontent mt10 pb20 w1200s"
|
||||
style={{ background: "#ffffff", padding: 30 }}
|
||||
>
|
||||
<div style={{ fontSize: 16, fontWeight: "700", color: "#333333" }}>
|
||||
求职意向
|
||||
</div>
|
||||
<div style={{ display: "flex", marginTop: 30 }}>
|
||||
<p style={{ color: "#888888" }}>期望职位:</p>
|
||||
<p style={{ color: "#333333", width: 300 }}>
|
||||
{job_position ? job_position.join("、") : ""}
|
||||
</p>
|
||||
<p style={{ color: "#888888", marginLeft: 120 }}>工作城市:</p>
|
||||
<p style={{ color: "#333333" }}>
|
||||
{job_city ? job_city.join("、") : city ? city.join("、") : ""}
|
||||
</p>
|
||||
</div>
|
||||
<div style={{ display: "flex", marginTop: 15 }}>
|
||||
<p style={{ color: "#888888" }}>薪资要求:</p>
|
||||
<p style={{ color: "#333333", width: 300 }}>{salary}</p>
|
||||
<p style={{ color: "#888888", marginLeft: 120 }}>工作性质:</p>
|
||||
<p style={{ color: "#333333" }}>
|
||||
{job_category ? job_category.join("、") : ""}
|
||||
</p>
|
||||
</div>
|
||||
<Divider />
|
||||
<div style={{ fontSize: 16, fontWeight: "700", color: "#333333" }}>
|
||||
教育经历
|
||||
</div>
|
||||
{education.map((item, index) => (
|
||||
<EduExperienceItem
|
||||
{...this.props}
|
||||
data={item}
|
||||
key={item.begin_on + item.end_on + index}
|
||||
/>
|
||||
))}
|
||||
<Divider />
|
||||
<div style={{ fontSize: 16, fontWeight: "700", color: "#333333" }}>
|
||||
工作经历
|
||||
</div>
|
||||
{experience.map((item, index) => (
|
||||
<WorkExperience
|
||||
{...this.props}
|
||||
data={item}
|
||||
key={item.begin_on + item.end_on + index}
|
||||
/>
|
||||
))}
|
||||
<Divider />
|
||||
<div style={{ fontSize: 16, fontWeight: "700", color: "#333333" }}>
|
||||
自我评价
|
||||
</div>
|
||||
<div
|
||||
className="mt25 mb25"
|
||||
style={{ whiteSpace: "pre-wrap", lineHeight: "2" }}
|
||||
>
|
||||
{evaluate}
|
||||
</div>
|
||||
{!this.hasAuth && (
|
||||
<div>
|
||||
<Divider />
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
fontSize: 16,
|
||||
fontWeight: "700",
|
||||
color: "#333333",
|
||||
}}
|
||||
>
|
||||
附件简历
|
||||
</div>
|
||||
<div className="mt25">
|
||||
{attachment_name ? (
|
||||
<a href={attachment_url} target="_blank" style={{ color: "#4CACFF" }}>
|
||||
<i
|
||||
className="iconfont icon-lianjie"
|
||||
style={{ fontSize: 12, marginRight: 5 }}
|
||||
></i>
|
||||
{attachment_name}
|
||||
</a>
|
||||
) : (
|
||||
"暂无"
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<Modal
|
||||
keyboard={false}
|
||||
title="提示"
|
||||
visible={this.state.modalVisible}
|
||||
closable={false}
|
||||
footer={null}
|
||||
destroyOnClose={true}
|
||||
centered={true}
|
||||
width="530px"
|
||||
>
|
||||
<div className="task-popup-content">
|
||||
<p className="task-popup-text-center font-16">
|
||||
{this.state.modalContent}
|
||||
</p>
|
||||
<div className="clearfix mt30 edu-txt-center">
|
||||
|
||||
<a
|
||||
className="task-btn mr30"
|
||||
onClick={this.state.onCancel}
|
||||
style={{display:this.state.cancelText?'inline-block':'none'}}
|
||||
>
|
||||
{ this.state.cancelText}
|
||||
</a>
|
||||
|
||||
<a
|
||||
className="task-btn task-btn-orange"
|
||||
onClick={this.state.onOk}
|
||||
>
|
||||
{this.state.okText}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ResumeDetails;
|
|
@ -1,49 +0,0 @@
|
|||
import React, { Component } from "react";
|
||||
import { Tabs, Divider } from "antd";
|
||||
const dateSplit = (date) => {
|
||||
if (!date) {
|
||||
return "";
|
||||
} else {
|
||||
const dateArr = date.split("-");
|
||||
return `${dateArr[0]}.${dateArr[1]}`;
|
||||
}
|
||||
};
|
||||
class WorkExperience extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
render() {
|
||||
const { company, begin_on, end_on, desc } = this.props.data;
|
||||
return (
|
||||
<div className="clearfix mt25">
|
||||
<div style={{ background: "#ffffff" }}>
|
||||
<div style={{ display: "flex" }}>
|
||||
<p style={{ color: "#888888" }}>
|
||||
{dateSplit(begin_on)}——{dateSplit(end_on)}
|
||||
</p>
|
||||
<p style={{ color: "#333333", marginLeft: 120, fontWeight: "700" }}>
|
||||
{company}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div style={{ display: "flex", marginTop: 30 }}>
|
||||
<p style={{ color: "#888888" }}>工作描述:</p>
|
||||
</div>
|
||||
<div
|
||||
style={{
|
||||
color: "#333333",
|
||||
marginTop: 15,
|
||||
whiteSpace: "pre-wrap",
|
||||
lineHeight: "2",
|
||||
}}
|
||||
>
|
||||
{desc}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default WorkExperience;
|
|
@ -1,164 +0,0 @@
|
|||
import React , { Component } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { Form,Input,Icon,DatePicker,Button} from 'antd'
|
||||
import locale from 'antd/lib/date-picker/locale/zh_CN';
|
||||
const TextArea = Input.TextArea;
|
||||
class WorkItem extends Component{
|
||||
|
||||
constructor(props){
|
||||
super(props);
|
||||
this.state={
|
||||
//显示 隐藏
|
||||
isdisplay:false,
|
||||
orderid:'',
|
||||
}
|
||||
if(props.onRef){//如果父组件传来该方法 则调用方法将子组件this指针传过去
|
||||
props.onRef(this)
|
||||
}
|
||||
}
|
||||
|
||||
workeducation=(educationarray)=>{
|
||||
this.props.workeducation(educationarray);
|
||||
}
|
||||
|
||||
cancel=()=>{
|
||||
//隐藏列表
|
||||
const isdisplay=this.state.isdisplay;
|
||||
this.setState({
|
||||
isdisplay:!isdisplay
|
||||
})
|
||||
}
|
||||
|
||||
CreateFormManFun=()=>{
|
||||
|
||||
// 创建Form表单
|
||||
|
||||
const CreateFormMan = Form.create()(props => {
|
||||
|
||||
const { dispatch,form} = props;
|
||||
|
||||
const { getFieldDecorator } = form;
|
||||
|
||||
const formItemLayout = {
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 0 },
|
||||
},
|
||||
wrapperCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 24 },
|
||||
},
|
||||
};
|
||||
|
||||
// 提交事件
|
||||
|
||||
const searchMan = () => {
|
||||
|
||||
const {dispatch}=this.props;
|
||||
|
||||
form.validateFields((err, fieldsValue) => {
|
||||
|
||||
if (err) return;
|
||||
this.workeducation(fieldsValue);
|
||||
//console.log(values)
|
||||
// const values = {...};
|
||||
|
||||
})
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Form.Item
|
||||
{...formItemLayout}
|
||||
>
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('begin_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择开始日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择开始日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
style={{ display: 'inline-block', width: 'calc(20% - 12px)' }}
|
||||
>
|
||||
{getFieldDecorator('end_on', {
|
||||
rules: [{
|
||||
required: true,
|
||||
message: '请选择结束日期',
|
||||
}],
|
||||
})(
|
||||
<DatePicker
|
||||
showToday={false}
|
||||
placeholder="请选择结束日期"
|
||||
// showTime={{format: 'HH:mm'}}
|
||||
style={{width:180}}
|
||||
locale={locale}
|
||||
onChange={this.onChangeTimepublishs}
|
||||
/>
|
||||
)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator(`school`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
rules: [
|
||||
{
|
||||
required: true, message: "不能为空"
|
||||
},
|
||||
],
|
||||
})(<Input placeholder="请输入公司名称" style={{ width:'60%',marginRight:8 }} />)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item>
|
||||
{getFieldDecorator(`des`, {
|
||||
validateTrigger: ['onChange', 'onBlur'],
|
||||
rules: [
|
||||
{
|
||||
required: true, message: "不能为空"
|
||||
},
|
||||
],
|
||||
})(<TextArea placeholder="请输入公司描述" rows={4} style={{ width:'60%',marginRight:8 }} />)}
|
||||
</Form.Item>
|
||||
<div style={{width:'100%',margin:'auto',marginLeft:200}}>
|
||||
<Button type="primary" onClick={searchMan} >
|
||||
保存
|
||||
</Button>
|
||||
<Button type="danger" style={{marginLeft:15}} onClick={this.cancel}>
|
||||
取消
|
||||
</Button>
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
</div>
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
return <CreateFormMan />
|
||||
|
||||
}
|
||||
|
||||
render(){
|
||||
return(
|
||||
<div style={{display:this.state.isdisplay?'':'none'}}>
|
||||
{this.CreateFormManFun()}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
export default WorkItem;
|
|
@ -1,23 +0,0 @@
|
|||
import { Route, Switch } from 'react-router-dom';
|
||||
import React from 'react';
|
||||
import ApplierPage from './routePage/ApplierPage';
|
||||
import JobDetailPage from './routePage/JobDetailPage';
|
||||
import AddJobPage from './routePage/AddJobPage';
|
||||
import EditJobPage from './routePage/EditJobPage';
|
||||
|
||||
|
||||
const Widget = (props) => {
|
||||
return (<Switch>
|
||||
<Route path="addjob">
|
||||
<AddJobPage {...props} />
|
||||
</Route>
|
||||
<Route path="editjob/:jobid"
|
||||
render={({ match }) => <EditJobPage {...props} jobId={match.params.jobid} />} />
|
||||
<Route path="applier/:jobid"
|
||||
render={({ match }) => <ApplierPage {...props} jobId={match.params.jobid} />} />
|
||||
<Route path="jobdetail/:jobid"
|
||||
render={({ match }) => <JobDetailPage {...props} jobId={match.params.jobid} />} />
|
||||
</Switch>);
|
||||
}
|
||||
|
||||
export default Widget;
|
|
@ -1,119 +0,0 @@
|
|||
import React, { Component } from "react";
|
||||
import { SnackbarHOC, CNotificationHOC } from "educoder";
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../../Loading";
|
||||
import { TPMIndexHOC } from "../tpm/TPMIndexHOC";
|
||||
|
||||
|
||||
const RecruitList = Loadable({
|
||||
loader: () => import("./tablist/RecruitList"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
//简历详情
|
||||
const ResumeDetails = Loadable({
|
||||
loader: () => import("./Resume/ResumeDetails"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
const AddJobPage = Loadable({
|
||||
loader: () => import("./routePage/AddJobPage"),
|
||||
loading: Loading,
|
||||
});
|
||||
const EditJobPage = Loadable({
|
||||
loader: () => import("./routePage/EditJobPage"),
|
||||
loading: Loading,
|
||||
});
|
||||
const JobDetailPage = Loadable({
|
||||
loader: () => import("./routePage/JobDetailPage"),
|
||||
loading: Loading,
|
||||
});
|
||||
const ApplierPage = Loadable({
|
||||
loader: () => import("./routePage/ApplierPage"),
|
||||
loading: Loading,
|
||||
});
|
||||
const AddResumePage = Loadable({
|
||||
loader: () => import("./routePage/AddResumePage"),
|
||||
loading: Loading,
|
||||
});
|
||||
const EditResumePage = Loadable({
|
||||
loader: () => import("./routePage/EditResumePage"),
|
||||
loading: Loading,
|
||||
});
|
||||
//test
|
||||
const DetailAddResumePage = Loadable({
|
||||
loader: () => import("./routePage/DetailAddResumePage"),
|
||||
loading: Loading,
|
||||
});
|
||||
class Tecruitment extends Component {
|
||||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {};
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div>
|
||||
<Switch {...this.props}>
|
||||
{/* 简历详情* ResumeDetails*/}
|
||||
<Route
|
||||
path={"/recruitment/resumedetails"}
|
||||
render={(props) => {
|
||||
return (
|
||||
<ResumeDetails {...this.props} {...props} {...this.state} />
|
||||
);
|
||||
}}
|
||||
></Route>
|
||||
{/* 新增职位 */}
|
||||
<Route path="/recruitment/addjob">
|
||||
<AddJobPage {...this.props} />
|
||||
</Route>
|
||||
{/* 编辑职位 */}
|
||||
<Route
|
||||
path="/recruitment/editjob/:jobid"
|
||||
render={({ match }) => (
|
||||
<EditJobPage {...this.props} jobId={match.params.jobid} />
|
||||
)}
|
||||
/>
|
||||
{/* 职位详情 */}
|
||||
<Route
|
||||
path="/recruitment/jobdetail/addresume/:jobid"
|
||||
render={({ match }) => (
|
||||
<DetailAddResumePage {...this.props} jobId={match.params.jobid} />
|
||||
)}
|
||||
/>
|
||||
<Route
|
||||
path="/recruitment/jobdetail/:jobid"
|
||||
render={({ match }) => (
|
||||
<JobDetailPage {...this.props} jobId={match.params.jobid} />
|
||||
)}
|
||||
/>
|
||||
|
||||
{/* 应聘者列表 */}
|
||||
<Route
|
||||
path="/recruitment/applier/:jobid"
|
||||
render={({ match }) => (
|
||||
<ApplierPage {...this.props} jobId={match.params.jobid} />
|
||||
)}
|
||||
/>
|
||||
<Route path="/recruitment/addresume" >
|
||||
<AddResumePage {...this.props}/>
|
||||
</Route>
|
||||
<Route path="/recruitment/editresume" >
|
||||
<EditResumePage {...this.props}/>
|
||||
</Route>
|
||||
{/*招聘链接*/}
|
||||
<Route
|
||||
path="/recruitment"
|
||||
render={(props) => (
|
||||
<RecruitList {...this.props} {...props} {...this.state} />
|
||||
)}
|
||||
></Route>
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Tecruitment)));
|
|
@ -1,13 +0,0 @@
|
|||
export function genUuid() {
|
||||
var s = [];
|
||||
var hexDigits = "0123456789abcdef";
|
||||
for (var i = 0; i < 36; i++) {
|
||||
s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1);
|
||||
}
|
||||
s[14] = "4"; // bits 12-15 of the time_hi_and_version field to 0010
|
||||
s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); // bits 6-7 of the clock_seq_hi_and_reserved to 01
|
||||
s[8] = s[13] = s[18] = s[23] = "-";
|
||||
|
||||
var uuid = s.join("");
|
||||
return uuid;
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
import axios from "axios";
|
||||
|
||||
function transf(json, history) {
|
||||
return {
|
||||
id: json.id,
|
||||
name: json.user_name,
|
||||
job: json.job_name,
|
||||
sex: json.sex,
|
||||
age: json.age,
|
||||
exp: json.work_year,
|
||||
edu_1: json.last_edu_1,
|
||||
edu_2: json.last_edu_2,
|
||||
dlFunc: json.attachment_url
|
||||
? () => {
|
||||
window.open(json.attachment_url);
|
||||
}
|
||||
: null,
|
||||
time: json.created_at,
|
||||
pfFunc: () => {
|
||||
history.push(`/recruitment/resumedetails?id=${json.id}`);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export async function getAppliers(jobID, page, history) {
|
||||
const res = await axios.get(`/jobs/${jobID}/applyed_users.json`, {
|
||||
params: {
|
||||
page,
|
||||
per_page: 10,
|
||||
},
|
||||
});
|
||||
return [res.data.data.map((json) => transf(json, history)),res.data.count];
|
||||
}
|
||||
|
||||
const applier = {
|
||||
id: 1,
|
||||
name: "张三",
|
||||
job: "开发",
|
||||
sex: "男",
|
||||
age: 20,
|
||||
exp: "1",
|
||||
edu_1: "硕士",
|
||||
edu_2: "统招全日制",
|
||||
dlFunc: () => {
|
||||
window.open("/api/attachments/392664");
|
||||
},
|
||||
time: "2020-01-10",
|
||||
pfFunc: () => {},
|
||||
};
|
||||
|
||||
export const mock = [applier, applier, applier, applier, applier, applier];
|
|
@ -1,26 +0,0 @@
|
|||
export const getCurrCity = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
let script = document.createElement("script");
|
||||
const url = `https://apis.map.qq.com/tools/geolocation/min?key=RPZBZ-CJE3D-YN24W-POI53-IAHPE-5HBB4&referer=educoder`;
|
||||
script.id = url;
|
||||
script.src = url;
|
||||
script.onload = script.onreadystatechange = () => {
|
||||
if (
|
||||
!script.readyState || //这是FF的判断语句,因为ff下没有readyState这个值,IE的readyState肯定有值
|
||||
script.readyState === "loaded" ||
|
||||
script.readyState === "complete" // 这是IE的判断语句
|
||||
) {
|
||||
const geolocation = new window.qq.maps.Geolocation();
|
||||
geolocation.getIpLocation(
|
||||
(position) => {
|
||||
resolve(position.city.replace("市",""));
|
||||
},
|
||||
(err) => {
|
||||
reject("fail");
|
||||
}
|
||||
);
|
||||
}
|
||||
};
|
||||
document.body.appendChild(script);
|
||||
});
|
||||
};
|
|
@ -1,5 +0,0 @@
|
|||
import axios from "axios";
|
||||
|
||||
export const getHotCity = async ()=>{
|
||||
return (await axios.get("/job_data/hot_city")).data.data;
|
||||
}
|
|
@ -1,51 +0,0 @@
|
|||
import axios from "axios";
|
||||
|
||||
function transf(json) {
|
||||
let map = new Map();
|
||||
for (const v of json) {
|
||||
let set = new Set();
|
||||
for (const c of v.children) {
|
||||
set.add(c.name);
|
||||
}
|
||||
map.set(v.name, set);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
export async function getJobCate() {
|
||||
const res = await axios.get(`/job_classifies.json`);
|
||||
return transf(res.data.data);
|
||||
}
|
||||
export async function getJobCate2() {
|
||||
const json = (await axios.get(`/job_classifies.json`)).data.data;
|
||||
let map = new Map();
|
||||
for (const v of json) {
|
||||
let innerMap = new Map();
|
||||
for (const c of v.children) {
|
||||
innerMap.set(c.name, { job_classify_root: v.name, job_classify: c.name });
|
||||
}
|
||||
map.set(v.name, innerMap);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
export const mock = transf([
|
||||
{
|
||||
name: "后端开发",
|
||||
children: [
|
||||
{ name: "Java" },
|
||||
{ name: "C++" },
|
||||
{ name: "Php" },
|
||||
{ name: "Go" },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "前端开发",
|
||||
children: [
|
||||
{ name: "web前端" },
|
||||
{ name: "html5" },
|
||||
{ name: "Php" },
|
||||
{ name: "JavaScript" },
|
||||
],
|
||||
},
|
||||
]);
|
|
@ -1,46 +0,0 @@
|
|||
import axios from 'axios';
|
||||
|
||||
function transf(json) {
|
||||
return {
|
||||
name: json.name,
|
||||
salary: json.salary,
|
||||
company: json.company,
|
||||
city: json.city,
|
||||
exp: json.work_year,
|
||||
class: json.job_category,
|
||||
edu: json.education,
|
||||
num: json.num,
|
||||
time: json.updated_at,
|
||||
address: json.address,
|
||||
desc: json.description,
|
||||
intro: json.introduce
|
||||
};
|
||||
}
|
||||
|
||||
export async function getJobInfo(jobID) {
|
||||
const res = await axios.get(`/jobs/${jobID}.json`);
|
||||
return transf(res.data.job);
|
||||
}
|
||||
|
||||
export async function getJobPlain(jobID){
|
||||
return (await axios.get(`/jobs/${jobID}.json`)).data.job;
|
||||
}
|
||||
|
||||
export async function applyProfile(JobID) {
|
||||
await axios.post(`/jobs/${JobID}/apply`)
|
||||
return;
|
||||
}
|
||||
|
||||
export const mock = {
|
||||
intro: "big comp",
|
||||
address: "开瓶器",
|
||||
desc: "need someone",
|
||||
name: "Java开发",
|
||||
salary: "10-12k",
|
||||
company: "Tencent",
|
||||
city: "Shanghai",
|
||||
class: "全职",
|
||||
edu: "本科",
|
||||
num: 1,
|
||||
time: "2020-2-2"
|
||||
};
|
|
@ -1,8 +0,0 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export async function getProfileLoc(user){
|
||||
if(user){
|
||||
return (await axios.get(`/users/accounts/${user.login}.json`)).data.location_city;
|
||||
}
|
||||
return "长沙";
|
||||
}
|
|
@ -1,6 +0,0 @@
|
|||
import axios from 'axios';
|
||||
|
||||
export async function getResume(){
|
||||
const data = (await axios.get(`/users/resume.json`)).data;
|
||||
return data;
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
import axios from "axios";
|
||||
|
||||
export async function ifHaveResume() {
|
||||
const resp = (await axios.get(`/users/resume.json`)).data;
|
||||
if (resp.status === -2) {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -1,64 +0,0 @@
|
|||
import { Form } from "antd";
|
||||
import { city2province } from './locData';
|
||||
|
||||
export function mapPropsToFields(props) {
|
||||
return {
|
||||
name: Form.createFormField({
|
||||
value: props.name
|
||||
}),
|
||||
class: Form.createFormField({
|
||||
value: { father: props.job_classify_root, son: props.job_classify }
|
||||
}),
|
||||
num: Form.createFormField({
|
||||
value: props.num
|
||||
}),
|
||||
prop: Form.createFormField({
|
||||
value: props.job_category
|
||||
}),
|
||||
city: Form.createFormField({
|
||||
value: [city2province.get(props.city), props.city]
|
||||
}),
|
||||
address: Form.createFormField({
|
||||
value: props.address
|
||||
}),
|
||||
max: Form.createFormField({
|
||||
value: props.max_salary
|
||||
}),
|
||||
min: Form.createFormField({
|
||||
value: props.min_salary
|
||||
}),
|
||||
edu: Form.createFormField({
|
||||
value: props.education
|
||||
}),
|
||||
exp: Form.createFormField({
|
||||
value: props.work_year
|
||||
}),
|
||||
desc: Form.createFormField({
|
||||
value: props.description
|
||||
}),
|
||||
intro: Form.createFormField({
|
||||
value: props.introduce
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
export const mock = {
|
||||
id: 21,
|
||||
name: "招开发人员", //职位
|
||||
salary: "2-10k", //薪资范围
|
||||
min_salary: 2000, //最低薪资
|
||||
max_salary: 10000, // 最高薪资
|
||||
job_classify_root: "前端", // 职位类别一级
|
||||
job_classify: "react 开发", // 职位类别二级
|
||||
company: "长沙智擎",
|
||||
city: "长沙市", //工作地点
|
||||
work_year: "1-3年", // 年限
|
||||
job_category: "全职", //工作性质
|
||||
education: "本科", //学历要求
|
||||
num: 2, //招聘人数
|
||||
updated_at: "2020-04-02", //发布时间
|
||||
address: "长沙岳麓区", //公司地址
|
||||
description: "开发岗位", // 岗位描述
|
||||
introduce: "公司介绍", //公司简介
|
||||
is_applyed: false // 是否已投递过该职位
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
import { Form } from "antd";
|
||||
import _ from "lodash";
|
||||
import moment from "moment";
|
||||
|
||||
function helper(v, verify = _.identity, mapper = _.identity) {
|
||||
if (!v) {
|
||||
return undefined;
|
||||
} else if (!verify(v)) {
|
||||
return undefined;
|
||||
} else {
|
||||
return Form.createFormField({
|
||||
value: mapper(v),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
export function mapPropsToFields(props) {
|
||||
return {
|
||||
name: helper(props.name),
|
||||
sex: helper(props.sex),
|
||||
birth_on: helper(props.birth_on, _.identity, (v) =>
|
||||
moment(v)
|
||||
),
|
||||
logo_url: helper(props.logo_url),
|
||||
job_year: helper(props.job_year, _.identity, (v) => moment(v)),
|
||||
job_position: helper(props.job_position, (v) => v.size != 0),
|
||||
city: helper(props.city, (v) => v.size != 0),
|
||||
salary: helper(props.salary),
|
||||
job_category: helper(props.job_category, (v) => v.size != 0),
|
||||
evaluate: helper(props.evaluate),
|
||||
mobile: helper(props.mobile),
|
||||
attachment_id: helper(props.attachment_id)
|
||||
};
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
import axios from "axios";
|
||||
|
||||
function filed2json(value) {
|
||||
return {
|
||||
job: {
|
||||
name: value.name.trim(),
|
||||
job_classify_root: value.class.father.trim(),
|
||||
job_classify: value.class.son.trim(),
|
||||
num: value.num,
|
||||
job_category: value.prop,
|
||||
city: value.city[1],
|
||||
address: value.address.trim(),
|
||||
max_salary: Number(value.max),
|
||||
min_salary: Number(value.min),
|
||||
education: value.edu,
|
||||
work_year: value.exp,
|
||||
description: value.desc.trim(),
|
||||
introduce: value.intro ? value.intro.trim() : "",
|
||||
},
|
||||
};
|
||||
}
|
||||
export async function submitJobInfo(value) {
|
||||
await axios.post(`/jobs.json`, filed2json(value));
|
||||
return;
|
||||
}
|
||||
export async function updateJobInfo(jobID, value) {
|
||||
return (await axios.put(`/jobs/${jobID}.json`, filed2json(value))).data;
|
||||
}
|
||||
|
||||
export async function applyProfile(JobID) {
|
||||
return (await axios.post(`/jobs/${JobID}/apply.json`)).data;
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
import axios from "axios";
|
||||
import moment from "moment";
|
||||
|
||||
export function processValue(v) {
|
||||
const education = [];
|
||||
const experience = [];
|
||||
const birth_on = v.birth_on.format("YYYY-MM-DD");
|
||||
const job_year = !v.job_year
|
||||
? undefined
|
||||
: v.job_year.format("YYYY-MM-DD");
|
||||
for (const key in v.education) {
|
||||
const obj = { ...v.education[key] };
|
||||
obj.begin_on = obj.begin_on.format("YYYY-MM-DD");
|
||||
obj.end_on = obj.end_on.format("YYYY-MM-DD");
|
||||
obj.major=obj.major.trim();
|
||||
obj.school=obj.school.trim();
|
||||
education.push(obj);
|
||||
}
|
||||
for (const key in v.experience) {
|
||||
const obj = { ...v.experience[key] };
|
||||
obj.begin_on = obj.begin_on.format("YYYY-MM-DD");
|
||||
obj.end_on = obj.end_on.format("YYYY-MM-DD");
|
||||
obj.company = obj.company.trim();
|
||||
obj.desc = obj.desc.trim();
|
||||
experience.push(obj);
|
||||
}
|
||||
const name = !v.name
|
||||
? undefined
|
||||
: v.name.trim();
|
||||
const evaluate = !v.evaluate
|
||||
? undefined
|
||||
: v.evaluate.trim();
|
||||
return {
|
||||
resume: { ...v,evaluate, name,education, experience, birth_on, job_year },
|
||||
};
|
||||
}
|
||||
|
||||
export async function sumitResume(v) {
|
||||
const json = processValue(v);
|
||||
await axios.post(`/resumes.json`, json);
|
||||
return;
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
import axios from "axios";
|
||||
import { processValue } from "./sumitResume";
|
||||
|
||||
export async function updateResume(v) {
|
||||
const json = processValue(v);
|
||||
await axios.put("/users/update_resume.json", json);
|
||||
return;
|
||||
}
|
|
@ -1,28 +0,0 @@
|
|||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
import { Row, Col } from "antd";
|
||||
import { config } from "./config";
|
||||
|
||||
const Box = styled(Row)`
|
||||
width: 100%;
|
||||
height: 57px;
|
||||
background: #fafafa;
|
||||
font-size: 16px;
|
||||
font-family: MicrosoftYaHeiSemibold;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
const FlexBox = ({ children }) => (
|
||||
<Box type="flex" justify="space-around" align="middle">
|
||||
{children}
|
||||
</Box>
|
||||
);
|
||||
|
||||
export default () => (
|
||||
<FlexBox>
|
||||
{config.map((i) => (
|
||||
<Col span={i[0]}>{i[1]}</Col>
|
||||
))}
|
||||
</FlexBox>
|
||||
);
|
|
@ -1,71 +0,0 @@
|
|||
import React from "react";
|
||||
import styled from "styled-components";
|
||||
import { Row, Col, Tooltip } from "antd";
|
||||
import { TextButton } from "../util/Button";
|
||||
|
||||
const Box = styled(Row)`
|
||||
font-size: 14px;
|
||||
font-family: MicrosoftYaHei;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
`;
|
||||
const FlexBox = ({ children }) => (
|
||||
<Box type="flex" justify="space-around" align="middle">
|
||||
{children}
|
||||
</Box>
|
||||
);
|
||||
const FlexRow = ({ children }) => (
|
||||
<Row type="flex" justify="space-around" align="middle">
|
||||
{children}
|
||||
</Row>
|
||||
);
|
||||
|
||||
const Edu = styled.div`
|
||||
div {
|
||||
font-size: 12px;
|
||||
color: rgba(136, 136, 136, 1);
|
||||
}
|
||||
`;
|
||||
|
||||
const Download = ({ onClick }) => {
|
||||
if (onClick) {
|
||||
return (
|
||||
<TextButton color="rgba(66,179,102,1)" onClick={onClick}>
|
||||
下载简历
|
||||
</TextButton>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Tooltip title="求职者未上传简历">
|
||||
<TextButton color="rgba(136,136,136,1)">下载简历</TextButton>
|
||||
</Tooltip>
|
||||
);
|
||||
};
|
||||
|
||||
export default ({ data }) => {
|
||||
return (
|
||||
<FlexBox>
|
||||
<Col span={3}>{data.name}</Col>
|
||||
<Col span={3}>{data.job}</Col>
|
||||
<Col span={2}>{data.sex}</Col>
|
||||
<Col span={2}>{data.age}</Col>
|
||||
<Col span={2}>{data.exp ? data.exp + "年" : "-"}</Col>
|
||||
<Col span={4}>
|
||||
<Edu>
|
||||
{data.edu_1}
|
||||
<div>({data.edu_2})</div>
|
||||
</Edu>
|
||||
</Col>
|
||||
<Col span={4}>{data.time}</Col>
|
||||
<Col span={4}>
|
||||
<FlexRow>
|
||||
<TextButton color="rgba(76,172,255,1)" onClick={data.pfFunc}>
|
||||
查看
|
||||
</TextButton>
|
||||
<Download onClick={data.dlFunc}></Download>
|
||||
</FlexRow>
|
||||
</Col>
|
||||
</FlexBox>
|
||||
);
|
||||
};
|
|
@ -1,36 +0,0 @@
|
|||
import React, { useCallback } from "react";
|
||||
import Item from "./Item";
|
||||
import styled from "styled-components";
|
||||
|
||||
const Divider = styled.div`
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
border-top: 1px solid #EEEEEE;
|
||||
margin-bottom: 6px;
|
||||
margin-top: 6px;
|
||||
`;
|
||||
const Margin = styled.div`
|
||||
height: 6px;
|
||||
`;
|
||||
const Widget = ({ data }) => {
|
||||
let isFirst = true;
|
||||
const isEnd = useCallback((idx) => idx === data.length - 1, [data]);
|
||||
const lst = [];
|
||||
data.forEach((item, idx) => {
|
||||
if (isEnd(idx)) {
|
||||
lst.push(<Item data={item} />);
|
||||
lst.push(<Margin />);
|
||||
} else if (isFirst) {
|
||||
lst.push(<Margin />);
|
||||
lst.push(<Item data={item} />);
|
||||
lst.push(<Divider />);
|
||||
} else {
|
||||
lst.push(<Item data={item} />);
|
||||
lst.push(<Divider />);
|
||||
}
|
||||
isFirst = false;
|
||||
});
|
||||
return <React.Fragment>{lst}</React.Fragment>;
|
||||
};
|
||||
|
||||
export default Widget;
|
|
@ -1,10 +0,0 @@
|
|||
export const config = [
|
||||
[3, "姓名"],
|
||||
[3, "职位名称"],
|
||||
[2, "性别"],
|
||||
[2, "年龄"],
|
||||
[2, "工作年限"],
|
||||
[4, "文化程度"],
|
||||
[4, "投递时间"],
|
||||
[4, "操作"]
|
||||
];
|
|
@ -1,22 +0,0 @@
|
|||
import React from "react";
|
||||
import ItemBase from "./ItemBase";
|
||||
import loc from "./icon/loc.png";
|
||||
import Icon from "./icon/Icon";
|
||||
import styled from "styled-components";
|
||||
|
||||
const Address = styled.div`
|
||||
font-size: 16px;
|
||||
font-family: MicrosoftYaHei;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
overflow-wrap: anywhere;
|
||||
`;
|
||||
|
||||
const Widget = ({ address }) => {
|
||||
const icon = <Icon src={loc} width="26px" height="24px" />;
|
||||
return (
|
||||
<ItemBase icon={icon} title="公司地址">
|
||||
<Address>{address}</Address>
|
||||
</ItemBase>
|
||||
);
|
||||
};
|
||||
export default Widget;
|
|
@ -1,31 +0,0 @@
|
|||
import React from "react";
|
||||
import com from "./icon/com.png";
|
||||
import ItemBase from "./ItemBase";
|
||||
import Icon from "./icon/Icon";
|
||||
import styled from "styled-components";
|
||||
|
||||
const Name = styled.div`
|
||||
font-size: 16px;
|
||||
font-family: MicrosoftYaHei;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
margin-bottom:10px;
|
||||
`;
|
||||
|
||||
const Intro = styled.div`
|
||||
font-size: 14px;
|
||||
font-family: MicrosoftYaHei;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
white-space: pre;
|
||||
line-height:20px;
|
||||
overflow-wrap: anywhere;
|
||||
`;
|
||||
|
||||
export default ({ company, intro }) => {
|
||||
const icon = <Icon src={com} width="28px" height="21px" />;
|
||||
return (
|
||||
<ItemBase icon={icon} title="公司介绍">
|
||||
<Name>{company}</Name>
|
||||
<Intro>{intro}</Intro>
|
||||
</ItemBase>
|
||||
);
|
||||
};
|
|
@ -1,26 +0,0 @@
|
|||
import React, { useCallback } from "react";
|
||||
import Modal from "../util/Modal";
|
||||
import { CenterBtnGrp, OkBtn, CancelBtn } from "../util/GeneralButton";
|
||||
import styled from "styled-components";
|
||||
|
||||
const Tip = styled.div`
|
||||
font-size: 16px;
|
||||
margin: 40px auto;
|
||||
text-align: center;
|
||||
`;
|
||||
|
||||
export default ({ onCancel, history, jobId, ...props }) => {
|
||||
const onOk = useCallback(() => {
|
||||
onCancel();
|
||||
history.push(`/recruitment/jobdetail/addresume/${jobId}`);
|
||||
}, []);
|
||||
return (
|
||||
<Modal title="提示" {...props} getContainer={false}>
|
||||
<Tip>你没有简历,是否前往创建简历?</Tip>
|
||||
<CenterBtnGrp>
|
||||
<CancelBtn onClick={onCancel} />
|
||||
<OkBtn onClick={onOk} />
|
||||
</CenterBtnGrp>
|
||||
</Modal>
|
||||
);
|
||||
};
|
|
@ -1,69 +0,0 @@
|
|||
import React from "react";
|
||||
import styled from 'styled-components';
|
||||
import { Divider } from 'antd';
|
||||
import { BtnBase } from "../util/Button";
|
||||
import { betweenMixin } from "../util/cssMixin";
|
||||
|
||||
const BetweenBox = styled.div`
|
||||
${betweenMixin}
|
||||
padding-bottom:30px;
|
||||
`;
|
||||
const Button = styled(BtnBase)`
|
||||
width:150px;
|
||||
border-radius:5px;
|
||||
background:rgba(76,172,255,1);
|
||||
color:rgba(255,255,255,1);
|
||||
font-size:16px;
|
||||
font-family:MicrosoftYaHeiSemibold;
|
||||
margin-top:60px;
|
||||
`;
|
||||
const ApplyBtn = (props) => <Button {...props} height="50px" />;
|
||||
|
||||
const Title = styled.div`
|
||||
font-size:28px;
|
||||
font-family:MicrosoftYaHeiSemibold;
|
||||
color:rgba(51,51,51,1);
|
||||
margin-bottom:15px;
|
||||
`;
|
||||
const Salary = styled.div`
|
||||
font-size:20px;
|
||||
font-family:MicrosoftYaHeiSemibold;
|
||||
color:rgba(251,72,72,1);
|
||||
margin-bottom:10px;
|
||||
`;
|
||||
const Company = styled.div`
|
||||
font-size:16px;
|
||||
font-family:MicrosoftYaHei;
|
||||
color:rgba(51,51,51,1);
|
||||
margin-bottom:10px;
|
||||
`;
|
||||
const Detail = styled.span`
|
||||
font-size:14px;
|
||||
font-family:MicrosoftYaHeiLight;
|
||||
color:rgba(136,136,136,1);
|
||||
`;
|
||||
|
||||
const Widget = ({ data, apply }) => {
|
||||
return <BetweenBox>
|
||||
<div>
|
||||
<Title>{data.name}</Title>
|
||||
<Salary>{data.salary}/月</Salary>
|
||||
<Company>{data.company}</Company>
|
||||
<div>
|
||||
<Detail>{data.city}</Detail>
|
||||
<Divider type="vertical" />
|
||||
<Detail>{data.class}</Detail>
|
||||
<Divider type="vertical" />
|
||||
<Detail>{data.edu}</Detail>
|
||||
<Divider type="vertical" />
|
||||
<Detail>招{data.num}人</Detail>
|
||||
<Divider type="vertical" />
|
||||
<Detail>{data.time}发布</Detail>
|
||||
</div>
|
||||
</div>
|
||||
<ApplyBtn onClick={apply}>申请职位</ApplyBtn>
|
||||
</BetweenBox>;
|
||||
}
|
||||
|
||||
|
||||
export default Widget;
|
|
@ -1,42 +0,0 @@
|
|||
import React from "react";
|
||||
import styled from 'styled-components';
|
||||
|
||||
const Divider = styled.div`
|
||||
height:1px;
|
||||
border-top:1px solid #FAFAFA;
|
||||
flex-grow:1;
|
||||
`;
|
||||
const Title = styled.div`
|
||||
font-size:18px;
|
||||
font-family:MicrosoftYaHeiSemibold;
|
||||
color:rgba(51,51,51,1);
|
||||
margin-right:20px;
|
||||
`;
|
||||
const IconBox = styled.div`
|
||||
width:28px;
|
||||
height:24px;
|
||||
margin-right:5px;
|
||||
display:flex;
|
||||
justify-content:start;
|
||||
align-items:center;
|
||||
`;
|
||||
const Header = styled.div`
|
||||
display:flex;
|
||||
margin:10px auto;
|
||||
align-items:center;
|
||||
`;
|
||||
const Box = styled.div`
|
||||
margin-top:40px;
|
||||
margin-bottom:40px;
|
||||
`;
|
||||
|
||||
export default ({ icon, title, children }) => {
|
||||
return <Box>
|
||||
<Header>
|
||||
<IconBox>{icon}</IconBox>
|
||||
<Title>{title}</Title>
|
||||
<Divider/>
|
||||
</Header>
|
||||
{children}
|
||||
</Box>;
|
||||
};
|
|
@ -1,22 +0,0 @@
|
|||
import React from "react";
|
||||
import job from "./icon/job.png";
|
||||
import styled from "styled-components";
|
||||
import ItemBase from "./ItemBase";
|
||||
import Icon from "./icon/Icon";
|
||||
|
||||
const Info = styled.div`
|
||||
font-size: 14px;
|
||||
font-family: MicrosoftYaHei;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
white-space: pre;
|
||||
line-height:25px;
|
||||
overflow-wrap: anywhere;
|
||||
`;
|
||||
export default ({ desc }) => {
|
||||
const icon = <Icon src={job} width="20px" height="23px" />;
|
||||
return (
|
||||
<ItemBase icon={icon} title="职位要求">
|
||||
<Info>{desc}</Info>
|
||||
</ItemBase>
|
||||
);
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
import styled from 'styled-components';
|
||||
|
||||
export default styled.img`
|
||||
display:block;
|
||||
width:${p=>p.width};
|
||||
height:${p=>p.height};
|
||||
`;
|
Binary file not shown.
Before Width: | Height: | Size: 735 B |
Binary file not shown.
Before Width: | Height: | Size: 322 B |
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB |
|
@ -1,47 +0,0 @@
|
|||
import React, { useRef, useCallback } from "react";
|
||||
import styled from "styled-components";
|
||||
import JobForm from "./JobForm";
|
||||
import { CenterBtnGrp, SaveBtn, CancelBtn } from "../util/GeneralButton";
|
||||
|
||||
const Background = styled.div`
|
||||
width: 100%;
|
||||
background: rgba(245, 246, 249, 1);
|
||||
min-height: 100vh;
|
||||
padding: 20px;
|
||||
padding-bottom: 70px;
|
||||
`;
|
||||
const Content = styled.div`
|
||||
width: 1200px;
|
||||
padding: 40px;
|
||||
background: rgba(255, 255, 255, 1);
|
||||
border-radius: 2px;
|
||||
margin: 0 auto;
|
||||
margin-bottom: 40px;
|
||||
`;
|
||||
const Margin = styled.div`
|
||||
height:80px;
|
||||
`;
|
||||
|
||||
export default ({ data, submit, back }) => {
|
||||
const formRef = useRef(null);
|
||||
const onOk = useCallback(() => {
|
||||
formRef.current.validateFieldsAndScroll((e, v) => {
|
||||
if (e) {
|
||||
return;
|
||||
}
|
||||
submit(v);
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<Background>
|
||||
<Content>
|
||||
<JobForm ref={formRef} {...data}></JobForm>
|
||||
</Content>
|
||||
<CenterBtnGrp>
|
||||
<CancelBtn onClick={back} />
|
||||
<SaveBtn onClick={onOk} />
|
||||
</CenterBtnGrp>
|
||||
<Margin/>
|
||||
</Background>
|
||||
);
|
||||
};
|
|
@ -1,196 +0,0 @@
|
|||
import React, { useCallback } from "react";
|
||||
import { Form, Input, InputNumber, Radio, Row, Select, Cascader } from "antd";
|
||||
import InputWithLen from "./widget/InputWithLen";
|
||||
import TextArea from "./widget/TextArea";
|
||||
import CateSelect from "./widget/CateSelect";
|
||||
import { locData } from "../data/locData";
|
||||
import { mapPropsToFields } from "../data/mapJobData";
|
||||
import styled from "styled-components";
|
||||
|
||||
const Divider = styled.div`
|
||||
position: relative;
|
||||
top: 20px;
|
||||
border: 1px solid #bbbbbb;
|
||||
width: 30px;
|
||||
height: 1px;
|
||||
margin: 0 10px;
|
||||
`;
|
||||
const Label = styled.div`
|
||||
&::before{
|
||||
content:${p=>p.required?'"*"':'""'};
|
||||
color:${p=>p.required?"red":"black"};
|
||||
}
|
||||
&::after{
|
||||
content:":";
|
||||
}
|
||||
margin-bottom:5px;
|
||||
font-size: 16px;
|
||||
font-family: MicrosoftYaHeiSemibold;
|
||||
color: rgba(51, 51, 51, 1);
|
||||
`;
|
||||
|
||||
export default Form.create({ mapPropsToFields })(({ form }) => {
|
||||
const { getFieldDecorator } = form;
|
||||
const helper = useCallback(
|
||||
(label, name, rules, widget, isRequired = true) => (
|
||||
<React.Fragment>
|
||||
<Label required={isRequired}>{label}</Label>
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true })(widget)}
|
||||
</Form.Item>
|
||||
</React.Fragment>
|
||||
),
|
||||
[]
|
||||
);
|
||||
const jobValidator = useCallback((r, v, cb) => {
|
||||
if (!v) {
|
||||
cb("请选择职位类别");
|
||||
} else if (!v.father || !v.son) {
|
||||
cb("请选择职位类别");
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
}, []);
|
||||
const greatValidator = useCallback((r, v, cb) => {
|
||||
if (Number(v) >= Number(form.getFieldValue("min"))) {
|
||||
cb();
|
||||
} else {
|
||||
cb("薪酬范围不正确");
|
||||
}
|
||||
}, []);
|
||||
const cityValidator = useCallback((r, v, cb) => {
|
||||
if (!v[1]) {
|
||||
cb("请选择城市");
|
||||
} else {
|
||||
cb();
|
||||
}
|
||||
}, []);
|
||||
return (
|
||||
<Form>
|
||||
{helper(
|
||||
"职位名称",
|
||||
"name",
|
||||
[
|
||||
{ required: true, message: "请输入职位名称" },
|
||||
{ max: 60, message: "超过60字符" },
|
||||
],
|
||||
<InputWithLen maxLen={60} placeholder="请输入职位名称" />
|
||||
)}
|
||||
{helper(
|
||||
"职位类别",
|
||||
"class",
|
||||
[{ validator: jobValidator }],
|
||||
<CateSelect />
|
||||
)}
|
||||
{helper(
|
||||
"招聘人数",
|
||||
"num",
|
||||
[],
|
||||
<InputNumber placeholder="请输入招聘人数" min={0} style={{width:"252px"}}/>,
|
||||
false
|
||||
)}
|
||||
{helper(
|
||||
"工作性质",
|
||||
"prop",
|
||||
[{ required: true, message: "请选择工作性质" }],
|
||||
<Radio.Group>
|
||||
{["全职", "兼职", "实习"].map((s) => (
|
||||
<Radio value={s}>{s}</Radio>
|
||||
))}
|
||||
</Radio.Group>
|
||||
)}
|
||||
<Label required>工作地址</Label>
|
||||
<Row type="flex">
|
||||
<Form.Item>
|
||||
{getFieldDecorator("city", {
|
||||
rules: [{ validator: cityValidator }],
|
||||
})(<Cascader placeholder="请选择城市" options={locData} style={{width:"191px",marginRight:"15px"}}/>)}
|
||||
</Form.Item>
|
||||
<Form.Item sty>
|
||||
{getFieldDecorator("address", {
|
||||
rules: [
|
||||
{ required: true, message: "请输入详细地址" },
|
||||
{ max: 60, message: "超过60字符" },
|
||||
],
|
||||
validateFirst: true,
|
||||
})(<Input placeholder="请输入详细地址" style={{width:"910px"}}/>)}
|
||||
</Form.Item>
|
||||
</Row>
|
||||
<Label>月薪范围</Label>
|
||||
<Row type="flex">
|
||||
<Form.Item>
|
||||
{getFieldDecorator("min", {
|
||||
rules: [
|
||||
{ pattern: /^\s*\d+\s*$/, message: "请输入数字" },
|
||||
{ required: true, message: "请输入最低薪酬" },
|
||||
],
|
||||
validateFirst: true,
|
||||
})(<Input placeholder="最低" suffix="元" style={{width:"252px"}}/>)}
|
||||
</Form.Item>
|
||||
<Divider />
|
||||
<Form.Item>
|
||||
{getFieldDecorator("max", {
|
||||
rules: [
|
||||
{ pattern: /^\s*\d+\s*$/, message: "请输入数字" },
|
||||
{ required: true, message: "请输入最高薪酬" },
|
||||
{ validator: greatValidator },
|
||||
],
|
||||
validateFirst: true,
|
||||
})(<Input placeholder="最高" suffix="元" style={{width:"252px"}}/>)}
|
||||
</Form.Item>
|
||||
</Row>
|
||||
{helper(
|
||||
"最低学历",
|
||||
"edu",
|
||||
[{ required: true, message: "请选择最低学历" }],
|
||||
<Select style={{width:"252px"}}>
|
||||
{[
|
||||
"学历不限",
|
||||
"本科",
|
||||
"硕士",
|
||||
"博士",
|
||||
"大专",
|
||||
"中技",
|
||||
"中专",
|
||||
"高中",
|
||||
].map((s) => (
|
||||
<Select.Option value={s}>{s}</Select.Option>
|
||||
))}
|
||||
</Select>
|
||||
)}
|
||||
{helper(
|
||||
"工作年限",
|
||||
"exp",
|
||||
[{ required: true, message: "请选择工作年限" }],
|
||||
<Select style={{width:"252px"}}>
|
||||
{["经验不限", "1年以下", "1-3年", "3-5年", "5-10年", "10年以上"].map(
|
||||
(s) => (
|
||||
<Select.Option value={s}>{s}</Select.Option>
|
||||
)
|
||||
)}
|
||||
</Select>
|
||||
)}
|
||||
{helper(
|
||||
"职位描述",
|
||||
"desc",
|
||||
[
|
||||
{ required: true, message: "请输入职位描述" },
|
||||
{ max: 5000, message: "超过5000字符" },
|
||||
],
|
||||
<TextArea
|
||||
placeholder="请输入职位描述"
|
||||
autoSize={{ minRows: 6, maxRows: 6 }}
|
||||
></TextArea>
|
||||
)}
|
||||
{helper(
|
||||
"公司介绍",
|
||||
"intro",
|
||||
[{ max: 5000, message: "超过5000字符" }],
|
||||
<TextArea
|
||||
placeholder="请输入公司介绍"
|
||||
autoSize={{ minRows: 6, maxRows: 6 }}
|
||||
></TextArea>
|
||||
)}
|
||||
</Form>
|
||||
);
|
||||
});
|
|
@ -1,51 +0,0 @@
|
|||
import React, { useCallback } from "react";
|
||||
import { Input, Form } from "antd";
|
||||
import Modal from "../../util/Modal";
|
||||
import { CenterBtnGrp, OkBtn, CancelBtn } from "../../util/GeneralButton";
|
||||
|
||||
const InnerForm = Form.create()(({ form, onCancel, setValue }) => {
|
||||
const { getFieldDecorator, validateFields } = form;
|
||||
const rules = [
|
||||
{ required: true, message: "请输入职业分类" },
|
||||
{ max: 10, message: "超过10字符" },
|
||||
{ whitespace: true, message: "不能全空" },
|
||||
];
|
||||
const formLayout = {
|
||||
labelCol: { span: 5 },
|
||||
wrapperCol: { span: 17 },
|
||||
};
|
||||
const onOk = useCallback(() => {
|
||||
validateFields((e, v) => {
|
||||
if (e) {
|
||||
return;
|
||||
}
|
||||
setValue(v);
|
||||
onCancel();
|
||||
});
|
||||
}, []);
|
||||
return (
|
||||
<Form {...formLayout} style={{ marginTop: "20px" }}>
|
||||
<Form.Item label="父级分类">
|
||||
{getFieldDecorator("father", { rules })(
|
||||
<Input placeholder="请输入父级分类" />
|
||||
)}
|
||||
</Form.Item>
|
||||
<Form.Item label="子级别分类">
|
||||
{getFieldDecorator("son", { rules })(
|
||||
<Input placeholder="请输入子级分类" />
|
||||
)}
|
||||
</Form.Item>
|
||||
<CenterBtnGrp>
|
||||
<CancelBtn onClick={onCancel} />
|
||||
<OkBtn onClick={onOk} />
|
||||
</CenterBtnGrp>
|
||||
</Form>
|
||||
);
|
||||
});
|
||||
|
||||
//visible, setValue, onCancel
|
||||
export default ({ setValue, ...props }) => (
|
||||
<Modal {...props} width="600px" title="新增职业类别" getContainer={false}>
|
||||
<InnerForm setValue={setValue} onCancel={props.onCancel} />
|
||||
</Modal>
|
||||
);
|
|
@ -1,66 +0,0 @@
|
|||
import { Row, Col } from 'antd';
|
||||
import React, { useState, useCallback, useRef, useEffect } from 'react';
|
||||
import Loading from '../../util/Loading';
|
||||
import { getJobCate } from '../../data/getJobCate';
|
||||
import Modal from '../../util/Modal';
|
||||
import { CenterBtnGrp, OkBtn, CancelBtn } from '../../util/GeneralButton';
|
||||
import FatherNav from './selectWidget/FatherNav';
|
||||
import SonArea from './selectWidget/SonArea';
|
||||
|
||||
|
||||
//visible, setValue, onCancel
|
||||
export default ({ setValue, ...props }) => {
|
||||
const [isloaded, setLoaded] = useState(false);
|
||||
const dataRef = useRef(null);
|
||||
useEffect(() => {
|
||||
const f = async () => {
|
||||
const map = await getJobCate();
|
||||
//const map = mock;
|
||||
dataRef.current = map;
|
||||
setLoaded(true);
|
||||
}
|
||||
f();
|
||||
return () => { setLoaded(false); };
|
||||
}, []);
|
||||
const [selectedCate, setCate] = useState(null);
|
||||
const [selectedJob, setJob] = useState(null);
|
||||
const selectCate = useCallback(text => {
|
||||
if (text === selectedCate) {
|
||||
return;
|
||||
}
|
||||
setCate(text);
|
||||
setJob(null);
|
||||
}, []);
|
||||
const selectJob = useCallback(text => {
|
||||
if (text === selectedJob) {
|
||||
return;
|
||||
}
|
||||
setJob(text);
|
||||
}, []);
|
||||
const onOk = useCallback(() => {
|
||||
if (selectedJob === null) {
|
||||
return;
|
||||
}
|
||||
props.onCancel();
|
||||
setValue({ father: selectedCate, son: selectedJob });
|
||||
}, [selectedCate, selectedJob]);
|
||||
const Content = <Row style={{ height: "572px" }}>
|
||||
<Col span={6} style={{ height: "100%" }}>
|
||||
<FatherNav data={dataRef.current} selectCate={selectCate} selectedCate={selectedCate}></FatherNav>
|
||||
</Col>
|
||||
<Col span={18} style={{ height: "100%" }}>
|
||||
<div style={{ height: "490px" }}>
|
||||
<SonArea data={selectedCate ? dataRef.current.get(selectedCate) : new Set()}
|
||||
selectedJob={selectedJob}
|
||||
selectJob={selectJob} />
|
||||
</div>
|
||||
<CenterBtnGrp>
|
||||
<CancelBtn onClick={props.onCancel} />
|
||||
<OkBtn onClick={onOk} />
|
||||
</CenterBtnGrp>
|
||||
</Col>
|
||||
</Row>;
|
||||
return <Modal title="选择职位类别" width="846px" {...props} getContainer={false}>
|
||||
{!isloaded ? <Loading /> : Content}
|
||||
</Modal>;
|
||||
};
|
|
@ -1,29 +0,0 @@
|
|||
import styled from 'styled-components';
|
||||
import React from 'react';
|
||||
import { Icon as AdIcon } from "antd";
|
||||
import { pointerMixin, betweenMixin } from "../../../util/cssMixin";
|
||||
|
||||
const Item = styled.div`
|
||||
height:57px;
|
||||
background:${p => p.isSelected ? "rgba(241,241,241,1)" : "transparent"};
|
||||
${pointerMixin}
|
||||
${betweenMixin}
|
||||
`;
|
||||
const Name = styled.div`
|
||||
color:rgba(51,51,51,1);
|
||||
font-size:16px;
|
||||
font-family:MicrosoftYaHei;
|
||||
margin-left:30px;
|
||||
`;
|
||||
const Icon = styled(AdIcon)`
|
||||
display:block;
|
||||
color:rgba(187,187,187,1);
|
||||
margin-right:20px;
|
||||
`;
|
||||
|
||||
//onClick, isSelected
|
||||
export default ({ children, ...props }) =>
|
||||
<Item {...props}>
|
||||
<Name>{children}</Name>
|
||||
<Icon type="right" />
|
||||
</Item>;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue