Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
Captain.B 2020-11-25 16:39:27 +08:00
commit 0ffe1cc414
4 changed files with 26 additions and 5 deletions

View File

@ -231,7 +231,7 @@ public class XmindCaseParser {
JSONObject step = new JSONObject(true); JSONObject step = new JSONObject(true);
step.put("num", i + 1); step.put("num", i + 1);
step.put("desc", attacheds.get(i).getTitle()); step.put("desc", attacheds.get(i).getTitle());
if (attacheds.get(i) != null && attacheds.get(i).getChildren() != null && attacheds.get(i).getChildren().getAttached()!=null) { if (attacheds.get(i) != null && attacheds.get(i).getChildren() != null && attacheds.get(i).getChildren().getAttached() != null) {
step.put("result", attacheds.get(i).getChildren().getAttached().get(0).getTitle()); step.put("result", attacheds.get(i).getChildren().getAttached().get(0).getTitle());
} }
jsonArray.add(step); jsonArray.add(step);
@ -283,17 +283,20 @@ public class XmindCaseParser {
// 测试步骤处理 // 测试步骤处理
List<Attached> steps = new LinkedList<>(); List<Attached> steps = new LinkedList<>();
StringBuilder rc = new StringBuilder();
if (attacheds != null && !attacheds.isEmpty()) { if (attacheds != null && !attacheds.isEmpty()) {
attacheds.forEach(item -> { attacheds.forEach(item -> {
if (isAvailable(item.getTitle(), PC_REGEX)) { if (isAvailable(item.getTitle(), PC_REGEX)) {
testCase.setPrerequisite(replace(item.getTitle(), PC_REGEX)); testCase.setPrerequisite(replace(item.getTitle(), PC_REGEX));
} else if (isAvailable(item.getTitle(), RC_REGEX)) { } else if (isAvailable(item.getTitle(), RC_REGEX)) {
testCase.setRemark(replace(item.getTitle(), RC_REGEX)); rc.append(replace(item.getTitle(), RC_REGEX));
rc.append("\n");
} else { } else {
steps.add(item); steps.add(item);
} }
}); });
} }
testCase.setRemark(rc.toString());
testCase.setSteps(this.getSteps(steps)); testCase.setSteps(this.getSteps(steps));
testCases.add(testCase); testCases.add(testCase);
// 校验合规性 // 校验合规性

View File

@ -204,6 +204,7 @@ export default {
}); });
} }
}, },
submit(formName) { submit(formName) {
this.$refs[formName].validate((valid) => { this.$refs[formName].validate((valid) => {
if (valid) { if (valid) {
@ -282,7 +283,18 @@ export default {
}, },
openEnvironmentConfig(project) { openEnvironmentConfig(project) {
this.$refs.environmentConfig.open(project.id); this.$refs.environmentConfig.open(project.id);
} },
handleEvent(event) {
if (event.keyCode === 13) {
this.submit('form')
}
},
},
created() {
document.addEventListener('keydown', this.handleEvent)
},
beforeDestroy() {
document.removeEventListener('keydown', this.handleEvent);
} }
} }
</script> </script>

View File

@ -381,7 +381,7 @@ export default {
rule: { rule: {
id: [ id: [
{required: true, message: this.$t('user.input_id'), trigger: 'blur'}, {required: true, message: this.$t('user.input_id'), trigger: 'blur'},
{min: 2, max: 50, message: this.$t('commons.input_limit', [2, 50]), trigger: 'blur'}, {min: 1, max: 50, message: this.$t('commons.input_limit', [1, 50]), trigger: 'blur'},
{ {
required: true, required: true,
pattern: '^[^\u4e00-\u9fa5]+$', pattern: '^[^\u4e00-\u9fa5]+$',

View File

@ -23,9 +23,10 @@
resize="none" resize="none"
:autosize="{ minRows: 4, maxRows: 4}" :autosize="{ minRows: 4, maxRows: 4}"
@keyup.ctrl.enter.native="sendComment" @keyup.ctrl.enter.native="sendComment"
:disabled="isReadOnly"
> >
</el-input> </el-input>
<el-button type="primary" size="mini" class="send-btn" @click="sendComment"> <el-button type="primary" size="mini" class="send-btn" @click="sendComment" :disabled="isReadOnly">
{{ $t('test_track.comment.send') }} {{ $t('test_track.comment.send') }}
</el-button> </el-button>
</div> </div>
@ -34,6 +35,7 @@
<script> <script>
import ReviewCommentItem from "./ReviewCommentItem"; import ReviewCommentItem from "./ReviewCommentItem";
import {checkoutTestManagerOrTestUser} from "@/common/js/utils";
export default { export default {
name: "ReviewComment", name: "ReviewComment",
@ -47,8 +49,12 @@ export default {
return { return {
result: {}, result: {},
textarea: '', textarea: '',
isReadOnly: false
} }
}, },
created() {
this.isReadOnly = !checkoutTestManagerOrTestUser();
},
methods: { methods: {
sendComment() { sendComment() {
let comment = {}; let comment = {};