diff --git a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue index 717808bb03..464c027db3 100644 --- a/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue +++ b/frontend/src/business/components/api/automation/scenario/ApiScenarioList.vue @@ -1200,7 +1200,7 @@ export default { isRedirectFilter() { this.selectDataRange = "all"; this.selectDataType = "all"; - let routeParamObj = this.$route.params.paramObj; + let routeParamObj = this.$route.params; if (routeParamObj) { let dataRange = routeParamObj.dataSelectRange; let dataType = routeParamObj.dataType; diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 4fc9e03ec7..c50a4aeef0 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -33,7 +33,8 @@ class="ms-api-button" ref="environmentSelect"/> - + @@ -287,7 +288,7 @@ export default { }, isSelectDefaultProtocol() { let selectDefaultProtocol = true; - let routeParamObj = this.$route.params.paramObj; + let routeParamObj = this.$route.params; if (routeParamObj) { let dataRange = routeParamObj.dataSelectRange; let dataType = routeParamObj.dataType; @@ -391,7 +392,7 @@ export default { }, activated() { this.$nextTick(() => { - let routeParamObj = this.$route.params.paramObj; + let routeParamObj = this.$route.params; if (routeParamObj) { let dataRange = routeParamObj.dataSelectRange; if (dataRange && dataRange.length > 0) { @@ -466,7 +467,7 @@ export default { } }, created() { - let routeParamObj = this.$route.params.paramObj; + let routeParamObj = this.$route.params; if (routeParamObj) { let workspaceId = routeParamObj.workspaceId; if (workspaceId) { @@ -792,35 +793,17 @@ export default { this.handleTabsEdit(this.$t('api_test.definition.request.fast_debug'), "debug", id); }, init() { - let routeParamObj = this.$route.params.paramObj; - if (routeParamObj) { - let dataRange = routeParamObj.dataSelectRange; - let dataType = routeParamObj.dataType; - if (dataRange && typeof dataRange === 'string') { - let selectParamArr = dataRange.split("edit:"); - if (selectParamArr.length === 2) { - let scenarioId = selectParamArr[1]; - if (dataType === 'api') { - this.$get('/api/definition/get/' + scenarioId, (response) => { - this.defaultProtocol = response.data.protocol; - this.editApi(response.data); - }); - } - } - } - } else { - let dataRange = this.$route.params.dataSelectRange; - let dataType = this.$route.params.dataType; - if (dataRange && typeof dataRange === 'string') { - let selectParamArr = dataRange.split("edit:"); - if (selectParamArr.length === 2) { - let scenarioId = selectParamArr[1]; - if (dataType === 'api') { - this.$get('/api/definition/get/' + scenarioId, (response) => { - this.defaultProtocol = response.data.protocol; - this.editApi(response.data); - }); - } + let dataRange = this.$route.params.dataSelectRange; + let dataType = this.$route.params.dataType; + if (dataRange && typeof dataRange === 'string') { + let selectParamArr = dataRange.split("edit:"); + if (selectParamArr.length === 2) { + let scenarioId = selectParamArr[1]; + if (dataType === 'api') { + this.$get('/api/definition/get/' + scenarioId, (response) => { + this.defaultProtocol = response.data.protocol; + this.editApi(response.data); + }); } } } @@ -969,8 +952,8 @@ export default { this.nodeTree = data; }, changeSelectDataRangeAll(tableType) { - if (this.$route.params.paramObj) { - this.$route.params.paramObj.dataSelectRange = 'all'; + if (this.$route.params) { + this.$route.params.dataSelectRange = 'all'; } }, enableTrash(data) { diff --git a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue index 3ed1426604..a105bb505d 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiCaseSimpleList.vue @@ -1200,19 +1200,10 @@ export default { //判断是否只显示本周的数据。 从首页跳转过来的请求会带有相关参数 isRedirectFilter() { this.selectDataRange = "all"; - let routeParamObj = this.$route.params.paramObj; - if (routeParamObj) { - let routeParam = routeParamObj.dataSelectRange; - let dataType = routeParamObj.dataType; - if (dataType === 'apiTestCase') { - this.selectDataRange = routeParam; - } - } else { - let routeParam = this.$route.params.dataSelectRange; - let dataType = this.$route.params.dataType; - if (dataType === 'apiTestCase') { - this.selectDataRange = routeParam; - } + let routeParam = this.$route.params.dataSelectRange; + let dataType = this.$route.params.dataType; + if (dataType === 'apiTestCase') { + this.selectDataRange = routeParam; } }, changeSelectDataRangeAll() { diff --git a/frontend/src/business/components/api/definition/components/list/ApiList.vue b/frontend/src/business/components/api/definition/components/list/ApiList.vue index 5f8ae4f646..efb1221f86 100644 --- a/frontend/src/business/components/api/definition/components/list/ApiList.vue +++ b/frontend/src/business/components/api/definition/components/list/ApiList.vue @@ -968,33 +968,16 @@ export default { }, //判断是否只显示本周的数据。 从首页跳转过来的请求会带有相关参数 getSelectDataRange() { - let routeParamObj = this.$route.params.paramObj; - if (routeParamObj) { - let dataRange = routeParamObj.dataSelectRange; - let dataType = routeParamObj.dataType; - this.selectDataRange = dataType === 'api' ? dataRange : "all"; - if (this.selectDataRange && - Object.prototype.toString.call(this.selectDataRange).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object' - && this.selectDataRange.indexOf(":") !== -1) { - let selectParamArr = this.selectDataRange.split(":"); - if (selectParamArr.length === 2) { - if (selectParamArr[0] === "apiList") { - this.condition.name = selectParamArr[1]; - } - } - } - } else { - let dataRange = this.$route.params.dataSelectRange; - let dataType = this.$route.params.dataType; - this.selectDataRange = dataType === 'api' ? dataRange : "all"; - if (this.selectDataRange && - Object.prototype.toString.call(this.selectDataRange).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object' - && this.selectDataRange.indexOf(":") !== -1) { - let selectParamArr = this.selectDataRange.split(":"); - if (selectParamArr.length === 2) { - if (selectParamArr[0] === "apiList") { - this.condition.name = selectParamArr[1]; - } + let dataRange = this.$route.params.dataSelectRange; + let dataType = this.$route.params.dataType; + this.selectDataRange = dataType === 'api' ? dataRange : "all"; + if (this.selectDataRange && + Object.prototype.toString.call(this.selectDataRange).match(/\[object (\w+)\]/)[1].toLowerCase() !== 'object' + && this.selectDataRange.indexOf(":") !== -1) { + let selectParamArr = this.selectDataRange.split(":"); + if (selectParamArr.length === 2) { + if (selectParamArr[0] === "apiList") { + this.condition.name = selectParamArr[1]; } } } diff --git a/frontend/src/business/components/api/definition/components/module/ApiModule.vue b/frontend/src/business/components/api/definition/components/module/ApiModule.vue index c268918cc6..a1a9983b0b 100644 --- a/frontend/src/business/components/api/definition/components/module/ApiModule.vue +++ b/frontend/src/business/components/api/definition/components/module/ApiModule.vue @@ -187,25 +187,12 @@ export default { }, isRedirect() { let isRedirectPage = false; - let routeParamObj = this.$route.params.paramObj; - if (routeParamObj) { - if (routeParamObj.dataSelectRange) { - let item = JSON.parse(JSON.stringify(routeParamObj.dataSelectRange)).param; - if (item !== undefined) { - let type = item.taskGroup.toString(); - if (type === "SWAGGER_IMPORT") { - isRedirectPage = true; - } - } - } - } else { - if (this.$route.params.dataSelectRange) { - let item = JSON.parse(JSON.stringify(this.$route.params.dataSelectRange)).param; - if (item !== undefined) { - let type = item.taskGroup.toString(); - if (type === "SWAGGER_IMPORT") { - isRedirectPage = true; - } + if (this.$route.params.dataSelectRange) { + let item = JSON.parse(JSON.stringify(this.$route.params.dataSelectRange)).param; + if (item !== undefined) { + let type = item.taskGroup.toString(); + if (type === "SWAGGER_IMPORT") { + isRedirectPage = true; } } } diff --git a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue index ea0a9741de..00b6cc42cb 100644 --- a/frontend/src/business/components/api/homepage/ApiTestHomePage.vue +++ b/frontend/src/business/components/api/homepage/ApiTestHomePage.vue @@ -291,8 +291,8 @@ export default { switch (page) { case "api": this.$router.push({ - name: 'ApiDefinition', - params: {paramObj: redirectObj} + name: 'ApiDefinitionWithQuery', + params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType} }); break; case "apiWithQuery": @@ -303,8 +303,8 @@ export default { break; case "scenario": this.$router.push({ - name: 'ApiAutomationSingle', - params: {paramObj: redirectObj} + name: 'ApiAutomationWithQuery', + params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType} }); break; case "scenarioWithQuery": diff --git a/frontend/src/business/components/api/router.js b/frontend/src/business/components/api/router.js index 4842c8c8c9..e4be2a023f 100644 --- a/frontend/src/business/components/api/router.js +++ b/frontend/src/business/components/api/router.js @@ -47,11 +47,6 @@ export default { name: "ApiAutomation", component: () => import('@/business/components/api/automation/ApiAutomation'), }, - { - path: "automation", - name: "ApiAutomationSingle", - component: () => import('@/business/components/api/automation/ApiAutomation'), - }, { path: 'monitor/view', name: 'ApiMonitor', diff --git a/frontend/src/business/components/track/case/components/TestCaseList.vue b/frontend/src/business/components/track/case/components/TestCaseList.vue index 3dbd6462ee..63ea7886e6 100644 --- a/frontend/src/business/components/track/case/components/TestCaseList.vue +++ b/frontend/src/business/components/track/case/components/TestCaseList.vue @@ -218,7 +218,6 @@ import MsTag from "@/business/components/common/components/MsTag"; import ApiStatus from "@/business/components/api/definition/components/list/ApiStatus.vue"; import { buildBatchParam, - deepClone, getCustomFieldBatchEditOption, getCustomFieldFilter, getCustomFieldValue, @@ -236,7 +235,8 @@ import { getCurrentProjectID, getCurrentWorkspaceId, getUUID, - hasLicense, operationConfirm, + hasLicense, + operationConfirm, parseTag } from "@/common/js/utils"; import {getTestTemplate} from "@/network/custom-field-template"; @@ -632,12 +632,9 @@ export default { }); }, getSelectDataRange() { - let routeParamObj = this.$route.params.paramObj; this.selectDataRange = 'all'; - if (routeParamObj) { - let dataRange = routeParamObj.dataSelectRange; - this.selectDataRange = dataRange; - } + let dataRange = this.$route.params.dataSelectRange; + this.selectDataRange = dataRange; }, initTableData(nodeIds) { this.condition.planId = ""; @@ -800,7 +797,7 @@ export default { this.$refs.apiDeleteConfirm.open(testCase, this.$t('test_track.case.delete_confirm')); } else { operationConfirm(this.$t('test_track.case.delete_confirm') + '\'' + testCase.name + '\'', () => { - this._handleDeleteVersion(testCase, false); + this._handleDeleteVersion(testCase, false); }); } }); diff --git a/frontend/src/business/components/track/home/TrackHome.vue b/frontend/src/business/components/track/home/TrackHome.vue index 59662f4291..b4633a5f07 100644 --- a/frontend/src/business/components/track/home/TrackHome.vue +++ b/frontend/src/business/components/track/home/TrackHome.vue @@ -172,7 +172,7 @@ export default { case "testCase": this.$router.push({ name: 'testCaseRedirect', - params: {paramObj: redirectObj} + params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType} }); break; case "testPlanEdit": @@ -186,8 +186,8 @@ export default { break; case "api": this.$router.push({ - name: 'ApiDefinition', - params: {paramObj: redirectObj} + name: 'ApiDefinitionWithQuery', + params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType} }); break; } diff --git a/frontend/src/business/components/track/router.js b/frontend/src/business/components/track/router.js index 878b36f7d2..acebb7c3fd 100644 --- a/frontend/src/business/components/track/router.js +++ b/frontend/src/business/components/track/router.js @@ -33,7 +33,7 @@ export default { component: TestCase, }, { - path: 'case/all', + path: 'case/all/:redirectID?/:dataType?/:dataSelectRange?/:projectId?/:workspaceId?', name: 'testCaseRedirect', component: TestCase, },