This commit is contained in:
2025-09-23 10:45:44 +08:00
parent 0a7482dbcf
commit 6c3b7ea922
2 changed files with 237 additions and 33 deletions

View File

@@ -334,29 +334,128 @@
<h2>
Reviewer Decision
</h2>
<div v-for="(item,index) in reviewList" :name="index" :key="index" @click="goReviewerDetail(item)"
class="art_author_list">
<!-- 时间轴 -->
<div style="position: relative;width: 100%;padding-left: 10px; height: 48px;
line-height: 48px;
background-color: #FFF;
color: #303133;
cursor: pointer;
border-bottom: 1px solid #EBEEF5;
font-size: 13px;
font-weight: 500;">
<b class="com_shu">{{index+1}}</b>
Reviewer Comment
<span style="color: #006699;font-weight: 700;margin-left: 10px">
<div
class="fixCard reviewer_decision"
style="position: relative"
>
<div class="overflow-x-auto">
<!-- 上面的表格代码放在这里 -->
<i class="el-icon-paperclip
"></i>
</span>
</div>
<!-- end -->
</div>
<table class="review_table">
<thead>
<tr>
<th></th>
<!-- 补充表头文本原代码是空建议加上 -->
<th>1<sup>st</sup> review</th>
<!-- 表头按最大重复次数遍历生成2nd3rd... -->
<template v-for="(_, index1) in maxRepeatReviewCount()">
<th>{{ index1 + 2 }}<sup>nd</sup> review</th>
</template>
</tr>
</thead>
<tbody>
<!-- 遍历每个评审者 -->
<tr v-for="(iken, reviewerIndex) in reviewList">
<td>Reviewer {{ reviewerIndex + 1 }}</td>
<!-- 1st review原逻辑不变 -->
<td @click="handleClick(iken)" style="cursor: pointer;">
<span style="display: inline-block; margin-left: 4px; margin-right: 8px">
<font
v-if="iken.state == 0"
style="
width: 12px;
height: 12px;
display: block;
border-radius: 10px;
background-color: #ccc;
"
>
</font>
<font
v-if="iken.state == 1 || iken.state == 3"
style="
width: 12px;
height: 12px;
display: block;
border-radius: 10px;
background-color: #67c23a;
"
>
</font>
<font
v-if="iken.state == 2"
style="
width: 12px;
height: 12px;
display: block;
border-radius: 10px;
background-color: #f56c6c;
"
>
</font>
</span>
<span>{{ mystate(iken.state) }}</span>
</td>
<!-- 关键按最大重复次数遍历而非仅遍历当前iken.repeat -->
<template v-for="(_1, index1) in maxRepeatReviewCount()">
<td >
<!-- 补全逻辑判断当前评审者的repeat中是否有第index1条数据 -->
<span v-if="Array.isArray(iken.repeat) && iken.repeat[index1]" style="cursor: pointer;" @click="handleClick(iken)">
<span style="display: inline-block; margin-left: 4px; margin-right: 8px">
<font
v-if="iken.repeat[index1].recommend == 1"
style="
width: 12px;
height: 12px;
display: block;
border-radius: 10px;
background-color: #67c23a;
"
>
</font>
<font
v-if="iken.repeat[index1].recommend == 2"
style="
width: 12px;
height: 12px;
display: block;
border-radius: 10px;
background-color: #f56c6c;
"
>
</font>
<font
v-if="iken.repeat[index1].recommend == 3"
style="
width: 12px;
height: 12px;
display: block;
border-radius: 10px;
background-color: #006699;
"
>
</font>
</span>
<!-- 有数据按原逻辑显示Accept/Reject等 -->
<span v-if="iken.repeat[index1].recommend == 1">Accept</span>
<span v-else-if="iken.repeat[index1].recommend == 2">Reject</span>
<span v-else-if="iken.repeat[index1].recommend == 3">Revision</span>
<span v-else>No reply</span>
</span>
<span v-else>
<!-- 无数据补全空内容可自定义为- -->
-
</span>
</td>
</template>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div v-if="finalList.length>0">
@@ -366,11 +465,11 @@
<h2>
Final Decision
</h2>
<el-collapse v-model="activeFinalComment" >
<el-collapse v-model="activeFinalComment" style="background-color: #fff;">
<el-collapse-item v-for="(item,index) in finalList" :name="index" :key="index"
class="art_author_list">
<template slot="title">
<div style="position: relative;width: 100%;padding-left: 10px;">
<div style="position: relative;width: 100%;">
<b class="com_shu">{{index+1}}</b>
Final Decision Comment
<span style="color: #006699;font-weight: 700;margin-left: 20px">
@@ -1110,6 +1209,32 @@ export default {
}
},
methods: {
maxRepeatReviewCount() {
if (!this.reviewList || !Array.isArray(this.reviewList)) return null; // 边界处理无数据返回null
// 遍历所有评审者找到repeat数组长度最大的那条数据
const maxItem = this.reviewList.reduce((maxItem, currentItem) => {
// 计算当前项的repeat长度非数组则视为0
const currentLen = Array.isArray(currentItem.repeat) ? currentItem.repeat.length : 0;
// 计算当前最大项的repeat长度非数组则视为0
const maxLen = Array.isArray(maxItem.repeat) ? maxItem.repeat.length : 0;
// 如果当前项长度更大,则更新最大项
return currentLen > maxLen ? currentItem : maxItem;
}, {}); // 初始值设为一个空对象
// console.log('maxItem at line 2142:', maxItem.repeat.length)
return maxItem && maxItem.repeat ? maxItem.repeat.length : 0;
},
handleClick(item){
console.log('item at line 1228:', item)
this.$router.push({
path: 'articleReviewerDetail',
query: {
id: item.art_rev_id
}
});
},
goReviewerDetail(id){
console.log('id at line 1112:', id)
this.$router.push({
@@ -1118,6 +1243,7 @@ export default {
id: id
}
});
},
getFinalList(){
@@ -1130,7 +1256,7 @@ getFinalList(){
if (res.status==1) {
if(res.status==1){
this.finalList = res.data.final_review;
this.finalList = [...res.data.final_review,];
this.reviewList = res.data.review;
}
}
@@ -2028,8 +2154,39 @@ getFinalList(){
.art_author_coment>p>font,.commentfs>font {
display: block;
margin: 15px 0 5px 0;
color: #006699;
color: #333;
font-weight: bold;
letter-spacing: -0.5px;
}
.review_table {
width: 100%;
background-color: #fff;
/* margin-top: 10px; */
border-collapse: collapse; /* 合并表格边框 */
}
.review_table th,
td {
padding: 6px;
min-width: 70px;
border: 1px solid #ddd;
text-align: left;
}
.review_table th {
font-size: 14px;
background-color: #f0f0f0;
}
.review_table td {
font-size: 14px;
/* background-color: #f0f0f0; */
}
.review_table tr:hover {
/* background-color: #fff; */
}
.overflow-x-auto {
overflow-x: auto;
}
</style>