diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index ba39a678f0..b8daaac905 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -735,10 +735,6 @@ export default { this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id); }, init() { - let routeTestCase = this.$route.params.apiDefinition; - if (routeTestCase) { - this.editApi(routeTestCase); - } let dataRange = this.$route.params.dataSelectRange; let dataType = this.$route.params.dataType; if (dataRange) { diff --git a/frontend/src/business/components/performance/test/EditPerformanceTest.vue b/frontend/src/business/components/performance/test/EditPerformanceTest.vue index 23e5a27c8d..a87294d3a3 100644 --- a/frontend/src/business/components/performance/test/EditPerformanceTest.vue +++ b/frontend/src/business/components/performance/test/EditPerformanceTest.vue @@ -106,6 +106,7 @@ import MsChangeHistory from "../../history/ChangeHistory"; import MsTableOperatorButton from "@/business/components/common/components/MsTableOperatorButton"; import MsTipButton from "@/business/components/common/components/MsTipButton"; import DiffVersion from "@/business/components/performance/test/DiffVersion"; +import {PROJECT_ID} from "@/common/js/constants"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const versionHistory = requireComponent.keys().length > 0 ? requireComponent("./version/VersionHistory.vue") : {}; @@ -179,6 +180,10 @@ export default { }, created() { + let projectId = this.$route.query.projectId; + if (projectId && projectId !== getCurrentProjectID()) { + sessionStorage.setItem(PROJECT_ID, projectId); + } this.isReadOnly = !hasPermission('PROJECT_PERFORMANCE_TEST:READ+EDIT'); this.getTest(this.$route.params.testId); if (hasLicense()) { diff --git a/frontend/src/business/components/track/case/TestCase.vue b/frontend/src/business/components/track/case/TestCase.vue index b1f385c4eb..8e84d93e43 100644 --- a/frontend/src/business/components/track/case/TestCase.vue +++ b/frontend/src/business/components/track/case/TestCase.vue @@ -221,6 +221,7 @@ import TestCaseMinder from "@/business/components/track/common/minder/TestCaseMi import IsChangeConfirm from "@/business/components/common/components/IsChangeConfirm"; import {openMinderConfirm, saveMinderConfirm} from "@/business/components/track/common/minder/minderUtils"; import TestCaseEditShow from "@/business/components/track/case/components/TestCaseEditShow"; +import {PROJECT_ID} from "@/common/js/constants"; const requireComponent = require.context('@/business/components/xpack/', true, /\.vue$/); const VersionSelect = requireComponent.keys().length > 0 ? requireComponent("./version/VersionSelect.vue") : {}; @@ -263,17 +264,22 @@ export default { versionEnable: false, isAsideHidden: true, showPublicNode: false, - publicTreeNodes: [] + publicTreeNodes: [], + ignoreTreeNodes:false, }; }, + created() { + let projectId = this.$route.query.projectId; + if (projectId) { + this.ignoreTreeNodes = true; + if (projectId !== getCurrentProjectID() && projectId !== 'all') { + sessionStorage.setItem(PROJECT_ID, projectId); + } + } + }, mounted() { this.getProject(); - let routeTestCase = this.$route.params.testCase; - if (routeTestCase && routeTestCase.add === true) { - this.addTab({name: 'add'}); - } else { - this.init(this.$route); - } + this.init(this.$route); this.checkVersionEnable(); }, beforeRouteLeave(to, from, next) { @@ -564,14 +570,11 @@ export default { if (path.indexOf("/track/case/edit") >= 0 || path.indexOf("/track/case/create") >= 0) { this.testCaseReadOnly = false; let caseId = this.$route.params.caseId; - let routeTestCase = this.$route.params.testCase; if (!this.projectId) { this.$warning(this.$t('commons.check_project_tip')); return; } - if (routeTestCase) { - this.editTestCase(routeTestCase); - } else if (caseId) { + if (caseId) { this.$get('test/case/get/' + caseId, response => { let testCase = response.data; this.editTestCase(testCase); @@ -607,10 +610,12 @@ export default { 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; + if (!this.ignoreTreeNodes) { + 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'); diff --git a/frontend/src/business/components/track/plan/view/TestPlanView.vue b/frontend/src/business/components/track/plan/view/TestPlanView.vue index daf75e30ea..09126b6a14 100644 --- a/frontend/src/business/components/track/plan/view/TestPlanView.vue +++ b/frontend/src/business/components/track/plan/view/TestPlanView.vue @@ -88,6 +88,12 @@ export default { } }, watch: { + '$route.query.projectId'() { + let projectId = this.$route.query.projectId; + if (projectId && projectId !== getCurrentProjectID()) { + sessionStorage.setItem(PROJECT_ID, projectId); + } + }, '$route.params.planId'() { this.genRedirectParam(); this.getTestPlans(); diff --git a/frontend/src/business/components/track/review/view/TestCaseReviewView.vue b/frontend/src/business/components/track/review/view/TestCaseReviewView.vue index 071e3ca0fe..8518298188 100644 --- a/frontend/src/business/components/track/review/view/TestCaseReviewView.vue +++ b/frontend/src/business/components/track/review/view/TestCaseReviewView.vue @@ -35,6 +35,7 @@ import TestReviewRelevance from "./components/TestReviewRelevance"; import MsTestPlanHeaderBar from "@/business/components/track/plan/view/comonents/head/TestPlanHeaderBar"; import TestReviewFunction from "@/business/components/track/review/view/components/TestReviewFunction"; import {getCurrentProjectID, hasLicense} from "@/common/js/utils"; +import {PROJECT_ID} from "@/common/js/constants"; export default { name: "TestCaseReviewView", @@ -76,6 +77,10 @@ export default { } }, created() { + let projectId = this.$route.query.projectId; + if (projectId) { + sessionStorage.setItem(PROJECT_ID, projectId); + } this.$EventBus.$on('projectChange', () => { if (this.$route.name === 'testCaseReviewView') { this.$router.push('/track/review/all');