From 1b24a6205cc85d17ba8aff55c14750598226b7cf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <1261960504@qq.com>
Date: Tue, 18 Jan 2022 17:22:43 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9issue?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../expert/expertUser/register/index.jsx | 2 +-
.../expert/expertUser/taskDetail/index.jsx | 48 +++++++++----------
.../expert/expertUser/taskDetail/index.scss | 5 +-
3 files changed, 27 insertions(+), 28 deletions(-)
diff --git a/src/military/expert/expertUser/register/index.jsx b/src/military/expert/expertUser/register/index.jsx
index 558bf9b9..a14030ca 100644
--- a/src/military/expert/expertUser/register/index.jsx
+++ b/src/military/expert/expertUser/register/index.jsx
@@ -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);
diff --git a/src/military/expert/expertUser/taskDetail/index.jsx b/src/military/expert/expertUser/taskDetail/index.jsx
index 71cb69be..36ca5d2d 100644
--- a/src/military/expert/expertUser/taskDetail/index.jsx
+++ b/src/military/expert/expertUser/taskDetail/index.jsx
@@ -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
{ downFile(item.id) }}>{item.fileName}
+ return
+ { downFile(item.id) }}>{item.fileName}
+
})
}
},
@@ -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 { writeComments(text, index, 'comments') }}>{record.status === 2 ? '填写' : '查看'}意见
+ return { writeComments(text, index, 'comments') }}>{record.status === 2 ? text ? '编辑' : '填写' : '查看'}意见
}
},
];
@@ -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 }) {
- { setActiveKey(activeKey) }}>
+
@@ -435,7 +431,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
/>
-
+
diff --git a/src/military/expert/expertUser/taskDetail/index.scss b/src/military/expert/expertUser/taskDetail/index.scss
index 31b5af86..67b1838f 100644
--- a/src/military/expert/expertUser/taskDetail/index.scss
+++ b/src/military/expert/expertUser/taskDetail/index.scss
@@ -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;
}
From baaa23e17eedd18d62a0e76847ddf618dacd247f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <1261960504@qq.com>
Date: Tue, 18 Jan 2022 17:42:48 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=84=8F=E8=A7=81?=
=?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../expert/expertUser/taskDetail/index.jsx | 23 ++++++++-----------
1 file changed, 9 insertions(+), 14 deletions(-)
diff --git a/src/military/expert/expertUser/taskDetail/index.jsx b/src/military/expert/expertUser/taskDetail/index.jsx
index 36ca5d2d..c03c0dcf 100644
--- a/src/military/expert/expertUser/taskDetail/index.jsx
+++ b/src/military/expert/expertUser/taskDetail/index.jsx
@@ -80,7 +80,10 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
key: 'comments',
width: 80,
render: (text, record, index) => {
- return
{ writeComments(text, index, 'comments') }}>{record.status === 2 ? text ? '编辑' : '填写' : '查看'}意见
+ return
+ { writeComments(text, index, 'comments') }}>{record.status === 2 ? text ? '编辑' : '填写' : '查看'}意见
+
+
}
},
];
@@ -192,7 +195,7 @@ function ReviewTasks({ showNotification, match, history, current_user }) {
}
setDataList(dataArr);
disabled && setLoading(false);
- !disabled && dataArr.length && initScoringDetails(dataArr).then(res => {
+ !disabled && dataArr.length && rules && initScoringDetails(dataArr).then(res => {
if (res) {
setReload(Math.random());
setLoading(false);
@@ -326,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);
+ errorArr.push(index+1);
} else if (!item.comments && gradesArr.length) {
- commentsError.push(index);
+ 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}行数据请填写意见 `;
- }
Info({
title: '提醒',
- content: content,
+ content: `第${commentsError.join(',')}行数据请填写意见`,
});
return;
}