forked from Gitlink/forgeplus-react
修改issue
This commit is contained in:
parent
65d4066468
commit
1b24a6205c
|
@ -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);
|
||||
|
|
|
@ -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,15 @@ 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 <a className="link" onClick={() => { writeComments(text, index, 'comments') }}>{record.status === 2 ? text ? '编辑' : '填写' : '查看'}意见</a>
|
||||
}
|
||||
},
|
||||
];
|
||||
|
@ -164,11 +161,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 +188,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){
|
||||
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 +249,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 +264,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 +316,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 = [];
|
||||
|
@ -331,9 +327,9 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
typeof item.gradesFive === 'number' && gradesArr.push(item.gradesFive);
|
||||
if (gradesArr.length < gradesNum && gradesArr.length) {
|
||||
errorArr.push(index);
|
||||
}else if(!item.comments && gradesArr.length ){
|
||||
} else if (!item.comments && gradesArr.length) {
|
||||
commentsError.push(index);
|
||||
} else if (gradesArr.length ) {
|
||||
} else if (gradesArr.length) {
|
||||
scoringArr.push(index);
|
||||
}
|
||||
}
|
||||
|
@ -350,7 +346,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
|
|||
return;
|
||||
}
|
||||
|
||||
if(commentsError.length){
|
||||
if (commentsError.length) {
|
||||
let content = '';
|
||||
for (const item of commentsError) {
|
||||
content += `第${item + 1}行数据请填写意见 `;
|
||||
|
@ -391,7 +387,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 +431,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>
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue