报告页头部面包屑

This commit is contained in:
shiziyuan9527 2020-03-09 18:05:18 +08:00
parent ceb8d200c5
commit ca45dfe66f
7 changed files with 87 additions and 7 deletions

View File

@ -9,4 +9,6 @@ import java.util.List;
public interface ExtLoadTestReportMapper { public interface ExtLoadTestReportMapper {
List<ReportDTO> getReportList(@Param("reportRequest")ReportRequest request); List<ReportDTO> getReportList(@Param("reportRequest")ReportRequest request);
ReportDTO getReportTestAndProInfo(@Param("id") String id);
} }

View File

@ -13,4 +13,12 @@
</where> </where>
</select> </select>
<select id="getReportTestAndProInfo" resultType="io.metersphere.dto.ReportDTO">
select ltr.id, ltr.name, ltr.test_id as testId, ltr.description,
ltr.create_time as createTime, ltr.update_time as updateTime, ltr.status as status, lt.name as testName,
p.id as projectId, p.name as projectName
from load_test_report ltr join load_test lt on ltr.test_id = lt.id join project p on lt.project_id = p.id
where ltr.id = #{id}
</select>
</mapper> </mapper>

View File

@ -45,4 +45,12 @@ public class ReportController {
public void deleteReport(@PathVariable String reportId) { public void deleteReport(@PathVariable String reportId) {
reportService.deleteReport(reportId); reportService.deleteReport(reportId);
} }
@GetMapping("/test/pro/info/{reportId}")
public ReportDTO getReportTestAndProInfo(@PathVariable String reportId) {
return reportService.getReportTestAndProInfo(reportId);
}
} }

View File

@ -11,6 +11,24 @@ public class ReportDTO {
private String status; private String status;
private String content; private String content;
private String testName; private String testName;
private String projectId;
private String projectName;
public String getProjectId() {
return projectId;
}
public void setProjectId(String projectId) {
this.projectId = projectId;
}
public String getProjectName() {
return projectName;
}
public void setProjectName(String projectName) {
this.projectName = projectName;
}
public String getId() { public String getId() {
return id; return id;

View File

@ -37,4 +37,8 @@ public class ReportService {
public void deleteReport(String reportId) { public void deleteReport(String reportId) {
loadTestReportMapper.deleteByPrimaryKey(reportId); loadTestReportMapper.deleteByPrimaryKey(reportId);
} }
public ReportDTO getReportTestAndProInfo(String reportId) {
return extLoadTestReportMapper.getReportTestAndProInfo(reportId);
}
} }

View File

@ -129,9 +129,9 @@
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
handleEdit(testPlan) { handleEdit(report) {
this.$router.push({ this.$router.push({
path: '/reportView/' + testPlan.id path: '/reportView/' + report.id
}) })
}, },
handleDelete(report) { handleDelete(report) {

View File

@ -1,11 +1,23 @@
<template> <template>
<div v-loading="result.loading"> <div v-loading="result.loading" class="report-view-container">
<div class="main-content"> <div class="main-content">
<el-card> <el-card>
<el-row> <el-row>
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/' }">{{projectName}}</el-breadcrumb-item>
<el-breadcrumb-item>{{testName}}</el-breadcrumb-item>
<el-breadcrumb-item>{{reportName}}</el-breadcrumb-item>
</el-breadcrumb>
</el-row> </el-row>
<el-row style="margin-top: 15px;margin-left: -300px;">
<el-button type="primary" plain size="mini">立即停止</el-button>
<el-button type="success" plain size="mini">再次执行</el-button>
<el-button type="info" plain size="mini">导出</el-button>
<el-button type="warning" plain size="mini">比较</el-button>
</el-row>
<el-divider></el-divider>
<el-tabs v-model="active" type="border-card" :stretch="true"> <el-tabs v-model="active" type="border-card" :stretch="true">
<el-tab-pane :label="$t('report.test_overview')"> <el-tab-pane :label="$t('report.test_overview')">
<ms-report-test-overview /> <ms-report-test-overview />
@ -43,15 +55,43 @@
data() { data() {
return { return {
result: {}, result: {},
active: '0' active: '0',
reportId: '',
reportName: '',
testName: '',
projectName: ''
} }
}, },
methods: { methods: {
initBreadcrumb() {
} this.result = this.$get("report/test/pro/info/" + this.reportId, res => {
let data = res.data;
this.reportName = data.name;
this.testName = data.testName;
this.projectName = data.projectName;
})
}
},
created() {
this.reportId = this.$route.path.split('/')[2];
this.initBreadcrumb();
},
} }
</script> </script>
<style scoped> <style scoped>
.report-view-container {
float: none;
text-align: center;
padding: 15px;
width: 100%;
height: 100%;
box-sizing: border-box;
}
.report-view-container .main-content {
margin: 0 auto;
width: 100%;
max-width: 1200px;
}
</style> </style>