|
|
|
@ -1,11 +1,11 @@
|
|
|
|
|
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
|
|
|
|
import classNames from 'classnames';
|
|
|
|
|
import { Input, Select, Button, Form, DatePicker, Modal, message, Popover } from 'antd';
|
|
|
|
|
import { Input, Select, Button, Form, DatePicker, Modal, message, Popover, InputNumber } 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,delayTask ,resetTask} from '../api';
|
|
|
|
|
import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask, addExpertReview, publishExpertsAndRules, delayTask, resetTask, changePinnedTaskSort } from '../api';
|
|
|
|
|
import '../index.scss';
|
|
|
|
|
import './index.scss';
|
|
|
|
|
import { getRules, selectExpertList } from 'src/military/expert/api';
|
|
|
|
@ -27,7 +27,7 @@ for (const item of paperCheckStatusArr) {
|
|
|
|
|
// 管理端 创客任务列表
|
|
|
|
|
export default Form.create()(({ form, showNotification, match, history, state }) => {
|
|
|
|
|
const { getFieldDecorator, setFieldsValue, getFieldsValue, validateFields } = form;
|
|
|
|
|
const { hash} = history && history.location;
|
|
|
|
|
const { hash } = history && history.location;
|
|
|
|
|
const [reload, setReload] = useState();
|
|
|
|
|
const [loading, setLoading] = useState(false);
|
|
|
|
|
const [statusString, setStatusString] = useState('');
|
|
|
|
@ -37,15 +37,15 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
const [recommend, setRecommend] = useState('');
|
|
|
|
|
|
|
|
|
|
const [sort, setSort] = useState('Desc');
|
|
|
|
|
const [order, setOrder] = useState('createdAt');
|
|
|
|
|
const [order, setOrder] = useState('default');
|
|
|
|
|
const [searchObj, setSearchObj] = useState({});
|
|
|
|
|
const [curPage, setCurPage] = useState(hashDate(hash) || 1);
|
|
|
|
|
const [total, setTotal] = useState(0);
|
|
|
|
|
const [taskList, setTaskList] = useState([]);
|
|
|
|
|
const [expertReview, setExpertReview] = useState('');
|
|
|
|
|
const [downloading,setDownloading] = useState(false);
|
|
|
|
|
const [downloading, setDownloading] = useState(false);
|
|
|
|
|
|
|
|
|
|
const [restartVisible,setRestartVisible]= useState(false); //重启任务modal
|
|
|
|
|
const [restartVisible, setRestartVisible] = useState(false); //重启任务modal
|
|
|
|
|
|
|
|
|
|
//查看评审规则、查看选取专家、发布评审任务
|
|
|
|
|
const [lookRules, setLookRules] = useState(false);
|
|
|
|
@ -58,10 +58,11 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
const [reviewTaskId, setReviewTaskId] = useState(undefined);
|
|
|
|
|
const [visible, setVisible] = useState(false); //延期任务modal
|
|
|
|
|
const [checkedItem, setCheckedItem] = useState('');
|
|
|
|
|
const [orderVisible, setOrderVisible] = useState(false);
|
|
|
|
|
|
|
|
|
|
useEffect(()=>{
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
setCurPage(hashDate(hash) || 1);
|
|
|
|
|
},[hash])
|
|
|
|
|
}, [hash])
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
const params = {
|
|
|
|
@ -71,16 +72,16 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
showUserMode: showUserMode.length > 1 ? '' : showUserMode,
|
|
|
|
|
curPage,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
orderBy: order + sort,
|
|
|
|
|
orderBy: order === 'default' ? '' : order + sort,
|
|
|
|
|
isDelete,
|
|
|
|
|
recommend,
|
|
|
|
|
expertReview: expertReview==='-1'?"":expertReview,
|
|
|
|
|
expertReview: expertReview === '-1' ? "" : expertReview,
|
|
|
|
|
};
|
|
|
|
|
setLoading(true);
|
|
|
|
|
getTaskAdminList(params).then(data => {
|
|
|
|
|
if (data) {
|
|
|
|
|
let taskIds = [];
|
|
|
|
|
for(const item of data.rows){
|
|
|
|
|
for (const item of data.rows) {
|
|
|
|
|
item.expertReview && (taskIds[taskIds.length] = item.id)
|
|
|
|
|
}
|
|
|
|
|
setReviewTaskId(taskIds.toString());
|
|
|
|
@ -100,7 +101,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
), []);
|
|
|
|
|
|
|
|
|
|
function hashDate(hash) {
|
|
|
|
|
return parseInt(hash.split("&")[0].substring(hash.split("&")[0].indexOf("=")+1));
|
|
|
|
|
return parseInt(hash.split("&")[0].substring(hash.split("&")[0].indexOf("=") + 1));
|
|
|
|
|
}
|
|
|
|
|
function onSearch() {
|
|
|
|
|
let values = getFieldsValue(['nameInput', 'endTime', 'startTime', 'enterpriseNameInput']);
|
|
|
|
@ -124,7 +125,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
expertReviewStatus: '-1',
|
|
|
|
|
showStatus: '0',
|
|
|
|
|
isRecommend: 'all',
|
|
|
|
|
sortBy: 'createdAt'
|
|
|
|
|
sortBy: 'default'
|
|
|
|
|
});
|
|
|
|
|
setStatusString('0,1,2,3,4,5,6,7,8,9');
|
|
|
|
|
setShowUserMode('0,1,2');
|
|
|
|
@ -132,35 +133,36 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
setExpertReview('-1');
|
|
|
|
|
setIsDelete('0');
|
|
|
|
|
setRecommend('');
|
|
|
|
|
setOrder("createdAt");
|
|
|
|
|
setOrder("default");
|
|
|
|
|
setSearchObj({});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function delayClick(item,restart) {
|
|
|
|
|
// 延期任务
|
|
|
|
|
function delayClick(item, restart) {
|
|
|
|
|
setCheckedItem(item);
|
|
|
|
|
if(restart){
|
|
|
|
|
if (restart) {
|
|
|
|
|
setVisible(true);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
setRestartVisible(true);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 主列表
|
|
|
|
|
const columns = useMemo(() => {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
title: '任务编号',
|
|
|
|
|
dataIndex: 'number',
|
|
|
|
|
width: "26%"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '任务名称',
|
|
|
|
|
dataIndex: 'name',
|
|
|
|
|
width: "10%",
|
|
|
|
|
render: (text, record) => (
|
|
|
|
|
<Popover content = {
|
|
|
|
|
<Popover content={
|
|
|
|
|
<div className='taskPopover'>
|
|
|
|
|
<p><span>任务名称:</span>{text}</p>
|
|
|
|
|
<p className='mt5'><span>截稿时间:</span>{record.collectingEndTime && record.collectingEndTime.replaceAll('-','/').substring(0,16) || '--'}</p>
|
|
|
|
|
<p className='mt5'><span>截稿时间:</span>{record.collectingEndTime && record.collectingEndTime.replaceAll('-', '/').substring(0, 16) || '--'}</p>
|
|
|
|
|
<p className='mt5'><span>稿件数:</span>{record.papersCount || '--'}</p>
|
|
|
|
|
</div>
|
|
|
|
|
}>
|
|
|
|
@ -177,7 +179,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
dataIndex: 'publishedAt',
|
|
|
|
|
width: "8%",
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
text = text && text.replaceAll('-','/').substring(0,16);
|
|
|
|
|
text = text && text.replaceAll('-', '/').substring(0, 16);
|
|
|
|
|
return text || '--'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
@ -209,12 +211,17 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
{
|
|
|
|
|
showUserModeArr.map(item => {
|
|
|
|
|
// 若创客任务在公示期及以后阶段,则不显示“自动公示”选项
|
|
|
|
|
return <Option key={item.dicItemCode} value={item.dicItemCode} disabled={item.dicItemCode===1 && [5,6,7,8].includes(record.status)}>{item.dicItemName}</Option>
|
|
|
|
|
return <Option key={item.dicItemCode} value={item.dicItemCode} disabled={item.dicItemCode === 1 && [5, 6, 7, 8].includes(record.status)}>{item.dicItemName}</Option>
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
</Select>
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '排序',
|
|
|
|
|
key: 'orderNum',
|
|
|
|
|
dataIndex: 'orderNum'
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '操作',
|
|
|
|
|
key: 'action',
|
|
|
|
@ -222,28 +229,17 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
align: 'center',
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
const disabled = record.assignRuleAndExperts || !(record.status == 1 || record.status == 3);
|
|
|
|
|
return(
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{[3,4,6,7].includes(record.status)&&<Button className="mr5 mb5 f89" onClick={() => { delayClick(record,true) }}>延期</Button>}
|
|
|
|
|
{record.status==8&& record.exceptClosedBoolean&&<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>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
!record.recommend && [3, 4, 5, 6, 7, 8].includes(record.status) && <Button className="mr5 font-12" type="primary" size="small" onClick={() => { recommendItem(record.id, '1') }}>首页推荐</Button>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
record.recommend && <Button className="mr5 font-12" type="danger" size="small" onClick={() => { recommendItem(record.id, '0') }}>撤销推荐</Button>
|
|
|
|
|
} */}
|
|
|
|
|
{/* <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>查看</Link> */}
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
)},
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{[3, 4, 6, 7].includes(record.status) && <Button className="mr5 mb5 f89" onClick={() => { delayClick(record, true) }}>延期</Button>}
|
|
|
|
|
{record.status == 8 && record.exceptClosedBoolean && <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" type='primary' onClick={() => { setCheckedItem(record); setOrderVisible(true); }}>排序</Button>
|
|
|
|
|
<Button className={`mr5 mb5 c2a3 ${text ? 'bor' : 'full'} ${disabled && 'disabled'}`} onClick={() => { changeExpertReviewStatus(text ? '-1' : '1', record.id) }} disabled={disabled}>{text ? '取消评审' : '加入评审'}</Button>
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
)
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
]
|
|
|
|
|
}, [isDelete, curPage]);
|
|
|
|
@ -293,13 +289,18 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
title: '专家评估',
|
|
|
|
|
dataIndex: 'expertScore',
|
|
|
|
|
align: 'center',
|
|
|
|
|
render:(text,record)=>{
|
|
|
|
|
render: (text, record) => {
|
|
|
|
|
return record.expertScore || '--';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
];
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
// 打开排序弹框后执行赋值语句
|
|
|
|
|
useEffect(()=>{
|
|
|
|
|
orderVisible&&setFieldsValue({ orderNum: checkedItem.orderNum })
|
|
|
|
|
},[orderVisible])
|
|
|
|
|
|
|
|
|
|
// function resetTaskModal
|
|
|
|
|
|
|
|
|
|
function recommendItem(id, recommend) {
|
|
|
|
@ -337,7 +338,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//监听lookRules,lookExperts,pulicReview的变化,弹框
|
|
|
|
|
useEffect(()=>{
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
//评审规则
|
|
|
|
|
lookRules && rules && Modal.info({
|
|
|
|
|
className: 'publishReview',
|
|
|
|
@ -347,7 +348,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
<div>{rules && rules.rule}</div>
|
|
|
|
|
<p>评分标准</p>
|
|
|
|
|
<div>
|
|
|
|
|
{rules.criterias.map(item=>{return <p key={Math.random()}>{item}</p>})}
|
|
|
|
|
{rules.criterias.map(item => { return <p key={Math.random()}>{item}</p> })}
|
|
|
|
|
</div>
|
|
|
|
|
<p>评审时间</p>
|
|
|
|
|
<div>{rules.reviewData}</div>
|
|
|
|
@ -362,9 +363,9 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
title: "已选取评审专家",
|
|
|
|
|
content:
|
|
|
|
|
<PaginationTable
|
|
|
|
|
dataSource={selectedExperts}
|
|
|
|
|
columns={columnsExperts}
|
|
|
|
|
scroll={{ y: 395 }}/>,
|
|
|
|
|
dataSource={selectedExperts}
|
|
|
|
|
columns={columnsExperts}
|
|
|
|
|
scroll={{ y: 395 }} />,
|
|
|
|
|
});
|
|
|
|
|
lookExperts && setLookExperts(false);
|
|
|
|
|
|
|
|
|
@ -383,7 +384,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
<div>{rules && rules.rule}</div>
|
|
|
|
|
<p>评分标准</p>
|
|
|
|
|
<div>
|
|
|
|
|
{rules.criterias.map(item=>{return <p key={Math.random()}>{item}</p>})}
|
|
|
|
|
{rules.criterias.map(item => { return <p key={Math.random()}>{item}</p> })}
|
|
|
|
|
</div>
|
|
|
|
|
<p>评审时间</p>
|
|
|
|
|
<div>{rules.reviewData}</div>
|
|
|
|
@ -391,37 +392,37 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
<PaginationTable
|
|
|
|
|
dataSource={selectedExperts}
|
|
|
|
|
columns={columnsExperts}
|
|
|
|
|
scroll={{ y: 230 }}/>
|
|
|
|
|
scroll={{ y: 230 }} />
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
,
|
|
|
|
|
okText: '确定',
|
|
|
|
|
cancelText: '取消',
|
|
|
|
|
onOk() {
|
|
|
|
|
publishExpertsAndRules(publicTaskId,1).then(response=>{
|
|
|
|
|
if(response && response.message==="发布成功"){
|
|
|
|
|
publishExpertsAndRules(publicTaskId, 1).then(response => {
|
|
|
|
|
if (response && response.message === "发布成功") {
|
|
|
|
|
setReload(Math.random());
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
pulicReview && setPublicReview(false);
|
|
|
|
|
},[lookRules,lookExperts,pulicReview])
|
|
|
|
|
}, [lookRules, lookExperts, pulicReview])
|
|
|
|
|
|
|
|
|
|
//发布评审任务
|
|
|
|
|
function publishTaskReview(record){
|
|
|
|
|
if(!record.ruleEditedCount || !record.expertSelectedCount){
|
|
|
|
|
function publishTaskReview(record) {
|
|
|
|
|
if (!record.ruleEditedCount || !record.expertSelectedCount) {
|
|
|
|
|
message.error("请先编辑评审规则以及选取评选专家再发布此任务");
|
|
|
|
|
}else{
|
|
|
|
|
getRules({containerId: record.id, containerType: 1, statusString: 3}).then(response=>{
|
|
|
|
|
if(response && response.message === "success"){
|
|
|
|
|
} else {
|
|
|
|
|
getRules({ containerId: record.id, containerType: 1, statusString: 3 }).then(response => {
|
|
|
|
|
if (response && response.message === "success") {
|
|
|
|
|
setRules(response.data);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
selectExpertList({containerId: record.id, containerType: 1, curPage:curPage, pageSize: 10000, curPage: 1,}).then(response=>{
|
|
|
|
|
if(response && response.message === "success" && Array.isArray(response.data.rows)){
|
|
|
|
|
selectExpertList({ containerId: record.id, containerType: 1, curPage: curPage, pageSize: 10000, curPage: 1, }).then(response => {
|
|
|
|
|
if (response && response.message === "success" && Array.isArray(response.data.rows)) {
|
|
|
|
|
let index = 1;
|
|
|
|
|
for (const item of response.data.rows) {
|
|
|
|
|
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo ? `、${item.reviewAreaTwo}`:''} ${item.reviewAreaThree ? `、${item.reviewAreaThree}`:''}`;
|
|
|
|
|
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo ? `、${item.reviewAreaTwo}` : ''} ${item.reviewAreaThree ? `、${item.reviewAreaThree}` : ''}`;
|
|
|
|
|
item.index = (index++) + (curPage > 1 ? (curPage - 1) * 10 : 0);
|
|
|
|
|
}
|
|
|
|
|
setPublicTaskId(record.id);
|
|
|
|
@ -433,9 +434,9 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//已发布任务 查看评审规则
|
|
|
|
|
function viewRules(record){
|
|
|
|
|
getRules({containerId: record.id, containerType: 1, statusString: '-1,1,2'}).then(response=>{
|
|
|
|
|
if(response && response.message === "success"){
|
|
|
|
|
function viewRules(record) {
|
|
|
|
|
getRules({ containerId: record.id, containerType: 1, statusString: '-1,1,2' }).then(response => {
|
|
|
|
|
if (response && response.message === "success") {
|
|
|
|
|
setRules(response.data);
|
|
|
|
|
setLookRules(true);
|
|
|
|
|
}
|
|
|
|
@ -443,12 +444,12 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//已发布任务 查看已选专家
|
|
|
|
|
function viewExperts(record){
|
|
|
|
|
selectExpertList({containerId: record.id, containerType: 1, curPage:curPage, pageSize: 10000, curPage: 1,}).then(response=>{
|
|
|
|
|
if(response && response.message === "success" && Array.isArray(response.data.rows)){
|
|
|
|
|
function viewExperts(record) {
|
|
|
|
|
selectExpertList({ containerId: record.id, containerType: 1, curPage: curPage, pageSize: 10000, curPage: 1, }).then(response => {
|
|
|
|
|
if (response && response.message === "success" && Array.isArray(response.data.rows)) {
|
|
|
|
|
let index = 1;
|
|
|
|
|
for (const item of response.data.rows) {
|
|
|
|
|
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo ? `、${item.reviewAreaTwo}`:''} ${item.reviewAreaThree ? `、${item.reviewAreaThree}`:''}`;
|
|
|
|
|
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo ? `、${item.reviewAreaTwo}` : ''} ${item.reviewAreaThree ? `、${item.reviewAreaThree}` : ''}`;
|
|
|
|
|
item.index = (index++) + (curPage > 1 ? (curPage - 1) * 10 : 0);
|
|
|
|
|
}
|
|
|
|
|
setSelectedExperts(response.data.rows);
|
|
|
|
@ -469,7 +470,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function changeExpertReviewStatus(expertReviewStatus, taskId) {
|
|
|
|
|
addExpertReview(taskId,expertReviewStatus).then(res => {
|
|
|
|
|
addExpertReview(taskId, expertReviewStatus).then(res => {
|
|
|
|
|
if (res && res.message === 'success') {
|
|
|
|
|
showNotification('操作成功!');
|
|
|
|
|
setReload(Math.random());
|
|
|
|
@ -479,9 +480,9 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function setCurPage1(page){
|
|
|
|
|
function setCurPage1(page) {
|
|
|
|
|
setCurPage(page);
|
|
|
|
|
window.location.href=`/managements/task/taskAdmin#page=${page}`;
|
|
|
|
|
window.location.href = `/managements/task/taskAdmin#page=${page}`;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 改变排序字段
|
|
|
|
@ -510,21 +511,17 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
setCurPage1(1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const ExpertDetail = (record)=>{
|
|
|
|
|
const ExpertDetail = (record) => {
|
|
|
|
|
const unDisabled = record.expertReview && (record.status === 1 || record.status === 3);
|
|
|
|
|
return <div className="expert_detail_div">
|
|
|
|
|
<div> 专家评审信息: </div>
|
|
|
|
|
<div> 评审规则 {record.assignRuleAndExperts ? <Button className='c2a3 bor' onClick={()=>{viewRules(record)}}>查看</Button> : unDisabled ? <Button className="c2a3 bor" href={`/managements/expert/task/review/rules/${1}/${record.id}/?status=${record.status}&name=${record.name}&createdAt=${record.createdAt}&collectingEndTime=${record.collectingEndTime}&choosingDays=${record.choosingDays}`}>编辑</Button> : <Button className='c2a3 disabled'>编辑</Button>}</div>
|
|
|
|
|
<div> 专家选取 {record.assignRuleAndExperts ? <Button className='c2a3 bor' onClick={()=>{viewExperts(record)}}>查看</Button> : unDisabled ? <Button className="c2a3 bor" href={`/managements/expert/task/review/select/${1}/${record.id}/?name=${record.name}`}>选择</Button> : <Button className='c2a3 disabled'>选择</Button>}</div>
|
|
|
|
|
<div> 评审任务 {record.assignRuleAndExperts ? <Button className='c2a3 disabled'>已发布</Button> : unDisabled ? <Button className='c2a3 full' onClick={()=>{publishTaskReview(record)}}>发布</Button> : <Button className='c2a3 disabled'>发布</Button>}</div>
|
|
|
|
|
<div> 评审结果 {record.assignRuleAndExperts ? <Button className="c2a3 bor" href={`/managements/expert/task/review/results/${1}/${record.id}/#status=${record.status}&name=${record.name}&taskModeId=${record.taskModeId}`}>查看</Button>:<Button className='c2a3 disabled'>查看</Button>}</div>
|
|
|
|
|
<div> 评审规则 {record.assignRuleAndExperts ? <Button className='c2a3 bor' onClick={() => { viewRules(record) }}>查看</Button> : unDisabled ? <Button className="c2a3 bor" href={`/managements/expert/task/review/rules/${1}/${record.id}/?status=${record.status}&name=${record.name}&createdAt=${record.createdAt}&collectingEndTime=${record.collectingEndTime}&choosingDays=${record.choosingDays}`}>编辑</Button> : <Button className='c2a3 disabled'>编辑</Button>}</div>
|
|
|
|
|
<div> 专家选取 {record.assignRuleAndExperts ? <Button className='c2a3 bor' onClick={() => { viewExperts(record) }}>查看</Button> : unDisabled ? <Button className="c2a3 bor" href={`/managements/expert/task/review/select/${1}/${record.id}/?name=${record.name}`}>选择</Button> : <Button className='c2a3 disabled'>选择</Button>}</div>
|
|
|
|
|
<div> 评审任务 {record.assignRuleAndExperts ? <Button className='c2a3 disabled'>已发布</Button> : unDisabled ? <Button className='c2a3 full' onClick={() => { publishTaskReview(record) }}>发布</Button> : <Button className='c2a3 disabled'>发布</Button>}</div>
|
|
|
|
|
<div> 评审结果 {record.assignRuleAndExperts ? <Button className="c2a3 bor" href={`/managements/expert/task/review/results/${1}/${record.id}/#status=${record.status}&name=${record.name}&taskModeId=${record.taskModeId}`}>查看</Button> : <Button className='c2a3 disabled'>查看</Button>}</div>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function downloadFile() {
|
|
|
|
|
window.open(main_web_site_url + '/admin/tasks.xlsx');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function disabledDate(current) {
|
|
|
|
|
return current && current < moment(checkedItem.eachPhaseEndTime).endOf('day');
|
|
|
|
|
}
|
|
|
|
@ -534,7 +531,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function delayTime() {
|
|
|
|
|
validateFields(['delayedTo'],(err, values) => {
|
|
|
|
|
validateFields(['delayedTo'], (err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
delayTask({
|
|
|
|
|
taskId: checkedItem.id,
|
|
|
|
@ -552,13 +549,13 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function restartTask(){
|
|
|
|
|
validateFields(["restartEndTime"],(err, values) => {
|
|
|
|
|
function restartTask() {
|
|
|
|
|
validateFields(["restartEndTime"], (err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
resetTask({
|
|
|
|
|
taskId: checkedItem.id,
|
|
|
|
|
endTime: moment(values.restartEndTime).format(format)
|
|
|
|
|
}).then(res => {
|
|
|
|
|
taskId: checkedItem.id,
|
|
|
|
|
endTime: moment(values.restartEndTime).format(format)
|
|
|
|
|
}).then(res => {
|
|
|
|
|
if (res && res.message === 'success') {
|
|
|
|
|
showNotification('操作成功');
|
|
|
|
|
setReload(Math.random());
|
|
|
|
@ -569,6 +566,26 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function changeOrderNum() {
|
|
|
|
|
validateFields(["orderNum"], (err, values) => {
|
|
|
|
|
if (!err) {
|
|
|
|
|
changePinnedTaskSort([{
|
|
|
|
|
id: checkedItem.id,
|
|
|
|
|
orderNum: values.orderNum
|
|
|
|
|
}]
|
|
|
|
|
).then(res => {
|
|
|
|
|
if (res && res.data) {
|
|
|
|
|
showNotification('操作成功');
|
|
|
|
|
setOrderVisible(false);
|
|
|
|
|
setReload(Math.random())
|
|
|
|
|
} else {
|
|
|
|
|
showNotification(res && res.message || '操作失败')
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className="task-manage-all ">
|
|
|
|
|
<div className='management-content-head'>
|
|
|
|
@ -594,27 +611,27 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
|
|
|
|
|
<div className="center-right-but time">
|
|
|
|
|
|
|
|
|
|
{helper(
|
|
|
|
|
"发布时间:",
|
|
|
|
|
"startTime",
|
|
|
|
|
[],
|
|
|
|
|
<DatePicker
|
|
|
|
|
showTime
|
|
|
|
|
format={format}
|
|
|
|
|
placeholder="请选择开始时间"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
{helper(
|
|
|
|
|
"发布时间:",
|
|
|
|
|
"startTime",
|
|
|
|
|
[],
|
|
|
|
|
<DatePicker
|
|
|
|
|
showTime
|
|
|
|
|
format={format}
|
|
|
|
|
placeholder="请选择开始时间"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
{helper(
|
|
|
|
|
"",
|
|
|
|
|
"endTime",
|
|
|
|
|
[],
|
|
|
|
|
<DatePicker
|
|
|
|
|
showTime
|
|
|
|
|
format={format}
|
|
|
|
|
placeholder="请选择结束时间"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
{helper(
|
|
|
|
|
"",
|
|
|
|
|
"endTime",
|
|
|
|
|
[],
|
|
|
|
|
<DatePicker
|
|
|
|
|
showTime
|
|
|
|
|
format={format}
|
|
|
|
|
placeholder="请选择结束时间"
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{helper(
|
|
|
|
@ -624,7 +641,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={(value)=>{setStatusString(value);setCurPage1(1);}}
|
|
|
|
|
onChange={(value) => { setStatusString(value); setCurPage1(1); }}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'0,1,2,3,4,5,6,7,8,9'} >全部</Option>
|
|
|
|
|
{
|
|
|
|
@ -644,7 +661,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
placeholder="请选择审核状态"
|
|
|
|
|
onChange={(value)=>{setShowUserMode(value);setCurPage1(1);}}
|
|
|
|
|
onChange={(value) => { setShowUserMode(value); setCurPage1(1); }}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'0,1,2'}>全部</Option>
|
|
|
|
|
{
|
|
|
|
@ -656,7 +673,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
'0,1,2'
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{helper(
|
|
|
|
|
"发布方式",
|
|
|
|
|
"publishMode1",
|
|
|
|
@ -664,7 +681,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={(value)=>{setPublishMode(value);setCurPage1(1);}}
|
|
|
|
|
onChange={(value) => { setPublishMode(value); setCurPage1(1); }}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'0,1'} >全部</Option>
|
|
|
|
|
<Option key={'0'} >自主提交</Option>
|
|
|
|
@ -679,7 +696,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={(value)=>{setExpertReview(value);setCurPage1(1);}}
|
|
|
|
|
onChange={(value) => { setExpertReview(value); setCurPage1(1); }}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'-1'} >全部</Option>
|
|
|
|
|
<Option key={'1'} >已提交评审</Option>
|
|
|
|
@ -687,63 +704,61 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
</Select>,
|
|
|
|
|
'-1'
|
|
|
|
|
)}
|
|
|
|
|
{/* <div className='center-right-but search'> */}
|
|
|
|
|
{helper(
|
|
|
|
|
"显示状态",
|
|
|
|
|
"showStatus",
|
|
|
|
|
[],
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={changeShow}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'0'} >正常显示</Option>
|
|
|
|
|
<Option key={'1'} >已隐藏</Option>
|
|
|
|
|
</Select>,
|
|
|
|
|
'0'
|
|
|
|
|
)}
|
|
|
|
|
{helper(
|
|
|
|
|
"是否推荐",
|
|
|
|
|
"isRecommend",
|
|
|
|
|
[],
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={changeRecommend}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'all'} >不限</Option>
|
|
|
|
|
<Option key={'0'} >未推荐</Option>
|
|
|
|
|
<Option key={'1'} >已推荐</Option>
|
|
|
|
|
</Select>,
|
|
|
|
|
'all'
|
|
|
|
|
)}
|
|
|
|
|
{helper(
|
|
|
|
|
"排序",
|
|
|
|
|
"sortBy",
|
|
|
|
|
[],
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={changeSortName}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'createdAt'} >创建时间</Option>
|
|
|
|
|
<Option key={'publishedAt'} >发布时间</Option>
|
|
|
|
|
</Select>,
|
|
|
|
|
'createdAt'
|
|
|
|
|
)}
|
|
|
|
|
<div className="button-div">
|
|
|
|
|
{/* <a href="/admin/tasks.xlsx" class="fr edu-default-btn edu-blueback-btn plr30">导出</a> downloadFile*/}
|
|
|
|
|
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
|
|
|
|
<Button className="mr10" onClick={clearSearch}>清除</Button>
|
|
|
|
|
<Button loading={downloading} className="mr10" type="primary" onClick={()=>{setDownloading(true)}}>导出</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<span className={classNames({ "sort-active": sort === 'Desc', 'sort-icon': true, 'mt5': true })} onClick={() => { changeSort('Desc') }}>
|
|
|
|
|
<i className="fa fa-long-arrow-down font-16 "></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span className={classNames({ "sort-active": sort === 'Asc', 'sort-icon': true, 'mt5': true })} onClick={() => { changeSort('Asc') }}>
|
|
|
|
|
<i className="fa fa-long-arrow-up font-16 "></i>
|
|
|
|
|
</span>
|
|
|
|
|
{/* </div> */}
|
|
|
|
|
{helper(
|
|
|
|
|
"显示状态",
|
|
|
|
|
"showStatus",
|
|
|
|
|
[],
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={changeShow}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'0'} >正常显示</Option>
|
|
|
|
|
<Option key={'1'} >已隐藏</Option>
|
|
|
|
|
</Select>,
|
|
|
|
|
'0'
|
|
|
|
|
)}
|
|
|
|
|
{helper(
|
|
|
|
|
"是否推荐",
|
|
|
|
|
"isRecommend",
|
|
|
|
|
[],
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={changeRecommend}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'all'} >不限</Option>
|
|
|
|
|
<Option key={'0'} >未推荐</Option>
|
|
|
|
|
<Option key={'1'} >已推荐</Option>
|
|
|
|
|
</Select>,
|
|
|
|
|
'all'
|
|
|
|
|
)}
|
|
|
|
|
{helper(
|
|
|
|
|
"排序",
|
|
|
|
|
"sortBy",
|
|
|
|
|
[],
|
|
|
|
|
<Select
|
|
|
|
|
className="column-select"
|
|
|
|
|
showArrow
|
|
|
|
|
onChange={changeSortName}
|
|
|
|
|
>
|
|
|
|
|
<Option key={'default'} >默认</Option>
|
|
|
|
|
<Option key={'createdAt'} >创建时间</Option>
|
|
|
|
|
<Option key={'publishedAt'} >发布时间</Option>
|
|
|
|
|
</Select>,
|
|
|
|
|
'default'
|
|
|
|
|
)}
|
|
|
|
|
<div className="button-div">
|
|
|
|
|
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
|
|
|
|
<Button className="mr10" onClick={clearSearch}>清除</Button>
|
|
|
|
|
<Button loading={downloading} className="mr10" type="primary" onClick={() => { setDownloading(true) }}>导出</Button>
|
|
|
|
|
</div>
|
|
|
|
|
<span className={classNames({ "sort-active": sort === 'Desc', 'sort-icon': true, 'mt5': true })} onClick={() => { changeSort('Desc') }}>
|
|
|
|
|
<i className="fa fa-long-arrow-down font-16 "></i>
|
|
|
|
|
</span>
|
|
|
|
|
<span className={classNames({ "sort-active": sort === 'Asc', 'sort-icon': true, 'mt5': true })} onClick={() => { changeSort('Asc') }}>
|
|
|
|
|
<i className="fa fa-long-arrow-up font-16 "></i>
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="center-content taskListCont">
|
|
|
|
@ -754,58 +769,76 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
|
|
|
|
columns={columns}
|
|
|
|
|
total={total}
|
|
|
|
|
current={curPage}
|
|
|
|
|
setCurPage={(page)=>{setCurPage1(page)}}
|
|
|
|
|
setCurPage={(page) => { setCurPage1(page) }}
|
|
|
|
|
className="expertReviewTable"
|
|
|
|
|
expandedRowRender={ExpertDetail}
|
|
|
|
|
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>
|
|
|
|
|
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>
|
|
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
|
title="重启任务"
|
|
|
|
|
visible={restartVisible}
|
|
|
|
|
onOk={restartTask}
|
|
|
|
|
onCancel={() => { setRestartVisible(false) }}
|
|
|
|
|
// className="time-edit-modal"
|
|
|
|
|
destroyOnClose
|
|
|
|
|
>
|
|
|
|
|
<div>当前任务将恢复至<span className="imoptantText">{statusArr[checkedItem.currentStatus]}</span>,请选择该阶段的截止日期:</div>
|
|
|
|
|
{helper(
|
|
|
|
|
"",
|
|
|
|
|
"restartEndTime",
|
|
|
|
|
[{ required: true, message: "请选择时间" }],
|
|
|
|
|
<DatePicker
|
|
|
|
|
format={format}
|
|
|
|
|
placeholder="请选择时间"
|
|
|
|
|
disabledDate={disabledDate2}
|
|
|
|
|
/>,
|
|
|
|
|
moment(moment(new Date()).format(formatDelay)+' 23:59:59')
|
|
|
|
|
)}
|
|
|
|
|
</Modal>
|
|
|
|
|
<Modal
|
|
|
|
|
title="重启任务"
|
|
|
|
|
visible={restartVisible}
|
|
|
|
|
onOk={restartTask}
|
|
|
|
|
onCancel={() => { setRestartVisible(false) }}
|
|
|
|
|
// className="time-edit-modal"
|
|
|
|
|
destroyOnClose
|
|
|
|
|
>
|
|
|
|
|
<div>当前任务将恢复至<span className="imoptantText">{statusArr[checkedItem.currentStatus]}</span>,请选择该阶段的截止日期:</div>
|
|
|
|
|
{helper(
|
|
|
|
|
"",
|
|
|
|
|
"restartEndTime",
|
|
|
|
|
[{ required: true, message: "请选择时间" }],
|
|
|
|
|
<DatePicker
|
|
|
|
|
format={format}
|
|
|
|
|
placeholder="请选择时间"
|
|
|
|
|
disabledDate={disabledDate2}
|
|
|
|
|
/>,
|
|
|
|
|
moment(moment(new Date()).format(formatDelay) + ' 23:59:59')
|
|
|
|
|
)}
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
<ExportTable downloading={downloading} setDownloading={setDownloading}/>
|
|
|
|
|
<Modal
|
|
|
|
|
title="请输入排序值,请输入正整数"
|
|
|
|
|
visible={orderVisible}
|
|
|
|
|
onOk={changeOrderNum}
|
|
|
|
|
onCancel={() => { setOrderVisible(false) }}
|
|
|
|
|
className="time-edit-modal"
|
|
|
|
|
destroyOnClose
|
|
|
|
|
>
|
|
|
|
|
{helper(
|
|
|
|
|
"",
|
|
|
|
|
"orderNum",
|
|
|
|
|
[{ required: true, message: "请输入正整数" }],
|
|
|
|
|
<InputNumber min={0} max={2100000000} precision={0} />
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
{/* 导出创客任务的组件 */}
|
|
|
|
|
<ExportTable downloading={downloading} setDownloading={setDownloading} />
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|