forked from Gitlink/forgeplus-react
This commit is contained in:
parent
0ee81bdbcb
commit
73e19d8937
|
@ -68,6 +68,7 @@ export function appendFileSizeToUploadFile(item) {
|
|||
return `${item.title}${uploadNameSizeSeperator}${item.filesize}`
|
||||
}
|
||||
export function appendFileSizeToUploadFileAll(fileList) {
|
||||
console.log('fileList',fileList);
|
||||
return fileList && fileList.map(item => {
|
||||
if(!item.name)item.name=item.fileName;
|
||||
if(!item.uid)item.uid="rc-upload" + item.id;
|
||||
|
|
|
@ -13,7 +13,7 @@ import './qz2022/index.scss';
|
|||
import { Button, Dropdown, Menu, Popover, Spin } from "antd";
|
||||
import banner from './qz2022/image/banner.png'
|
||||
import { paths } from "./qz2022/static";
|
||||
import { getQz2022 } from "./qz2022/api";
|
||||
import { getQz2022, userCompetitionStatus } from "./qz2022/api";
|
||||
|
||||
const Introduce = Loadable({
|
||||
loader: () => import('./qz2022/introduce'),
|
||||
|
@ -64,13 +64,13 @@ const menu = (
|
|||
);
|
||||
|
||||
const Qz2022 = (props) => {
|
||||
// const history:{location:{pathname}}
|
||||
const {history} = props;
|
||||
const {history, current_user} = props;
|
||||
const {location} = history;
|
||||
const {pathname} = location;
|
||||
const [active, setActive] = useState();
|
||||
const [reload, setReload] = useState();
|
||||
const [qzDetail, setQzDetail] = useState();
|
||||
console.log(active);
|
||||
const [enrollStatus, setEnrollStatus] = useState();
|
||||
|
||||
useEffect(()=>{
|
||||
setActive(pathname.substring(pathname.lastIndexOf('/')+1, pathname.lenght));
|
||||
|
@ -79,12 +79,21 @@ const Qz2022 = (props) => {
|
|||
useEffect(()=>{
|
||||
// 获取启智2022详情
|
||||
getQz2022().then(response=>{
|
||||
if(response && response.message==="success"){
|
||||
setQzDetail(response.data);
|
||||
if(response && response.status===200){
|
||||
setQzDetail(response.data.data);
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
useEffect(()=>{
|
||||
// 获取用户参与竞赛状态
|
||||
userCompetitionStatus('qz2022').then(response=>{
|
||||
if(response && response.status === 200){
|
||||
setEnrollStatus(response.data.data);
|
||||
}
|
||||
})
|
||||
}, [reload])
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{/* banner图+选项 */}
|
||||
|
@ -100,12 +109,12 @@ const Qz2022 = (props) => {
|
|||
<li className={active === "notice" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/competition/qz2022/notice` }}>通知公告</Link>
|
||||
</li>
|
||||
<li className={active === "apply" ? "active" : ""}>
|
||||
{current_user && current_user.login ? <li className={active === "apply" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/competition/qz2022/apply` }}>参赛报名</Link>
|
||||
</li>
|
||||
<li className={active === "refer" ? "active" : ""}>
|
||||
</li> : props.showLoginDialog}
|
||||
{current_user && current_user.login ? <li className={active === "refer" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/competition/qz2022/refer` }}>提案提交</Link>
|
||||
</li>
|
||||
</li> : props.showLoginDialog}
|
||||
<li className={active === "statistics" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/competition/qz2022/statistics` }}>数据统计</Link>
|
||||
</li>
|
||||
|
@ -115,11 +124,11 @@ const Qz2022 = (props) => {
|
|||
<li className={active === "contact" ? "active" : ""}>
|
||||
<Link to={{ pathname: `/competition/qz2022/contact` }}>联系我们</Link>
|
||||
</li>
|
||||
<li className={(active === "applys" || active === "production") ? "active" : ""}>
|
||||
{current_user && current_user.login && current_user.admin && <li className={(active === "applys" || active === "production") ? "active" : ""}>
|
||||
<Popover content={menu} placement="bottomRight" overlayClassName="qz_manage">
|
||||
<a>后台管理</a>
|
||||
</Popover>
|
||||
</li>
|
||||
</li>}
|
||||
</ul>}
|
||||
{paths.indexOf(active) !== -1 && <div className="menu_border mt20 qz_main"></div>}
|
||||
<Spin spinning={false} wrapperClassName="spinstyle qzCont" tip="正在同步镜像" size="large">
|
||||
|
@ -133,7 +142,7 @@ const Qz2022 = (props) => {
|
|||
{/* 大赛指南 */}
|
||||
<Route path="/competition/qz2022/fingerpost"
|
||||
render={
|
||||
() => (<Fingerpost {...props} />)
|
||||
() => (<Fingerpost {...props} qzDetail={qzDetail}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 通知公告详情页 */}
|
||||
|
@ -151,13 +160,13 @@ const Qz2022 = (props) => {
|
|||
{/* 参赛报名 */}
|
||||
<Route path="/competition/qz2022/apply"
|
||||
render={
|
||||
() => (<Apply {...props} qzDetail={qzDetail}/>)
|
||||
() => (<Apply {...props} qzDetail={qzDetail} enrollStatus={enrollStatus} setReload={setReload}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 提案提交 */}
|
||||
<Route path="/competition/qz2022/refer"
|
||||
render={
|
||||
() => (<Refer {...props}/>)
|
||||
() => (<Refer {...props} enrollStatus={enrollStatus}/>)
|
||||
}
|
||||
></Route>
|
||||
{/* 交流互动 */}
|
||||
|
|
|
@ -1,298 +1,31 @@
|
|||
import fetch,{main_web_site_url, current_main_site_url} from './fetch';
|
||||
import { notification } from 'antd';
|
||||
import axios from 'axios';
|
||||
|
||||
// 用户参与启智2022状态
|
||||
// 用户参与启智2022状态?debug=teacher
|
||||
export async function userCompetitionStatus(id) {
|
||||
let res = await fetch({
|
||||
url: `${current_main_site_url}/api/competition_infos/${id}/enroll_status.json`,
|
||||
method: 'get'
|
||||
});
|
||||
return res;
|
||||
return axios.get(`/competition_infos/${id}/enroll_status.json`);
|
||||
}
|
||||
|
||||
// 启智2022详情接口
|
||||
export function getQz2022() {
|
||||
return fetch({
|
||||
url: `${current_main_site_url}/api/competition_infos/qz2022.json`,
|
||||
method: 'get'
|
||||
});
|
||||
return axios.get(`/competition_infos/qz2022.json`);
|
||||
}
|
||||
|
||||
// 报名启智2022 竞赛
|
||||
// 报名启智2022 竞赛?debug=teacher
|
||||
export async function enrollCompetition(data){
|
||||
return fetch({
|
||||
url: `${current_main_site_url}/api/competition_infos/qz2022/enroll.json`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return axios.post(`/competition_infos/qz2022/enroll.json`,data);
|
||||
}
|
||||
|
||||
// 竞赛提交作品
|
||||
export async function uploadCompetition(data){
|
||||
return fetch({
|
||||
url: `${current_main_site_url}/api/competition_infos/qz2022/upload.json`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return axios.post(`/competition_infos/qz2022/upload.json`,data);
|
||||
}
|
||||
|
||||
// 管理-竞赛报名列表
|
||||
// 管理-竞赛报名列表?debug=admin
|
||||
export function getQzEnrollList(params) {
|
||||
return fetch({
|
||||
url: `${current_main_site_url}/api/competition_infos/qz2022/enroll_list.json`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
return axios.get(`/competition_infos/qz2022/enroll_list.json`,params={params});
|
||||
}
|
||||
|
||||
// 管理-竞赛报名列表导出
|
||||
export function exportEnrollList(params) {
|
||||
return fetch({
|
||||
url: `${current_main_site_url}/api/competition_infos/qz2022/enroll_list.xlsx`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 管理-竞赛提交作品列表
|
||||
// 管理-竞赛提交作品列表&debug=admin
|
||||
export function getQzProList(params) {
|
||||
return fetch({
|
||||
url: `${current_main_site_url}/api/competition_infos/qz2022/enroll_list.json?upload=true`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
//删除专家
|
||||
export function deleteExpert(expertId) {
|
||||
return fetch({
|
||||
url: `/api/experts/${expertId}?isDelete=1`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
export function getUserInfo() {
|
||||
return fetch({
|
||||
url: '/user/getUserInfo',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 查看当前登录用户专家信息
|
||||
export function getCurrentExpert(params) {
|
||||
return fetch({
|
||||
url: '/api/experts/getCurrentExpert',
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
//专家注册
|
||||
export async function expertRegister(data){
|
||||
let res = await fetch({
|
||||
url: '/api/experts/register',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
//更新专家信息
|
||||
export async function expertUpdate(data){
|
||||
let res = await fetch({
|
||||
url: '/api/experts/',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
//管理员审核专家信息
|
||||
export async function registerCheck(data){
|
||||
let res = await fetch({
|
||||
url: '/api/experts/adminCheckExpert',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
// 获取文件信息
|
||||
export function getFile(id) {
|
||||
return fetch({
|
||||
url: `/busiAttachments/${id}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取评审任务列表
|
||||
export function getExpertTasks(params) {
|
||||
return fetch({
|
||||
url: `/api/taskExpert/getExpertTasksPageList`,
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取竞赛作品列表
|
||||
export function getCompetition(id) {
|
||||
return fetch({
|
||||
url: `${main_web_site_url}/api/v1/competitions/${id}/works`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 获取竞赛详情接口
|
||||
export function getCompetitionDetail(id) {
|
||||
return fetch({
|
||||
url: `${main_web_site_url}/api/v1/competitions/${id}`,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
// 查看竞赛/任务的评分细则
|
||||
export function getScoringDetails(params) {
|
||||
return fetch({
|
||||
url: `/api/expertScoringDetails/getExpertScoringDetailsList`,
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 查看最终得分排行
|
||||
export function getFinalScoreRankingList(params) {
|
||||
return fetch({
|
||||
url: `/api/expertScoringDetails/getFinalScoreRankingList`,
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 查看单个竞赛/任务的所有评分细则
|
||||
export function getOpsScoringDetails(params) {
|
||||
return fetch({
|
||||
url: `/api/expertScoringDetails/getOpsExpertScoringDetailsList`,
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
// 初始化评分细则
|
||||
export function initScoringDetails(data){
|
||||
return fetch({
|
||||
url: '/api/expertScoringDetails/initExpertScoringDetails',
|
||||
method: 'post',
|
||||
data,
|
||||
})
|
||||
}
|
||||
|
||||
// 更新评分细则
|
||||
export function updateScoringDetails(data){
|
||||
return fetch({
|
||||
url: '/api/expertScoringDetails/',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//评选胜出者和公示者
|
||||
export function selectWinnersAndPublicists(data){
|
||||
return fetch({
|
||||
url: '/api/expertScoringDetails/selectWinnersAndPublicists',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
//查看胜出者和公示名单
|
||||
export function getWinnersAndPublicists(params) {
|
||||
return fetch({
|
||||
url: `/api/expertScoringDetails/getWinnersAndPublicists`,
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
//获取创客任务评审规则
|
||||
export async function getRules(params){
|
||||
let response = await fetch({
|
||||
url: `/api/taskRuleCriteria/getRuleAndCriteria`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
if(response && response.message === "success"){
|
||||
let criterias = [];
|
||||
response.data.criteriaOne && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaOne);
|
||||
response.data.criteriaTwo && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaTwo);
|
||||
response.data.criteriaThree && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaThree);
|
||||
response.data.criteriaFour && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaFour);
|
||||
response.data.criteriaFive && (criterias[criterias.length] = (criterias.length+1)+"、"+response.data.criteriaFive);
|
||||
response.data.criterias = criterias;
|
||||
response.data.reviewData = response.data.reviewStartOn.substring(0,response.data.reviewStartOn.length-3) + " ~ " + response.data.reviewEndOn.substring(0,response.data.reviewEndOn.length-3)
|
||||
}
|
||||
return response;
|
||||
}
|
||||
|
||||
//编辑评审规则(第一次)
|
||||
export async function editRules(data){
|
||||
let res = await fetch({
|
||||
url: '/api/taskRuleCriteria/editRuleAndCriteria',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
//更新评审规则(第一次)
|
||||
export async function updateRules(data){
|
||||
let res = await fetch({
|
||||
url: '/api/taskRuleCriteria/',
|
||||
method: 'put',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
//为创客任务添加评审专家
|
||||
export async function assignExperts(data){
|
||||
let res = await fetch({
|
||||
url: '/api/taskExpert/assignExperts',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
//删除指派专家
|
||||
export function deleteExperts(taskExpertId,isDelete) {
|
||||
return fetch({
|
||||
url: `/api/taskExpert/${taskExpertId}?isDelete=${isDelete}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
//已选专家列表
|
||||
export function selectExpertList(params) {
|
||||
return fetch({
|
||||
url: `/api/taskExpert/selectedExpertPageList`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
//竞赛任务列表
|
||||
export function getCompetitionList(params) {
|
||||
return fetch({
|
||||
url: `/api/competitionExpert/getCompetitionList`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
// 修改竞赛是否加入专家评审流程
|
||||
export function updateCompetitionReview(data) {
|
||||
return fetch({
|
||||
url: `${main_web_site_url}/api/v1/competitions/update_expert_audit`,
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return axios.get(`/competition_infos/qz2022/enroll_list.json?upload=true`,params={params});
|
||||
}
|
|
@ -1,9 +1,7 @@
|
|||
import React, { useState, useCallback, useMemo, useEffect, useRef } from "react";
|
||||
import { Input, Select, Button, Form, message, DatePicker, Table, Pagination, Upload, Modal } from 'antd';
|
||||
import {competitionArea, competitionType} from '../static.js';
|
||||
import { Link } from "react-router-dom";
|
||||
import { formatDuring } from 'educoder';
|
||||
import {userCompetitionStatus, enrollCompetition} from '../api';
|
||||
import React, {useState, useCallback} from "react";
|
||||
import { Input, Select, Button, Form, message, Radio } from 'antd';
|
||||
import {enrollCompetition} from '../api';
|
||||
import {httpUrl} from '../fetch';
|
||||
import EditTable from "../editTable";
|
||||
import apply_top from "../image/apply_top.png";
|
||||
import apply_down from "../image/apply_down.png";
|
||||
|
@ -18,11 +16,11 @@ import '../../index.scss';
|
|||
const Option = Select.Option;
|
||||
|
||||
export default Form.create()((props) => {
|
||||
const { match, history, showNotification, form, current_user, qzDetail} = props
|
||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
const [applyStatue, setApplyState] = useState(undefined);
|
||||
const {form, qzDetail, enrollStatus, setReload} = props
|
||||
const {getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
const [members, setMembers] = useState([]);
|
||||
const [errorMessage, setErrorMessage] = useState(undefined);
|
||||
const [sourceBy, setSourceBy] = useState(1);
|
||||
|
||||
// form表单公共处理函数
|
||||
const helper = useCallback(
|
||||
|
@ -34,15 +32,6 @@ export default Form.create()((props) => {
|
|||
[]
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
// 获取用户是否报名启智2022
|
||||
userCompetitionStatus('qz2022').then(response=>{
|
||||
if(response && response.message === "success"){
|
||||
setApplyState(response.data.enroll_status);
|
||||
}
|
||||
})
|
||||
}, []);
|
||||
|
||||
// 当用户输入结束时 检验用户输入是否符合规范
|
||||
function verify(dataIndex){
|
||||
validateFields([dataIndex],(error, values)=>{
|
||||
|
@ -72,37 +61,47 @@ export default Form.create()((props) => {
|
|||
// 用户输入正确 报名该竞赛
|
||||
const params = {
|
||||
...values,
|
||||
members
|
||||
members,
|
||||
subject_source_type: sourceBy,
|
||||
}
|
||||
enrollCompetition(params).then(response=>{
|
||||
if(response && response.message === "success"){
|
||||
if(response && response.data.message === "success"){
|
||||
setReload(Math.random());
|
||||
message.success('报名成功')
|
||||
}else{
|
||||
message.error(response.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="qz_main">
|
||||
<div className="step">
|
||||
<span className="left_tit"> 报名</span>
|
||||
<img src={apply_top} className="step_icon"/>
|
||||
<div className="border_dashed"></div>
|
||||
<img src={applyStatue ? apply_one : apply_one_active} className="step_icon"/>
|
||||
<div className="img_span">
|
||||
<img src={enrollStatus && enrollStatus.enroll_status ? apply_one : apply_one_active} className="step_icon"/>
|
||||
个人信息
|
||||
</div>
|
||||
<div className="border_dashed"></div>
|
||||
<img src={applyStatue ? apply_two_active : apply_two} className="step_icon"/>
|
||||
<div className="img_span">
|
||||
<img src={enrollStatus && enrollStatus.enroll_status ? apply_two_active : apply_two} className="step_icon"/>
|
||||
报名成功
|
||||
</div>
|
||||
<div className="border_dashed"></div>
|
||||
<img src={apply_down} className="step_icon"/>
|
||||
</div>
|
||||
{!applyStatue && <div className="apply_tip font-15">
|
||||
{!(enrollStatus && enrollStatus.enroll_status) && <div className="apply_tip font-15">
|
||||
<img src={apply_notice} className="apply_notice"/>
|
||||
请认真核对报名信息,务必与线下报名表信息一致!
|
||||
</div>}
|
||||
<div className="apply_information mb60">
|
||||
<div className="info_head">{!applyStatue && '填写'}报名信息</div>
|
||||
<div className="info_head">{!(enrollStatus && enrollStatus.enroll_status) && '填写'}报名信息</div>
|
||||
{/* 报名表单 */}
|
||||
{!applyStatue && <Form className="info_form">
|
||||
{!(enrollStatus && enrollStatus.enroll_status) && <Form className="info_form">
|
||||
{helper('参赛单位',
|
||||
'org_name',
|
||||
[{ required: true, message: "请正确输入报名信息" },
|
||||
|
@ -131,22 +130,26 @@ export default Form.create()((props) => {
|
|||
'zone',
|
||||
[{ required: true, message: "请正确输入报名信息" }],
|
||||
<Select placeholder="请选择赛区" onBlur={()=>{verify("zone")}}>
|
||||
{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>
|
||||
)}
|
||||
{helper('赛项',
|
||||
'sub_competition',
|
||||
[{ required: true, message: "请正确输入报名信息" }],
|
||||
<Select placeholder="请选择赛项" onBlur={()=>{verify("sub_competition")}}>
|
||||
{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>
|
||||
)}
|
||||
{qzDetail && qzDetail.is_local && <div className="class_from">
|
||||
<Radio.Group onChange={(e)=>{setSourceBy(e.target.value)}} value={sourceBy} defaultValue={1}>
|
||||
<Radio value={1}>计划支持</Radio>
|
||||
<Radio value={0}>自主提报</Radio>
|
||||
</Radio.Group>
|
||||
{helper('课题来源',
|
||||
'subject_source_type',
|
||||
'subject_source_name',
|
||||
[{ required: true, message: "请正确输入报名信息" },
|
||||
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
|
||||
<Input placeholder="请输入项目名称" onBlur={()=>{verify("subject_source_type")}}/>
|
||||
<Input placeholder="请输入项目名称" onBlur={()=>{verify("subject_source_name")}} disabled={sourceBy === 0}/>
|
||||
)}
|
||||
</div>}
|
||||
{helper('电话',
|
||||
|
@ -163,25 +166,25 @@ export default Form.create()((props) => {
|
|||
</div>
|
||||
</Form>}
|
||||
{/* 已报名,报名信息 */}
|
||||
{applyStatue && <div className="info">
|
||||
<div><span>参赛单位 : </span></div>
|
||||
<div className="info-right"><span>参赛团队负责人姓名 : </span></div>
|
||||
<div><span>职务 : </span></div>
|
||||
<div className="info-right"><span>JXJXJX : </span></div>
|
||||
<div><span>赛区 : </span></div>
|
||||
<div className="info-right"><span>赛项 : </span></div>
|
||||
<div><span>课题来源 : </span></div>
|
||||
<div className="info-right"><span>成员 : </span></div>
|
||||
<div><span>电话 : </span></div>
|
||||
{enrollStatus && enrollStatus.enroll_status && <div className="info">
|
||||
<div><span>参赛单位 : </span>{enrollStatus && enrollStatus.enroll_info.org_name}</div>
|
||||
<div className="info-right"><span>参赛团队负责人姓名 : </span>{enrollStatus && enrollStatus.enroll_info.leader}</div>
|
||||
<div><span>职务 : </span>{enrollStatus && enrollStatus.enroll_info.org_job}</div>
|
||||
<div className="info-right"><span>JXJXJX : </span>{enrollStatus && enrollStatus.enroll_info.org_rank}</div>
|
||||
<div><span>赛区 : </span>{enrollStatus && enrollStatus.enroll_info.zone}</div>
|
||||
<div className="info-right"><span>赛项 : </span>{enrollStatus && enrollStatus.enroll_info.sub_competition}</div>
|
||||
<div><span>课题来源 : </span>{enrollStatus && enrollStatus.enroll_info.subject_source_type === 0 ? "自主提报" : enrollStatus.enroll_info.subject_source_name || '--'}</div>
|
||||
<div className="info-right"><span>成员 : </span>{enrollStatus && enrollStatus.enroll_info.members && enrollStatus.enroll_info.members.map(item=>{return item.real_name + ' '})}</div>
|
||||
<div><span>电话 : </span>{enrollStatus && enrollStatus.enroll_info.phone}</div>
|
||||
</div>}
|
||||
</div>
|
||||
{!applyStatue && <div className="apply_but">
|
||||
{!(enrollStatus && enrollStatus.enroll_status) && <div className="apply_but">
|
||||
<Button type="primary" className="submit_info" onClick={applySubmit}>
|
||||
提交资料
|
||||
</Button>
|
||||
<Button className="add_member cancel_submit ml20">
|
||||
取消
|
||||
</Button>
|
||||
<a href={httpUrl+'/busiAttachments/download/391'}><Button className="add_member download ml20">
|
||||
下载报名表
|
||||
</Button></a>
|
||||
</div>}
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
.step{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 50px 0 60px;
|
||||
margin: 30px 0 40px;
|
||||
.left_tit{
|
||||
height: 20px;
|
||||
line-height: 19px;
|
||||
|
@ -16,6 +16,12 @@
|
|||
margin: 0 12px;
|
||||
border-bottom: 1px dashed #bac1c9;
|
||||
}
|
||||
.img_span{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 25px;
|
||||
}
|
||||
}
|
||||
.apply_tip{
|
||||
background-color:#fff5eb;
|
||||
|
@ -47,7 +53,17 @@
|
|||
.ant-input:hover{border-color:#2e5bfe;}
|
||||
}
|
||||
.class_from{
|
||||
display: inline;
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: 46.5%;
|
||||
}
|
||||
.class_from .ant-form-item{
|
||||
width: 71%;
|
||||
}
|
||||
.class_from>.ant-radio-group{
|
||||
position: absolute;
|
||||
left: 36%;
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
.info{
|
||||
|
@ -113,11 +129,11 @@
|
|||
.apply_but{
|
||||
padding-bottom: 60px;
|
||||
text-align: center;
|
||||
.cancel_submit, .submit_info{
|
||||
.download, .submit_info{
|
||||
padding: 0 18px;
|
||||
height: 36px;
|
||||
}
|
||||
.cancel_submit{
|
||||
padding: 0 30px;
|
||||
.download{
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
|
@ -1,22 +1,14 @@
|
|||
import React, { useState, useCallback, useMemo, useEffect } from "react";
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Modal } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import { formatDuring } from 'educoder';
|
||||
import React from "react";
|
||||
|
||||
import './index.scss';
|
||||
import '../../index.scss';
|
||||
const Option = Select.Option;
|
||||
|
||||
function Introduce({ form, showNotification, match, history }) {
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
}, []);
|
||||
|
||||
function Introduce({qzDetail }) {
|
||||
return (
|
||||
<React.Fragment>
|
||||
da指南
|
||||
</React.Fragment>
|
||||
<div className="qz_main fingerpost">
|
||||
<div className="fingerpost_head font-18 mb20">2022年赛程说明</div>
|
||||
<div className="fingerpost_cont" dangerouslySetInnerHTML={{ __html: qzDetail && qzDetail.guide }}></div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
export default Introduce;
|
|
@ -0,0 +1,8 @@
|
|||
.fingerpost{
|
||||
.fingerpost_head{
|
||||
padding: 60px 0 30px;
|
||||
text-align: center;
|
||||
border-bottom: 1px dashed #979797;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 2.6 MiB After Width: | Height: | Size: 2.6 MiB |
|
@ -1,23 +1,19 @@
|
|||
import React, { useState, useCallback, useMemo, useEffect } from "react";
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Modal, Icon } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import { formatDuring } from 'educoder';
|
||||
import {competitionArea, competitionType} from '../static.js';
|
||||
import React, { useState, useMemo, useEffect } from "react";
|
||||
import {Select, Button, Tooltip } from 'antd';
|
||||
import {current_main_site_url} from '../fetch';
|
||||
import PaginationTable from "../../components/paginationTable";
|
||||
|
||||
import './index.scss';
|
||||
import '../index.scss';
|
||||
import { getQzEnrollList, getQzProList, exportEnrollList } from "../api.js";
|
||||
import { getQzEnrollList, getQzProList } from "../api.js";
|
||||
const Option = Select.Option;
|
||||
|
||||
function Introduce({ form, showNotification, match, history:{location:{pathname}},qzDetail }) {
|
||||
console.log(qzDetail);
|
||||
function Introduce({history:{location:{pathname}},qzDetail }) {
|
||||
// 报名列表和作品列表到指向此处,type做区分,0报名,1作品
|
||||
const [type, setType] = useState(pathname.substring(pathname.lastIndexOf('/')+1, pathname.lenght));
|
||||
const [reload, setReload] = useState();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
const [dataList, setDataList] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
// 赛区 赛项
|
||||
|
@ -29,7 +25,6 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
}, [pathname]);
|
||||
|
||||
useEffect(()=>{
|
||||
console.log(zone, subCompetition);
|
||||
const params = {
|
||||
zone: zone === '-1' ? undefined : zone,
|
||||
sub_competition: subCompetition === '-1' ? undefined : subCompetition
|
||||
|
@ -37,24 +32,23 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
if(type === "applys"){
|
||||
// 报名列表
|
||||
getQzEnrollList(params).then(response=>{
|
||||
console.log(response);
|
||||
if(response && response.message === "success"){
|
||||
if(response && response.status === 200){
|
||||
setTotal(response.count);
|
||||
setDataList(response.data);
|
||||
setDataList(response.data.data);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
// 提交作品列表
|
||||
getQzProList(params).then(response=>{
|
||||
if(response && response.message === "success"){
|
||||
if(response && response.status === 200){
|
||||
setTotal(response.count);
|
||||
setDataList(response.data);
|
||||
setDataList(response.data.data);
|
||||
}
|
||||
})
|
||||
}
|
||||
}, [type, zone, subCompetition])
|
||||
|
||||
const columns_apply = useMemo(() => {
|
||||
let columns_apply = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
title: '参赛单位',
|
||||
|
@ -67,16 +61,7 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
dataIndex: 'leader',
|
||||
key: 'leader',
|
||||
},
|
||||
{
|
||||
title: '职务',
|
||||
dataIndex: 'org_job',
|
||||
key: 'org_job',
|
||||
},
|
||||
{
|
||||
title: 'JXJXJX',
|
||||
dataIndex: 'org_rank',
|
||||
key: 'org_rank',
|
||||
},
|
||||
|
||||
{
|
||||
title: '电话',
|
||||
dataIndex: 'phone',
|
||||
|
@ -85,29 +70,15 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
{
|
||||
title: '赛区',
|
||||
dataIndex: 'zone',
|
||||
render:(text, record)=>{
|
||||
return (qzDetail && qzDetail.zones[text]) || '--';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '赛项',
|
||||
dataIndex: 'sub_competition',
|
||||
render:(text, record)=>{
|
||||
return (qzDetail && qzDetail.sub_competitions[text]) || '--';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '课题来源',
|
||||
dataIndex: 'subject_source_type',
|
||||
render:(text, record)=>{
|
||||
return text === '0' ? "自主提报" : record.subject_source_name || '--';
|
||||
}
|
||||
dataIndex: 'sub_competition'
|
||||
},
|
||||
{
|
||||
title: '成员',
|
||||
dataIndex: 'members',
|
||||
render:(text, record)=>{
|
||||
console.log('members', text);
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@ -126,24 +97,44 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
},
|
||||
{
|
||||
title: '赛区',
|
||||
dataIndex: 'zone',
|
||||
render:(text, record)=>{
|
||||
return (qzDetail && qzDetail.zones[text]) || '--';
|
||||
}
|
||||
dataIndex: 'zone'
|
||||
},
|
||||
{
|
||||
title: '赛项',
|
||||
dataIndex: 'sub_competition',
|
||||
render:(text, record)=>{
|
||||
return (qzDetail && qzDetail.sub_competitions[text]) || '--';
|
||||
}
|
||||
dataIndex: 'sub_competition'
|
||||
},
|
||||
{
|
||||
title: '作品',
|
||||
dataIndex: 'sttachments',
|
||||
dataIndex: 'attachments',
|
||||
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>;
|
||||
}
|
||||
},
|
||||
];
|
||||
}, [qzDetail]);
|
||||
}, [qzDetail, reload]);
|
||||
|
||||
// 如果是内网环境,则增加部分字段
|
||||
if(qzDetail && qzDetail.is_local && columns_apply[2].title !== "职务"){
|
||||
// 职务、JXJXJX、课题来源
|
||||
columns_apply.splice(2,0,{
|
||||
title: '职务',
|
||||
dataIndex: 'org_job',
|
||||
key: 'org_job',
|
||||
},
|
||||
{
|
||||
title: 'JXJXJX',
|
||||
dataIndex: 'org_rank',
|
||||
key: 'org_rank',
|
||||
},);
|
||||
columns_apply.splice(7,0,
|
||||
{
|
||||
title: '课题来源',
|
||||
dataIndex: 'subject_source_type',
|
||||
render:(text, record)=>{
|
||||
return text === 0 ? "自主提报" : record.subject_source_name || '--';
|
||||
}
|
||||
},)
|
||||
}
|
||||
|
||||
const expandRow = (record) =>{
|
||||
return <div className="expandRowManage">
|
||||
|
@ -165,13 +156,25 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
})}
|
||||
</div>
|
||||
}
|
||||
|
||||
const customExpandIcon1 = useMemo((props)=>{
|
||||
// console.log(props);
|
||||
},[dataList])
|
||||
// 外网环境下 赛队成员无职务、JXJXJX属性
|
||||
const expandRowWai = (record) =>{
|
||||
return <div className="expandRowManage">
|
||||
<div className="row">
|
||||
<div>序号</div>
|
||||
<div>姓名</div>
|
||||
<div className="job">单位</div>
|
||||
</div>
|
||||
{record.members && record.members.map((item, index)=>{
|
||||
return <div className="row">
|
||||
<div>{index+1}</div>
|
||||
<div>{item.real_name}</div>
|
||||
<div className="job">{item.org_job}</div>
|
||||
</div>
|
||||
})}
|
||||
</div>
|
||||
}
|
||||
|
||||
const customExpandIcon = (props) => {
|
||||
console.log(props);
|
||||
if(props.record.members.length > 0){
|
||||
if (props.expanded) {
|
||||
return <a style={{ color: 'black',marginRight:8 }} onClick={e => {
|
||||
|
@ -187,10 +190,6 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
}
|
||||
}
|
||||
|
||||
function exportApplyInfo(){
|
||||
exportEnrollList();
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="qz_management">
|
||||
|
||||
|
@ -209,7 +208,7 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
{qzDetail && qzDetail.sub_competitions.map((item,i)=> {return <Option value={i} key={i}>{item}</Option>})}
|
||||
</Select>
|
||||
</div>
|
||||
{type === "applys" && <Button className="but_2e5" onClick={exportApplyInfo}>导出</Button>}
|
||||
<a href={current_main_site_url+`/api/competition_infos/qz2022/enroll_list.xlsx${type === "applys"? '':"?upload=true"}`}><Button className="but_2e5">导出</Button></a>
|
||||
</div>
|
||||
|
||||
<PaginationTable
|
||||
|
@ -220,7 +219,7 @@ function Introduce({ form, showNotification, match, history:{location:{pathname}
|
|||
total={total}
|
||||
setCurPage={setCurPage}
|
||||
current={curPage}
|
||||
expandedRowRender={expandRow}
|
||||
expandedRowRender={qzDetail && qzDetail.is_local ? expandRow : expandRowWai}
|
||||
expandIconColumnIndex={8}
|
||||
expandIconAsCell={false}
|
||||
expandIcon={customExpandIcon}/>
|
||||
|
|
|
@ -21,6 +21,21 @@
|
|||
display: inline-block;
|
||||
width: 17%;
|
||||
text-align: center;
|
||||
padding-top: 15px;
|
||||
&.job{width: 30%;}
|
||||
&:first-child{
|
||||
padding-top: 0;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
}
|
||||
.expandRowManage .row{
|
||||
border-bottom: 1px solid #ececec;
|
||||
margin: 0 -8px;
|
||||
}
|
||||
.expandRowManage .row:last-child{
|
||||
border-bottom: none;
|
||||
}
|
||||
.attachments_a{
|
||||
color: #2e5bfe;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import React, { useState, useCallback, useMemo, useEffect } from "react";
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Modal, Icon } from 'antd';
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Modal, Icon, message } from 'antd';
|
||||
import { appendFileSizeToUploadFileAll } from 'educoder';
|
||||
import { Link } from "react-router-dom";
|
||||
import { formatDuring } from 'educoder';
|
||||
import {httpUrl} from '../fetch.js';
|
||||
import {uploadCompetition} from '../api';
|
||||
import {httpUrl, current_main_site_url} from '../fetch.js';
|
||||
import {uploadCompetition, uploadFile} from '../api';
|
||||
import {getFile} from '../../expert/api';
|
||||
import { Confirm } from '../../components/ModalFun';
|
||||
import refer_tip from "../image/refer_tip.svg";
|
||||
import refer from "../image/refer.svg";
|
||||
|
||||
|
@ -12,45 +14,37 @@ import './index.scss';
|
|||
import '../../index.scss';
|
||||
const Option = Select.Option;
|
||||
|
||||
function Introduce({ form, showNotification, match, history }) {
|
||||
function Introduce({ form, showNotification, match, history, enrollStatus }) {
|
||||
// 上传文件时 按钮loading效果
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [referStatue, setReferState] = useState(true);
|
||||
const [files, setFiles] = useState(undefined);
|
||||
|
||||
const showUploadList = {
|
||||
|
||||
}
|
||||
const [files, setFiles] = useState();
|
||||
|
||||
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') {
|
||||
if (info.file.status === 'uploading' || info.file.status == "done" || info.file.status === 'removed') {
|
||||
setLoading(true);
|
||||
let fileList = info.fileList;
|
||||
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);
|
||||
}
|
||||
}
|
||||
if (!info.file.response.data) {
|
||||
info.file.response && showNotification(info.file.response.message)
|
||||
}
|
||||
}
|
||||
setFiles(appendFileSizeToUploadFileAll(info.fileList).slice(-1))
|
||||
}
|
||||
if(info.file.status == "done"){
|
||||
if(info.file.status == "done" || info.file.status === 'removed'){
|
||||
setLoading(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 支持文件下载
|
||||
function download(file){
|
||||
const fileId = file.response.data.id;
|
||||
window.open(`${httpUrl}/busiAttachments/download/${fileId}`);
|
||||
const fileId = file.id || file.response.id;
|
||||
window.open(`${current_main_site_url}/api/attachments/${fileId}`);
|
||||
}
|
||||
|
||||
// 进行文件大小检查
|
||||
|
@ -65,18 +59,25 @@ function Introduce({ form, showNotification, match, history }) {
|
|||
// 作品提交
|
||||
function referProduction(){
|
||||
if(files && files.length === 1){
|
||||
uploadCompetition({"attachment_ids":Array.from(files[0].response.data.id)}).then(response=>{
|
||||
console.log(response);
|
||||
const params = {
|
||||
"attachment_ids": [files[0].response.id]
|
||||
}
|
||||
uploadCompetition(params).then(response=>{
|
||||
if(response && response.status === 200){
|
||||
message.success('提交作品成功');
|
||||
}else{
|
||||
message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="qz_main refer">
|
||||
<img src={refer} className="refer_img mb20"/>
|
||||
<Upload
|
||||
accept=".zip,.rar,.tar"
|
||||
action={`${httpUrl}/busiAttachments/upload`}
|
||||
// 开发时 action需要添加?debug=admin
|
||||
action={`${current_main_site_url}/api/attachments.json?debug=admin`}
|
||||
fileList={files}
|
||||
onChange={handleChange}
|
||||
onDownload={download}
|
||||
|
@ -88,7 +89,9 @@ function Introduce({ form, showNotification, match, history }) {
|
|||
>
|
||||
<Button className="upload"><Icon type="upload" />上传</Button>
|
||||
</Upload>
|
||||
<div className="refer_tip mt20">上传小于等于256m的作品压缩包(仅限上传一个压缩包,格式如下: .zip, .rar, .tar)</div>
|
||||
<Modal/>
|
||||
{enrollStatus && enrollStatus.upload_status && <div className="refer_tip mt20 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={referProduction} loading={loading}>提交作品</Button>
|
||||
</div>
|
||||
|
|
|
@ -15,6 +15,13 @@
|
|||
.refer_tip{
|
||||
color:#595959;
|
||||
font-size:15px;
|
||||
&.cover{
|
||||
color: red;
|
||||
margin-bottom: -20px;
|
||||
}
|
||||
&.cover .icon-erciqueren_icon{
|
||||
color: #FA2D2D;
|
||||
}
|
||||
}
|
||||
.refer_bor{
|
||||
width: 40vw;
|
||||
|
@ -31,6 +38,9 @@
|
|||
right: -55px;
|
||||
.anticon{padding-right: 10px;}
|
||||
}
|
||||
& a:link{
|
||||
color: #2e5bfe;
|
||||
}
|
||||
}
|
||||
.ant-upload-list-item:hover .ant-upload-list-item-info{background: none;}
|
||||
}
|
Loading…
Reference in New Issue