fix: 编辑相同用例只开一个tab
This commit is contained in:
parent
4bfb95e0d3
commit
049eddd540
|
@ -429,17 +429,22 @@ export default {
|
|||
this.$refs.nodeTree.decrease(id);
|
||||
},
|
||||
editTestCase(testCase) {
|
||||
this.type = "edit";
|
||||
this.testCaseReadOnly = false;
|
||||
if (testCase.label !== "redirect") {
|
||||
if (this.treeNodes.length < 1) {
|
||||
this.$warning(this.$t('test_track.case.create_module_first'));
|
||||
return;
|
||||
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") {
|
||||
if (this.treeNodes.length < 1) {
|
||||
this.$warning(this.$t('test_track.case.create_module_first'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
|
||||
this.$set(testCase, 'rowClickHasPermission', hasEditPermission);
|
||||
this.addTab({name: 'edit', testCaseInfo: testCase});
|
||||
} else {
|
||||
this.activeName = index.name;
|
||||
}
|
||||
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
|
||||
this.$set(testCase, 'rowClickHasPermission', hasEditPermission);
|
||||
this.addTab({name: 'edit', testCaseInfo: testCase});
|
||||
},
|
||||
handleCaseCreateOrEdit(data, type) {
|
||||
if (this.$refs.minder) {
|
||||
|
|
Loading…
Reference in New Issue