From 0c084a3c77394929e7e95af5631e4d9aa242cc52 Mon Sep 17 00:00:00 2001 From: wenyann Date: Thu, 13 May 2021 16:36:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8=E4=BE=8B=E8=AF=84=E5=AE=A1=20?= =?UTF-8?q?=E4=B8=8D=E9=80=9A=E8=BF=87=20=E6=97=B6=E8=AF=84=E8=AE=BA?= =?UTF-8?q?=E4=B8=BA=E5=BF=85=E5=A1=AB=20=E9=AB=98=E4=BA=AE=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E8=BE=93=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../track/review/commom/ReviewComment.vue | 22 +++++---- .../components/TestReviewTestCaseEdit.vue | 46 ++++++++++++++----- 2 files changed, 47 insertions(+), 21 deletions(-) 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++) {