microwave-project-unite/src/components/qtReport/index.vue

329 lines
7.7 KiB
Vue
Raw Normal View History

2023-01-09 01:55:54 +00:00
<template>
2024-08-26 19:22:53 +00:00
<div class="qtReport">
<div class="realResult">
<div class="box1">
<span class="sp1"></span><span class="sp2">真实性检验结果</span>
</div>
<div class="resContent">
<div>
<el-tabs v-model="activeTabs">
<el-tab-pane label="误差矩阵" name="pixel">
2024-09-03 08:28:38 +00:00
<ReportTable :errorMatrix="errorMatrix" activeTabs="pixel"></ReportTable>
2024-08-26 19:22:53 +00:00
</el-tab-pane>
<el-tab-pane label="用户精度" name="userPre">
2024-09-03 08:28:38 +00:00
<ReportTable :errorMatrix="errorMatrix" :preResults="preResults['用户精度']" activeTabs="userPre">
2024-08-26 19:22:53 +00:00
</ReportTable>
</el-tab-pane>
<el-tab-pane label="生产者精度" name="producerPre">
2024-09-03 08:28:38 +00:00
<ReportTable :errorMatrix="errorMatrix" :preResults="preResults['生产者精度']" activeTabs="producerPre">
2024-08-26 19:22:53 +00:00
</ReportTable>
</el-tab-pane>
<el-tab-pane label="错分精度" name="errorPre">
2024-09-03 08:28:38 +00:00
<ReportTable :errorMatrix="errorMatrix" :preResults="preResults['错分误差']" activeTabs="errorPre">
2024-08-26 19:22:53 +00:00
</ReportTable>
</el-tab-pane>
<el-tab-pane label="漏分精度" name="LeakagePre">
2024-09-03 08:28:38 +00:00
<ReportTable :errorMatrix="errorMatrix" :preResults="preResults['漏分误差']" activeTabs="LeakagePre">
2024-08-26 19:22:53 +00:00
</ReportTable>
</el-tab-pane>
</el-tabs>
2023-01-09 01:55:54 +00:00
</div>
2024-08-26 19:22:53 +00:00
</div>
</div>
<div class="groudCoverType">
<div class="box1">
2024-09-03 08:28:38 +00:00
<span class="sp1"></span><span class="sp2">{{ pdSubTypeName }}误差结果图</span>
2024-08-26 19:22:53 +00:00
</div>
<div class="gctContent">
<div id="qtReportEchart" ref="chart"></div>
</div>
2023-01-09 01:55:54 +00:00
</div>
2024-08-26 19:22:53 +00:00
</div>
2023-01-09 01:55:54 +00:00
</template>
<script>
import ReportTable from "@/components/reportTable";
import { productTypeMap } from "@/lib/variateMap";
export default {
2024-08-26 19:22:53 +00:00
components: {
ReportTable,
},
props: {
realRes: {
require: true,
2023-01-09 01:55:54 +00:00
},
2024-08-26 19:22:53 +00:00
pdSubType: {
require: true,
2024-08-26 17:09:39 +00:00
},
2024-08-26 19:22:53 +00:00
},
data() {
return {
activeTabs: "pixel",
pdSubTypeName: null,
myCharts: null,
errorMatrix: null,
preResults: null,
};
},
created() {
this.initParam();
},
mounted() {
this.myCharts = this.$echarts.init(this.$refs.chart);
if (this.realRes.rocCoordinateValues !== undefined)
this.drawPie(this.realRes.rocCoordinateValues);
},
methods: {
initParam() {
if (this.realRes !== undefined) {
this.pdSubTypeName = productTypeMap(this.pdSubType);
2025-02-19 07:20:44 +00:00
this.errorMatrix = this.realRes.report["" + 8 + ""]
? this.realRes.report["" + 8 + ""]
2024-08-26 19:22:53 +00:00
: [];
this.preResults = this.realRes.results ? this.realRes.results : {};
2025-02-19 07:20:44 +00:00
console.log(this.errorMatrix,'this.errorMatrix');
2024-08-26 19:22:53 +00:00
}
2024-08-26 17:09:39 +00:00
},
2024-08-26 19:22:53 +00:00
drawPie(rocVal) {
2025-02-19 07:20:44 +00:00
let tableData = this.realRes.report["" + 8 + ""];
2024-08-26 19:22:53 +00:00
let newTableData = this.deepClone(tableData);
let xArr = newTableData.pop();
let yArr = newTableData.pop();
let dataArr = [];
newTableData.forEach((a, index1) => {
a.forEach((b, index2) => {
2024-09-03 08:28:38 +00:00
dataArr.push([index2, index1, b.count]);
2024-08-26 19:22:53 +00:00
});
});
let echartOption = {
tooltip: {
position: "top",
},
grid: {
height: "70%",
top: "10%",
},
xAxis: {
type: "category",
data: xArr,
splitArea: {
show: true,
},
axisLabel: {
interval: 0,
formatter: function (value) {
// 将 x 轴的文字改为竖版显示
var str = value.split("");
return str.join("\n");
},
},
2023-01-09 01:55:54 +00:00
},
2024-08-26 19:22:53 +00:00
yAxis: {
type: "category",
data: yArr,
splitArea: {
show: true,
},
2023-01-09 01:55:54 +00:00
},
2024-08-26 19:22:53 +00:00
visualMap: {
min: 0,
max: 10,
calculable: true,
left: "right", // 将 visualMap 组件放置在容器的右侧
top: "middle", // 垂直居中
orient: "vertical", // 垂直显示
inRange: {
color: ["#F4FBFD", "#073671"], // 定义颜色渐变
},
// outOfRange: {
// color: "#999", // 数据值在范围外时的颜色
// },
},
series: [
{
name: "Punch Card",
type: "heatmap",
data: dataArr,
animation: false,
label: {
show: true,
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
},
],
};
echartOption && this.myCharts.setOption(echartOption);
return;
let allData = [];
for (let i in rocVal) {
let ad = [];
ad.push(
parseFloat(rocVal[i].cre_falseAlarmX.toFixed(3)),
parseFloat(rocVal[i].cre_reCallY.toFixed(3))
);
allData.push(ad);
}
console.log(allData);
let option = {
animation: false,
tooltip: {
formatter: "({c})",
},
xAxis: {
name: "漏分精度",
nameLocation: "middle",
nameTextStyle: {
lineHeight: 30,
height: 60,
fontWeight: "bold",
},
min: 0,
max: 1,
axisLabel: {
formatter: function (value) {
return Number(value).toFixed(1);
},
},
},
yAxis: {
name: "用户精度",
nameTextStyle: {
lineHeight: 30,
height: 60,
fontWeight: "bold",
},
min: 0,
max: 1,
axisLabel: {
formatter: function (value) {
return Number(value).toFixed(1);
},
},
},
series: [
{
symbolSize: 10,
data: allData,
type: "scatter",
},
],
};
option && this.myCharts.setOption(option);
2023-01-09 01:55:54 +00:00
},
2024-08-26 19:22:53 +00:00
deepClone(obj) {
if (obj === null) return null;
let clone = obj instanceof Array ? [] : {};
for (const key of Object.keys(obj)) {
clone[key] =
typeof obj[key] === "object" ? this.deepClone(obj[key]) : obj[key];
}
return clone;
},
},
2023-01-09 01:55:54 +00:00
};
</script>
2024-08-26 17:09:39 +00:00
2023-01-09 01:55:54 +00:00
<style scoped lang="less">
.qtReport {
2024-08-26 19:22:53 +00:00
width: 100%;
height: 100%;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
.realResult {
2024-08-26 19:22:53 +00:00
width: 100%;
height: calc(55% - 5px);
background-color: white;
margin-bottom: 5px;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
.groudCoverType {
2024-08-26 19:22:53 +00:00
width: 100%;
height: 45%;
background-color: white;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
.resContent {
2024-08-26 19:22:53 +00:00
// border: 1px black solid;
height: calc(100% - 60px);
width: calc(100% - 20px);
margin: 10px;
font-size: 20px;
overflow-y: scroll;
2024-08-26 17:09:39 +00:00
2024-08-26 19:22:53 +00:00
.rptitle {
display: block;
float: left;
font-size: 16px;
2024-08-26 17:09:39 +00:00
2024-08-26 19:22:53 +00:00
span {
color: #354595;
font-weight: bold;
2024-08-26 17:09:39 +00:00
}
2024-08-26 19:22:53 +00:00
}
2024-08-26 17:09:39 +00:00
2024-08-26 19:22:53 +00:00
.sampling {
width: calc(40% - 6px);
text-align: start;
margin-left: 6px;
}
2024-08-26 17:09:39 +00:00
2024-08-26 19:22:53 +00:00
.pixelDeal {
width: calc(60% - 6px);
text-align: end;
margin-right: 6px;
}
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
/deep/.resContent .el-tabs__header {
2024-08-26 19:22:53 +00:00
margin: 0;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
/deep/.resContent .el-tabs__item {
2024-08-26 19:22:53 +00:00
padding: 0 13px;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
.gctContent {
2024-08-26 19:22:53 +00:00
border: 1px black solid;
height: calc(100% - 60px);
width: calc(100% - 20px);
margin: 10px;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
#qtReportEchart {
2024-08-26 19:22:53 +00:00
width: 100%;
height: 100%;
position: relative;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
.box1 {
2024-08-26 19:22:53 +00:00
height: 40px;
line-height: 40px;
border-bottom: 1px solid rgb(205, 205, 205, 0.5);
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
.sp1 {
2024-08-26 19:22:53 +00:00
display: inline-block;
width: 7px;
height: 26px;
background-color: #354595;
vertical-align: top;
margin-left: 20px;
margin-top: 8px;
2023-01-09 01:55:54 +00:00
}
2023-01-12 09:56:38 +00:00
2023-01-09 01:55:54 +00:00
.sp2 {
2024-08-26 19:22:53 +00:00
margin-left: 10px;
font-size: 20px;
font-weight: 700;
color: #354595;
vertical-align: top;
2023-01-09 01:55:54 +00:00
}
</style>