fix: 用例评审 不通过 时评论为必填 高亮显示输入框
This commit is contained in:
parent
103b2946fa
commit
0c084a3c77
|
@ -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');
|
||||
},
|
||||
|
|
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue