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) { changeRedirectParam(redirectIDParam) {
this.redirectID = redirectIDParam; this.redirectID = redirectIDParam;
if (redirectIDParam != null) { if (redirectIDParam != null) {
if (this.redirectFlag == "none") { if (this.redirectFlag === "none") {
this.activeName = "default"; this.activeName = "default";
this.redirectFlag = "redirected"; this.redirectFlag = "redirected";
} }
@ -610,13 +610,9 @@ export default {
if (!index) { if (!index) {
this.type = "edit"; this.type = "edit";
this.testCaseReadOnly = false; this.testCaseReadOnly = false;
if (!this.ignoreTreeNodes) { if (!this.ignoreTreeNodes && testCase.label !== "redirect" && this.treeNodes.length < 1) {
if (testCase.label !== "redirect") { this.$warning(this.$t('test_track.case.create_module_first'));
if (this.treeNodes.length < 1) { return;
this.$warning(this.$t('test_track.case.create_module_first'));
return;
}
}
} }
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT'); let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
this.$set(testCase, 'rowClickHasPermission', hasEditPermission); this.$set(testCase, 'rowClickHasPermission', hasEditPermission);
@ -631,11 +627,9 @@ export default {
if (!index) { if (!index) {
this.type = "edit"; this.type = "edit";
this.testCaseReadOnly = false; this.testCaseReadOnly = false;
if (testCase.label !== "redirect") { if (testCase.label !== "redirect" && this.treeNodes.length < 1) {
if (this.treeNodes.length < 1) { this.$warning(this.$t('test_track.case.create_module_first'));
this.$warning(this.$t('test_track.case.create_module_first')); return;
return;
}
} }
let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT'); let hasEditPermission = hasPermission('PROJECT_TRACK_CASE:READ+EDIT');
this.$set(testCase, 'rowClickHasPermission', hasEditPermission); this.$set(testCase, 'rowClickHasPermission', hasEditPermission);