fix(测试跟踪): 测试计划报告展示优化

--bug=1024708
--user=宋天阳
【测试跟踪】报告-查看-点击场景用例-未显示执行结果-前端报错
https://www.tapd.cn/55049933/s/1356003
This commit is contained in:
song-tianyang 2023-03-27 15:40:26 +08:00 committed by 建国
parent 2d9d3e44ea
commit 7119e050b7
4 changed files with 25 additions and 32 deletions

View File

@ -23,7 +23,7 @@ export default {
}, },
legend: { legend: {
orient: "vertical", orient: "vertical",
right: 50, left: "60%",
bottom: "40%", bottom: "40%",
formatter: function (name) { formatter: function (name) {
return name; return name;

View File

@ -1,8 +1,11 @@
<template> <template>
<div class="request-result" v-loading="loading"> <div class="request-result" v-loading="loading">
<ms-request-metric v-if="showMetric" :response="response"/> <ms-request-metric v-if="showMetric" :response="response" />
<ms-response-result :currentProtocol="currentProtocol" :response="response" <ms-response-result
:isTestPlan="isTestPlan"/> :currentProtocol="currentProtocol"
:response="response"
:isTestPlan="isTestPlan"
/>
</div> </div>
</template> </template>
@ -12,7 +15,7 @@ import MsRequestMetric from "./RequestMetric";
export default { export default {
name: "MsRequestResultTail", name: "MsRequestResultTail",
components: {MsRequestMetric, MsResponseResult}, components: { MsRequestMetric, MsResponseResult },
props: { props: {
response: Object, response: Object,
currentProtocol: String, currentProtocol: String,
@ -21,27 +24,22 @@ export default {
type: Boolean, type: Boolean,
default() { default() {
return true; return true;
} },
}, },
isTestPlan: { isTestPlan: {
type: Boolean, type: Boolean,
default() { default() {
return false; return false;
} },
}
},
watch: {
reportId: {
immediate: true,
}, },
}, },
data() { data() {
return { return {
loading: false, loading: false,
report: {}, report: {},
} };
}, },
} };
</script> </script>
<style scoped> <style scoped>
@ -52,13 +50,13 @@ export default {
} }
.request-result .info { .request-result .info {
background-color: #F9F9F9; background-color: #f9f9f9;
margin-left: 20px; margin-left: 20px;
cursor: pointer; cursor: pointer;
} }
.request-result .method { .request-result .method {
color: #1E90FF; color: #1e90ff;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
line-height: 40px; line-height: 40px;
@ -86,20 +84,19 @@ export default {
} }
.sub-result .info { .sub-result .info {
background-color: #FFF; background-color: #fff;
} }
.sub-result .method { .sub-result .method {
border-left: 5px solid #1E90FF; border-left: 5px solid #1e90ff;
padding-left: 20px; padding-left: 20px;
} }
.sub-result:last-child { .sub-result:last-child {
border-bottom: 1px solid #EBEEF5; border-bottom: 1px solid #ebeef5;
} }
.request-result .icon.is-active { .request-result .icon.is-active {
transform: rotate(90deg); transform: rotate(90deg);
} }
</style> </style>

View File

@ -56,15 +56,9 @@
</ms-aside-container> </ms-aside-container>
<ms-main-container v-loading="responseLoading"> <ms-main-container v-loading="responseLoading">
<div v-if="showResponse"> <div v-if="showResponse">
<micro-app <el-card v-if="!isTemplate">
v-if="!isTemplate" <ms-request-result-tail :response="response" ref="showRspResult" />
route-name="ApiReportView" </el-card>
service="api"
:route-params="{
isTestPlan: showResponse,
response,
}"
/>
<el-card v-else> <el-card v-else>
<ms-request-result-tail <ms-request-result-tail
:response="response" :response="response"
@ -107,7 +101,6 @@ import {
apiDefinitionReportGet, apiDefinitionReportGet,
apiDefinitionReportGetDb, apiDefinitionReportGetDb,
} from "@/api/remote/api/api-definition"; } from "@/api/remote/api/api-definition";
import MicroApp from "metersphere-frontend/src/components/MicroApp";
import MsTestPlanApiStatus from "@/business/plan/view/comonents/api/TestPlanApiStatus"; import MsTestPlanApiStatus from "@/business/plan/view/comonents/api/TestPlanApiStatus";
export default { export default {
@ -116,7 +109,6 @@ export default {
MsTestPlanApiStatus, MsTestPlanApiStatus,
MsMainContainer, MsMainContainer,
MsAsideContainer, MsAsideContainer,
MicroApp,
MsTableColumn, MsTableColumn,
MsTable, MsTable,
StatusTableItem, StatusTableItem,

View File

@ -47,7 +47,7 @@
:field="item" :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
:label="$t('test_track.report.list.test_plan')" :label="$t('test_track.report.list.test_plan')"
min-width="100" min-width="160"
/> />
<ms-table-column <ms-table-column
@ -62,6 +62,7 @@
:field="item" :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
sortable sortable
min-width="120"
:label="$t('test_track.report.list.create_time')" :label="$t('test_track.report.list.create_time')"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
> >
@ -74,6 +75,7 @@
prop="triggerMode" prop="triggerMode"
:field="item" :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
min-width="120"
sortable sortable
:label="$t('test_track.report.list.trigger_mode')" :label="$t('test_track.report.list.trigger_mode')"
> >
@ -86,6 +88,7 @@
prop="status" prop="status"
:field="item" :field="item"
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
min-width="100"
sortable sortable
:label="$t('commons.status')" :label="$t('commons.status')"
> >
@ -121,6 +124,7 @@
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
sortable="custom" sortable="custom"
:label="$t('test_track.report.list.run_time')" :label="$t('test_track.report.list.run_time')"
min-width="120"
> >
<template v-slot:default="scope"> <template v-slot:default="scope">
<span v-if="scope.row.endTime != null">{{ <span v-if="scope.row.endTime != null">{{