fix: 用例评审 不通过 时评论为必填 高亮显示输入框
This commit is contained in:
parent
103b2946fa
commit
0c084a3c77
|
@ -15,15 +15,16 @@
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea"
|
ref="test"
|
||||||
:placeholder="$t('test_track.comment.send_comment')"
|
type="textarea"
|
||||||
v-model="textarea"
|
:placeholder="$t('test_track.comment.send_comment')"
|
||||||
maxlength="180"
|
v-model.trim="textarea"
|
||||||
show-word-limt
|
maxlength="180"
|
||||||
resize="none"
|
show-word-limt
|
||||||
:autosize="{ minRows: 4, maxRows: 4}"
|
resize="none"
|
||||||
@keyup.ctrl.enter.native="sendComment"
|
:autosize="{ minRows: 4, maxRows: 4}"
|
||||||
:disabled="isReadOnly"
|
@keyup.ctrl.enter.native="sendComment"
|
||||||
|
:disabled="isReadOnly"
|
||||||
>
|
>
|
||||||
</el-input>
|
</el-input>
|
||||||
<el-button type="primary" size="mini" class="send-btn" @click="sendComment" :disabled="isReadOnly">
|
<el-button type="primary" size="mini" class="send-btn" @click="sendComment" :disabled="isReadOnly">
|
||||||
|
@ -71,6 +72,9 @@ export default {
|
||||||
this.textarea = '';
|
this.textarea = '';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
inputLight() {
|
||||||
|
this.$refs.test.focus();
|
||||||
|
},
|
||||||
refresh() {
|
refresh() {
|
||||||
this.$emit('getComments');
|
this.$emit('getComments');
|
||||||
},
|
},
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
style="margin-left:10px;font-size: 14px; cursor: pointer"/>
|
style="margin-left:10px;font-size: 14px; cursor: pointer"/>
|
||||||
</template>
|
</template>
|
||||||
<review-comment :comments="comments" :case-id="testCase.caseId" :review-id="testCase.reviewId"
|
<review-comment :comments="comments" :case-id="testCase.caseId" :review-id="testCase.reviewId"
|
||||||
@getComments="getComments"/>
|
@getComments="getComments" ref="reviewComment"/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</div>
|
</div>
|
||||||
|
@ -256,18 +256,40 @@ export default {
|
||||||
param.caseId = this.testCase.caseId;
|
param.caseId = this.testCase.caseId;
|
||||||
param.reviewId = this.testCase.reviewId;
|
param.reviewId = this.testCase.reviewId;
|
||||||
param.status = status;
|
param.status = status;
|
||||||
this.$post('/test/review/case/edit', param, () => {
|
//reviewComment
|
||||||
this.$success(this.$t('commons.save_success'));
|
if (status == 'UnPass') {
|
||||||
this.updateTestCases(param);
|
if (this.comments.length > 0) {
|
||||||
this.setReviewStatus(this.testCase.reviewId);
|
this.$post('/test/review/case/edit', param, () => {
|
||||||
// 修改当前用例的评审状态
|
this.$success(this.$t('commons.save_success'));
|
||||||
this.testCase.reviewStatus = status;
|
this.updateTestCases(param);
|
||||||
// 修改当前用例在整个用例列表的状态
|
this.setReviewStatus(this.testCase.reviewId);
|
||||||
this.testCases[this.index].reviewStatus = status;
|
// 修改当前用例的评审状态
|
||||||
if (this.index < this.testCases.length - 1) {
|
this.testCase.reviewStatus = status;
|
||||||
this.handleNext();
|
// 修改当前用例在整个用例列表的状态
|
||||||
|
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) {
|
updateTestCases(param) {
|
||||||
for (let i = 0; i < this.testCases.length; i++) {
|
for (let i = 0; i < this.testCases.length; i++) {
|
||||||
|
|
Loading…
Reference in New Issue