Merge branch 'pre_dev_military' of http://106.75.45.236:3000/Gitlink/forgeplus-react into dev_military_admin
|
@ -13,7 +13,7 @@ export function getImageUrl(path) {
|
|||
// const local = 'http://localhost:3000'
|
||||
// const local = 'http://39.105.176.215:49999';
|
||||
const local = 'http://111.8.36.180:8000';
|
||||
path && !path.startsWith('/') && (path = '/'.concat(path));
|
||||
path && !path.startsWith('/') && !path.startsWith('http') && (path = '/'.concat(path));
|
||||
if (isDev) {
|
||||
return `${local}${path}`
|
||||
}
|
||||
|
|
|
@ -6,12 +6,21 @@ import RenderHtml from '../../../components/render-html';
|
|||
import cookie from 'react-cookies';
|
||||
// import axios from 'axios';
|
||||
|
||||
function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice}){
|
||||
function SystemNotice({showNotice,system_notification,history,login,hideSystemNotice,location}){
|
||||
const [ visible , setVisible ] = useState(false);
|
||||
useEffect(()=>{
|
||||
if(system_notification && !cookie.load('notice_stage')){
|
||||
setVisible(true);
|
||||
let pathname=history.location.pathname;
|
||||
let isCompetition=pathname.indexOf('/competition/')>-1;
|
||||
let openNotice=true;
|
||||
// 非启智竞赛路由不展示启智通知
|
||||
if(isCompetition&&system_notification.subject.indexOf('启智')&&!(pathname.indexOf('/competition/qz2022')>-1)){
|
||||
openNotice=false;
|
||||
}
|
||||
|
||||
openNotice&&setVisible(true);
|
||||
}
|
||||
|
||||
},[system_notification,history.location])
|
||||
|
||||
// useEffect(()=>{
|
||||
|
|
|
@ -2,8 +2,9 @@ import React, { memo, useEffect, useState } from 'react';
|
|||
import { Button, Modal } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import bg from '../img/modal.png';
|
||||
import bg_local from '../img/modal_local.png';
|
||||
// import bg from '../img/modal.png';
|
||||
import bg from '../img/ckds.jpg';
|
||||
// import bg_local from '../img/modal_local.png';
|
||||
import './index.scss';
|
||||
|
||||
|
||||
|
@ -37,9 +38,9 @@ function QzModal() {
|
|||
width='728px'
|
||||
maskClosable={false}
|
||||
>
|
||||
<img src={window.location.href.indexOf('osredm.jk')>-1?bg_local: bg} />
|
||||
|
||||
<Link to="/competition/qz2022" className="qz-btn">查看详情</Link>
|
||||
{/* <img src={window.location.href.indexOf('osredm.jk')>-1?bg_local: bg} /> */}
|
||||
<img src={bg} />
|
||||
<a target="_blank" href="https://ckds.osredm.com" className="qz-btn">查看详情</a>
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
img {
|
||||
border-radius: 2px;
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,14 +38,14 @@ function SecondSection() {
|
|||
<Slider {...setting}>
|
||||
|
||||
<div>
|
||||
<Link to="/competition/qz2022" className="competition-slide-item" >
|
||||
<Link to="/competition/qz2022/notice" className="competition-slide-item" >
|
||||
<img className='competition-notice' src={notice} />
|
||||
<img className='competition-text' src={text} />
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<Link to="/competition/qz2022" className="competition-slide-item" >
|
||||
<Link to="/competition/qz2022/notice" className="competition-slide-item" >
|
||||
<img className='competition-notice' src={notice} />
|
||||
<img className='competition-text' src={text} />
|
||||
</Link>
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
.competition-slide-item {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 2.6vw;
|
||||
}
|
||||
|
||||
|
@ -18,7 +19,8 @@
|
|||
}
|
||||
|
||||
.competition-text {
|
||||
width: 23.5vw;
|
||||
// width: 23.5vw;
|
||||
height: 2vw;
|
||||
}
|
||||
|
||||
@keyframes ballRotation {
|
||||
|
|
After Width: | Height: | Size: 152 KiB |
Before Width: | Height: | Size: 170 KiB After Width: | Height: | Size: 8.5 KiB |
|
@ -21,6 +21,9 @@ export default Form.create()(({ form, match, history, current_user, showNotifica
|
|||
const [plainOptions, setPlainOptions] = useState([]);
|
||||
const [admin_data, setAdmin_data] = useState([]);
|
||||
|
||||
const [contentMd,setContentMd]=useState(false);
|
||||
const [guideMd,setGuideMd]=useState(false);
|
||||
|
||||
let tableRef = useRef();
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -49,27 +52,29 @@ export default Form.create()(({ form, match, history, current_user, showNotifica
|
|||
// manager_ids: details.manager_ids,
|
||||
};
|
||||
setFieldsValue(initValue);
|
||||
setContent(details.content);
|
||||
setGuide(details.guide);
|
||||
setAbout_us(details.about_us);
|
||||
setTimeout(() => {
|
||||
setContent(details.content);
|
||||
setContentMd(true);
|
||||
}, 200);
|
||||
setTimeout(() => {
|
||||
setGuide(details.guide);
|
||||
}, 800);
|
||||
setGuideMd(true);
|
||||
}, 300);
|
||||
setTimeout(() => {
|
||||
setAbout_us(details.about_us);
|
||||
document.querySelector('#title').focus();
|
||||
}, 1400);
|
||||
setLoading(false);
|
||||
}, 600);
|
||||
if (details.is_local) {
|
||||
zonesArr(details.zones_local);
|
||||
} else {
|
||||
zonesArr(details.zones);
|
||||
}
|
||||
setAdmin_data(Array.isArray(details.admin_data) ? details.admin_data : []);
|
||||
}else{
|
||||
setLoading(false);
|
||||
}
|
||||
setLoading(false);
|
||||
}).catch((error) => {
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
})
|
||||
}
|
||||
}, [id])
|
||||
|
@ -314,26 +319,26 @@ export default Form.create()(({ form, match, history, current_user, showNotifica
|
|||
</Form.Item>
|
||||
|
||||
<Form.Item className="mb0 mdEditor" label={'大赛介绍'}>
|
||||
<MDEditor
|
||||
{contentMd&&<MDEditor
|
||||
placeholder={"请输入大赛介绍"}
|
||||
height={500}
|
||||
mdID={"competition-content"}
|
||||
initValue={content}
|
||||
onChange={(value) => { onContentChange(value, 'content') }}
|
||||
/>
|
||||
/>}
|
||||
{getFieldDecorator("content", {
|
||||
rules: [{ required: true, message: "请输入大赛介绍" }],
|
||||
})(<Input style={{ display: "none" }} />)}
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item className="mb0 mdEditor" label={'赛事指南'}>
|
||||
<MDEditor
|
||||
{guideMd&&<MDEditor
|
||||
placeholder={"请输入赛事指南"}
|
||||
height={500}
|
||||
mdID={"competition-guide"}
|
||||
initValue={guide}
|
||||
onChange={(value) => { onContentChange(value, 'guide') }}
|
||||
/>
|
||||
/>}
|
||||
{getFieldDecorator("guide", {
|
||||
rules: [{ required: true, message: "请输入赛事指南" }],
|
||||
})(<Input style={{ display: "none" }} />)}
|
||||
|
|
|
@ -44,9 +44,6 @@ export default (props) => {
|
|||
sessionStorage.setItem("current_user", JSON.stringify(current_user));
|
||||
}, [current_user.login]);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
}, [])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -69,7 +66,6 @@ export default (props) => {
|
|||
}
|
||||
|
||||
function itemClick(item) {
|
||||
console.log(111);
|
||||
let myIframe = document.getElementById("iframe");
|
||||
if (myIframe) {
|
||||
myIframe.height = 'auto';
|
||||
|
@ -112,14 +108,36 @@ export default (props) => {
|
|||
try {
|
||||
let myIframe = document.getElementById("iframe");
|
||||
if (myIframe.contentDocument) {
|
||||
myIframe.height = myIframe.contentDocument.querySelector('.content').clientHeight + 60;
|
||||
myIframe.height = myIframe.contentDocument.querySelector('.content').clientHeight + 260;
|
||||
myIframe.contentDocument.querySelector('.admin-body-container').style.overflow = 'hidden';
|
||||
// let MutationObserver =window.MutationObserver ;
|
||||
|
||||
// // let MutationObserver =myIframe.contentWindow.MutationObserver || myIframe.contentWindow.WebKitMutationObserver || myIframe.contentWindow.MozMutationObserver;
|
||||
// let observer = new MutationObserver(function (mutations) {
|
||||
// console.log("asdf", mutations);
|
||||
// });
|
||||
// observer.observe(myIframe.contentDocument.querySelector('.content'), {
|
||||
// attributes: true,
|
||||
// attributeFilter:['style'],
|
||||
// attributeOldValue:true
|
||||
// });
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
// useEffect(() => {
|
||||
// try {
|
||||
// document.getElementById("iframe").contentDocument.querySelector('.content').addEventListener("message", iframeHeight, false);
|
||||
// return () => {
|
||||
// document.getElementById("iframe").contentDocument.querySelector('.content').removeEventListener("message", iframeHeight, false);
|
||||
// }
|
||||
// } catch (err) {
|
||||
// console.error(err);
|
||||
// }
|
||||
// }, []);
|
||||
|
||||
function onOpenChange(newOpenKeys) {
|
||||
const latestOpenKey = newOpenKeys.find(key => openKeys.indexOf(key) === -1);
|
||||
if (rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
|
||||
|
@ -150,7 +168,7 @@ export default (props) => {
|
|||
|
||||
function iframeHeight(e) {
|
||||
if (e.origin === main_web_site_url && e.data && !isNaN(e.data)) {
|
||||
document.getElementById("iframe").height=Number(e.data);
|
||||
document.getElementById("iframe").height=Number(e.data)+20;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
top: 70px;
|
||||
left: 0;
|
||||
width: 13.75rem;
|
||||
height: 100vh;
|
||||
height: calc(100vh - 70px);
|
||||
padding-bottom: 5vh;
|
||||
overflow: hidden;
|
||||
overflow-y: scroll;
|
||||
background-color:#ffffff;
|
||||
|
|
|
@ -136,7 +136,7 @@ const MenuList = Loadable({
|
|||
const Managements = (propsF) => {
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<div className="newMain clearfix managementMain">
|
||||
<Layouts {...propsF} >
|
||||
<Switch {...propsF}>
|
||||
|
||||
|
@ -330,5 +330,5 @@ export default withRouter(
|
|||
ImageLayerOfCommentHOC({
|
||||
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||
parentSelector: ".newMain",
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Managements))))
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Managements,{noFooter:true}))))
|
||||
);
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
.managementMain{
|
||||
padding:0;
|
||||
}
|
||||
.managements{
|
||||
margin-left: 13.75rem;
|
||||
padding:0 1.875rem 1.6rem;
|
||||
background: #f6f9fe;
|
||||
min-height: 80vh;
|
||||
min-height: calc(100vh - 70px);
|
||||
.content{
|
||||
margin-top:1rem;
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
background: #fff;
|
||||
border-radius: 1em;
|
||||
box-shadow: 0 1px 2px #d9d9d9;
|
||||
overflow-y: scroll;
|
||||
padding-bottom: 1vh;
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
|
|
|
@ -35,7 +35,7 @@ export default function Global(props){
|
|||
url: 'http://111.8.36.180:8092/api/GlobalResourcesData/',
|
||||
method: 'get',
|
||||
}).then(res => {
|
||||
if (res.code === '1') {
|
||||
if (res.data) {
|
||||
const data = res.data;
|
||||
setTotalProjects(data.totalProjects);
|
||||
setTotalMembers(data.totalMembers);
|
||||
|
|
|
@ -10,10 +10,10 @@ import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfComme
|
|||
import './competition/index.scss';
|
||||
import { Menu, Popover, Spin } from "antd";
|
||||
import InfoModal from './competition/components/infoModal';
|
||||
import banner from './competition/image/banner.jpg';
|
||||
import banner_local from './competition/image/banner_local.jpg';
|
||||
// import banner from './competition/image/banner.jpg';
|
||||
// import banner_local from './competition/image/banner_local.jpg';
|
||||
import logo from './competition/image/logo.png';
|
||||
import { getQz2022, userCompetitionStatus } from "./competition/api";
|
||||
import { getCompetitionDetail, userCompetitionStatus } from "./competition/api";
|
||||
// import { paths } from "./competition/static";
|
||||
import Login from './components/login';
|
||||
|
||||
|
@ -49,6 +49,10 @@ const Refer = Loadable({
|
|||
loader: () => import('./competition/refer'),
|
||||
loading: Loading,
|
||||
})
|
||||
const Rank = Loadable({
|
||||
loader: () => import('./competition/rank'),
|
||||
loading: Loading,
|
||||
});
|
||||
const Chat = Loadable({
|
||||
loader: () => import('./competition/chat'),
|
||||
loading: Loading,
|
||||
|
@ -66,7 +70,7 @@ const Management = Loadable({
|
|||
loading: Loading,
|
||||
})
|
||||
|
||||
const Qz2022 = (props) => {
|
||||
const Competition = (props) => {
|
||||
const { history, current_user, match } = props;
|
||||
const { location } = history;
|
||||
const { pathname } = location;
|
||||
|
@ -117,7 +121,7 @@ const Qz2022 = (props) => {
|
|||
|
||||
useEffect(() => {
|
||||
// 获取竞赛详情
|
||||
getQz2022(competitionId).then(response => {
|
||||
getCompetitionDetail(competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setQzDetail(response.data.data);
|
||||
}
|
||||
|
@ -149,9 +153,10 @@ const Qz2022 = (props) => {
|
|||
props.showNotification("您还未报名竞赛!");
|
||||
} else if (enrollStatus && enrollStatus.status === 0) {
|
||||
props.showNotification("报名信息被管理员驳回!");
|
||||
} else if (['ccks','zstp2022'].includes(competitionId)&& enrollStatus && enrollStatus.status === 1) {
|
||||
} else if (['ccks', 'zstp2022'].includes(competitionId) && enrollStatus && enrollStatus.status === 1) {
|
||||
props.showNotification("您的报名信息未通过审核!");
|
||||
} else {
|
||||
} else if(['ccks', 'zstp2022'].includes(competitionId) && applyStatus ){
|
||||
}else{
|
||||
!referStatus ? props.showNotification(!referEnd ? `竞赛尚未开始提交作品,提交作品开始时间为:${qzDetail && qzDetail.enroll_date.substring(0, 10)}` : "比赛已结束") : "";
|
||||
}
|
||||
}
|
||||
|
@ -163,8 +168,8 @@ const Qz2022 = (props) => {
|
|||
<React.Fragment>
|
||||
<Login {...props} />
|
||||
{/* banner图+选项 */}
|
||||
{banner_url&&<img src={banner_url } className="qz_banner" alt="" />}
|
||||
{pathname.indexOf("qz2022")>-1 && <InfoModal />}
|
||||
{banner_url && <img src={banner_url} className="qz_banner" alt="" />}
|
||||
{pathname.indexOf("qz2022") > -1 && <InfoModal />}
|
||||
<div className="competition">
|
||||
<div className={`competition-top ${fixedTop}`}>
|
||||
{/* {paths.indexOf(active) !== -1 && */}
|
||||
|
@ -184,16 +189,25 @@ const Qz2022 = (props) => {
|
|||
<Link to={{ pathname: `/competition/${competitionId}/notice` }}>通知公告</Link>
|
||||
</li>
|
||||
{/* 处于报名阶段正常跳转到报名页面,不处于右侧弹消息 */}
|
||||
<li className={active === "apply" ? "active" : ""}>
|
||||
{competitionId === 'qz2022' ? <li className={active === "apply" ? "active" : ""}>
|
||||
<Link to={{ pathname: applyStatus && current_user && current_user.login ? `/competition/${competitionId}/apply` : '' }} onClick={() => { current_user && current_user.login ? !applyStatus && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名</Link>
|
||||
</li> : <li className={active === "apply" ? "active" : ""}>
|
||||
<Link to={{ pathname: applyStatus||( enrollStatus && enrollStatus.status>1) && current_user && current_user.login ? `/competition/${competitionId}/apply` : '' }} onClick={() => { current_user && current_user.login ? !applyStatus&& ( enrollStatus && enrollStatus.status<2 ) && props.showNotification("报名时间已截止") : props.showLoginDialog() }}>参赛报名</Link>
|
||||
</li>
|
||||
}
|
||||
{competitionId === 'qz2022' ? <li className={active === "refer" ? "active" : ""}>
|
||||
<Link to={{ pathname: referStatus && !referEnd && current_user && current_user.login && enrollStatus && enrollStatus.enroll_status ? `/competition/${competitionId}/refer` : '' }} onClick={goToRefer}>提案提交</Link>
|
||||
</li> :
|
||||
<li className={active === "refer" ? "active" : ""}>
|
||||
<Link to={{ pathname: referStatus && !referEnd && current_user && current_user.login && enrollStatus && enrollStatus.status==2 ? `/competition/${competitionId}/refer` : '' }} onClick={goToRefer}>提案提交</Link>
|
||||
<Link to={{ pathname: !referEnd && current_user && current_user.login && enrollStatus && enrollStatus.status>1 ? `/competition/${competitionId}/refer` : '' }} onClick={goToRefer}>提案提交</Link>
|
||||
</li>}
|
||||
|
||||
{
|
||||
['ccks', 'zstp2022'].includes(competitionId) && <li className={active === "rank" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/competition/${competitionId}/rank` }}>排行榜</Link>
|
||||
</li>
|
||||
}
|
||||
|
||||
{competitionId === 'qz2022' && <li className={active === "statistics" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/competition/${competitionId}/statistics` }}>数据统计</Link>
|
||||
</li>}
|
||||
|
@ -258,6 +272,12 @@ const Qz2022 = (props) => {
|
|||
() => (<Refer {...props} enrollStatus={enrollStatus} qzDetail={qzDetail} setReload={setReload} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 排行榜 */}
|
||||
<Route path="/competition/:competitionId/rank"
|
||||
render={
|
||||
() => (<Rank {...props} isLoacl={qzDetail && qzDetail.is_local} />)
|
||||
}
|
||||
></Route>
|
||||
{/* 交流互动 */}
|
||||
<Route path="/competition/:competitionId/chat"
|
||||
render={
|
||||
|
@ -303,7 +323,7 @@ const Qz2022 = (props) => {
|
|||
{/* 大赛介绍 */}
|
||||
<Route path="/competition/:competitionId"
|
||||
render={
|
||||
() => (competitionId=='qz2022'? <Introduce {...props} qzDetail={qzDetail} /> :<Fingerpost {...props} qzDetail={qzDetail} />)
|
||||
() => (competitionId == 'qz2022' ? <Introduce {...props} qzDetail={qzDetail} /> : <Fingerpost {...props} qzDetail={qzDetail} />)
|
||||
}
|
||||
></Route>
|
||||
</Switch>
|
||||
|
@ -317,5 +337,5 @@ export default withRouter(
|
|||
ImageLayerOfCommentHOC({
|
||||
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||
parentSelector: ".newMain",
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Qz2022))))
|
||||
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Competition))))
|
||||
);
|
||||
|
|
|
@ -5,39 +5,39 @@ export async function userCompetitionStatus(competitionId) {
|
|||
return axios.get(`/competition_infos/${competitionId}/enroll_status.json`);
|
||||
}
|
||||
|
||||
// 启智2022详情接口
|
||||
export function getQz2022(competitionId) {
|
||||
// 竞赛详情接口
|
||||
export function getCompetitionDetail(competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}.json`);
|
||||
}
|
||||
|
||||
// 报名启智2022 竞赛?debug=teacher
|
||||
export async function enrollCompetition(data,competitionId){
|
||||
return axios.post(`/competition_infos/${competitionId}/enroll.json`,data);
|
||||
export async function enrollCompetition(data, competitionId) {
|
||||
return axios.post(`/competition_infos/${competitionId}/enroll.json`, data);
|
||||
}
|
||||
|
||||
// 修改报名信息
|
||||
export async function enrollUpdate(data,competitionId){
|
||||
return axios.post(`/competition_infos/${competitionId}/enroll_update.json`,data);
|
||||
export async function enrollUpdate(data, competitionId) {
|
||||
return axios.post(`/competition_infos/${competitionId}/enroll_update.json`, data);
|
||||
}
|
||||
|
||||
// 统计启智2022 竞赛
|
||||
export async function stattistics(competitionId){
|
||||
return axios.get( `/competition_infos/${competitionId}/statistics.json`);
|
||||
export async function stattistics(competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/statistics.json`);
|
||||
}
|
||||
|
||||
// 竞赛提交作品
|
||||
export async function uploadCompetition(data,competitionId){
|
||||
return axios.post(`/competition_infos/${competitionId}/upload.json`,data);
|
||||
export async function uploadCompetition(data, competitionId) {
|
||||
return axios.post(`/competition_infos/${competitionId}/upload.json`, data);
|
||||
}
|
||||
|
||||
// 管理-竞赛报名列表?debug=admin
|
||||
export function getQzEnrollList(params,competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/enroll_list.json`,params={params});
|
||||
export function getEnrollList(params, competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/enroll_list.json`, params = { params });
|
||||
}
|
||||
|
||||
// 管理-竞赛提交作品列表&debug=admin
|
||||
export function getQzProList(params,competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/enroll_list.json?upload=true`,params={params});
|
||||
export function getProList(params, competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/enroll_list.json?upload=true`, params = { params });
|
||||
}
|
||||
|
||||
// 通知公告列表
|
||||
|
@ -46,36 +46,41 @@ export function getNoticeList(competitionId) {
|
|||
}
|
||||
|
||||
// 通知公告详情
|
||||
export function getNoticeDetail(id,competitionId) {
|
||||
export function getNoticeDetail(id, competitionId) {
|
||||
return axios.get(`/competition_infos/${competitionId}/competition_notices/${id}.json`);
|
||||
}
|
||||
|
||||
// 新增通知
|
||||
export async function addQz2022Notice(data,competitionId){
|
||||
return axios.post(`/competition_infos/${competitionId}/competition_notices.json`,data);
|
||||
export async function addCompetitionNotice(data, competitionId) {
|
||||
return axios.post(`/competition_infos/${competitionId}/competition_notices.json`, data);
|
||||
}
|
||||
|
||||
// 编辑通知
|
||||
export async function updateQz2022Notice(id,data,competitionId){
|
||||
return axios.put(`/competition_infos/${competitionId}/competition_notices/${id}.json`,data);
|
||||
export async function updateCompetitionNotice(id, data, competitionId) {
|
||||
return axios.put(`/competition_infos/${competitionId}/competition_notices/${id}.json`, data);
|
||||
}
|
||||
|
||||
// 删除通知
|
||||
export async function deleteQz2022Notice(id,competitionId){
|
||||
export async function deleteCompetitionNotice(id, competitionId) {
|
||||
return axios.delete(`/competition_infos/${competitionId}/competition_notices/${id}.json`);
|
||||
}
|
||||
|
||||
// 编辑大赛介绍、大赛指南、关于我
|
||||
export async function updateQz2022(data,competitionId){
|
||||
return axios.put(`/competition_infos/${competitionId}.json`,data);
|
||||
export async function updateCompetition(data, competitionId) {
|
||||
return axios.put(`/competition_infos/${competitionId}.json`, data);
|
||||
}
|
||||
|
||||
// 修改竞赛报名状态
|
||||
export async function updateEnroll(data,competitionId){
|
||||
return axios.post(`/competition_infos/${competitionId}/enroll_status_update.json`,data);
|
||||
export async function updateEnroll(data, competitionId) {
|
||||
return axios.post(`/competition_infos/${competitionId}/enroll_status_update.json`, data);
|
||||
}
|
||||
|
||||
// 报名表扫描件上传
|
||||
export async function updateTemplate(data,competitionId){
|
||||
return axios.post(`/competition_infos/${competitionId}/upload_enroll_template.json`,data);
|
||||
export async function updateTemplate(data, competitionId) {
|
||||
return axios.post(`/competition_infos/${competitionId}/upload_enroll_template.json`, data);
|
||||
}
|
||||
|
||||
|
||||
export async function rankingList(competitionId, params) {
|
||||
return axios.get(`/competition_infos/${competitionId}/ranking_list.json`, { params });
|
||||
}
|
|
@ -44,7 +44,7 @@ export default Form.create()((props) => {
|
|||
const applyStatus = qzDetail
|
||||
? Date.parse(new Date()) < Date.parse(new Date(qzDetail.enroll_date))
|
||||
: true;
|
||||
if ((current_user && !current_user.login) || !applyStatus) {
|
||||
if ((current_user && !current_user.login) || (!applyStatus && (enrollStatus && enrollStatus.status<2))) {
|
||||
history.push(`/competition/${competitionId}`);
|
||||
}
|
||||
if (
|
||||
|
@ -77,7 +77,7 @@ export default Form.create()((props) => {
|
|||
|
||||
// form表单公共处理函数
|
||||
const helper = useCallback(
|
||||
(label, name, rules, widget, extra,className) => (
|
||||
(label, name, rules, widget, extra, className) => (
|
||||
<Form.Item label={label} extra={extra} className={className}>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true })(widget)}
|
||||
</Form.Item>
|
||||
|
@ -96,14 +96,14 @@ export default Form.create()((props) => {
|
|||
|
||||
// 检查用户填写信息
|
||||
function checkInfo() {
|
||||
if(!files.length){
|
||||
setFieldsValue({enroll_template_id:''})
|
||||
if (!files.length) {
|
||||
setFieldsValue({ enroll_template_id: '' })
|
||||
}
|
||||
setErrorMessage(undefined);
|
||||
// 检查用户输入的成员属性是否完全
|
||||
if (members.length > 0) {
|
||||
let all = 0;
|
||||
const len =3;
|
||||
const len = 3;
|
||||
// 用户输入的长度是否满足要求
|
||||
let sizes = 0;
|
||||
members.map((item) => {
|
||||
|
@ -186,7 +186,7 @@ export default Form.create()((props) => {
|
|||
info.file.status === "removed"
|
||||
) {
|
||||
setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,15 +199,15 @@ export default Form.create()((props) => {
|
|||
// 进行文件大小检查
|
||||
function beforeUpload(file) {
|
||||
const isLt100M = file.size / 1024 / 1024 < 10;
|
||||
const isType = file.type === "image/png" || file.type === "image/jpg" || file.type === "image/jpeg" ||file.name.endsWith(".zip") || file.name.endsWith(".rar");
|
||||
if(!isType){
|
||||
const isType = file.type === "image/png" || file.type === "image/jpg" || file.type === "image/jpeg" || file.name.endsWith(".zip") || file.name.endsWith(".rar");
|
||||
if (!isType) {
|
||||
message.error("只能上传指定类型文件");
|
||||
}
|
||||
if (!isLt100M) {
|
||||
message.error("文件大小必须小于10MB");
|
||||
}
|
||||
|
||||
return isLt100M &&isType;
|
||||
|
||||
return isLt100M && isType;
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -218,11 +218,10 @@ export default Form.create()((props) => {
|
|||
<div className="img_span">
|
||||
<img src={apply_input} className="step_icon_svg" alt="" />
|
||||
<span
|
||||
className={`${
|
||||
enrollStatus &&
|
||||
className={`${enrollStatus &&
|
||||
(!enrollStatus.enroll_status || enrollStatus.status === 0) &&
|
||||
"active"
|
||||
}`}
|
||||
}`}
|
||||
>
|
||||
个人信息
|
||||
</span>
|
||||
|
@ -231,9 +230,8 @@ export default Form.create()((props) => {
|
|||
<div className="img_span">
|
||||
<img src={apply_check} className="step_icon_svg" alt="" />
|
||||
<span
|
||||
className={`${
|
||||
enrollStatus && enrollStatus.status === 1 && "active"
|
||||
}`}
|
||||
className={`${enrollStatus && enrollStatus.status === 1 && "active"
|
||||
}`}
|
||||
>
|
||||
报名审核中
|
||||
</span>
|
||||
|
@ -242,9 +240,8 @@ export default Form.create()((props) => {
|
|||
<div className="img_span">
|
||||
<img src={apply_success} className="step_icon_svg" alt="" />
|
||||
<span
|
||||
className={`${
|
||||
enrollStatus && enrollStatus.status === 2 && "active"
|
||||
}`}
|
||||
className={`${enrollStatus && enrollStatus.status === 2 && "active"
|
||||
}`}
|
||||
>
|
||||
报名成功
|
||||
</span>
|
||||
|
@ -379,7 +376,7 @@ export default Form.create()((props) => {
|
|||
|
||||
<div className="edit_table">
|
||||
{/* <p className="mt10">成员 : </p> */}
|
||||
|
||||
|
||||
{qzDetail && (
|
||||
<EditTable
|
||||
members={
|
||||
|
@ -436,7 +433,7 @@ export default Form.create()((props) => {
|
|||
{enrollStatus && enrollStatus.enroll_info.mail}
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div className={`info-right }`}>
|
||||
<span>队长单位证明 : </span>
|
||||
|
@ -453,28 +450,28 @@ export default Form.create()((props) => {
|
|||
)}
|
||||
</div>
|
||||
|
||||
{enrollStatus && enrollStatus.enroll_info.members.length ?<div className={`info-right `}>
|
||||
{enrollStatus && enrollStatus.enroll_info.members.length ? <div className={`info-right `}>
|
||||
<span>成员 : </span>
|
||||
<Tooltip
|
||||
title={
|
||||
enrollStatus &&
|
||||
enrollStatus.enroll_info.members &&
|
||||
enrollStatus.enroll_info.members.map((item) => {
|
||||
return item.real_name + ",";
|
||||
})
|
||||
return item.real_name;
|
||||
}).join(',')
|
||||
}
|
||||
placement="topLeft"
|
||||
>
|
||||
{enrollStatus &&
|
||||
enrollStatus.enroll_info.members &&
|
||||
enrollStatus.enroll_info.members.map((item) => {
|
||||
return item.real_name + ",";
|
||||
})}
|
||||
return item.real_name
|
||||
}).join(',')}
|
||||
</Tooltip>
|
||||
</div>:''}
|
||||
</div> : ''}
|
||||
</div>
|
||||
|
||||
{enrollStatus && enrollStatus.enroll_info.status == 2 &&qzDetail && qzDetail.enroll_template&& (
|
||||
{enrollStatus && enrollStatus.enroll_info.status == 2 && qzDetail && qzDetail.enroll_template && (
|
||||
<div className="download_box">
|
||||
<a
|
||||
href={
|
||||
|
@ -496,7 +493,8 @@ export default Form.create()((props) => {
|
|||
)}
|
||||
</div>
|
||||
{enrollStatus &&
|
||||
(!enrollStatus.enroll_status || enrollStatus.status === 0) && (
|
||||
(!enrollStatus.enroll_status || enrollStatus.status === 0) &&
|
||||
(
|
||||
<div className="apply_but">
|
||||
<Button type="primary" className="submit_info" onClick={checkInfo}>
|
||||
提交资料
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Button, Form, message, Input } from 'antd';
|
|||
import { Link } from "react-router-dom";
|
||||
import icon from '../image/notice_breadcrumb.svg';
|
||||
import MDEditor from '../../../modules/tpm/challengesnew/tpm-md-editor';
|
||||
import { updateQz2022 } from "../api";
|
||||
import { updateCompetition } from "../api";
|
||||
import '../index.scss';
|
||||
import '../notice/index.scss';
|
||||
import '../notice/detail.scss';
|
||||
|
@ -43,7 +43,7 @@ export default Form.create()((props) => {
|
|||
const params = {
|
||||
'competition_info': info,
|
||||
}
|
||||
updateQz2022(params,competitionId).then(response=>{
|
||||
updateCompetition(params,competitionId).then(response=>{
|
||||
if(response && response.data.message === "success"){
|
||||
setReloadDetail(Math.random());
|
||||
message.success('更新成功');
|
||||
|
|
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 9.3 KiB |
After Width: | Height: | Size: 1.0 MiB |
After Width: | Height: | Size: 924 KiB |
After Width: | Height: | Size: 6.7 KiB |
After Width: | Height: | Size: 5.2 KiB |
After Width: | Height: | Size: 20 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 988 B |
|
@ -4,7 +4,7 @@ import { Select, Button, Tooltip, Input, Popconfirm, message } from 'antd';
|
|||
import { current_main_site_url } from '../fetch';
|
||||
import PaginationTable from "../../components/paginationTable";
|
||||
|
||||
import { getQzEnrollList, getQzProList, updateEnroll } from "../api.js";
|
||||
import { getEnrollList, getProList, updateEnroll } from "../api.js";
|
||||
const Option = Select.Option;
|
||||
const { Search } = Input;
|
||||
|
||||
|
@ -38,7 +38,7 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
}
|
||||
if (type === "applys") {
|
||||
// 报名列表
|
||||
getQzEnrollList(params, competitionId).then(response => {
|
||||
getEnrollList(params, competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -49,7 +49,7 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
} else {
|
||||
// 提交作品列表
|
||||
delete params.status;
|
||||
getQzProList(params, competitionId).then(response => {
|
||||
getProList(params, competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -97,6 +97,9 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
{
|
||||
title: '队长邮箱地址',
|
||||
dataIndex: 'mail',
|
||||
render: (text, record) => {
|
||||
return <Tooltip title={text} placement="topLeft">{text}</Tooltip>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '成员',
|
||||
|
@ -153,7 +156,10 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
},
|
||||
{
|
||||
title: '队长邮箱地址',
|
||||
dataIndex: 'mail'
|
||||
dataIndex: 'mail',
|
||||
render: (text, record) => {
|
||||
return <Tooltip title={text} placement="topLeft">{text}</Tooltip>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '作品',
|
||||
|
@ -162,18 +168,18 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
return <Tooltip title={text[0] && text[0].title} placement="topLeft"><a href={current_main_site_url + (text[0] && text[0].url)} className="attachments_a">{text[0] && text[0].title}</a></Tooltip>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: "status",
|
||||
align: "center",
|
||||
render: (text, record) => {
|
||||
return text === 1 ? <Button size="small" disabled>已驳回</Button> : <Popconfirm
|
||||
title="您确定驳回此用户的作品信息?"
|
||||
icon={<i className="iconfont icon-shanchu_tc_icon mr3 font-15" style={{ float: 'left', color: "red" }}></i>}
|
||||
onConfirm={() => { reject(record.user_id, 2) }}
|
||||
><Button size="small">驳回</Button></Popconfirm>
|
||||
}
|
||||
}
|
||||
// {
|
||||
// title: '操作',
|
||||
// dataIndex: "status",
|
||||
// align: "center",
|
||||
// render: (text, record) => {
|
||||
// return text === 1 ? <Button size="small" disabled>已驳回</Button> : <Popconfirm
|
||||
// title="您确定驳回此用户的作品信息?"
|
||||
// icon={<i className="iconfont icon-shanchu_tc_icon mr3 font-15" style={{ float: 'left', color: "red" }}></i>}
|
||||
// onConfirm={() => { reject(record.user_id, 2) }}
|
||||
// ><Button size="small">驳回</Button></Popconfirm>
|
||||
// }
|
||||
// }
|
||||
];
|
||||
}, [qzDetail]);
|
||||
|
||||
|
@ -222,7 +228,7 @@ function Introduce({ history: { location: { pathname } }, qzDetail, match }) {
|
|||
}
|
||||
// 外网环境下 赛队成员无职务、JXJXJX属性
|
||||
const expandRowWai = (record) => {
|
||||
return <div className="expandRowManage">
|
||||
return <div className="expandRowManage expandRowLess">
|
||||
<div className="row">
|
||||
<div className="index">序号</div>
|
||||
<div>姓名</div>
|
||||
|
|
|
@ -31,6 +31,9 @@
|
|||
text-overflow: ellipsis;
|
||||
&.index{width: 10%;}
|
||||
}
|
||||
.expandRowLess .row div:last-child{
|
||||
width: 60%;
|
||||
}
|
||||
.expandRowManage .row{
|
||||
border-bottom: 1px solid #ececec;
|
||||
margin: 0 -8px;
|
||||
|
|
|
@ -5,7 +5,7 @@ import {current_main_site_url} from '../fetch';
|
|||
import PaginationTable from "../../components/paginationTable";
|
||||
|
||||
|
||||
import { getQzEnrollList, getQzProList, updateEnroll } from "../api.js";
|
||||
import { getEnrollList, getProList, updateEnroll } from "../api.js";
|
||||
const Option = Select.Option;
|
||||
const {Search} = Input;
|
||||
|
||||
|
@ -44,7 +44,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
}
|
||||
if(type === "applys"){
|
||||
// 报名列表
|
||||
getQzEnrollList(params,competitionId).then(response=>{
|
||||
getEnrollList(params,competitionId).then(response=>{
|
||||
if(response && response.status === 200){
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -54,7 +54,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
})
|
||||
}else{
|
||||
// 提交作品列表
|
||||
getQzProList(params,competitionId).then(response=>{
|
||||
getProList(params,competitionId).then(response=>{
|
||||
if(response && response.status === 200){
|
||||
setTotal(response.data.count);
|
||||
setDataList(response.data.data);
|
||||
|
@ -216,7 +216,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
return <div className="row">
|
||||
<div className="index">{index+1}</div>
|
||||
<div>{item.real_name}</div>
|
||||
<div>{item.org_name}</div>
|
||||
<div>{item.org_name&&<Tooltip title={item.org_name} placement="topLeft">{item.org_name}</Tooltip>}</div>
|
||||
<div>{item.org_job}</div>
|
||||
<div>{item.org_rank}</div>
|
||||
</div>
|
||||
|
@ -225,7 +225,7 @@ function Introduce({history:{location:{pathname}},qzDetail,match }) {
|
|||
}
|
||||
// 外网环境下 赛队成员无职务、JXJXJX属性
|
||||
const expandRowWai = (record) =>{
|
||||
return <div className="expandRowManage">
|
||||
return <div className="expandRowManage expandRowLess">
|
||||
<div className="row">
|
||||
<div className="index">序号</div>
|
||||
<div>姓名</div>
|
||||
|
|
|
@ -5,7 +5,7 @@ import icon from '../image/notice_breadcrumb.svg';
|
|||
import MDEditor from '../../../modules/tpm/challengesnew/tpm-md-editor';
|
||||
import './index.scss';
|
||||
import './detail.scss';
|
||||
import { getNoticeDetail, addQz2022Notice, updateQz2022Notice } from "../api";
|
||||
import { getNoticeDetail, addCompetitionNotice, updateCompetitionNotice } from "../api";
|
||||
|
||||
export default Form.create()((props) => {
|
||||
const {form, history, match:{params:{noticeId,type,competitionId}}, current_user, qzDetail} = props;
|
||||
|
@ -47,7 +47,7 @@ export default Form.create()((props) => {
|
|||
...values,
|
||||
content: description
|
||||
}
|
||||
type === "add" && addQz2022Notice(params,competitionId).then(response=>{
|
||||
type === "add" && addCompetitionNotice(params,competitionId).then(response=>{
|
||||
if(response && response.data.message === "success"){
|
||||
message.success('新增成功');
|
||||
history.push(`/competition/${competitionId}/notice`);
|
||||
|
@ -55,7 +55,7 @@ export default Form.create()((props) => {
|
|||
message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
type === "edit" && updateQz2022Notice(noticeId,params,competitionId).then(response=>{
|
||||
type === "edit" && updateCompetitionNotice(noticeId,params,competitionId).then(response=>{
|
||||
if(response && response.data.message === "success"){
|
||||
message.success('修改成功');
|
||||
history.push(`/competition/${competitionId}/notice`);
|
||||
|
|
|
@ -4,7 +4,7 @@ import { Link } from "react-router-dom";
|
|||
import notice from '../image/notice.gif';
|
||||
import './index.scss';
|
||||
import '../../index.scss';
|
||||
import { getNoticeList, deleteQz2022Notice } from "../api";
|
||||
import { getNoticeList, deleteCompetitionNotice } from "../api";
|
||||
import RenderHtml from "src/components/render-html";
|
||||
|
||||
function Notice({ current_user, qzDetail,match }) {
|
||||
|
@ -26,7 +26,7 @@ function Notice({ current_user, qzDetail,match }) {
|
|||
title: "是否删除",
|
||||
content: "确定删除此通知公告?",
|
||||
onOk() {
|
||||
deleteQz2022Notice(id,competitionId).then(response => {
|
||||
deleteCompetitionNotice(id,competitionId).then(response => {
|
||||
if (response.status === 200 && response.data.message === "success") {
|
||||
setReload(Math.random());
|
||||
message.success("删除成功");
|
||||
|
|
|
@ -0,0 +1,105 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import { Tabs, Input, Pagination, Table, Tooltip } from 'antd';
|
||||
import { rankingList } from '../api';
|
||||
import rank_start from "../image/rank_start.png";
|
||||
import PaginationTable from "../../components/paginationTable";
|
||||
|
||||
import './index.scss';
|
||||
import '../index.scss';
|
||||
import { set } from "lodash";
|
||||
const { Search } = Input;
|
||||
function Rank({ isLocal, match }) {
|
||||
const { competitionId } = match.params;
|
||||
const [keyword, setKeyword] = useState('');
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [list, setList] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
||||
const columns = [{
|
||||
title: '排名',
|
||||
dataIndex: 'rank_num',
|
||||
className: 'ranking-num',
|
||||
render: (text, record, i) => {
|
||||
return text < 4 ? <div className={`rank-icon rank${text}`}></div> : text
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '参赛单位',
|
||||
dataIndex: 'org_name',
|
||||
width: '30%',
|
||||
render: (text, record) => {
|
||||
return <Tooltip title={text} placement="topLeft">{text}</Tooltip>;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '参赛队长',
|
||||
dataIndex: 'leader',
|
||||
},
|
||||
{
|
||||
title: '三元组个数',
|
||||
dataIndex: 'other_score_1',
|
||||
className: 'textCenter',
|
||||
},
|
||||
{
|
||||
title: '分数',
|
||||
dataIndex: 'score',
|
||||
className: 'textCenter',
|
||||
},
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
rankingList(competitionId, {
|
||||
page: curPage,
|
||||
limit: 20,
|
||||
keyword,
|
||||
}).then(res => {
|
||||
if (res && res.data && res.data.message == "success") {
|
||||
setList(res.data.data);
|
||||
setTotal(res.data.count)
|
||||
}
|
||||
})
|
||||
}, [keyword, curPage])
|
||||
|
||||
return (
|
||||
<div className="rang-bg ">
|
||||
<div className="rank_bg1" ></div>
|
||||
<div className="rank_bg2" ></div>
|
||||
<div className="rank qz_main clearfix">
|
||||
<div className="rank-head">
|
||||
<div className="head-tit">
|
||||
<span className="head-tit-img"></span>排 行 榜<span className="head-tit-img"></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="rank-list">
|
||||
<img className="ccks_start" src={rank_start} />
|
||||
<div className="rank-search">
|
||||
<Search
|
||||
placeholder='参赛单位/参赛队长姓名'
|
||||
allowClear
|
||||
enterButton
|
||||
onSearch={(value) => { setKeyword(value);setCurPage(1) }}
|
||||
/>
|
||||
</div>
|
||||
{/* <Table
|
||||
rowKey={(row, i) => row.id || i}
|
||||
dataSource={list}
|
||||
columns={columns}
|
||||
/> */}
|
||||
|
||||
<PaginationTable
|
||||
loading={loading}
|
||||
dataSource={list}
|
||||
columns={columns}
|
||||
total={total}
|
||||
setCurPage={(page) => setCurPage(page)}
|
||||
current={curPage}
|
||||
pageSize={20} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Rank;
|
|
@ -0,0 +1,144 @@
|
|||
.rang-bg {
|
||||
position: relative;
|
||||
background-color: #fcfcfc;
|
||||
padding: 20px 0 70px;
|
||||
|
||||
.rank_bg1 {
|
||||
position: absolute;
|
||||
width: 33.45vw;
|
||||
height: 27.5vw;
|
||||
background-image: url("../image/rank_bg1.png");
|
||||
background-size: 100% 100%;
|
||||
left: 0;
|
||||
z-index: 0;
|
||||
}
|
||||
.rank_bg2 {
|
||||
position: absolute;
|
||||
width: 33.45vw;
|
||||
height: 27.5vw;
|
||||
top: 10vw;
|
||||
right: 0;
|
||||
z-index: 0;
|
||||
background-image: url("../image/rank_bg1.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
.rank {
|
||||
position: relative;
|
||||
margin: 0 auto;
|
||||
padding: 10px;
|
||||
background-color: #4c5ef1;
|
||||
border-radius: 5px;
|
||||
z-index: 10;
|
||||
.rank-head {
|
||||
text-align: center;
|
||||
}
|
||||
.head-tit {
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
color: #ffdc9f;
|
||||
font-size: 24px;
|
||||
margin: 15px auto 20px;
|
||||
}
|
||||
.head-tit-img {
|
||||
display: inline-block;
|
||||
margin: 0 18px;
|
||||
width: 64px;
|
||||
height: 15px;
|
||||
background-image: url("../image/rank_tit.png");
|
||||
background-size: 100% 100%;
|
||||
|
||||
&:last-child {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
}
|
||||
.rank-search {
|
||||
text-align: right;
|
||||
margin: -15px auto 10px;
|
||||
.ant-input-group-wrapper {
|
||||
width: 30%;
|
||||
}
|
||||
.ant-input {
|
||||
border: 0 !important;
|
||||
background: #f1f3ff !important;
|
||||
}
|
||||
}
|
||||
.ant-input-group {
|
||||
.ant-input-affix-wrapper {
|
||||
height: 40px;
|
||||
}
|
||||
.ant-input-search-button {
|
||||
font-size: 20px;
|
||||
width: 61px;
|
||||
height: 40px;
|
||||
border-color: #7e89ff;
|
||||
background-color: #7e89ff;
|
||||
border-radius: 0px 4px 4px 0px;
|
||||
}
|
||||
}
|
||||
|
||||
.rank-list {
|
||||
position: relative;
|
||||
background: #fff;
|
||||
padding: 40px;
|
||||
border-radius: 10px;
|
||||
|
||||
.pagination-table .ant-table{
|
||||
border:0;
|
||||
}
|
||||
.ant-table-thead > tr > th {
|
||||
background: inherit;
|
||||
|
||||
.ant-table-column-title {
|
||||
color: #1d2f60;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-tbody > tr > td {
|
||||
border-bottom: 1px dashed #bed4ff;
|
||||
color: #485884;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.rank-icon {
|
||||
width: 36px;
|
||||
height: 35px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.rank1 {
|
||||
background-image: url("../image/rank_first.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.rank2 {
|
||||
background-image: url("../image/rank_second.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.rank3 {
|
||||
background-image: url("../image/rank_third.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-table-tbody > tr:nth-child(2n) > td {
|
||||
background: #f8faff;
|
||||
}
|
||||
// .ant-table-tbody > tr:nth-child(2) > td {
|
||||
// background: #fff;
|
||||
// }
|
||||
|
||||
.ccks_start {
|
||||
position: absolute;
|
||||
width: 187px;
|
||||
top: -10px;
|
||||
left: -19px;
|
||||
}
|
||||
|
||||
.ranking-num {
|
||||
text-align: center;
|
||||
}
|
||||
.textCenter {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,180 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import { Prompt } from 'react-router-dom'
|
||||
import { Select, Button, Upload, Modal, Icon, message } from 'antd';
|
||||
import { appendFileSizeToUploadFileAll, getUploadActionUrl, getImageUrl } from 'educoder';
|
||||
import { current_main_site_url } from '../fetch.js';
|
||||
import { uploadCompetition } from '../api';
|
||||
import ccks_upload from "../image/ccks_upload.png";
|
||||
import ccks_upload_success from "../image/ccks_upload_success.png";
|
||||
import ccks_csv from "../image/ccks_csv.png";
|
||||
|
||||
|
||||
import './index.scss';
|
||||
import '../../index.scss';
|
||||
import '../apply/index.scss';
|
||||
|
||||
function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail, setReload }) {
|
||||
const { competitionId } = match.params;
|
||||
|
||||
console.log(enrollStatus);
|
||||
// 是否允许用户上传作品
|
||||
// const upload = enrollStatus && (!enrollStatus.upload_status || enrollStatus.upload_status === 1);
|
||||
|
||||
const [upload, setUpload] = useState(false);
|
||||
// 上传文件时 按钮loading效果
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [files, setFiles] = useState();
|
||||
// 用户是否更改上传的作品列表
|
||||
const [changeFiles, setChangeFiles] = useState(false);
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
window.onbeforeunload = function (e) {
|
||||
if (changeFiles) {
|
||||
e.returnValue = "离开此页面将不保留已上传的作品文件,确定离开?";
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (enrollStatus && (!enrollStatus.upload_status || enrollStatus.upload_status === 1)) {
|
||||
setUpload(true);
|
||||
}
|
||||
}, [enrollStatus])
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
// referStatus : 当前时间不处于提案提交时间
|
||||
if (qzDetail && enrollStatus && current_user) {
|
||||
const referStatus = qzDetail && !(Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date)));
|
||||
// 当前时间不处于提案提交时间 或者用户未登录情况下 或者用户未报名 通过URL访问此页面,跳转到大赛介绍页面 或者用户报名信息被驳回未处理(enrollStatus.status = 0)
|
||||
if (referStatus || (current_user && !current_user.login) || (enrollStatus && (!enrollStatus.enroll_status || enrollStatus.status <2))) {
|
||||
history.push(`/competition/${competitionId}`);
|
||||
}
|
||||
}
|
||||
|
||||
}, [qzDetail, current_user, enrollStatus])
|
||||
|
||||
useEffect(() => {
|
||||
if (enrollStatus && enrollStatus.upload_status) {
|
||||
enrollStatus.attachments.map(item => {
|
||||
item.uid = 'rc-upload' + item.id;
|
||||
item.name = item.title;
|
||||
item.status = "done";
|
||||
});
|
||||
setFiles(enrollStatus.attachments);
|
||||
}
|
||||
}, [enrollStatus]);
|
||||
|
||||
function handleChange(info) {
|
||||
if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') {
|
||||
setLoading(true);
|
||||
setFiles(info.fileList.slice(-1))
|
||||
}
|
||||
if (info.file.status === "done" || info.file.status === 'removed') {
|
||||
setLoading(false);
|
||||
setChangeFiles(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 支持文件下载
|
||||
function download(file) {
|
||||
const fileId = file.id || file.response.id;
|
||||
window.open(`${current_main_site_url}/api/attachments/${fileId}`);
|
||||
}
|
||||
|
||||
// 进行文件大小检查
|
||||
function beforeUpload(file) {
|
||||
const isZip = file.name.endsWith(".csv");
|
||||
if (!isZip) {
|
||||
showNotification(`只能上传csv文件`);
|
||||
}
|
||||
const isLt100M = file.size / 1024 / 1024 < 50;
|
||||
if (!isLt100M) {
|
||||
showNotification(`文件大小必须小于${50}MB!`);
|
||||
}
|
||||
return isLt100M && isZip;
|
||||
}
|
||||
|
||||
// 作品提交
|
||||
function referProduction() {
|
||||
if (files && files.length === 1) {
|
||||
const params = {
|
||||
"attachment_ids": [files[0].response.id]
|
||||
}
|
||||
uploadCompetition(params, competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setChangeFiles(false);
|
||||
setReload(Math.random());
|
||||
setVisible(false);
|
||||
setUpload(false);
|
||||
message.success('提交作品成功');
|
||||
} else {
|
||||
message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="refer_bg rang-bg">
|
||||
<div className="rank_bg1" ></div>
|
||||
<div className="rank_bg2" ></div>
|
||||
{
|
||||
changeFiles &&
|
||||
<Prompt
|
||||
when={true}
|
||||
message={() => '离开此页面将不保留已上传的作品文件,确定离开?'}
|
||||
/>
|
||||
}
|
||||
<div className="qz_main refer ccks_refer">
|
||||
<div className="refer_tit">上传作品</div>
|
||||
{upload ? <div className="refer_content">
|
||||
<img src={ccks_upload} className="refer_img mb20" alt="" />
|
||||
<div className="refer_tip">请上传utf-8编码格式的csv格式作品</div>
|
||||
<Upload
|
||||
accept=".csv"
|
||||
// 开发时 action需要添加?debug=admin
|
||||
action={getUploadActionUrl}
|
||||
fileList={files}
|
||||
onChange={handleChange}
|
||||
onDownload={download}
|
||||
beforeUpload={beforeUpload}
|
||||
showUploadList={false}
|
||||
>
|
||||
<Button className="upload" >上传</Button>
|
||||
</Upload>
|
||||
</div>
|
||||
: <div className="refer_content">
|
||||
<img src={ccks_upload_success} className="refer_img mb20" alt="" />
|
||||
<div className="refer_tip">您的作品已上传成功,可在排行榜实时查看作品得分</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
{
|
||||
Array.isArray(files) && files.map(i => {
|
||||
return <div className="ccks_csv" key={i.name}><img src={ccks_csv} className="ccks_csv_img" alt="" />
|
||||
<a href={getImageUrl(i.url)}>{i.name} <span className="filesize">{i.filesize}</span></a>
|
||||
{enrollStatus && enrollStatus.enroll_info && enrollStatus.enroll_info && enrollStatus.enroll_info.api_result_text && <div className="error_text">{enrollStatus.enroll_info.api_result_text}</div>}
|
||||
</div>
|
||||
})
|
||||
}
|
||||
|
||||
{upload ? <Button type="primary" onClick={() => { changeFiles ? setVisible(true) : message.error("您暂未上传作品文件") }} loading={loading} >提交作品</Button>
|
||||
: <Button type="primary" onClick={() => { setUpload(true) }} >重新提交</Button>
|
||||
}
|
||||
</div>
|
||||
<Modal
|
||||
title="提示"
|
||||
visible={visible}
|
||||
onOk={referProduction}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
centered
|
||||
wrapClassName="applyInfoCon"
|
||||
cancelText=""
|
||||
>
|
||||
<div className="tips mb10"><i className="iconfont icon-shanchu_tc_icon1 font-24 mr10" style={{ color: '#ffa13a' }}></i><span className="tipTitle font-16">确定提交作品</span></div>
|
||||
<span>可重复提交,每天最多可提交一次作品!</span>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Introduce;
|
|
@ -1,146 +1,14 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import {Prompt} from 'react-router-dom'
|
||||
import {Select, Button, Upload, Modal, Icon, message } from 'antd';
|
||||
import { appendFileSizeToUploadFileAll, getUploadActionUrl } from 'educoder';
|
||||
import {current_main_site_url} from '../fetch.js';
|
||||
import {uploadCompetition} from '../api';
|
||||
import refer from "../image/refer.svg";
|
||||
|
||||
import React, {useState, useCallback} from "react";
|
||||
import Qz2022 from './qz2022';
|
||||
import Ccks from './ccks';
|
||||
import './index.scss';
|
||||
import '../../index.scss';
|
||||
import '../apply/index.scss';
|
||||
import '../index.scss';
|
||||
|
||||
function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail, setReload}) {
|
||||
export default (props)=>{
|
||||
const {match} = props;
|
||||
const { competitionId } = match.params;
|
||||
// 上传文件时 按钮loading效果
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [files, setFiles] = useState();
|
||||
// 用户是否更改上传的作品列表
|
||||
const [changeFiles, setChangeFiles] = useState(false);
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
window.onbeforeunload = function (e) {
|
||||
if(changeFiles){
|
||||
e.returnValue = "离开此页面将不保留已上传的作品文件,确定离开?";
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(()=>{
|
||||
// referStatus : 当前时间不处于提案提交时间
|
||||
const referStatus = qzDetail && !(Date.parse(new Date()) > Date.parse(new Date(qzDetail.enroll_date)) && Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date)));
|
||||
// 当前时间不处于提案提交时间 或者用户未登录情况下 或者用户未报名 通过URL访问此页面,跳转到大赛介绍页面 或者用户报名信息被驳回未处理(enrollStatus.status = 0)
|
||||
if(referStatus || (current_user && !current_user.login) || (enrollStatus && (!enrollStatus.enroll_status || enrollStatus.status === 0))){
|
||||
history.push(`/competition/${competitionId}`);
|
||||
}
|
||||
},[qzDetail, current_user, enrollStatus])
|
||||
|
||||
useEffect(() => {
|
||||
if(enrollStatus && enrollStatus.upload_status){
|
||||
enrollStatus.attachments.map(item=>{
|
||||
item.uid = 'rc-upload'+item.id;
|
||||
item.name = item.title;
|
||||
item.status = "done";
|
||||
});
|
||||
setFiles(enrollStatus.attachments);
|
||||
}
|
||||
}, [enrollStatus]);
|
||||
|
||||
function handleChange(info) {
|
||||
if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') {
|
||||
setLoading(true);
|
||||
setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1))
|
||||
}
|
||||
if(info.file.status === "done" || info.file.status === 'removed'){
|
||||
setLoading(false);
|
||||
setChangeFiles(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 支持文件下载
|
||||
function download(file){
|
||||
const fileId = file.id || file.response.id;
|
||||
window.open(`${current_main_site_url}/api/attachments/${fileId}`);
|
||||
}
|
||||
|
||||
// 进行文件大小检查
|
||||
function beforeUpload(file){
|
||||
const isZip = file.name.endsWith(".zip") || file.name.endsWith(".tar") || file.name.endsWith(".rar");
|
||||
if(!isZip){
|
||||
showNotification(`只能上传压缩包文件`);
|
||||
}
|
||||
const isLt100M = file.size / 1024 / 1024 < 50;
|
||||
if (!isLt100M) {
|
||||
showNotification(`文件大小必须小于${50}MB!`);
|
||||
}
|
||||
return isLt100M && isZip;
|
||||
}
|
||||
|
||||
// 作品提交
|
||||
function referProduction(){
|
||||
if(files && files.length === 1){
|
||||
const params = {
|
||||
"attachment_ids": [files[0].response.id]
|
||||
}
|
||||
uploadCompetition(params,competitionId).then(response=>{
|
||||
if(response && response.status === 200){
|
||||
setChangeFiles(false);
|
||||
setReload(Math.random());
|
||||
setVisible(false);
|
||||
message.success('提交作品成功');
|
||||
}else{
|
||||
message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 是否允许用户上传作品
|
||||
const upload = enrollStatus && (!enrollStatus.upload_status || enrollStatus.status === 1);
|
||||
return (
|
||||
<div className="refer_bg">
|
||||
{
|
||||
changeFiles &&
|
||||
<Prompt
|
||||
when={true}
|
||||
message={() => '离开此页面将不保留已上传的作品文件,确定离开?'}
|
||||
/>
|
||||
}
|
||||
<div className="qz_main refer">
|
||||
<img src={refer} className="refer_img mb20" alt=""/>
|
||||
<Upload
|
||||
accept=".zip,.rar,.tar"
|
||||
// 开发时 action需要添加?debug=admin
|
||||
action={getUploadActionUrl}
|
||||
fileList={files}
|
||||
onChange={handleChange}
|
||||
onDownload={download}
|
||||
beforeUpload={beforeUpload}
|
||||
showUploadList={{
|
||||
showDownloadIcon: true,
|
||||
downloadIcon: <i className="iconfont icon-xiazai-icon"></i>,
|
||||
showRemoveIcon: false
|
||||
}}
|
||||
>
|
||||
<Button className="upload" disabled={!upload}><Icon type="upload"/>{!upload ? '已' : ''}上传</Button>
|
||||
</Upload>
|
||||
<Modal/>
|
||||
{enrollStatus && enrollStatus.upload_status && enrollStatus.status === 1 && <div className="refer_tip mt15 cover"><i className="iconfont icon-erciqueren_icon mr10"></i>您的作品被打回,可以再次提交作品,未重新提交前保留您原来的提交记录。</div>}
|
||||
<div className="refer_tip mt20">上传单个作品压缩包(仅限上传一个压缩包)</div>
|
||||
<div className="refer_bor"></div>
|
||||
<Button type="primary" onClick={()=>{changeFiles ? setVisible(true) : message.error("您暂未上传作品文件")}} loading={loading} disabled={!upload}>{!upload ? '已' : ''}提交作品</Button>
|
||||
</div>
|
||||
<Modal
|
||||
title="提示"
|
||||
visible={visible}
|
||||
onOk={referProduction}
|
||||
onCancel={()=>{setVisible(false)}}
|
||||
centered
|
||||
wrapClassName="applyInfoCon"
|
||||
cancelText=""
|
||||
>
|
||||
<div className="tips mb10"><i className="iconfont icon-shanchu_tc_icon1 font-24 mr10" style={{color: '#ffa13a'}}></i><span className="tipTitle font-16">确定提交作品</span></div>
|
||||
<span>提交后作品文件将无法修改!</span>
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
return(
|
||||
competitionId=="qz2022"? <Qz2022 {...props} />:<Ccks {...props} />
|
||||
)
|
||||
}
|
||||
export default Introduce;
|
||||
}
|
|
@ -1,53 +1,151 @@
|
|||
.refer_bg{
|
||||
padding: 40px 0 60px;
|
||||
.refer_bg {
|
||||
padding: 40px 0 60px;
|
||||
}
|
||||
.refer{
|
||||
background-color:white;
|
||||
// border:1px solid rgba(46, 91, 254, 0.37);
|
||||
border-radius:4px 4px 0px 0px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
padding: 66px 0 86px;
|
||||
.refer_img{
|
||||
width: 48px;
|
||||
.refer {
|
||||
position: relative;
|
||||
background-color: white;
|
||||
// border:1px solid rgba(46, 91, 254, 0.37);
|
||||
border-radius: 4px 4px 0px 0px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
padding: 66px 0 86px;
|
||||
.refer_img {
|
||||
width: 48px;
|
||||
}
|
||||
.upload {
|
||||
padding: 0 28px;
|
||||
}
|
||||
.refer_tip {
|
||||
color: #595959;
|
||||
font-size: 15px;
|
||||
&.cover {
|
||||
color: red;
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
.upload{
|
||||
padding: 0 28px;
|
||||
&.cover .icon-erciqueren_icon {
|
||||
color: #fa2d2d;
|
||||
}
|
||||
.refer_tip{
|
||||
color:#595959;
|
||||
font-size:15px;
|
||||
&.cover{
|
||||
color: red;
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
&.cover .icon-erciqueren_icon{
|
||||
color: #FA2D2D;
|
||||
}
|
||||
}
|
||||
.refer_bor {
|
||||
width: 40vw;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
margin: 25px 0 35px;
|
||||
}
|
||||
> span {
|
||||
text-align: center;
|
||||
}
|
||||
.ant-upload-list-item-info {
|
||||
color: #2e5bfe;
|
||||
:hover {
|
||||
color: #2e5bfe;
|
||||
}
|
||||
.refer_bor{
|
||||
width: 40vw;
|
||||
border-bottom: 1px solid #eeeeee;
|
||||
margin: 25px 0 35px;
|
||||
.ant-upload-list-item-card-actions {
|
||||
right: -55px;
|
||||
.anticon {
|
||||
padding-right: 10px;
|
||||
}
|
||||
}
|
||||
>span{
|
||||
text-align: center;
|
||||
& a:link {
|
||||
color: #2e5bfe;
|
||||
}
|
||||
.ant-upload-list-item-info{
|
||||
color: #2e5bfe;
|
||||
:hover{color: #2e5bfe;}
|
||||
.ant-upload-list-item-card-actions{
|
||||
right: -55px;
|
||||
.anticon{padding-right: 10px;}
|
||||
}
|
||||
& a:link{
|
||||
color: #2e5bfe;
|
||||
}
|
||||
}
|
||||
.ant-upload-list-item:hover .ant-upload-list-item-info {
|
||||
background: none;
|
||||
}
|
||||
.ant-upload-list-item {
|
||||
text-overflow: ellipsis;
|
||||
max-width: 46vw;
|
||||
}
|
||||
|
||||
&.ccks_refer {
|
||||
border-radius: 10px;
|
||||
padding: 24px 57px;
|
||||
.refer_content {
|
||||
text-align: center;
|
||||
width: 100%;
|
||||
height: 252px;
|
||||
background-image: linear-gradient(180deg, #f7fafe 0%, #f2f8ff 100%);
|
||||
border: 1px dashed #c0c4d3;
|
||||
|
||||
.refer_img {
|
||||
width: 92px;
|
||||
margin: 33px auto 24px;
|
||||
}
|
||||
}
|
||||
.ant-upload-list-item:hover .ant-upload-list-item-info{background: none;}
|
||||
.ant-upload-list-item{
|
||||
text-overflow: ellipsis;
|
||||
max-width: 46vw;
|
||||
|
||||
.upload {
|
||||
color: #4154f1;
|
||||
border-color: #4154f1;
|
||||
&:hover {
|
||||
opacity: 0.75;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.refer_tip {
|
||||
color: #243b55;
|
||||
font-size: 17px;
|
||||
text-align: center;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
|
||||
.ccks_csv {
|
||||
align-self: flex-start;
|
||||
margin-top: 24px;
|
||||
color: #243b55;
|
||||
font-size: 15px;
|
||||
display: flex;
|
||||
.ccks_csv_img {
|
||||
width: 34px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.filesize {
|
||||
margin-left: 10px;
|
||||
color: #90a0b2;
|
||||
}
|
||||
|
||||
.error_text{
|
||||
margin-left: 30px;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-btn-primary{
|
||||
margin-top:35px;
|
||||
}
|
||||
.refer_tit {
|
||||
font-weight: 700;
|
||||
color: #0b1929;
|
||||
font-size: 18px;
|
||||
align-self: flex-start;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.rang-bg {
|
||||
position: relative;
|
||||
background-color: #f7f7f7;
|
||||
padding:40px 0 70px;
|
||||
|
||||
.rank_bg1{
|
||||
position: absolute;
|
||||
width: 33.45vw;
|
||||
height: 27.5vw;
|
||||
background-image: url("../image/rank_bg1.png");
|
||||
background-size: 100% 100%;
|
||||
left:0;
|
||||
z-index: 0;
|
||||
}
|
||||
.rank_bg2{
|
||||
position: absolute;
|
||||
width: 33.45vw;
|
||||
height: 27.5vw;
|
||||
top:10vw;
|
||||
right: 0;
|
||||
z-index: 0;
|
||||
background-image: url("../image/rank_bg1.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import { Prompt } from 'react-router-dom'
|
||||
import { Select, Button, Upload, Modal, Icon, message } from 'antd';
|
||||
import { appendFileSizeToUploadFileAll, getUploadActionUrl } from 'educoder';
|
||||
import { current_main_site_url } from '../fetch.js';
|
||||
import { uploadCompetition } from '../api';
|
||||
import refer from "../image/refer.svg";
|
||||
|
||||
import './index.scss';
|
||||
import '../../index.scss';
|
||||
import '../apply/index.scss';
|
||||
|
||||
function Introduce({ form, showNotification, match, history, enrollStatus, current_user, qzDetail, setReload }) {
|
||||
const { competitionId } = match.params;
|
||||
// 上传文件时 按钮loading效果
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [files, setFiles] = useState();
|
||||
// 用户是否更改上传的作品列表
|
||||
const [changeFiles, setChangeFiles] = useState(false);
|
||||
const [visible, setVisible] = useState(false);
|
||||
|
||||
window.onbeforeunload = function (e) {
|
||||
if (changeFiles) {
|
||||
e.returnValue = "离开此页面将不保留已上传的作品文件,确定离开?";
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
// referStatus : 当前时间不处于提案提交时间
|
||||
const referStatus = qzDetail && !(Date.parse(new Date()) > Date.parse(new Date(qzDetail.enroll_date)) && Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date)));
|
||||
// 当前时间不处于提案提交时间 或者用户未登录情况下 或者用户未报名 通过URL访问此页面,跳转到大赛介绍页面 或者用户报名信息被驳回未处理(enrollStatus.status = 0)
|
||||
if (referStatus || (current_user && !current_user.login) || (enrollStatus && (!enrollStatus.enroll_status || enrollStatus.status === 0))) {
|
||||
history.push(`/competition/${competitionId}`);
|
||||
}
|
||||
}, [qzDetail, current_user, enrollStatus])
|
||||
|
||||
useEffect(() => {
|
||||
if (enrollStatus && enrollStatus.upload_status) {
|
||||
enrollStatus.attachments.map(item => {
|
||||
item.uid = 'rc-upload' + item.id;
|
||||
item.name = item.title;
|
||||
item.status = "done";
|
||||
});
|
||||
setFiles(enrollStatus.attachments);
|
||||
}
|
||||
}, [enrollStatus]);
|
||||
|
||||
function handleChange(info) {
|
||||
if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') {
|
||||
setLoading(true);
|
||||
setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1))
|
||||
}
|
||||
if (info.file.status === "done" || info.file.status === 'removed') {
|
||||
setLoading(false);
|
||||
setChangeFiles(true);
|
||||
}
|
||||
}
|
||||
|
||||
// 支持文件下载
|
||||
function download(file) {
|
||||
const fileId = file.id || file.response.id;
|
||||
window.open(`${current_main_site_url}/api/attachments/${fileId}`);
|
||||
}
|
||||
|
||||
// 进行文件大小检查
|
||||
function beforeUpload(file) {
|
||||
const isZip = file.name.endsWith(".zip") || file.name.endsWith(".tar") || file.name.endsWith(".rar");
|
||||
if (!isZip) {
|
||||
showNotification(`只能上传压缩包文件`);
|
||||
}
|
||||
const isLt100M = file.size / 1024 / 1024 < 50;
|
||||
if (!isLt100M) {
|
||||
showNotification(`文件大小必须小于${50}MB!`);
|
||||
}
|
||||
return isLt100M && isZip;
|
||||
}
|
||||
|
||||
// 作品提交
|
||||
function referProduction() {
|
||||
if (files && files.length === 1) {
|
||||
const params = {
|
||||
"attachment_ids": [files[0].response.id]
|
||||
}
|
||||
uploadCompetition(params, competitionId).then(response => {
|
||||
if (response && response.status === 200) {
|
||||
setChangeFiles(false);
|
||||
setReload(Math.random());
|
||||
setVisible(false);
|
||||
message.success('提交作品成功');
|
||||
|
||||
// 三分钟后刷新一次结果
|
||||
setTimeout(() => {
|
||||
setReload(Math.random());
|
||||
}, 180000);
|
||||
} else {
|
||||
message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
// 是否允许用户上传作品
|
||||
const upload = enrollStatus && (!enrollStatus.upload_status || enrollStatus.status === 1);
|
||||
return (
|
||||
<div className="refer_bg">
|
||||
{
|
||||
changeFiles &&
|
||||
<Prompt
|
||||
when={true}
|
||||
message={() => '离开此页面将不保留已上传的作品文件,确定离开?'}
|
||||
/>
|
||||
}
|
||||
<div className="qz_main refer ccks_refer">
|
||||
<img src={refer} className="refer_img mb20" alt="" />
|
||||
<Upload
|
||||
accept=".zip,.rar,.tar"
|
||||
// 开发时 action需要添加?debug=admin
|
||||
action={getUploadActionUrl}
|
||||
fileList={files}
|
||||
onChange={handleChange}
|
||||
onDownload={download}
|
||||
beforeUpload={beforeUpload}
|
||||
showUploadList={{
|
||||
showDownloadIcon: true,
|
||||
downloadIcon: <i className="iconfont icon-xiazai-icon"></i>,
|
||||
showRemoveIcon: false
|
||||
}}
|
||||
>
|
||||
<Button className="upload" disabled={!upload}><Icon type="upload" />{!upload ? '已' : ''}上传</Button>
|
||||
</Upload>
|
||||
<Modal />
|
||||
{/* {enrollStatus && enrollStatus.upload_status && enrollStatus.status === 1 && <div className="refer_tip mt15 cover"><i className="iconfont icon-erciqueren_icon mr10"></i>您的作品被打回,可以再次提交作品,未重新提交前保留您原来的提交记录。</div>} */}
|
||||
<div className="refer_tip mt15 cover"><i className="iconfont icon-erciqueren_icon mr10"></i>{enrollStatus && enrollStatus.upload_status && enrollStatus.status === 1 ? "您的作品被打回,可以再次提交作品,未重新提交前保留您原来的提交记录。" : "提案提交后不允许再修改,如有问题请联系分赛区管理员"}</div>
|
||||
<div className="refer_tip mt20">上传单个作品压缩包(仅限上传一个压缩包)</div>
|
||||
<div className="refer_bor"></div>
|
||||
<Button type="primary" onClick={() => { changeFiles ? setVisible(true) : message.error("您暂未上传作品文件") }} loading={loading} disabled={!upload}>{!upload ? '已' : ''}提交作品</Button>
|
||||
</div>
|
||||
<Modal
|
||||
title="提示"
|
||||
visible={visible}
|
||||
onOk={referProduction}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
centered
|
||||
wrapClassName="applyInfoCon"
|
||||
cancelText=""
|
||||
>
|
||||
<div className="tips mb10"><i className="iconfont icon-shanchu_tc_icon1 font-24 mr10" style={{ color: '#ffa13a' }}></i><span className="tipTitle font-16">确定提交作品</span></div>
|
||||
<span>提交后作品文件将无法修改!</span>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Introduce;
|
|
@ -97,7 +97,8 @@ service.interceptors.response.use(
|
|||
message: "提示",
|
||||
description: res.data.message || '无权限!',
|
||||
});
|
||||
if(window.location.port !== "3007"){
|
||||
if(window.location.port !== "3007" && !res.config.url.startsWith('/api/tasks/getTask/')){
|
||||
// console.log(res);
|
||||
window.location.href="/403";
|
||||
}
|
||||
return Promise.reject('error');
|
||||
|
|
|
@ -4,6 +4,7 @@ import { getImageUrl } from 'educoder';
|
|||
import Nodata from 'forge/Nodata';
|
||||
import { taskStatusAllArr } from '../../static';
|
||||
import Loading from "src/Loading";
|
||||
import chuangke_icon from '../../image/chuangke_icon.svg';
|
||||
import './index.scss';
|
||||
|
||||
const statusArr = [];
|
||||
|
@ -31,7 +32,10 @@ export default (props) => {
|
|||
<div className="list-box" key={item.id}>
|
||||
<div className="list-content">
|
||||
<div className="list-title mb10" onClick={() => { itemClick(item.id) }}>
|
||||
{/* {item.enterpriseName=="taohuayuan" ||item.enterpriseName=="军工企业" && <div className="chuangke_icon">创客行动-2022</div>} */}
|
||||
{item.enterpriseName=="taohuayuan" && <img className="chuangke_icon" src={chuangke_icon}/>}
|
||||
<div className="title-content text-ellipsis">{item.name}</div>
|
||||
{/* 为创客行动特地加的标签,以后会去除 */}
|
||||
{item.status && <span className={classArr[item.status]}>{item.exceptClosedBoolean ? '已关闭' : statusArr[item.status]}</span>}
|
||||
{(item.status !== 8) && item.delayTime.indexOf('延期') > -1 ? <span className="list-yellow">延期中</span>
|
||||
: <React.Fragment>
|
||||
|
|
|
@ -32,6 +32,28 @@
|
|||
display: inline-block;
|
||||
max-width: 80%;
|
||||
}
|
||||
.chuangke_icon{
|
||||
position: relative;
|
||||
top:-10px;
|
||||
margin-left: -40px;
|
||||
}
|
||||
// .chuangke_icon{
|
||||
// position: relative;
|
||||
// top:-8px;
|
||||
// background-image: url("../../image/chuangke_icon.png");
|
||||
// width: 140px;
|
||||
// height: 46px;
|
||||
// background-size: 100% 100%;
|
||||
// font-size: 14px;
|
||||
// color: #fff;
|
||||
// display: flex;
|
||||
// transform: scale(0.75);
|
||||
// justify-content: center;
|
||||
// align-items: center;
|
||||
// padding-left: 10px;
|
||||
// margin-right: -15px;
|
||||
// margin-left: -27px;
|
||||
// }
|
||||
}
|
||||
.list-title:hover {
|
||||
color: #4154f1;
|
||||
|
@ -55,3 +77,4 @@
|
|||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
After Width: | Height: | Size: 6.7 KiB |
|
@ -29,7 +29,7 @@ for (const item of applyStatusAllArr) {
|
|||
|
||||
export default Form.create()(
|
||||
forwardRef((props, ref) => {
|
||||
const { match, current_user, form, history, showNotification, mygetHelmetapi } = props;
|
||||
const { match, current_user, form, history, showNotification, mygetHelmetapi ,showLoginDialog} = props;
|
||||
const id = match.params.taskId;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
|
||||
|
@ -57,6 +57,11 @@ export default Form.create()(
|
|||
// 已发布评审任务 评审规则
|
||||
const [publishedReviewRules, setPublishedReviewRules] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
!current_user.login&&showLoginDialog();
|
||||
},[current_user.login]);
|
||||
|
||||
|
||||
// 获取任务领域配置数据
|
||||
useEffect(() => {
|
||||
getTaskCategory().then(data => {
|
||||
|
@ -87,21 +92,21 @@ export default Form.create()(
|
|||
|
||||
// 检查用户是否同意协议
|
||||
useEffect(() => {
|
||||
current_user.user_id && id && checkAgreement(id).then(res => {
|
||||
current_user.login && id && checkAgreement(id).then(res => {
|
||||
if (res && res.data && res.data.status === 1) {
|
||||
setSignAgreement(true);
|
||||
}
|
||||
})
|
||||
}, [current_user.user_id]);
|
||||
}, [current_user.login]);
|
||||
|
||||
// 检查用户是否上传成果
|
||||
useEffect(() => {
|
||||
current_user.user_id && id && checkHavePaper(id).then(res => {
|
||||
current_user.login && id && checkHavePaper(id).then(res => {
|
||||
if (res && res.data && res.data.status === 1) {
|
||||
setIsPaper(true);
|
||||
}
|
||||
})
|
||||
}, [current_user.user_id]);
|
||||
}, [current_user.login]);
|
||||
|
||||
const taskLimit = useMemo(() => {
|
||||
if (current_user.admin) {
|
||||
|
@ -114,7 +119,7 @@ export default Form.create()(
|
|||
|
||||
// 获取协议内容
|
||||
useEffect(() => {
|
||||
applyModal && getAgreement(1).then(res => {
|
||||
applyModal&¤t_user.login && getAgreement(1).then(res => {
|
||||
if (res && res.data) {
|
||||
setApplyContent({
|
||||
title: res.data.title,
|
||||
|
@ -122,12 +127,12 @@ export default Form.create()(
|
|||
});
|
||||
}
|
||||
});
|
||||
}, [applyModal]);
|
||||
}, [applyModal,current_user.login]);
|
||||
|
||||
// 获取成果列表
|
||||
useEffect(() => {
|
||||
// 等加载完成果详情再加载成果列表
|
||||
if (detailData.id) {
|
||||
if (detailData.id && current_user.login) {
|
||||
setLoading(true);
|
||||
let params = {
|
||||
taskId: id,
|
||||
|
@ -150,7 +155,7 @@ export default Form.create()(
|
|||
setTotal(data.total);
|
||||
});
|
||||
}
|
||||
}, [id, status, curPage, reload, relaodChildList, detailData]);
|
||||
}, [id, status, curPage, reload, relaodChildList, detailData ,current_user.login]);
|
||||
|
||||
|
||||
// 流程步骤显示,返回剩余时间
|
||||
|
@ -354,7 +359,8 @@ export default Form.create()(
|
|||
)
|
||||
} else if (detailData.user && (current_user.login !== detailData.user.login)) {
|
||||
return <div className="edu-back-white padding30 mt20 text-center">
|
||||
<Button className="mr20" type={"primary"} onClick={() => { setApplyModal(true) }}>我要应征投稿</Button>
|
||||
{/* 为创客大赛,暂时disable应征投稿 */}
|
||||
<Button className="mr20" type={"primary"} onClick={() => { setApplyModal(true) }} disabled>我要应征投稿</Button>
|
||||
</div>
|
||||
}
|
||||
}, [signAgreement, isPaper, current_user, detailData, dataList]);
|
||||
|
@ -451,7 +457,8 @@ export default Form.create()(
|
|||
</React.Fragment>
|
||||
}
|
||||
|
||||
<div className="font-16 font-bd mt10">知识产权说明:</div>
|
||||
{/* 配合创客大赛,暂时注释,以后还原 */}
|
||||
{/* <div className="font-16 font-bd mt10">知识产权说明:</div>
|
||||
<p className="color-grey-6 lineh-20 padding10-15 mb10">
|
||||
1、参赛作品一经采用,其所有权、修改权和使用权均归主办方所有,设计者不得再在任何地方使用;<br />
|
||||
2、应征者所提交的作品必须由应征者本人创作或参与创作,应征者应确认其作品的原创性,主办单位不承担因作品侵犯他人(或单位)的权利而产生的法律责任,其法律责任由应征者本人承担。
|
||||
|
@ -459,7 +466,8 @@ export default Form.create()(
|
|||
<div className="font-16 font-bd">交稿声明:</div>
|
||||
<p className="color-grey-6 lineh-20 padding10-15 mb10">
|
||||
应征者提交的稿件必须是设计作品,广告等无效交稿一律不采用!
|
||||
</p>
|
||||
</p> */}
|
||||
|
||||
{publishedReviewRules && <React.Fragment>
|
||||
<div className="font-16 font-bd">评审规则:</div>
|
||||
<p className="color-grey-6 lineh-20 padding10-15 mb10">{publishedReviewRules.rule}</p>
|
||||
|
@ -470,10 +478,14 @@ export default Form.create()(
|
|||
</React.Fragment>}
|
||||
</div>
|
||||
|
||||
{!current_user.enterpriseCertification && <div className="edu-back-white padding30 mt20 font-16 text-center mb50">
|
||||
{!current_user.enterpriseCertification && current_user.login &&<div className="edu-back-white padding30 mt20 font-16 text-center mb50">
|
||||
<a onClick={goUserProfiles} className="color-blue_41">请先完善主体信息</a>
|
||||
</div>}
|
||||
|
||||
{!current_user.login &&<div className="edu-back-white padding30 mt20 font-16 text-center mb50">
|
||||
<span className="color-blue_41">创客任务仅限登录用户查看,请先注册登录红山开源账号!</span>
|
||||
</div>}
|
||||
|
||||
{current_user.enterpriseCertification && detailData.status === 3 && (!detailData.exceptClosedBoolean) && signContent()}
|
||||
|
||||
<div className="applyList edu-back-white padding30 mt20">
|
||||
|
|
|
@ -150,12 +150,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
.task-detail{
|
||||
.ant-btn-primary{
|
||||
background-color:#4154f1;
|
||||
border-color: #4154f1;
|
||||
}
|
||||
}
|
||||
|
||||
.agreement-content{
|
||||
box-sizing: border-box;
|
||||
|
|
|
@ -11,7 +11,7 @@ class Shixunauthority extends Component {
|
|||
{/*mt100 mb100*/}
|
||||
<img src={getImageUrl("images/warn/pic_403.jpg")} />
|
||||
<p className="font-18 mt40">
|
||||
您可以稍后尝试 <a href="/"
|
||||
无权限,您可以登录或切换账号后尝试 <a href="/"
|
||||
className="color-blue">返回首页</a>
|
||||
{/* ,或者
|
||||
<a target="_blank"
|
||||
|
|