提案提交
This commit is contained in:
parent
17bdcd61ee
commit
65d616b116
|
@ -34,8 +34,6 @@ const Apply = Loadable({
|
||||||
loader: () => import('./qz2022/apply'),
|
loader: () => import('./qz2022/apply'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
const Chat = Loadable({
|
const Chat = Loadable({
|
||||||
loader: () => import('./qz2022/chat'),
|
loader: () => import('./qz2022/chat'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -44,7 +42,6 @@ const Statistics = Loadable({
|
||||||
loader: () => import('./qz2022/statistics'),
|
loader: () => import('./qz2022/statistics'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
})
|
})
|
||||||
>>>>>>> 91839339 (S某M修改)
|
|
||||||
const Management = Loadable({
|
const Management = Loadable({
|
||||||
loader: () => import('./qz2022/management'),
|
loader: () => import('./qz2022/management'),
|
||||||
loading: Loading,
|
loading: Loading,
|
||||||
|
@ -142,8 +139,6 @@ const Qz2022 = (props) => {
|
||||||
() => (<Apply {...props} />)
|
() => (<Apply {...props} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
<<<<<<< HEAD
|
|
||||||
=======
|
|
||||||
{/* 交流互动 */}
|
{/* 交流互动 */}
|
||||||
<Route path="/competition/qz2022/chat"
|
<Route path="/competition/qz2022/chat"
|
||||||
render={
|
render={
|
||||||
|
@ -156,7 +151,6 @@ const Qz2022 = (props) => {
|
||||||
() => (<Statistics {...props} />)
|
() => (<Statistics {...props} />)
|
||||||
}
|
}
|
||||||
></Route>
|
></Route>
|
||||||
>>>>>>> 91839339 (S某M修改)
|
|
||||||
{/* 后台管理-报名列表 */}
|
{/* 后台管理-报名列表 */}
|
||||||
<Route path="/competition/qz2022/management/applys"
|
<Route path="/competition/qz2022/management/applys"
|
||||||
render={
|
render={
|
||||||
|
|
|
@ -10,6 +10,23 @@ export async function userCompetitionStatus(id) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 启智2022详情接口
|
||||||
|
export function getQz2022() {
|
||||||
|
return fetch({
|
||||||
|
url: `${current_main_site_url}/api/competition_infos/qz2022.json`,
|
||||||
|
method: 'get'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 报名启智2022 竞赛
|
||||||
|
export async function enrollCompetition(data){
|
||||||
|
return fetch({
|
||||||
|
url: `${current_main_site_url}/api/competition_infos/${id}/enroll.json`,
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
//删除专家
|
//删除专家
|
||||||
export function deleteExpert(expertId) {
|
export function deleteExpert(expertId) {
|
||||||
return fetch({
|
return fetch({
|
||||||
|
|
|
@ -3,7 +3,7 @@ import { Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Mod
|
||||||
import {competitionArea, competitionType} from '../static.js';
|
import {competitionArea, competitionType} from '../static.js';
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { formatDuring } from 'educoder';
|
import { formatDuring } from 'educoder';
|
||||||
import {userCompetitionStatus} from '../api';
|
import {userCompetitionStatus, enrollCompetition} from '../api';
|
||||||
import EditTable from "../editTable";
|
import EditTable from "../editTable";
|
||||||
import apply_top from "../image/apply_top.png";
|
import apply_top from "../image/apply_top.png";
|
||||||
import apply_down from "../image/apply_down.png";
|
import apply_down from "../image/apply_down.png";
|
||||||
|
@ -17,9 +17,11 @@ import './index.scss';
|
||||||
import '../../index.scss';
|
import '../../index.scss';
|
||||||
const Option = Select.Option;
|
const Option = Select.Option;
|
||||||
|
|
||||||
export default Form.create()(({ match, history, showNotification, form, current_user }) => {
|
export default Form.create()((props) => {
|
||||||
|
const { match, history, showNotification, form, current_user, qzDetail} = props
|
||||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||||
const [applyStatue, setApplyState] = useState(undefined);
|
const [applyStatue, setApplyState] = useState(undefined);
|
||||||
|
const [members, setMembers] = useState([]);
|
||||||
|
|
||||||
// form表单公共处理函数
|
// form表单公共处理函数
|
||||||
const helper = useCallback(
|
const helper = useCallback(
|
||||||
|
@ -40,6 +42,33 @@ export default Form.create()(({ match, history, showNotification, form, current_
|
||||||
})
|
})
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// 当用户输入结束时 检验用户输入是否符合规范
|
||||||
|
function verify(dataIndex){
|
||||||
|
validateFields([dataIndex],(error, values)=>{
|
||||||
|
if(error && error[dataIndex]){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//提交报名信息
|
||||||
|
function applySubmit(){
|
||||||
|
validateFields((error, values)=>{
|
||||||
|
if(error){
|
||||||
|
return
|
||||||
|
}else{
|
||||||
|
console.log('正确输入');
|
||||||
|
// 用户输入正确 报名该竞赛
|
||||||
|
const params = {
|
||||||
|
...values,
|
||||||
|
}
|
||||||
|
// enrollCompetition(params).then(response=>{
|
||||||
|
// console.log(response);
|
||||||
|
// })
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
console.log('members', members);
|
||||||
return (
|
return (
|
||||||
<div className="qz_main">
|
<div className="qz_main">
|
||||||
<div className="step">
|
<div className="step">
|
||||||
|
@ -61,61 +90,60 @@ export default Form.create()(({ match, history, showNotification, form, current_
|
||||||
{/* 报名表单 */}
|
{/* 报名表单 */}
|
||||||
{!applyStatue && <Form className="info_form">
|
{!applyStatue && <Form className="info_form">
|
||||||
{helper('参赛单位',
|
{helper('参赛单位',
|
||||||
'expertName',
|
'org_name',
|
||||||
[{ required: true, message: "参赛单位不能为空" },
|
[{ required: true, message: "请正确输入报名信息" },
|
||||||
{ max: 32, message: '长度不能超过32个字符' }],
|
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
|
||||||
<Input placeholder="请输入参赛单位"/>
|
<Input placeholder="请输入参赛单位" onBlur={()=>{verify("org_name")}}/>
|
||||||
)}
|
)}
|
||||||
{helper('参赛团队负责人姓名',
|
{helper('参赛团队负责人姓名',
|
||||||
'expertName',
|
'leader',
|
||||||
[{ required: true, message: "参赛团队负责人不能为空" },
|
[{ required: true, message: "请正确输入报名信息" },
|
||||||
{ max: 32, message: '长度不能超过32个字符' }],
|
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
|
||||||
<Input placeholder="请输入参赛团队负责人姓名"/>
|
<Input placeholder="请输入参赛团队负责人姓名" onBlur={()=>{verify("leader")}}/>
|
||||||
)}
|
)}
|
||||||
{helper('职务',
|
{qzDetail && qzDetail.is_local && helper('职务',
|
||||||
'expertName',
|
'org_job',
|
||||||
[{ required: true, message: "职务不能为空" },
|
[{ required: true, message: "请正确输入报名信息" },
|
||||||
{ max: 32, message: '长度不能超过32个字符' }],
|
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
|
||||||
<Input placeholder="请输入职务"/>
|
<Input placeholder="请输入职务" onBlur={()=>{verify("org_job")}}/>
|
||||||
)}
|
)}
|
||||||
{helper('JXJXJX',
|
{qzDetail && qzDetail.is_local && helper('军衔',
|
||||||
'expertName',
|
'org_rank',
|
||||||
[{ required: true, message: "JXJXJX不能为空" },
|
[{ required: true, message: "请正确输入报名信息" },
|
||||||
{ max: 32, message: '长度不能超过32个字符' }],
|
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
|
||||||
<Input placeholder="请输入JXJXJX"/>
|
<Input placeholder="请输入军衔" onBlur={()=>{verify("org_rank")}}/>
|
||||||
)}
|
)}
|
||||||
{helper('赛区',
|
{helper('赛区',
|
||||||
'expertName',
|
'zone',
|
||||||
[{ required: true, message: "JXJXJX不能为空" }],
|
[{ required: true, message: "请正确输入报名信息" }],
|
||||||
<Select placeholder="请选择赛区">
|
<Select placeholder="请选择赛区" onBlur={()=>{verify("zone")}}>
|
||||||
{competitionArea.map(item=> {return <Option value={item.value} key={item.value}>{item.title}</Option>})}
|
{qzDetail && qzDetail.zones.map((item,i)=> {return <Option value={i} key={i}>{item}</Option>})}
|
||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
{helper('赛项',
|
{helper('赛项',
|
||||||
'expertName',
|
'sub_competition',
|
||||||
[{ required: true, message: "JXJXJX不能为空" }],
|
[{ required: true, message: "请正确输入报名信息" }],
|
||||||
<Select placeholder="请选择赛项">
|
<Select placeholder="请选择赛项" onBlur={()=>{verify("sub_competition")}}>
|
||||||
{competitionType.map(item=> {return <Option value={item.value} key={item.value}>{item.title}</Option>})}
|
{qzDetail && qzDetail.sub_competitions.map((item,i)=> {return <Option value={i} key={i}>{item}</Option>})}
|
||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
<div className="class_from">
|
{qzDetail && qzDetail.is_local && <div className="class_from">
|
||||||
{helper('课题来源',
|
{helper('课题来源',
|
||||||
'expertName',
|
'subject_source_type',
|
||||||
[{ required: true, message: "课题来源不能为空" },
|
[{ required: true, message: "请正确输入报名信息" },
|
||||||
{ max: 32, message: '长度不能超过32个字符' }],
|
{ max: 32, message: '超出限制长度32位字符,请重新编辑' }],
|
||||||
<Input placeholder="请输入项目名称"/>
|
<Input placeholder="请输入项目名称" onBlur={()=>{verify("subject_source_type")}}/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>}
|
||||||
{helper('电话',
|
{helper('电话',
|
||||||
'expertName',
|
'phone',
|
||||||
[{ required: true, message: "电话不能为空" },
|
[{ required: true, message: "请正确输入报名信息" }],
|
||||||
{ max: 32, message: '长度不能超过32个字符' }],
|
<Input placeholder="超出限制长度32位字符,请重新编辑" onBlur={()=>{verify("phone")}}/>
|
||||||
<Input placeholder="请输入联系方式"/>
|
|
||||||
)}
|
)}
|
||||||
<div>
|
<div>
|
||||||
<p>成员</p>
|
<p>成员</p>
|
||||||
{/* */}
|
{/* */}
|
||||||
<EditTable/>
|
<EditTable setMembers={setMembers}/>
|
||||||
</div>
|
</div>
|
||||||
</Form>}
|
</Form>}
|
||||||
{/* 已报名,报名信息 */}
|
{/* 已报名,报名信息 */}
|
||||||
|
@ -132,7 +160,7 @@ export default Form.create()(({ match, history, showNotification, form, current_
|
||||||
</div>}
|
</div>}
|
||||||
</div>
|
</div>
|
||||||
{!applyStatue && <div className="apply_but">
|
{!applyStatue && <div className="apply_but">
|
||||||
<Button type="primary" className="submit_info">
|
<Button type="primary" className="submit_info" onClick={applySubmit}>
|
||||||
提交资料
|
提交资料
|
||||||
</Button>
|
</Button>
|
||||||
<Button className="add_member cancel_submit ml20">
|
<Button className="add_member cancel_submit ml20">
|
||||||
|
|
|
@ -38,7 +38,7 @@ class EditableCell extends React.Component {
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
validateFirst: true,
|
validateFirst: true,
|
||||||
})(<Input onPressEnter={this.save} onBlur={(e)=>{this.save(dataIndex,e)}} placeholder="请输入"/>)}
|
})(<Input onPressEnter={(e)=>{this.save(dataIndex,e)}} onBlur={(e)=>{this.save(dataIndex,e)}} placeholder="请输入"/>)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ class EditableCell extends React.Component {
|
||||||
|
|
||||||
class EditableTable extends React.Component {
|
class EditableTable extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
console.log(props,'表格');
|
||||||
super(props);
|
super(props);
|
||||||
this.columns = [
|
this.columns = [
|
||||||
{
|
{
|
||||||
|
@ -119,7 +120,9 @@ class EditableTable extends React.Component {
|
||||||
|
|
||||||
handleDelete = key => {
|
handleDelete = key => {
|
||||||
const dataSource = [...this.state.dataSource];
|
const dataSource = [...this.state.dataSource];
|
||||||
this.setState({ dataSource: dataSource.filter(item => item.key !== key) });
|
const newData = dataSource.filter(item => item.key !== key);
|
||||||
|
this.setState({ dataSource: newData });
|
||||||
|
this.props.setMembers(newData);
|
||||||
};
|
};
|
||||||
|
|
||||||
handleAdd = () => {
|
handleAdd = () => {
|
||||||
|
@ -142,6 +145,7 @@ class EditableTable extends React.Component {
|
||||||
...row,
|
...row,
|
||||||
});
|
});
|
||||||
this.setState({ dataSource: newData });
|
this.setState({ dataSource: newData });
|
||||||
|
this.props.setMembers(newData);
|
||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.6 MiB |
|
@ -0,0 +1,6 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="54.518" height="50.973" viewBox="0 0 54.518 50.973">
|
||||||
|
<g id="提交订单" transform="translate(0 -33.3)">
|
||||||
|
<path id="路径_71" data-name="路径 71" d="M31.008,84.273H8.093A8.1,8.1,0,0,1,0,76.181V41.393A8.1,8.1,0,0,1,8.093,33.3h32a8.1,8.1,0,0,1,8.093,8.093v7.145a1.7,1.7,0,1,1-3.407,0V41.393a4.692,4.692,0,0,0-4.685-4.685h-32a4.692,4.692,0,0,0-4.685,4.685V76.186a4.692,4.692,0,0,0,4.685,4.685H31.008a1.7,1.7,0,1,1,0,3.4Z" fill="#2e3341"/>
|
||||||
|
<path id="路径_72" data-name="路径 72" d="M188.9,258.007H163.341a1.7,1.7,0,1,1,0-3.407H188.9a1.7,1.7,0,1,1,0,3.407Zm-8.865,11.9H163.314a1.7,1.7,0,1,1,0-3.407h16.718a1.7,1.7,0,1,1,0,3.407Zm-5.441,11.942H163.3a1.7,1.7,0,1,1,0-3.407h11.287a1.7,1.7,0,1,1,0,3.407Zm8.838-1.922,3.509,3.86a.263.263,0,0,1-.138.431l-5.1,1.1a.257.257,0,0,1-.3-.33l1.6-4.962a.252.252,0,0,1,.431-.1Zm17.8-8.449-12.246,11.08a.843.843,0,0,1-1.15-.186l-2.9-3.184a.834.834,0,0,1-.075-1.161l12.246-11.08a.843.843,0,0,1,1.15.186l2.9,3.184A.839.839,0,0,1,201.233,271.478Zm5.819-5.2-3.205,2.912a1.081,1.081,0,0,1-1.5.122l-2.891-3.178a1.084,1.084,0,0,1,.266-1.475l3.21-2.907a1.081,1.081,0,0,1,1.5-.122l2.891,3.179A1.074,1.074,0,0,1,207.052,266.276Zm0,0" transform="translate(-152.996 -209.518)" fill="#2e3341"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
|
@ -0,0 +1,7 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="31.5" height="31.5" viewBox="0 0 31.5 31.5">
|
||||||
|
<g id="shanchu_tc_icon" transform="translate(0.75 0.75)">
|
||||||
|
<path id="路径" d="M15,0A15,15,0,1,0,30,15,15,15,0,0,0,15,0Z" fill="#ffa13a" stroke="#ffa13a" stroke-miterlimit="10" stroke-width="1.5"/>
|
||||||
|
<path id="路径-2" data-name="路径" d="M2,1.5a1,1,0,0,1-2,0V1A1,1,0,0,1,2,1Z" transform="translate(14 19.344)" fill="#fff"/>
|
||||||
|
<path id="路径-3" data-name="路径" d="M2,8.5a1,1,0,0,1-2,0V1A1,1,0,0,1,2,1Z" transform="translate(14 8.156)" fill="#fff"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 573 B |
|
@ -0,0 +1,34 @@
|
||||||
|
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 {httpUrl} from '../fetch.js';
|
||||||
|
import refer_tip from "../image/refer_tip.svg";
|
||||||
|
import refer from "../image/refer.svg";
|
||||||
|
|
||||||
|
import './index.scss';
|
||||||
|
import '../../index.scss';
|
||||||
|
const Option = Select.Option;
|
||||||
|
|
||||||
|
function Introduce({ form, showNotification, match, history }) {
|
||||||
|
const [referStatue, setreferState] = useState(true);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="qz_main refer">
|
||||||
|
<img src={refer} className="refer_img mb20"/>
|
||||||
|
<Upload
|
||||||
|
action={`${httpUrl}/busiAttachments/upload`}
|
||||||
|
>
|
||||||
|
<Button className="upload"><Icon type="upload" />上传</Button>
|
||||||
|
</Upload>
|
||||||
|
<div className="refer_tip mt20">上传小于等于256m的作品压缩包(仅限上传一个压缩包)</div>
|
||||||
|
<div className="refer_bor"></div>
|
||||||
|
<Button type="primary">提交作品</Button>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
export default Introduce;
|
|
@ -0,0 +1,27 @@
|
||||||
|
.refer{
|
||||||
|
background-color:#f8f9ff;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
.refer_bor{
|
||||||
|
width: 40vw;
|
||||||
|
border-bottom: 1px solid #eeeeee;
|
||||||
|
margin: 25px 0 35px;
|
||||||
|
}
|
||||||
|
>span{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue