Merge branch 'dev_military_osredm' of http://106.75.45.236:3000/tongChong/forgeplus-react into expert_review

This commit is contained in:
unknown 2022-01-19 10:45:13 +08:00
commit e0b4cdc16c
3 changed files with 35 additions and 41 deletions

View File

@ -95,7 +95,7 @@ export default Form.create()(({ match, history, showNotification, form, current_
setHonorIds(lastRegister.honors);
}
} else if(res && res.message=="未登录"){
// history.push('/403');
history.push('/403');
}
else {
setForbidden(false);

View File

@ -19,8 +19,6 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
// table
const [reload, setReload] = useState();
const [loading, setLoading] = useState(false);
const [curPage, setCurPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [dataList, setDataList] = useState([]);
const [taskId, setTaskId] = useState();
@ -29,9 +27,6 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
//
const [rules, setRules] = useState({});
//tab
const [activeKey, setActiveKey] = useState(0);
//
const [visible, setVisible] = useState(false);
const [activeIndex, setActiveIndex] = useState(false);
@ -45,7 +40,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
{
title: '序号',
dataIndex: 'index',
width:50,
width: 50,
render: (text, record, index) => {
return index + 1
}
@ -66,7 +61,9 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
className: 'text-tooltip',
render: (text, record) => {
return text && text.map(item => {
return <p key={item.id} className="link" onClick={() => { downFile(item.id) }}>{item.fileName}</p>
return <Tooltip key={item.id} overlayClassName="expert-tooltip" title={item.fileName} placement="top">
<p className="link" onClick={() => { downFile(item.id) }}>{item.fileName}</p>
</Tooltip>
})
}
},
@ -75,15 +72,18 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
title: '平均分',
dataIndex: 'gradesAverage',
key: 'gradesAverage',
width:80,
width: 70,
},
{
title: '评审意见',
dataIndex: 'comments',
key: 'comments',
width:90,
width: 80,
render: (text, record, index) => {
return <a className="link" onClick={() => { writeComments(text, index, 'comments') }}>{record.status === 2 ? '填写' : '查看'}意见</a>
return <Tooltip overlayClassName="expert-tooltip" title={text} placement="top">
<a className="link" onClick={() => { writeComments(text, index, 'comments') }}>{record.status === 2 ? text ? '编辑' : '填写' : '查看'}意见</a>
</Tooltip>
}
},
];
@ -164,11 +164,12 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
taskId,
checkStatus: '1',
pageSize: 10000,
curPage,
curPage: 1,
status: '',
parentId: 0,
}
taskId && current_user.expertId && readyCheckPapers(params).then(data => {
//
!dataList.length && taskId && current_user.expertId && readyCheckPapers(params).then(data => {
let dataArr = [];
if (data && Array.isArray(data.rows)) {
for (const item of data.rows) {
@ -190,20 +191,18 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
opsType: containerType,
status: 2
});
// item.detail = item.paperDetail && item.paperDetail.content;
// item.busiAttachments = item.paperDetail && item.paperDetail.busiAttachments;
}
}
setDataList(dataArr);
disabled && setLoading(false);
!disabled && dataArr.length && initScoringDetails(dataArr).then(res => {
if(res){
!disabled && dataArr.length && rules && initScoringDetails(dataArr).then(res => {
if (res) {
setReload(Math.random());
setLoading(false);
}
});
});
}, [taskId,disabled, current_user.expertId]);
}, [taskId, disabled, current_user.expertId]);
function downFile(id) {
let url = httpUrl + '/busiAttachments/download/' + id;
@ -253,7 +252,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
containerType == 1 ? setTaskId(containerId) : setCompetitionId(containerId);
}
});
}, [curPage, reload, pageSize, current_user.expertId]);
}, [reload, current_user.expertId]);
function cancel() {
@ -268,19 +267,19 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
//
function commit() {
if(disabled){
if (disabled) {
setVisible(false);
return;
}
if (comments) {
let data = dataList[activeIndex];
let dataListNew=dataList.slice();
let dataListNew = dataList.slice();
data.comments = comments;
updateScoringDetails([data]).then(res => {
if (res && res.message) {
if (res.message.indexOf("成功")) {
showNotification("保存成功");
dataListNew[activeIndex].comments=comments;
dataListNew[activeIndex].comments = comments;
setDataList(dataListNew);
setVisible(false);
} else {
@ -320,7 +319,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
//
function verify() {
let errorArr = [];
let commentsError=[];
let commentsError = [];
let scoringArr = [];
for (const [index, item] of dataList.entries()) {
let gradesArr = [];
@ -330,34 +329,26 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
typeof item.gradesFour === 'number' && gradesArr.push(item.gradesFour);
typeof item.gradesFive === 'number' && gradesArr.push(item.gradesFive);
if (gradesArr.length < gradesNum && gradesArr.length) {
errorArr.push(index);
}else if(!item.comments && gradesArr.length ){
commentsError.push(index);
} else if (gradesArr.length ) {
errorArr.push(index+1);
} else if (!item.comments && gradesArr.length) {
commentsError.push(index+1);
} else if (gradesArr.length) {
scoringArr.push(index);
}
}
if (errorArr.length) {
let content = '';
for (const item of errorArr) {
content += `${item + 1}行数据请填写完整 `;
}
Info({
title: '提醒',
content: content,
content: `${errorArr.join('')}行数据请填写完整`,
});
return;
}
if(commentsError.length){
let content = '';
for (const item of commentsError) {
content += `${item + 1}行数据请填写意见 `;
}
if (commentsError.length) {
Info({
title: '提醒',
content: content,
content: `${commentsError.join('')}行数据请填写意见`,
});
return;
}
@ -391,7 +382,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
<button className="back-button but41_border" onClick={() => { history.goBack() }}>返回上一页</button>
</p>
<Tabs defaultActiveKey="0" animated={false} onChange={(activeKey) => { setActiveKey(activeKey) }}>
<Tabs defaultActiveKey="1" animated={false}>
<TabPane tab="评选信息" key="0">
<div className="task-rules">
@ -435,7 +426,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
/>
<div className="text-center">
<Button className="mr10" type="primary" disabled={disabled} onClick={commitGrades}>提交评审结果</Button>
<Button className="mr10" type="primary" disabled={disabled} onClick={commitGrades}>提交评审结果</Button>
<Button className="mr10" disabled={disabled} onClick={draft}>保存评审结果</Button>
<Button className="butE3_border" onClick={cancel}>取消</Button>
</div>

View File

@ -94,7 +94,7 @@
}
.text-tooltip{
max-width: 200px;
max-width: 150px;
overflow: hidden;
span{
display: block;
@ -104,6 +104,9 @@
}
.link{
color: #4154f1;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
&:hover{
opacity: 0.8;
}