fix: 接口定义-用例列表-新建用例,用例名称和标签会保留上个用例的信息

This commit is contained in:
Captain.B 2021-01-25 16:38:42 +08:00
parent c26e7aa314
commit 3a20c69b80
1 changed files with 11 additions and 4 deletions

View File

@ -9,7 +9,9 @@
<el-row>
<el-col :span="4">
<span>
{{operationType == 'edit' ? ( readOnly ? $t('test_track.case.view_case') : $t('test_track.case.edit_case')) : $t('test_track.case.create')}}
{{
operationType == 'edit' ? (readOnly ? $t('test_track.case.view_case') : $t('test_track.case.edit_case')) : $t('test_track.case.create')
}}
</span>
</el-col>
<el-col class="head-right" :span="19">
@ -82,7 +84,7 @@
<el-row>
<el-col :span="10" :offset="1">
<el-form-item :label="$t('commons.tag')" :label-width="formLabelWidth" prop="tag">
<ms-input-tag :currentScenario="form" ref="tag"/>
<ms-input-tag :currentScenario="form" v-if="showInputTag" ref="tag"/>
</el-form-item>
</el-col>
</el-row>
@ -350,7 +352,8 @@ export default {
],
testCase: {},
testCases: [],
index: 0
index: 0,
showInputTag: false,
};
},
props: {
@ -441,6 +444,7 @@ export default {
});
},
getTestCase(index) {
this.showInputTag = false;
let testCase = this.testCases[index];
this.result = this.$get('/test/case/get/' + testCase.id, response => {
let testCase = response.data;
@ -448,6 +452,9 @@ export default {
this.setTestCaseExtInfo(testCase);
this.getSelectOptions();
this.reload();
this.$nextTick(() => {
this.showInputTag = true
})
})
},
setFormData(testCase) {
@ -459,7 +466,7 @@ export default {
this.form.module = testCase.nodeId;
this.getFileMetaData(testCase);
},
setTestCaseExtInfo (testCase) {
setTestCaseExtInfo(testCase) {
this.testCase = {};
if (testCase) {
//