fix(接口定义): 接口用例代码优化

--user=郭雨琦
--bug=1013977
This commit is contained in:
guoyuqi 2022-06-13 10:49:25 +08:00 committed by f2c-ci-robot[bot]
parent 4e2af32e82
commit f7a97a78e0
1 changed files with 7 additions and 13 deletions

View File

@ -430,7 +430,7 @@ export default {
changeRedirectParam(redirectIDParam) {
this.redirectID = redirectIDParam;
if (redirectIDParam != null) {
if (this.redirectFlag == "none") {
if (this.redirectFlag === "none") {
this.activeName = "default";
this.redirectFlag = "redirected";
}
@ -610,14 +610,10 @@ export default {
if (!index) {
this.type = "edit";
this.testCaseReadOnly = false;
if (!this.ignoreTreeNodes) {
if (testCase.label !== "redirect") {
if (this.treeNodes.length < 1) {
if (!this.ignoreTreeNodes && testCase.label !== "redirect" && 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});
@ -631,12 +627,10 @@ export default {
if (!index) {
this.type = "edit";
this.testCaseReadOnly = false;
if (testCase.label !== "redirect") {
if (this.treeNodes.length < 1) {
if (testCase.label !== "redirect" && 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.addTabShow({name: 'show', testCaseInfo: testCase});