feat(测试跟踪): 测试计划接口性能用例支持点击id跳转

--story=1008184 --user=陈建星 测试计划优化 https://www.tapd.cn/55049933/s/1198664
This commit is contained in:
chenjianxing 2022-07-11 17:09:54 +08:00 committed by jianxing
parent 1317871669
commit ed76c92ce3
3 changed files with 78 additions and 7 deletions

View File

@ -32,9 +32,20 @@
@filter="search" @filter="search"
ref="table"> ref="table">
<span v-for="(item) in fields" :key="item.key"> <span v-for="(item) in fields" :key="item.key">
<ms-table-column :field="item" prop="num" <ms-table-column :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
sortable label="ID" min-width="80"/> sortable
label="ID"
prop="num"
min-width="80">
<template v-slot:default="scope">
<el-link @click="openApiById(scope.row)">
<span>
{{ scope.row.num }}
</span>
</el-link>
</template>
</ms-table-column>
<ms-table-column :field="item" :fields-width="fieldsWidth" prop="name" sortable min-width="120" <ms-table-column :field="item" :fields-width="fieldsWidth" prop="name" sortable min-width="120"
:label="$t('test_track.case.name')"/> :label="$t('test_track.case.name')"/>
@ -188,7 +199,7 @@ import MsContainer from "../../../../../common/components/MsContainer";
import MsBottomContainer from "../../../../../api/definition/components/BottomContainer"; import MsBottomContainer from "../../../../../api/definition/components/BottomContainer";
import BatchEdit from "@/business/components/track/case/components/BatchEdit"; import BatchEdit from "@/business/components/track/case/components/BatchEdit";
import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP} from "../../../../../api/definition/model/JsonData"; import {API_METHOD_COLOUR, CASE_PRIORITY, RESULT_MAP} from "../../../../../api/definition/model/JsonData";
import {getCurrentProjectID, hasLicense, strMapToObj} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentWorkspaceId, hasLicense, strMapToObj} from "@/common/js/utils";
import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem"; import PriorityTableItem from "../../../../common/tableItems/planview/PriorityTableItem";
import {getUUID} from "../../../../../../../common/js/utils"; import {getUUID} from "../../../../../../../common/js/utils";
import TestPlanCaseListHeader from "./TestPlanCaseListHeader"; import TestPlanCaseListHeader from "./TestPlanCaseListHeader";
@ -676,6 +687,20 @@ 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(),
}
});
window.open(definitionData.href, '_blank');
},
}, },
}; };
</script> </script>

View File

@ -35,7 +35,15 @@
sortable sortable
prop="customNum" prop="customNum"
min-width="80px" min-width="80px"
label="ID"/> label="ID">
<template v-slot:default="scope">
<el-link @click="openById(scope.row)">
<span>
{{ scope.row.customNum }}
</span>
</el-link>
</template>
</ms-table-column>
<ms-table-column :field="item" <ms-table-column :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
@ -201,7 +209,7 @@
import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsTableHeader from "@/business/components/common/components/MsTableHeader";
import MsTablePagination from "@/business/components/common/pagination/TablePagination"; import MsTablePagination from "@/business/components/common/pagination/TablePagination";
import MsTag from "../../../../../common/components/MsTag"; import MsTag from "../../../../../common/components/MsTag";
import {getCurrentProjectID, getUUID, hasLicense, strMapToObj} from "@/common/js/utils"; import {getCurrentProjectID, getCurrentWorkspaceId, getUUID, hasLicense, strMapToObj} from "@/common/js/utils";
import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail"; import MsApiReportDetail from "../../../../../api/automation/report/ApiReportDetail";
import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn"; import MsTableMoreBtn from "../../../../../api/automation/scenario/TableMoreBtn";
import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns"; import MsScenarioExtendButtons from "@/business/components/api/automation/scenario/ScenarioExtendBtns";
@ -594,6 +602,19 @@ 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()
}
});
window.open(automationData.href, '_blank');
},
} }
} }
</script> </script>

View File

@ -37,7 +37,16 @@
prop="num" prop="num"
sortable sortable
min-width="80" min-width="80"
label="ID"/> label="ID">
<template v-slot:default="scope">
<el-link @click="openById(scope.row)">
<span>
{{ scope.row.num }}
</span>
</el-link>
</template>
</ms-table-column>
<ms-table-column <ms-table-column
:field="item" :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
@ -144,7 +153,14 @@ import {
buildBatchParam, getCustomTableHeader, getCustomTableWidth buildBatchParam, getCustomTableHeader, getCustomTableWidth
} from "@/common/js/tableUtils"; } from "@/common/js/tableUtils";
import {TEST_PLAN_LOAD_CASE} from "@/common/js/constants"; import {TEST_PLAN_LOAD_CASE} from "@/common/js/constants";
import {getCurrentProjectID, getCurrentUser, getCurrentUserId, hasLicense} from "@/common/js/utils"; import {
getCurrentProjectID,
getCurrentUser,
getCurrentUserId,
getCurrentWorkspaceId,
getUUID,
hasLicense
} from "@/common/js/utils";
import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate"; import HeaderLabelOperate from "@/business/components/common/head/HeaderLabelOperate";
import MsPlanRunMode from "../../../common/PlanRunMode"; import MsPlanRunMode from "../../../common/PlanRunMode";
import MsTable from "@/business/components/common/components/table/MsTable"; import MsTable from "@/business/components/common/components/table/MsTable";
@ -487,6 +503,15 @@ export default {
}); });
} }
}, },
openById(item) {
let loadData = this.$router.resolve({
name: 'editPerTest',
params: {
testId: item.loadCaseId,
}
});
window.open(loadData.href, '_blank');
},
}, },
beforeDestroy() { beforeDestroy() {
this.cancelRefresh(); this.cancelRefresh();