测试计划关联测试报告界面调整
This commit is contained in:
@@ -114,7 +114,7 @@ export default {
|
||||
this.$tab.openPage('平台报告', '/testplan/casereport/platformReport',
|
||||
{id: row.id,
|
||||
name: row.name,
|
||||
type: row.result,
|
||||
type: row.type,
|
||||
planId: row.planId,
|
||||
report: row.report
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-page-header :title="reportTitle" @back="goBack" ></el-page-header>
|
||||
<div class="header-buttons">
|
||||
<span>测试结果</span>
|
||||
<el-select v-model="selectedResult" placeholder="请选择" clearable>
|
||||
<el-select v-model="selectedResult" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in resultOptions"
|
||||
:key="item.value"
|
||||
@@ -18,7 +18,7 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="report-container">
|
||||
<div class="report-container" :class="testStatusClass">
|
||||
<div class="report-header">
|
||||
<div class="report-title">
|
||||
<span>{{ reportTitle }}</span>
|
||||
@@ -90,9 +90,8 @@ export default {
|
||||
reportData: {},
|
||||
selectedResult: '', // 选择的测试结果
|
||||
resultOptions: [ // 测试结果选项
|
||||
{ value: 'all', label: '全部' },
|
||||
{ value: 'passed', label: '通过' },
|
||||
{ value: 'failed', label: '失败' }
|
||||
{ value: '1', label: '通过' },
|
||||
{ value: '0', label: '不通过' }
|
||||
],
|
||||
|
||||
// 执行结果分布数据
|
||||
@@ -118,6 +117,7 @@ export default {
|
||||
this.reportTitle = this.$route.query.name;
|
||||
this.reportType = this.$route.query.type;
|
||||
this.reportData = JSON.parse(this.$route.query.report);
|
||||
this.selectedResult = this.reportData.result;
|
||||
|
||||
// 更新饼图数据
|
||||
this.resultDistributionData.series[0].value = this.reportData.passNum || 0;
|
||||
@@ -141,6 +141,9 @@ export default {
|
||||
passRate() {
|
||||
if (this.reportData.caseNum === 0) return 0;
|
||||
return (this.reportData.passNum / this.reportData.caseNum) * 100;
|
||||
},
|
||||
testStatusClass() {
|
||||
return this.selectedResult === '0' ? 'status-not-passed' : 'status-passed';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -156,6 +159,7 @@ export default {
|
||||
myChart.setOption({
|
||||
series: [{
|
||||
type: 'pie',
|
||||
radius: ['40%', '70%'],
|
||||
data: this.resultDistributionData.series
|
||||
}]
|
||||
}, true); // true 表示合并选项
|
||||
@@ -259,7 +263,12 @@ export default {
|
||||
.report-container {
|
||||
height: 300px;
|
||||
margin-bottom: 20px;
|
||||
background: linear-gradient(90deg, #6fcdac, #9ed2bb);
|
||||
&.status-not-passed {
|
||||
background: linear-gradient(180deg, #e7998b, #e8b1b0);
|
||||
}
|
||||
&.status-passed {
|
||||
background: linear-gradient(180deg, #6fcdac, #9ed2bb);
|
||||
}
|
||||
.report-header {
|
||||
|
||||
color: white;
|
||||
|
||||
Reference in New Issue
Block a user