fix: 用例评审 不通过 时评论为必填 高亮显示输入框

This commit is contained in:
wenyann 2021-05-13 16:36:40 +08:00 committed by 刘瑞斌
parent 103b2946fa
commit 0c084a3c77
2 changed files with 47 additions and 21 deletions

View File

@ -15,15 +15,16 @@
</div>
<div>
<el-input
type="textarea"
:placeholder="$t('test_track.comment.send_comment')"
v-model="textarea"
maxlength="180"
show-word-limt
resize="none"
:autosize="{ minRows: 4, maxRows: 4}"
@keyup.ctrl.enter.native="sendComment"
:disabled="isReadOnly"
ref="test"
type="textarea"
:placeholder="$t('test_track.comment.send_comment')"
v-model.trim="textarea"
maxlength="180"
show-word-limt
resize="none"
:autosize="{ minRows: 4, maxRows: 4}"
@keyup.ctrl.enter.native="sendComment"
:disabled="isReadOnly"
>
</el-input>
<el-button type="primary" size="mini" class="send-btn" @click="sendComment" :disabled="isReadOnly">
@ -71,6 +72,9 @@ export default {
this.textarea = '';
});
},
inputLight() {
this.$refs.test.focus();
},
refresh() {
this.$emit('getComments');
},

View File

@ -115,7 +115,7 @@
style="margin-left:10px;font-size: 14px; cursor: pointer"/>
</template>
<review-comment :comments="comments" :case-id="testCase.caseId" :review-id="testCase.reviewId"
@getComments="getComments"/>
@getComments="getComments" ref="reviewComment"/>
</el-card>
</el-col>
</div>
@ -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++) {