forked from Gitlink/forgeplus-react
修改issue
This commit is contained in:
parent
cf361ad002
commit
6cabd38d87
|
@ -33,7 +33,7 @@ export default Form.create()(
|
|||
const [fileList, setFileList] = useState(undefined);
|
||||
const [attachment, setAttachment] = useState(undefined);
|
||||
const [options , setOptions] = useState(undefined);
|
||||
const stable = history && history.location && history.location.state.stable;
|
||||
const stable = history && history.location && history.location.state&&history.location.state.stable;
|
||||
const { projectsId, versionId , owner } = match.params;
|
||||
|
||||
useEffect(()=>{
|
||||
|
|
|
@ -9,7 +9,6 @@ import banner from "../img/banner.png";
|
|||
import studentSvg from "../img/student.png";
|
||||
import './index.scss';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { color } from 'echarts/lib/theme/light';
|
||||
|
||||
const Option = Select.Option;
|
||||
const gradeList = [
|
||||
|
@ -27,6 +26,8 @@ function Apply(props) {
|
|||
// 可用于开发时不同账号报名
|
||||
// current_user && (current_user.user_id = 6)
|
||||
// current_user && (current_user.userName = "创新使者")
|
||||
const isStudentApplyDate = new Date().getTime() > new Date('2022-05-26').getTime() && new Date().getTime() < new Date('2022-06-26').getTime();
|
||||
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, validateFieldsAndScroll } = form;
|
||||
const [imageUrl, setImageUrl] = useState(undefined);
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
@ -44,24 +45,24 @@ function Apply(props) {
|
|||
const [allTaskList, setAllTaskList] = useState([]);
|
||||
|
||||
// 学生报名时间范围内
|
||||
const isStudentApplyDate = Date.parse(new Date()) > 1653494400000 && Date.parse(new Date()) < 1656086400000;
|
||||
// 已过学生报名时间
|
||||
const studentApplyEnd = Date.parse(new Date()) > 1656086400000;
|
||||
|
||||
useEffect(() => {
|
||||
// 进入此页面到填写页面
|
||||
// setTimeout(()=>{
|
||||
setTimeout(()=>{
|
||||
let clientWidth = document.body.clientWidth;
|
||||
let scrollHeight = 500 * clientWidth / 1920;
|
||||
window.scrollTo(0, scrollHeight);
|
||||
});
|
||||
// window.scrollTo(0, 50);
|
||||
|
||||
if (!isStudentApplyDate) {
|
||||
// 不在开源夏令营报名时间之内
|
||||
window.location.href = "/glcc/student/2";
|
||||
// window.location.href = "/glcc/student/2";
|
||||
} else if (current_user && current_user.login) {
|
||||
|
||||
} else {
|
||||
window.location.href = "/login?go_page=/glcc";
|
||||
window.location.href = `/login?go_page=/glcc/student/apply/${taskId}`;
|
||||
}
|
||||
}, [])
|
||||
|
||||
|
@ -260,12 +261,11 @@ function Apply(props) {
|
|||
// 自荐书上传
|
||||
function bookChange(info, i) {
|
||||
if (info.file.status === 'uploading' || info.file.status === "done" || info.file.status === 'removed') {
|
||||
setLoading(true);
|
||||
// setLoading(true);
|
||||
if (info.file.status === "done") {
|
||||
changeTaskItem('memoAttachmentId', info.fileList[0].response && info.fileList[0].response.data.id, i)
|
||||
}
|
||||
if (info.file.status === 'removed') {
|
||||
console.log(1111)
|
||||
changeTaskItem('memoAttachmentId', '', i);
|
||||
}
|
||||
console.log(info.fileList);
|
||||
|
@ -276,9 +276,9 @@ function Apply(props) {
|
|||
}
|
||||
}
|
||||
|
||||
if (info.file.status === "done" || info.file.status === 'removed') {
|
||||
setLoading(false);
|
||||
}
|
||||
// if (info.file.status === "done" || info.file.status === 'removed') {
|
||||
// setLoading(false);
|
||||
// }
|
||||
}
|
||||
|
||||
// 支持文件下载
|
||||
|
@ -397,7 +397,7 @@ function Apply(props) {
|
|||
'',
|
||||
'grade',
|
||||
[],
|
||||
<Select placeholder="请选择所在年级" disabled={editable ? false : true} className={editable ? "" : "disabledInput"} dropdownClassName="glcc_select">
|
||||
<Select placeholder="请选择所在年级" expandTrigger="hover" disabled={editable ? false : true} className={editable ? "" : "disabledInput"} dropdownClassName="glcc_select">
|
||||
{gradeList.map(item => { return <Option value={item.name} key={item.id}>{item.name}</Option> })}
|
||||
</Select>
|
||||
)}
|
||||
|
@ -406,7 +406,7 @@ function Apply(props) {
|
|||
'phone',
|
||||
[{ required: true, message: "请正确输入联系电话" },
|
||||
{ max: 14, message: '超出限制长度14位字符,请重新编辑' },
|
||||
{ pattern: /[\d-]{4,14}$/, message: '请正确输入联系电话' }],
|
||||
{ pattern: /(^(\d{3,4}-)?\d{7,8})$|([1][3,4,5,6,7,8,9][0-9]{9})/, message: '请正确输入联系电话' }],
|
||||
<Input placeholder="请输入联系电话" onBlur={() => { verify("phone") }} className={editable ? "" : "disabledInput"} disabled={editable ? false : true} />
|
||||
)}
|
||||
{helper('邮箱地址',
|
||||
|
@ -424,28 +424,28 @@ function Apply(props) {
|
|||
'请以图片的形式上传学生证明,大小不超过5M,格式为png、jpg、jpeg',
|
||||
'proveAttachmentId',
|
||||
[{ required: true, message: "请正确上传学生证明" }],
|
||||
userApplyInfo && userApplyInfo.proveAttachmentId ? <div className='projectLogo'><img src={`${getUrl()}/api/attachments/${userApplyInfo.proveAttachmentId}`} alt='' /></div>
|
||||
: <Upload
|
||||
listType="picture-card"
|
||||
className="avatar-uploader"
|
||||
showUploadList={false}
|
||||
action={getUploadActionUrl()}
|
||||
accept=".png,.jpg,.jpeg"
|
||||
beforeUpload={beforeUpload}
|
||||
onChange={handleChange}
|
||||
>
|
||||
{imageUrl ? <img src={imageUrl} alt="avatar" style={{ maxWidth: '100px', maxHeight: '100px' }} /> : <div>
|
||||
<Upload
|
||||
listType="picture-card"
|
||||
className="avatar-uploader"
|
||||
showUploadList={false}
|
||||
action={getUploadActionUrl()}
|
||||
accept=".png,.jpg,.jpeg"
|
||||
beforeUpload={beforeUpload}
|
||||
onChange={handleChange}
|
||||
>
|
||||
{imageUrl ? <img src={imageUrl} alt="avatar" style={{ maxWidth: '100px', maxHeight: '100px' }} /> : userApplyInfo && userApplyInfo.proveAttachmentId ?
|
||||
<div><img src={`${getUrl()}/api/attachments/${userApplyInfo.proveAttachmentId}`} alt='' /></div> : <div>
|
||||
<i className='iconfont icon-tianjiadaohang font-30'></i>
|
||||
<div className="ant-upload-text font-13">请上传学生证明</div>
|
||||
</div>}
|
||||
</Upload>
|
||||
</Upload>
|
||||
)}</div>
|
||||
|
||||
{
|
||||
myTaskList.map((item, i) => {
|
||||
return (
|
||||
<Fragment key={item.taskId + '' + i}>
|
||||
<h4 className="item-tit">课题信息(<span className="item-tit-num">{i + 1}</span>/2) {myTaskList.length > 1 && <span className="delete"><i className="iconfont icon-shanchu mr5" onClick={() => { deleteTask(i) }}></i>删除</span>}</h4>
|
||||
<h4 className="item-tit">课题信息(<span className="item-tit-num">{i + 1}</span>/2) {myTaskList.length > 1 && <span className="delete" onClick={() => { deleteTask(i) }}><i className="iconfont icon-shanchu mr5"></i>删除</span>}</h4>
|
||||
{helper('课题名称',
|
||||
'',
|
||||
'taskId' + i,
|
||||
|
@ -463,7 +463,7 @@ function Apply(props) {
|
|||
</Select>
|
||||
)}
|
||||
<div className='introArea'>{helper('自荐书',
|
||||
<div className="memoExtra">自荐书示例:<span >https://forum.gitlink.org.cn/forums/7299/detail</span></div>,
|
||||
<div className="memoExtra">自荐书示例:<a href="https://forum.gitlink.org.cn/forums/7299/detail" target="_black">https://forum.gitlink.org.cn/forums/7299/detail</a></div>,
|
||||
'memo' + i,
|
||||
[{ required: true, message: "请正确输入自荐书" },
|
||||
{ max: 500, message: '超出限制长度500位字符,请重新编辑' }],
|
||||
|
|
|
@ -293,7 +293,7 @@
|
|||
.memoExtra {
|
||||
margin-top: 12px;
|
||||
margin-bottom: -10px;
|
||||
span {
|
||||
a {
|
||||
color: #466aff;
|
||||
}
|
||||
}
|
||||
|
@ -312,4 +312,26 @@
|
|||
border: 1px solid #fff;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0px 0px 12px rgba(203, 220, 255, 0.47);
|
||||
|
||||
.ant-select-dropdown-menu-item{
|
||||
&:hover{
|
||||
background-color: #e9efff;
|
||||
}
|
||||
}
|
||||
}
|
||||
.glcc_cascader{
|
||||
.ant-cascader-menu{
|
||||
width: 240px;
|
||||
|
||||
&::-webkit-scrollbar-track{
|
||||
background-color: #E2E9FF;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb{
|
||||
background-color: #BCCCFF;
|
||||
}
|
||||
}
|
||||
.ant-cascader-menu:first-child{
|
||||
width: 250px;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue