fix: 编辑相同用例只开一个tab

This commit is contained in:
chenjianxing 2021-11-04 16:54:29 +08:00 committed by jianxing
parent 4bfb95e0d3
commit 049eddd540
1 changed files with 14 additions and 9 deletions

View File

@ -429,6 +429,8 @@ export default {
this.$refs.nodeTree.decrease(id);
},
editTestCase(testCase) {
const index = this.tabs.find(p => p.testCaseInfo && p.testCaseInfo.id === testCase.id);
if (!index) {
this.type = "edit";
this.testCaseReadOnly = false;
if (testCase.label !== "redirect") {
@ -440,6 +442,9 @@ export default {
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
this.$set(testCase, 'rowClickHasPermission', hasEditPermission);
this.addTab({name: 'edit', testCaseInfo: testCase});
} else {
this.activeName = index.name;
}
},
handleCaseCreateOrEdit(data, type) {
if (this.$refs.minder) {