diff --git a/frontend/src/business/components/track/review/commom/ReviewComment.vue b/frontend/src/business/components/track/review/commom/ReviewComment.vue index 728a19d88d..8a8a89fa6e 100644 --- a/frontend/src/business/components/track/review/commom/ReviewComment.vue +++ b/frontend/src/business/components/track/review/commom/ReviewComment.vue @@ -15,15 +15,16 @@
@@ -71,6 +72,9 @@ export default { this.textarea = ''; }); }, + inputLight() { + this.$refs.test.focus(); + }, refresh() { this.$emit('getComments'); }, diff --git a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue index 7be629f007..96eae4de53 100644 --- a/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue +++ b/frontend/src/business/components/track/review/view/components/TestReviewTestCaseEdit.vue @@ -115,7 +115,7 @@ style="margin-left:10px;font-size: 14px; cursor: pointer"/> + @getComments="getComments" ref="reviewComment"/>
@@ -256,18 +256,40 @@ export default { param.caseId = this.testCase.caseId; param.reviewId = this.testCase.reviewId; param.status = status; - this.$post('/test/review/case/edit', param, () => { - this.$success(this.$t('commons.save_success')); - this.updateTestCases(param); - this.setReviewStatus(this.testCase.reviewId); - // 修改当前用例的评审状态 - this.testCase.reviewStatus = status; - // 修改当前用例在整个用例列表的状态 - this.testCases[this.index].reviewStatus = status; - if (this.index < this.testCases.length - 1) { - this.handleNext(); + //reviewComment + if (status == 'UnPass') { + if (this.comments.length > 0) { + this.$post('/test/review/case/edit', param, () => { + this.$success(this.$t('commons.save_success')); + this.updateTestCases(param); + this.setReviewStatus(this.testCase.reviewId); + // 修改当前用例的评审状态 + this.testCase.reviewStatus = status; + // 修改当前用例在整个用例列表的状态 + this.testCases[this.index].reviewStatus = status; + if (this.index < this.testCases.length - 1) { + this.handleNext(); + } + }); + } else { + this.$refs.reviewComment.inputLight(); + this.$warning(this.$t('test_track.comment.description_is_null')); } - }); + } else { + this.$post('/test/review/case/edit', param, () => { + this.$success(this.$t('commons.save_success')); + this.updateTestCases(param); + this.setReviewStatus(this.testCase.reviewId); + // 修改当前用例的评审状态 + this.testCase.reviewStatus = status; + // 修改当前用例在整个用例列表的状态 + this.testCases[this.index].reviewStatus = status; + if (this.index < this.testCases.length - 1) { + this.handleNext(); + } + }); + } + }, updateTestCases(param) { for (let i = 0; i < this.testCases.length; i++) {