|
|
@@ -10,14 +10,14 @@
|
|
|
<el-row class="status-information">
|
|
|
<i class="el-icon-info"></i>
|
|
|
<div v-if="fileReview.status === 'Planning' && userRole === 'WORKER'">目前正处于计划阶段,您可以更改递交审查的文件列表</div>
|
|
|
- <div v-if="fileReview.status === 'Planning' && userRole === 'CREATOR'">目前正处于计划阶段,您可以更改递交审查的文件列表,确认无误后请点击递交审查进入下一阶段</div>
|
|
|
+ <div v-if="fileReview.status === 'Planning' && (userRole === 'CREATOR' || userRole === 'CREATOR&REVIEWER')">目前正处于计划阶段,您可以更改递交审查的文件列表,确认无误后请点击递交审查进入下一阶段</div>
|
|
|
<div v-if="fileReview.status === 'Planning' && userRole === 'REVIEWER'">目前正处于计划阶段,您可以预览需评审文件,但暂时无法发表评论</div>
|
|
|
<div v-if="fileReview.status === 'Inspecting' && userRole === 'WORKER'">目前正处于评审阶段,请等待所有评审人评审完成</div>
|
|
|
<div v-if="fileReview.status === 'Inspecting' && userRole === 'CREATOR'">目前正处于评审阶段,请等待所有评审人评审完成</div>
|
|
|
- <div v-if="fileReview.status === 'Inspecting' && userRole === 'REVIEWER' && !hasInspected">目前正处于评审阶段,请提出您的评审意见,并根据结果选择返工或是结束</div>
|
|
|
- <div v-if="fileReview.status === 'Inspecting' && userRole === 'REVIEWER' && hasInspected">目前正处于评审阶段,您已提交了您的评审结果,请等待其他人评审结束</div>
|
|
|
+ <div v-if="fileReview.status === 'Inspecting' && (userRole === 'REVIEWER' || userRole === 'CREATOR&REVIEWER') && !hasInspected">目前正处于评审阶段,请提出您的评审意见,并根据结果选择返工或是结束</div>
|
|
|
+ <div v-if="fileReview.status === 'Inspecting' && (userRole === 'REVIEWER' || userRole === 'CREATOR&REVIEWER') && hasInspected">目前正处于评审阶段,您已提交了您的评审结果,请等待其他人评审结束</div>
|
|
|
<div v-if="fileReview.status === 'Rework' && userRole === 'WORKER'">目前正处于返工阶段,请根据评审意见完成修改</div>
|
|
|
- <div v-if="fileReview.status === 'Rework' && userRole === 'CREATOR'">目前正处于返工阶段,请根据评审意见完成修改,修改完毕后请点击递交审查进入下一阶段</div>
|
|
|
+ <div v-if="fileReview.status === 'Rework' && (userRole === 'CREATOR' || userRole === 'CREATOR&REVIEWER')">目前正处于返工阶段,请根据评审意见完成修改,修改完毕后请点击递交审查进入下一阶段</div>
|
|
|
<div v-if="fileReview.status === 'Rework' && userRole === 'REVIEWER'">目前正处于返工阶段,请等待修改完毕</div>
|
|
|
<div v-if="fileReview.status === 'Completed'">代码已通过评审</div>
|
|
|
</el-row>
|
|
|
@@ -160,12 +160,14 @@ export default {
|
|
|
return resolve([]);
|
|
|
},
|
|
|
setUserRole() {
|
|
|
- if (this.currentUserId === this.fileReview.creatorId) this.userRole = 'CREATOR';
|
|
|
- else if (this.fileReview.reviewerList.includes(this.currentUserId)) this.userRole = 'REVIEWER';
|
|
|
+ if (this.currentUserId === this.fileReview.creatorId) {
|
|
|
+ this.userRole = 'CREATOR';
|
|
|
+ if (this.fileReview.reviewerList.includes(this.currentUserId)) this.userRole = 'CREATOR&REVIEWER';
|
|
|
+ } else if (this.fileReview.reviewerList.includes(this.currentUserId)) this.userRole = 'REVIEWER';
|
|
|
else this.userRole = 'WORKER';
|
|
|
},
|
|
|
showUpdateFileList() {
|
|
|
- return this.fileReview.status === 'Planning' && (this.userRole === 'WORKER' || this.userRole === 'CREATOR');
|
|
|
+ return this.fileReview.status === 'Planning' && (this.userRole === 'WORKER' || this.userRole === 'CREATOR' || this.userRole === 'CREATOR&REVIEWER');
|
|
|
},
|
|
|
updateFileList() {
|
|
|
this.fileReview.fileList = this.$refs.fileTree.getCheckedKeys();
|
|
|
@@ -179,7 +181,7 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
showMoveToInspect() {
|
|
|
- return (this.fileReview.status === 'Planning' || this.fileReview.status === 'Rework') && this.userRole === 'CREATOR';
|
|
|
+ return (this.fileReview.status === 'Planning' || this.fileReview.status === 'Rework') && (this.userRole === 'CREATOR' || this.userRole === 'CREATOR&REVIEWER');
|
|
|
},
|
|
|
submitToInspect() {
|
|
|
CodeReviewAPI.submitToInspection(this.fileReview.id).then(
|
|
|
@@ -190,7 +192,7 @@ export default {
|
|
|
);
|
|
|
},
|
|
|
showSubmitToRework() {
|
|
|
- return this.fileReview.status === 'Inspecting' && this.userRole === 'REVIEWER';
|
|
|
+ return this.fileReview.status === 'Inspecting' && (this.userRole === 'REVIEWER' || this.userRole === 'CREATOR&REVIEWER');
|
|
|
},
|
|
|
async submitToRework() {
|
|
|
this.fileReview.status = await CodeReviewAPI.submitToRework(this.fileReview.id, this.currentUserId);
|
|
|
@@ -213,7 +215,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
clickLine(lineNum) {
|
|
|
- if (this.userRole === 'REVIEWER' && this.fileReview.status === 'Inspecting' && !this.hasInspected) {
|
|
|
+ if ((this.userRole === 'REVIEWER' || this.userRole === 'CREATOR&REVIEWER') && this.fileReview.status === 'Inspecting' && !this.hasInspected) {
|
|
|
this.selectedLine.path = this.fileName;
|
|
|
this.selectedLine.line = lineNum;
|
|
|
this.showAddCommentDrawer = true;
|