forked from Gitlink/forgeplus-react
处理创客任务列表已选专家过多时页面不显示问题
This commit is contained in:
parent
c8fd59d101
commit
8c0f99c274
|
@ -41,6 +41,13 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
const [taskList, setTaskList] = useState([]);
|
const [taskList, setTaskList] = useState([]);
|
||||||
const [expertReview, setExpertReview] = useState('');
|
const [expertReview, setExpertReview] = useState('');
|
||||||
|
|
||||||
|
//查看评审规则、查看选取专家、发布评审任务
|
||||||
|
const [lookRules, setLookRules] = useState(false);
|
||||||
|
const [lookExperts, setLookExperts] = useState(false);
|
||||||
|
const [pulicReview, setPublicReview] = useState(false);
|
||||||
|
const [rules, setRules] = useState(undefined);
|
||||||
|
const [selectedExperts, setSelectedExperts] = useState(undefined);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setCurPage(hashDate(hash) || 1);
|
setCurPage(hashDate(hash) || 1);
|
||||||
},[hash])
|
},[hash])
|
||||||
|
@ -360,30 +367,41 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//发布评审任务
|
//监听lookRules,lookExperts,pulicReview的变化,弹框
|
||||||
function publishTaskReview(record){
|
useEffect(()=>{
|
||||||
if(!record.ruleEditedCount || !record.expertSelectedCount){
|
|
||||||
message.error("请先编辑评审规则以及选取评选专家再发布此任务");
|
//评审规则
|
||||||
}else{
|
lookRules && rules && Modal.info({
|
||||||
let rules = undefined;
|
className: 'publishReview',
|
||||||
let selectedExperts = undefined;
|
title: "评审规则",
|
||||||
getRules({containerId: record.id, containerType: 1, statusString: 3}).then(response=>{
|
content:
|
||||||
if(response && response.message === "success"){
|
<React.Fragment>
|
||||||
rules = response.data;
|
<div>{rules && rules.rule}</div>
|
||||||
}
|
<p>评分标准</p>
|
||||||
})
|
<div>
|
||||||
selectExpertList({containerId: record.id, containerType: 1, curPage:curPage, pageSize: 10000, curPage: 1,}).then(response=>{
|
{rules.criterias.map(item=>{return <p key={Math.random()}>{item}</p>})}
|
||||||
if(response && response.message === "success" && Array.isArray(response.data.rows)){
|
</div>
|
||||||
let index = 1;
|
<p>评审时间</p>
|
||||||
for (const item of response.data.rows) {
|
<div>{rules.reviewData}</div>
|
||||||
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo ? `、${item.reviewAreaTwo}`:''} ${item.reviewAreaThree ? `、${item.reviewAreaThree}`:''}`;
|
</React.Fragment>
|
||||||
item.index = (index++) + (curPage > 1 ? (curPage - 1) * 10 : 0);
|
,
|
||||||
}
|
|
||||||
selectedExperts = response.data.rows
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
lookRules && setLookRules(false);
|
||||||
Modal.confirm({
|
|
||||||
|
//已选取评审专家
|
||||||
|
lookExperts && selectedExperts && Modal.info({
|
||||||
|
className: 'publishReview',
|
||||||
|
title: "已选取评审专家",
|
||||||
|
content:
|
||||||
|
<PaginationTable
|
||||||
|
dataSource={selectedExperts}
|
||||||
|
columns={columnsExperts}
|
||||||
|
scroll={{ y: 395 }}/>,
|
||||||
|
});
|
||||||
|
lookExperts && setLookExperts(false);
|
||||||
|
|
||||||
|
//发布评审任务
|
||||||
|
pulicReview && rules && selectedExperts && Modal.confirm({
|
||||||
className: 'publishReview',
|
className: 'publishReview',
|
||||||
title: "发布评审任务",
|
title: "发布评审任务",
|
||||||
centered: true,
|
centered: true,
|
||||||
|
@ -418,40 +436,19 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
}, 300);
|
pulicReview && setPublicReview(false);
|
||||||
}
|
},[lookRules,lookExperts,pulicReview])
|
||||||
}
|
|
||||||
|
|
||||||
//已发布任务 查看评审规则
|
//发布评审任务
|
||||||
function viewRules(record){
|
function publishTaskReview(record){
|
||||||
let rules = undefined;
|
if(!record.ruleEditedCount || !record.expertSelectedCount){
|
||||||
getRules({containerId: record.id, containerType: 1, statusString: '-1,1,2'}).then(response=>{
|
message.error("请先编辑评审规则以及选取评选专家再发布此任务");
|
||||||
|
}else{
|
||||||
|
getRules({containerId: record.id, containerType: 1, statusString: 3}).then(response=>{
|
||||||
if(response && response.message === "success"){
|
if(response && response.message === "success"){
|
||||||
rules = response.data;
|
setRules(response.data);
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
setTimeout(() => {
|
|
||||||
Modal.info({
|
|
||||||
className: 'publishReview',
|
|
||||||
title: "评审规则",
|
|
||||||
content:
|
|
||||||
<React.Fragment>
|
|
||||||
<div>{rules && rules.rule}</div>
|
|
||||||
<p>评分标准</p>
|
|
||||||
<div>
|
|
||||||
{rules.criterias.map(item=>{return <p key={Math.random()}>{item}</p>})}
|
|
||||||
</div>
|
|
||||||
<p>评审时间</p>
|
|
||||||
<div>{rules.reviewData}</div>
|
|
||||||
</React.Fragment>
|
|
||||||
,
|
|
||||||
});
|
|
||||||
}, 300);
|
|
||||||
}
|
|
||||||
|
|
||||||
//已发布任务 查看已选专家
|
|
||||||
function viewExperts(record){
|
|
||||||
let selectedExperts = undefined;
|
|
||||||
selectExpertList({containerId: record.id, containerType: 1, curPage:curPage, pageSize: 10000, curPage: 1,}).then(response=>{
|
selectExpertList({containerId: record.id, containerType: 1, curPage:curPage, pageSize: 10000, curPage: 1,}).then(response=>{
|
||||||
if(response && response.message === "success" && Array.isArray(response.data.rows)){
|
if(response && response.message === "success" && Array.isArray(response.data.rows)){
|
||||||
let index = 1;
|
let index = 1;
|
||||||
|
@ -459,20 +456,36 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
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);
|
item.index = (index++) + (curPage > 1 ? (curPage - 1) * 10 : 0);
|
||||||
}
|
}
|
||||||
selectedExperts = response.data.rows
|
setSelectedExperts(response.data.rows);
|
||||||
|
setPublicReview(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
}
|
||||||
Modal.info({
|
}
|
||||||
className: 'publishReview',
|
|
||||||
title: "已选取评审专家",
|
//已发布任务 查看评审规则
|
||||||
content:
|
function viewRules(record){
|
||||||
<PaginationTable
|
getRules({containerId: record.id, containerType: 1, statusString: '-1,1,2'}).then(response=>{
|
||||||
dataSource={selectedExperts}
|
if(response && response.message === "success"){
|
||||||
columns={columnsExperts}
|
setRules(response.data);
|
||||||
scroll={{ y: 395 }}/>,
|
setLookRules(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//已发布任务 查看已选专家
|
||||||
|
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.index = (index++) + (curPage > 1 ? (curPage - 1) * 10 : 0);
|
||||||
|
}
|
||||||
|
setSelectedExperts(response.data.rows);
|
||||||
|
setLookExperts(true);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}, 300);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeStatus(showUserMode, taskId) {
|
function changeStatus(showUserMode, taskId) {
|
||||||
|
|
Loading…
Reference in New Issue