定制竞赛issue
This commit is contained in:
parent
d6dda2a980
commit
507fe8788f
|
@ -100,7 +100,6 @@ const Qz2022 = (props) => {
|
||||||
applyStatus = Date.parse(new Date()) < Date.parse(new Date(qzDetail.enroll_date));
|
applyStatus = Date.parse(new Date()) < Date.parse(new Date(qzDetail.enroll_date));
|
||||||
referStatus = !applyStatus && Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date));
|
referStatus = !applyStatus && Date.parse(new Date()) < Date.parse(new Date(qzDetail.upload_date));
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{/* banner图+选项 */}
|
{/* banner图+选项 */}
|
||||||
|
@ -120,8 +119,11 @@ const Qz2022 = (props) => {
|
||||||
<li className={active === "apply" ? "active" : ""}>
|
<li className={active === "apply" ? "active" : ""}>
|
||||||
<Link to={{ pathname: applyStatus ? '/competition/qz2022/apply' :'' }} onClick={()=>{current_user && current_user.login ? !applyStatus && props.showNotification("当前不处于报名时间") : props.showLoginDialog()}}>参赛报名</Link>
|
<Link to={{ pathname: applyStatus ? '/competition/qz2022/apply' :'' }} onClick={()=>{current_user && current_user.login ? !applyStatus && props.showNotification("当前不处于报名时间") : props.showLoginDialog()}}>参赛报名</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className={active === "refer" ? "active" : ""}>
|
{/* <li className={active === "refer" ? "active" : ""}>
|
||||||
<Link to={{ pathname: referStatus ? `/competition/qz2022/refer` : '' }} onClick={()=>{current_user && current_user.login ? !referStatus && props.showNotification("未到作品提交时间,请耐心等待") : props.showLoginDialog()}}>提案提交</Link>
|
<Link to={{ pathname: referStatus ? `/competition/qz2022/refer` : '' }} onClick={()=>{current_user && current_user.login ? !referStatus && props.showNotification("未到作品提交时间,请耐心等待") : props.showLoginDialog()}}>提案提交</Link>
|
||||||
|
</li> */}
|
||||||
|
<li className={active === "refer" ? "active" : ""}>
|
||||||
|
<Link to={{ pathname: `/competition/qz2022/refer`}}>提案提交</Link>
|
||||||
</li>
|
</li>
|
||||||
<li className={active === "statistics" ? "active" : ""}>
|
<li className={active === "statistics" ? "active" : ""}>
|
||||||
<Link to={{ pathname: `/competition/qz2022/statistics` }}>数据统计</Link>
|
<Link to={{ pathname: `/competition/qz2022/statistics` }}>数据统计</Link>
|
||||||
|
|
|
@ -162,7 +162,7 @@ export default Form.create()((props) => {
|
||||||
<p className="mt10">成员 : </p>
|
<p className="mt10">成员 : </p>
|
||||||
<p className="error_message">{errorMessage}</p>
|
<p className="error_message">{errorMessage}</p>
|
||||||
{/* */}
|
{/* */}
|
||||||
<EditTable setMembers={setMembers}/>
|
<EditTable setMembers={setMembers} isLocal = {qzDetail && qzDetail.is_local}/>
|
||||||
</div>
|
</div>
|
||||||
</Form>}
|
</Form>}
|
||||||
{/* 已报名,报名信息 */}
|
{/* 已报名,报名信息 */}
|
||||||
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
import React from "react";
|
||||||
|
import chatSvg from "../image/chat.svg";
|
||||||
|
import btn from "../image/btn-right.png";
|
||||||
|
import './index.scss';
|
||||||
|
import '../../index.scss';
|
||||||
|
|
||||||
|
function Chat({ form, showNotification, match, history }) {
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="chat qz_main clearfix">
|
||||||
|
<img className="chat-left" src={chatSvg} ></img>
|
||||||
|
<div className="chat-words">
|
||||||
|
<div className="chat-tit">交流互动</div>
|
||||||
|
<div className="chat-content">
|
||||||
|
<p>集萃群智体会</p>
|
||||||
|
<p>与论坛成员交流比赛经验,分享参赛心得</p>
|
||||||
|
<p>汇聚赛事资讯</p>
|
||||||
|
<p>助您第一时间解读竞赛动态,把握赛事脉搏</p>
|
||||||
|
</div>
|
||||||
|
<div className="chat-btn" onClick={()=>{window.open('https://fc.osredm.com/forums/theme/105')}}>
|
||||||
|
<span className="detail1">了解详情</span>
|
||||||
|
<img
|
||||||
|
className="iconPlay1"
|
||||||
|
src={btn}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Chat;
|
|
@ -0,0 +1,62 @@
|
||||||
|
.chat {
|
||||||
|
margin: 9rem auto;
|
||||||
|
padding: 0 1.5rem;
|
||||||
|
background: #fff;
|
||||||
|
.chat-left {
|
||||||
|
float: left;
|
||||||
|
position: relative;
|
||||||
|
top: -5rem;
|
||||||
|
width: 56.6%;
|
||||||
|
box-shadow: 0px 3px 8px rgba(219, 227, 255, 0.7) inset;
|
||||||
|
margin-bottom: -3.5rem;
|
||||||
|
padding: 1.25rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-words {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 1.5rem;
|
||||||
|
}
|
||||||
|
.chat-tit {
|
||||||
|
display: inline-block;
|
||||||
|
font-weight: 700;
|
||||||
|
color: #2e3341;
|
||||||
|
font-size: 1.25rem;
|
||||||
|
line-height: 1rem;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
content: "";
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
height: 1px;
|
||||||
|
background-color: #2e5bfe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.chat-conten {
|
||||||
|
font-size: 1rem;
|
||||||
|
line-height: 1.625rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chat-btn {
|
||||||
|
margin-top:1.5rem;
|
||||||
|
width: 9.5rem;
|
||||||
|
height: 2.5rem;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border: 2px solid #2e5bfe;
|
||||||
|
background-color: #2e5bfe;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detail1 {
|
||||||
|
white-space: nowrap;
|
||||||
|
color: #ffffff;
|
||||||
|
font-size: 1rem;
|
||||||
|
font-weight: 400;
|
||||||
|
margin-left:1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iconPlay1 {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
}
|
|
@ -107,7 +107,7 @@ function Introduce({history:{location:{pathname}},qzDetail }) {
|
||||||
title: '作品',
|
title: '作品',
|
||||||
dataIndex: 'attachments',
|
dataIndex: 'attachments',
|
||||||
render:(text, record)=>{
|
render:(text, record)=>{
|
||||||
return <Tooltip title={text[0].title}><a href={current_main_site_url+text[0].url} className="attachments_a">{text[0].title}</a></Tooltip>;
|
return <Tooltip title={text && text[0].title}><a href={current_main_site_url+text && text[0].url} className="attachments_a">{text && text[0].title}</a></Tooltip>;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -200,12 +200,12 @@ function Introduce({history:{location:{pathname}},qzDetail }) {
|
||||||
赛区:
|
赛区:
|
||||||
<Select defaultValue="-1" style={{ width: 200 }} onChange={(value)=>{setZone(value)}}>
|
<Select defaultValue="-1" style={{ width: 200 }} onChange={(value)=>{setZone(value)}}>
|
||||||
<Option value='-1'>所有赛区</Option>
|
<Option value='-1'>所有赛区</Option>
|
||||||
{qzDetail && qzDetail.zones.map((item,i)=> {return <Option value={i} key={i}>{item}</Option>})}
|
{qzDetail && qzDetail.zones.map((item,i)=> {return <Option value={item} key={i}>{item}</Option>})}
|
||||||
</Select>
|
</Select>
|
||||||
<span className="ml30">赛项:</span>
|
<span className="ml30">赛项:</span>
|
||||||
<Select defaultValue="-1" style={{ width: 200 }} onChange={(value)=>{setSubCompetition(value)}}>
|
<Select defaultValue="-1" style={{ width: 200 }} onChange={(value)=>{setSubCompetition(value)}}>
|
||||||
<Option value='-1'>所有赛项</Option>
|
<Option value='-1'>所有赛项</Option>
|
||||||
{qzDetail && qzDetail.sub_competitions.map((item,i)=> {return <Option value={i} key={i}>{item}</Option>})}
|
{qzDetail && qzDetail.sub_competitions.map((item,i)=> {return <Option value={item} key={i}>{item}</Option>})}
|
||||||
</Select>
|
</Select>
|
||||||
</div>
|
</div>
|
||||||
<a href={current_main_site_url+`/api/competition_infos/qz2022/enroll_list.xlsx${type === "applys"? '':"?upload=true"}`}><Button className="but_2e5">导出</Button></a>
|
<a href={current_main_site_url+`/api/competition_infos/qz2022/enroll_list.xlsx${type === "applys"? '':"?upload=true"}`}><Button className="but_2e5">导出</Button></a>
|
||||||
|
|
|
@ -38,4 +38,10 @@
|
||||||
.attachments_a{
|
.attachments_a{
|
||||||
color: #2e5bfe;
|
color: #2e5bfe;
|
||||||
}
|
}
|
||||||
|
.qzManageTable .ant-table-tbody > tr > td{
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 100px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,94 +0,0 @@
|
||||||
import React, { useEffect, useState } from "react";
|
|
||||||
import { Upload, Button } from 'antd';
|
|
||||||
import { appendFileSizeToUploadFileAll } from 'educoder';
|
|
||||||
import { httpUrl } from '../fetch';
|
|
||||||
|
|
||||||
function Uploads({ className, size, actionUrl, fileList, showNotification, load, accept, disabled,count }) {
|
|
||||||
const [files, setFiles] = useState(undefined);
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (fileList) {
|
|
||||||
init();
|
|
||||||
}
|
|
||||||
}, [fileList]);
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
let f = appendFileSizeToUploadFileAll(fileList);
|
|
||||||
setFiles(f);
|
|
||||||
}
|
|
||||||
function onAttachmentRemove(file) {
|
|
||||||
if (!file.percent || file.percent === 100) {
|
|
||||||
deleteAttachment(file);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
function deleteAttachment(file) {
|
|
||||||
let id = (file.response && file.response.data && file.response.data.id) || file.id;
|
|
||||||
|
|
||||||
// 暂时不直接删除上传的文件,只在最后保存的时候进行修改
|
|
||||||
let nf = files.filter(item => {
|
|
||||||
let itemId = (item.response && item.response.data && item.response.data.id) || item.id;
|
|
||||||
return itemId !== id;
|
|
||||||
});
|
|
||||||
setFiles(nf);
|
|
||||||
backFiles(nf);
|
|
||||||
}
|
|
||||||
|
|
||||||
function backFiles(fileList) {
|
|
||||||
let filesId = [];
|
|
||||||
for (const item of fileList) {
|
|
||||||
if (item) {
|
|
||||||
let itemId = (item.response && item.response.data && item.response.data.id) || item.id;
|
|
||||||
itemId && filesId.push(itemId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
load && load(fileList, filesId.join());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function handleChange(info) {
|
|
||||||
if (info.file.status === 'uploading' || info.file.status === 'done' || info.file.status === 'removed') {
|
|
||||||
let fileList = info.fileList;
|
|
||||||
if(count){
|
|
||||||
fileList = fileList.slice(-count);
|
|
||||||
}
|
|
||||||
setFiles(appendFileSizeToUploadFileAll(fileList));
|
|
||||||
if (info.file.response) {
|
|
||||||
for (let i = 0; i < fileList.length; i++) {
|
|
||||||
if (fileList[i].response && !fileList[i].response.data) {
|
|
||||||
fileList.splice(i, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
backFiles(fileList);
|
|
||||||
if (!info.file.response.data) {
|
|
||||||
info.file.response && showNotification(info.file.response.message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function beforeUpload(file) {
|
|
||||||
const isLt100M = file.size / 1024 / 1024 < size;
|
|
||||||
if (!isLt100M) {
|
|
||||||
showNotification(`文件大小必须小于${size}MB!`);
|
|
||||||
}
|
|
||||||
return isLt100M;
|
|
||||||
}
|
|
||||||
|
|
||||||
const upload = {
|
|
||||||
name: 'file',
|
|
||||||
fileList: files,
|
|
||||||
disabled: disabled,
|
|
||||||
action: (httpUrl || actionUrl) + `/busiAttachments/upload`,
|
|
||||||
onChange: handleChange,
|
|
||||||
onRemove: onAttachmentRemove,
|
|
||||||
beforeUpload: beforeUpload,
|
|
||||||
};
|
|
||||||
return (
|
|
||||||
<Upload {...upload} className={className}>
|
|
||||||
<Button type="primary" disabled={disabled}>点击上传</Button>
|
|
||||||
<span className="ml10 color-grey-9">(你可以上传小于<span className="color-red">{size}MB</span>的文件)</span>
|
|
||||||
</Upload>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
export default Uploads;
|
|
|
@ -49,11 +49,15 @@ function Introduce({ form, showNotification, match, history, enrollStatus }) {
|
||||||
|
|
||||||
// 进行文件大小检查
|
// 进行文件大小检查
|
||||||
function beforeUpload(file){
|
function beforeUpload(file){
|
||||||
const isLt100M = file.size / 1024 / 1024 < 256;
|
const isZip = file.name.endsWith(".zip") || file.name.endsWith(".tar") || file.name.endsWith(".rar");
|
||||||
|
if(!isZip){
|
||||||
|
showNotification(`只能上传压缩包文件`);
|
||||||
|
}
|
||||||
|
const isLt100M = file.size / 1024 / 1024 < 1024;
|
||||||
if (!isLt100M) {
|
if (!isLt100M) {
|
||||||
showNotification(`文件大小必须小于${256}MB!`);
|
showNotification(`文件大小必须小于${256}MB!`);
|
||||||
}
|
}
|
||||||
return isLt100M;
|
return isLt100M && isZip;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 作品提交
|
// 作品提交
|
||||||
|
@ -72,7 +76,7 @@ function Introduce({ form, showNotification, match, history, enrollStatus }) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="qz_main refer">
|
<div className="qz_main refer mt40 mb60">
|
||||||
<img src={refer} className="refer_img mb20"/>
|
<img src={refer} className="refer_img mb20"/>
|
||||||
<Upload
|
<Upload
|
||||||
accept=".zip,.rar,.tar"
|
accept=".zip,.rar,.tar"
|
||||||
|
@ -84,7 +88,8 @@ function Introduce({ form, showNotification, match, history, enrollStatus }) {
|
||||||
beforeUpload={beforeUpload}
|
beforeUpload={beforeUpload}
|
||||||
showUploadList={{
|
showUploadList={{
|
||||||
showDownloadIcon: true,
|
showDownloadIcon: true,
|
||||||
downloadIcon: <i className="iconfont icon-xiazai-icon"></i>
|
downloadIcon: <i className="iconfont icon-xiazai-icon"></i>,
|
||||||
|
showRemoveIcon: false
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Button className="upload"><Icon type="upload" />上传</Button>
|
<Button className="upload"><Icon type="upload" />上传</Button>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: 66px 0 86px;
|
padding: 66px 0 86px;
|
||||||
|
margin-top: 50px;
|
||||||
.refer_img{
|
.refer_img{
|
||||||
width: 48px;
|
width: 48px;
|
||||||
}
|
}
|
||||||
|
@ -43,4 +44,8 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ant-upload-list-item:hover .ant-upload-list-item-info{background: none;}
|
.ant-upload-list-item:hover .ant-upload-list-item-info{background: none;}
|
||||||
|
.ant-upload-list-item{
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
max-width: 46vw;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue