fix(测试跟踪): 修复测试跟踪首页跳转api服务时跳转不过去的问题

--bug=1018378 --user=宋天阳 【测试跟踪】测试计划-接口测试用例-点击ID跳转到了个人信息页面
https://www.tapd.cn/55049933/s/1269293
This commit is contained in:
song-tianyang 2022-10-20 14:30:37 +08:00 committed by f2c-ci-robot[bot]
parent aa490650f3
commit 2ce8b4ae7b
3 changed files with 24 additions and 40 deletions

View File

@ -170,6 +170,7 @@ export default {
//api
//UUID
let uuid = getUUID();
let home;
switch (page) {
case "testCase":
this.$router.push({
@ -180,18 +181,15 @@ export default {
this.$router.push('/track/plan/view/' + selectType)
break;
case "scenarioWithQuery":
this.$router.push({
name: 'ApiAutomationWithQuery',
params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType}
});
home = this.$router.resolve('/api/automation/' + uuid + "/" + dataType + "/" + selectType);
break;
case "api":
this.$router.push({
name: 'ApiDefinitionWithQuery',
params: {redirectID: uuid, dataType: dataType, dataSelectRange: selectType}
});
home = this.$router.resolve('/api/definition/' + uuid + "/" + dataType + "/" + selectType);
break;
}
if (home) {
window.open(home.href, '_blank');
}
}
}
}

View File

@ -140,7 +140,8 @@
:label="$t('test_track.plan.execute_result')" min-width="150" align="center">
<template v-slot:default="scope">
<div v-loading="rowLoading === scope.row.id">
<el-link @click="getReportResult(scope.row)" :disabled="!scope.row.execResult || scope.row.execResult==='PENDING'">
<el-link @click="getReportResult(scope.row)"
:disabled="!scope.row.execResult || scope.row.execResult==='PENDING'">
<ms-test-plan-api-status :status="scope.row.execResult"/>
</el-link>
<div v-if="scope.row.id" style="color: #999999;font-size: 12px">
@ -185,7 +186,7 @@ import BatchEdit from "@/business/case/components/BatchEdit";
import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP} from "metersphere-frontend/src/model/JsonData";
import {getCurrentProjectID, getCurrentWorkspaceId} from "metersphere-frontend/src/utils/token";
import {hasLicense} from "metersphere-frontend/src/utils/permission";
import {strMapToObj, getUUID} from "metersphere-frontend/src/utils";
import {getUUID, strMapToObj} from "metersphere-frontend/src/utils";
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
import TestPlanCaseListHeader from "./TestPlanCaseListHeader";
import TestPlanApiCaseResult from "./TestPlanApiCaseResult";
@ -204,17 +205,18 @@ import MsTableColumn from "metersphere-frontend/src/components/table/MsTableColu
import MsPlanRunMode from "@/business/plan/common/PlanRunModeWithEnv";
import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpdateTimeColumn";
import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn";
import {editTestPlanApiCaseOrder, testPlanAutoCheck} from "@/api/remote/plan/test-plan";
import {editTestPlanApiCaseOrder, reportSocket, run, testPlanAutoCheck} from "@/api/remote/plan/test-plan";
import {getProjectMemberUserFilter} from "@/api/user";
import {apiTestCaseGet, apiTestCaseReduction} from "@/api/remote/api/api-case";
import {
testPlanApiCaseBatchDelete, testPlanApiCaseBatchUpdateEnv,
testPlanApiCaseBatchDelete,
testPlanApiCaseBatchUpdateEnv,
testPlanApiCaseDelete,
testPlanApiCaseList, testPlanApiCaseRun,
testPlanApiCaseList,
testPlanApiCaseRun,
testPlanApiCaseSelectAllTableRows
} from "@/api/remote/plan/test-plan-api-case";
import {apiDefinitionPlanReportGetByCaseId} from "@/api/remote/api/api-definition-report";
import {reportSocket, run} from "@/api/remote/plan/test-plan";
import MsTestPlanApiStatus from "@/business/plan/view/comonents/api/TestPlanApiStatus";
import {getProjectVersions} from "@/business/utils/sdk-utils";
@ -323,7 +325,7 @@ export default {
projectIds: [],
projectList: [],
versionFilters: [],
execResultFilters:[
execResultFilters: [
{text: 'Pending', value: 'PENDING'},
{text: 'Success', value: 'SUCCESS'},
{text: 'Error', value: 'ERROR'},
@ -676,17 +678,7 @@ export default {
}
},
openApiById(item) {
let definitionData = this.$router.resolve({
name: 'ApiDefinitionWithQuery',
params: {
redirectID: getUUID(),
dataType: "apiTestCase",
dataSelectRange: 'single:' + item.caseId,
projectId: getCurrentProjectID(),
type: item.protocol,
workspaceId: getCurrentWorkspaceId(),
}
});
let definitionData = this.$router.resolve('/api/definition/' + getUUID() + "/apiTestCase/single:" + item.caseId + "/" + getCurrentProjectID() + "/" + item.protocol + "/" + getCurrentWorkspaceId());
window.open(definitionData.href, '_blank');
},
},

View File

@ -208,10 +208,10 @@ import {hasLicense} from "metersphere-frontend/src/utils/permission";
import MsTableMoreBtn from "metersphere-frontend/src/components/table/TableMoreBtn";
import TestPlanScenarioListHeader from "./TestPlanScenarioListHeader";
import {
initCondition,
buildBatchParam,
getCustomTableHeader,
getCustomTableWidth
getCustomTableWidth,
initCondition
} from "metersphere-frontend/src/utils/tableUtils";
import {ENV_TYPE, TEST_PLAN_SCENARIO_CASE} from "metersphere-frontend/src/utils/constants";
import HeaderLabelOperate from "metersphere-frontend/src/components/head/HeaderLabelOperate";
@ -226,8 +226,11 @@ import MsUpdateTimeColumn from "metersphere-frontend/src/components/table/MsUpda
import MsCreateTimeColumn from "metersphere-frontend/src/components/table/MsCreateTimeColumn";
import {editTestPlanScenarioCaseOrder} from "@/api/remote/plan/test-plan";
import {
testPlanScenarioCaseBatchDelete, testPlanScenarioCaseBatchUpdateEnv,
testPlanScenarioCaseDelete, testPlanScenarioCaseRun, testPlanScenarioCaseSelectAllTableRows,
testPlanScenarioCaseBatchDelete,
testPlanScenarioCaseBatchUpdateEnv,
testPlanScenarioCaseDelete,
testPlanScenarioCaseRun,
testPlanScenarioCaseSelectAllTableRows,
testPlanScenarioEnv,
testPlanScenarioList
} from "@/api/remote/plan/test-plan-scenario";
@ -571,16 +574,7 @@ export default {
}
},
openById(item) {
let automationData = this.$router.resolve({
name: 'ApiAutomationWithQuery',
params: {
redirectID: getUUID(),
dataType: "scenario",
dataSelectRange: 'edit:' + item.caseId,
projectId: item.projectId,
workspaceId: getCurrentWorkspaceId()
}
});
let automationData = this.$router.resolve('/api/automation/' + getUUID() + "/scenario/edit:" + item.caseId + "/" + item.projectId + "/" + getCurrentWorkspaceId());
window.open(automationData.href, '_blank');
},
}