forked from Gitlink/forgeplus-react
Merge pull request '调整创客流程' (#429) from tongChong/forgeplus-react:dev_military_admin into pre_dev_military
This commit is contained in:
commit
c5dfa5a774
|
@ -62,6 +62,11 @@ ul,ol,dl{
|
|||
color: #666;
|
||||
display: inline-block;
|
||||
}
|
||||
.ProjectListIndex{
|
||||
.ant-affix{
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
@media screen and (max-width: 1200px){
|
||||
.main{
|
||||
width:100%;
|
||||
|
|
|
@ -76,6 +76,13 @@ export default Form.create()(({ form, match, history, current_user, showNotifica
|
|||
}
|
||||
}).catch((error) => {
|
||||
})
|
||||
}else{
|
||||
setTimeout(() => {
|
||||
setContentMd(true);
|
||||
}, 200);
|
||||
setTimeout(() => {
|
||||
setGuideMd(true);
|
||||
}, 300);
|
||||
}
|
||||
}, [id])
|
||||
|
||||
|
|
|
@ -22,10 +22,12 @@ service.interceptors.request.use(config => {
|
|||
if (window.location.port === "3007") {
|
||||
// 模拟token为登录用户
|
||||
const osredmToken = cookie.load(TokenKey) ||cookie.load('autologin_trustie')||sessionStorage.osredmToken;
|
||||
if (config.url.indexOf('?') === -1) {
|
||||
config.url = `${config.url}?token=${osredmToken}`;
|
||||
} else {
|
||||
config.url = `${config.url}&token=${osredmToken}`;
|
||||
if(osredmToken){
|
||||
if (config.url.indexOf('?') === -1 ) {
|
||||
config.url = `${config.url}?token=${osredmToken}`;
|
||||
} else {
|
||||
config.url = `${config.url}&token=${osredmToken}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
return config;
|
||||
|
|
|
@ -122,7 +122,7 @@ export default Form.create()((props) => {
|
|||
})
|
||||
|
||||
function disabledDate(current) {
|
||||
return current && current < moment().endOf('day');
|
||||
return current && current < moment(checkedItem.eachPhaseEndTime).endOf('day');
|
||||
}
|
||||
|
||||
return (
|
||||
|
@ -251,7 +251,7 @@ export default Form.create()((props) => {
|
|||
placeholder="请选择日期"
|
||||
disabledDate={disabledDate}
|
||||
/>,
|
||||
moment(new Date(), format)
|
||||
null
|
||||
)}
|
||||
</Modal>
|
||||
</React.Fragment>
|
||||
|
|
|
@ -112,9 +112,9 @@ export const paperCheckStatusArr = [
|
|||
];
|
||||
|
||||
export const paperCheckTextArr = [
|
||||
"您已成功提交,请等待审核!",
|
||||
"您的成果已经审核通过!",
|
||||
"您的成果审核未通过",
|
||||
"您的成果已经审核通过!",
|
||||
"您已成功提交,请等待审核!",
|
||||
];
|
||||
|
||||
export const paperComplainStatusArr = [
|
||||
|
|
|
@ -2,14 +2,16 @@ import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
|||
import classNames from 'classnames';
|
||||
import { Input, Select, Button, Form, DatePicker, Modal, message, Popover } from 'antd';
|
||||
import { Link } from 'react-router-dom';
|
||||
import moment from 'moment';
|
||||
|
||||
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr, main_web_site_url } from '../static';
|
||||
import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask, addExpertReview, publishExpertsAndRules } from '../api';
|
||||
import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask, addExpertReview, publishExpertsAndRules,delayTask } from '../api';
|
||||
import '../index.scss';
|
||||
import './index.scss';
|
||||
import { getRules, selectExpertList } from 'src/military/expert/api';
|
||||
import PaginationTable from '../../../components/pagination-table';
|
||||
const format = "YYYY-MM-DD HH:mm:ss";
|
||||
const formatDelay = "YYYY-MM-DD";
|
||||
const Option = Select.Option;
|
||||
|
||||
const statusArr = [];
|
||||
|
@ -23,7 +25,7 @@ for (const item of paperCheckStatusArr) {
|
|||
|
||||
// 管理端 创客任务列表
|
||||
export default Form.create()(({ form, showNotification, match, history, state }) => {
|
||||
const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
|
||||
const { getFieldDecorator, setFieldsValue, getFieldsValue, validateFields } = form;
|
||||
const { hash} = history && history.location;
|
||||
const [reload, setReload] = useState();
|
||||
const [loading, setLoading] = useState(false);
|
||||
|
@ -50,6 +52,8 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|||
const [publicTaskId, setPublicTaskId] = useState(undefined);
|
||||
// 加入专家评审的创客id数组
|
||||
const [reviewTaskId, setReviewTaskId] = useState(undefined);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [checkedItem, setCheckedItem] = useState('');
|
||||
|
||||
useEffect(()=>{
|
||||
setCurPage(hashDate(hash) || 1);
|
||||
|
@ -128,6 +132,11 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|||
setSearchObj({});
|
||||
}
|
||||
|
||||
function delayClick(item) {
|
||||
setCheckedItem(item);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
|
@ -206,9 +215,10 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|||
const disabled = record.assignRuleAndExperts || !(record.status == 1 || record.status == 3);
|
||||
return(
|
||||
<React.Fragment>
|
||||
<Button className="mr5 f20" onClick={() => { deleteItem(record.id,isDelete == '0' ? '1':'0') }}>{isDelete == '0' ? '隐藏任务':'恢复任务'}</Button>
|
||||
<Button className="mr5 f89" onClick={() => { recommendItem(record.id, record.recommend ? '0' :'1') }}>{record.recommend ? '撤销推荐':'首页推荐'}</Button>
|
||||
<Button className={`mr5 c2a3 ${text ? 'bor':'full'} ${disabled && 'disabled'}`} onClick={() => { changeExpertReviewStatus(text ? '-1':'1', record.id) }} disabled={disabled}>{text ? '取消专家评审':'加入专家评审'}</Button>
|
||||
{[3,4,6,7].includes(record.status)&&<Button className="mr5 mb5 f89" onClick={() => { delayClick(record) }}>延期</Button>}
|
||||
<Button className="mr5 mb5 f20" onClick={() => { deleteItem(record.id,isDelete == '0' ? '1':'0') }}>{isDelete == '0' ? '隐藏任务':'恢复任务'}</Button>
|
||||
<Button className="mr5 mb5 f89" onClick={() => { recommendItem(record.id, record.recommend ? '0' :'1') }}>{record.recommend ? '撤销推荐':'首页推荐'}</Button>
|
||||
<Button className={`mr5 mb5 c2a3 ${text ? 'bor':'full'} ${disabled && 'disabled'}`} onClick={() => { changeExpertReviewStatus(text ? '-1':'1', record.id) }} disabled={disabled}>{text ? '取消专家评审':'加入专家评审'}</Button>
|
||||
{/* {
|
||||
isDelete == '0' ? <Button className="mr5 font-12" type="danger" size="small" onClick={() => { deleteItem(record.id, '1') }}>隐藏任务</Button>
|
||||
: <Button className="mr5 font-12" type="primary" size="small" onClick={() => { deleteItem(record.id, '0') }}>恢复任务</Button>
|
||||
|
@ -502,6 +512,30 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|||
window.open(main_web_site_url + '/admin/tasks.xlsx');
|
||||
}
|
||||
|
||||
function disabledDate(current) {
|
||||
return current && current < moment(checkedItem.eachPhaseEndTime).endOf('day');
|
||||
}
|
||||
|
||||
function delayTime() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
console.log(values)
|
||||
delayTask({
|
||||
taskId: checkedItem.id,
|
||||
params: {
|
||||
delayedTo: moment(values.delayedTo).format(formatDelay)
|
||||
},
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('操作成功');
|
||||
setReload(Math.random());
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="task-manage-all ">
|
||||
<div className='management-content-head'>
|
||||
|
@ -693,6 +727,28 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|||
expandedRowKeys={reviewTaskId}
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<Modal
|
||||
title="请输入延期截止的具体时间"
|
||||
visible={visible}
|
||||
onOk={delayTime}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
className="time-edit-modal"
|
||||
destroyOnClose
|
||||
>
|
||||
{helper(
|
||||
"",
|
||||
"delayedTo",
|
||||
[{ required: true, message: "请选择日期" }],
|
||||
<DatePicker
|
||||
format={formatDelay}
|
||||
placeholder="请选择日期"
|
||||
disabledDate={disabledDate}
|
||||
/>,
|
||||
null
|
||||
)}
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -82,6 +82,9 @@
|
|||
color:#f20000;
|
||||
}
|
||||
}
|
||||
.mb5{
|
||||
margin-bottom: 5px !important;
|
||||
}
|
||||
.f89{
|
||||
border-color:#f89d00;
|
||||
span{
|
||||
|
@ -230,4 +233,8 @@
|
|||
// td{padding: 0.5rem 1rem;}
|
||||
}
|
||||
tr.ant-table-expanded-row td{padding: 0.5rem 1rem;}
|
||||
}
|
||||
.time-edit-modal .ant-modal-body{
|
||||
width: 200px;
|
||||
margin:0 auto;
|
||||
}
|
|
@ -57,9 +57,9 @@ export default Form.create()(
|
|||
// 已发布评审任务 评审规则
|
||||
const [publishedReviewRules, setPublishedReviewRules] = useState(undefined);
|
||||
|
||||
useEffect(()=>{
|
||||
!current_user.login&&showLoginDialog();
|
||||
},[current_user.login]);
|
||||
// useEffect(()=>{
|
||||
// !current_user.login&&showLoginDialog();
|
||||
// },[current_user.login]);
|
||||
|
||||
|
||||
// 获取任务领域配置数据
|
||||
|
@ -132,7 +132,7 @@ export default Form.create()(
|
|||
// 获取成果列表
|
||||
useEffect(() => {
|
||||
// 等加载完成果详情再加载成果列表
|
||||
if (detailData.id && current_user.login) {
|
||||
if (detailData.id ) {
|
||||
setLoading(true);
|
||||
let params = {
|
||||
taskId: id,
|
||||
|
@ -318,14 +318,14 @@ export default Form.create()(
|
|||
|
||||
const signContent = useCallback(() => {
|
||||
if (signAgreement && isPaper) {
|
||||
let checkStatustext = paperCheckTextArr[0];
|
||||
let checkStatustext ;
|
||||
for (const item of dataList) {
|
||||
if (item.user.login === current_user.login) {
|
||||
checkStatustext = paperCheckTextArr[item.checkStatus];
|
||||
}
|
||||
}
|
||||
return <div className="edu-back-white padding30 mt20 font-16 color-orange text-center">
|
||||
{checkStatustext}
|
||||
{checkStatustext||paperCheckTextArr[2]}
|
||||
</div>
|
||||
} else if (signAgreement) {
|
||||
return (<div className="edu-back-white padding30 mt20">
|
||||
|
@ -360,7 +360,7 @@ export default Form.create()(
|
|||
} else if (detailData.user && (current_user.login !== detailData.user.login)) {
|
||||
return <div className="edu-back-white padding30 mt20 text-center">
|
||||
{/* 为创客大赛,暂时disable应征投稿 */}
|
||||
<Button className="mr20" type={"primary"} onClick={() => { setApplyModal(true) }} disabled>我要应征投稿</Button>
|
||||
<Button className="mr20" type={"primary"} onClick={() => { setApplyModal(true) }} disabled={detailData.enterpriseName=="taohuayuan"}>我要应征投稿</Button>
|
||||
</div>
|
||||
}
|
||||
}, [signAgreement, isPaper, current_user, detailData, dataList]);
|
||||
|
@ -458,7 +458,7 @@ export default Form.create()(
|
|||
}
|
||||
|
||||
{/* 配合创客大赛,暂时注释,以后还原 */}
|
||||
{/* <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、应征者所提交的作品必须由应征者本人创作或参与创作,应征者应确认其作品的原创性,主办单位不承担因作品侵犯他人(或单位)的权利而产生的法律责任,其法律责任由应征者本人承担。
|
||||
|
@ -466,7 +466,7 @@ 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>
|
||||
|
@ -482,9 +482,9 @@ export default Form.create()(
|
|||
<a onClick={goUserProfiles} className="color-blue_41">请先完善主体信息</a>
|
||||
</div>}
|
||||
|
||||
{!current_user.login &&<div className="edu-back-white padding30 mt20 font-16 text-center mb50">
|
||||
{/* {!current_user.login &&<div className="edu-back-white padding30 mt20 font-16 text-center mb50">
|
||||
<span className="color-blue_41">创客任务仅限登录用户查看,请先注册登录红山开源账号!</span>
|
||||
</div>}
|
||||
</div>} */}
|
||||
|
||||
{current_user.enterpriseCertification && detailData.status === 3 && (!detailData.exceptClosedBoolean) && signContent()}
|
||||
|
||||
|
|
|
@ -130,10 +130,10 @@ export default ({ history, current_user, showLoginDialog, location, mygetHelmeta
|
|||
}, []);
|
||||
|
||||
function taskClick(id) {
|
||||
if (!current_user.user_id) {
|
||||
showLoginDialog();
|
||||
return;
|
||||
}
|
||||
// if (!current_user.user_id) {
|
||||
// showLoginDialog();
|
||||
// return;
|
||||
// }
|
||||
history.push(`/task/taskDetail/${id}`);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue