Ver Fonte

feat:需求迭代

linchengzhe há 2 meses atrás
pai
commit
d81c523282
2 ficheiros alterados com 73 adições e 34 exclusões
  1. 3 1
      src/api/workManagement.js
  2. 70 33
      src/views/workManagement/sceneReport.vue

+ 3 - 1
src/api/workManagement.js

@@ -47,6 +47,7 @@ const getStandardTestReport = basePart + '/simulationProject/getProjectReportFor
 
 
 const selectAllSimulationMageGroupList = basePart + '/simulationMageGroup/selectAllSimulationMageGroupList';
 const selectAllSimulationMageGroupList = basePart + '/simulationMageGroup/selectAllSimulationMageGroupList';
 
 
+const queryCoverOrExpose = basePart + '/simulationProject/selectProjectComputerRates' // 获取项目的覆盖率和暴露率
 
 
 
 
 export default {
 export default {
@@ -95,5 +96,6 @@ export default {
     getStandardTestReport,
     getStandardTestReport,
 
 
     selectAllSimulationMageGroupList,
     selectAllSimulationMageGroupList,
-    getMultiSimulationSceneStatus
+    getMultiSimulationSceneStatus,
+    queryCoverOrExpose
 }
 }

+ 70 - 33
src/views/workManagement/sceneReport.vue

@@ -31,14 +31,26 @@
         <p class="text">
         <p class="text">
           针对<span style="border-bottom: 2px solid red">{{
           针对<span style="border-bottom: 2px solid red">{{
             info.algorithmName
             info.algorithmName
-          }}</span
-          >,进行场景的算法验证,共有{{
-            Number(info.scenePassNum)
-          }}例场景通过,通过率{{ Number(info.passRate) * 100 }}%。其中<span
-            style="border-bottom: 2px solid red"
-            >{{ info.packageName }}</span
-          >的场景复杂度、危险度分布结果如下图所示。
+            }}</span>,进行场景的算法验证,共有{{
+              Number(info.scenePassNum)
+            }}例场景通过,通过率{{ Number(info.passRate) * 100 }}%。其中<span style="border-bottom: 2px solid red">{{ info.packageName
+            }}</span>的场景覆盖率、暴露率结果如下所示。
         </p>
         </p>
+        <el-table :data="coverData" style="width: 100%;margin-bottom: 15px;">
+          <el-table-column prop="scene" label="场景行为">
+          </el-table-column>
+          <el-table-column prop="ratio" label="覆盖率">
+          </el-table-column>
+        </el-table>
+        <p class="echart_desc">表1-1 覆盖率结果</p>
+        <el-table :data="exposeData" style="width: 100%;margin-bottom: 15px;">
+          <el-table-column prop="scene" label="场景行为">
+          </el-table-column>
+          <el-table-column prop="ratio" label="暴露率">
+          </el-table-column>
+        </el-table>
+        <p class="echart_desc">表1-2 暴露率结果</p>
+        <p class="text">场景复杂度、危险度分布结果如下图所示</p>
         <!-- 复杂度图表 -->
         <!-- 复杂度图表 -->
         <div class="echart-box" ref="myChart_complex"></div>
         <div class="echart-box" ref="myChart_complex"></div>
         <p class="echart_desc">图1-1 复杂度分布图</p>
         <p class="echart_desc">图1-1 复杂度分布图</p>
@@ -152,33 +164,17 @@
         </p>
         </p>
         <p class="echart_desc">表4-1 评价结果表</p>
         <p class="echart_desc">表4-1 评价结果表</p>
         <el-table :data="tableDataA" border style="width: 100%">
         <el-table :data="tableDataA" border style="width: 100%">
-          <el-table-column
-            v-for="item in tableColumnA"
-            :prop="item.key"
-            :label="item.label"
-          >
+          <el-table-column v-for="item in tableColumnA" :prop="item.key" :label="item.label">
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
         <p class="subtitle">附录</p>
         <p class="subtitle">附录</p>
         <p class="echart_desc">表5-1 评价结果表</p>
         <p class="echart_desc">表5-1 评价结果表</p>
         <el-table :data="tableDataB" border style="width: 100%">
         <el-table :data="tableDataB" border style="width: 100%">
-          <el-table-column
-            v-for="item in tableColumnB"
-            :prop="item.key"
-            :label="item.label"
-          >
+          <el-table-column v-for="item in tableColumnB" :prop="item.key" :label="item.label">
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
-        <el-table
-          :data="tableDataC"
-          border
-          style="width: 100%; margin-top: 50px"
-        >
-          <el-table-column
-            v-for="item in tableColumnC"
-            :prop="item.key"
-            :label="item.label"
-          >
+        <el-table :data="tableDataC" border style="width: 100%; margin-top: 50px">
+          <el-table-column v-for="item in tableColumnC" :prop="item.key" :label="item.label">
           </el-table-column>
           </el-table-column>
         </el-table>
         </el-table>
       </div>
       </div>
@@ -192,8 +188,8 @@ import html2canvas from 'html2canvas'
 import jsPDF from 'jspdf'
 import jsPDF from 'jspdf'
 import * as echarts from 'echarts'
 import * as echarts from 'echarts'
 export default {
 export default {
-  name:'sceneReport',
-  data() {
+  name: 'sceneReport',
+  data () {
     return {
     return {
       tableColumnA: [
       tableColumnA: [
         {
         {
@@ -255,15 +251,43 @@ export default {
         { a: '[0,25]', b: 'D' },
         { a: '[0,25]', b: 'D' },
       ],
       ],
       info: {}, // 报告数据
       info: {}, // 报告数据
+      coverData: [],
+      exposeData: []
     }
     }
   },
   },
-  mounted() {
+  mounted () {
     const { id, projectType } = this.$route.query
     const { id, projectType } = this.$route.query
     this.getReportDetail(id, projectType)
     this.getReportDetail(id, projectType)
+    this.queryCoverOrExpose(id)
   },
   },
   methods: {
   methods: {
+    queryCoverOrExpose (id) {
+      this.$axios({
+        method: 'post',
+        url: this.$api.workManagement.queryCoverOrExpose,
+        data: {
+          id,
+        }
+      }).then(res => {
+        if (res.code == 200) {
+          // 生成 coverageRate 的数组
+          const coverageArray = (res.info || []).map(item => ({
+            scene: item.sceneBaseName,
+            ratio: item.coverageRate
+          }));
+          this.coverData = coverageArray
+
+          // 生成 exposureRate 的数组
+          const exposureArray = (res.info || []).map(item => ({
+            scene: item.sceneBaseName,
+            ratio: item.exposureRate
+          }));
+          this.exposeData = exposureArray
+        }
+      })
+    },
     // 获取报告
     // 获取报告
-    getReportDetail(id, projectType) {
+    getReportDetail (id, projectType) {
       this.$axios({
       this.$axios({
         method: 'post',
         method: 'post',
         url: this.$api.workManagement.getStandardTestReport,
         url: this.$api.workManagement.getStandardTestReport,
@@ -279,7 +303,7 @@ export default {
       })
       })
     },
     },
     // 图表初始化
     // 图表初始化
-    echartInit(info) {
+    echartInit (info) {
       const chart_complex = echarts.init(this.$refs.myChart_complex) // 复杂度分布图
       const chart_complex = echarts.init(this.$refs.myChart_complex) // 复杂度分布图
       const chart_risk = echarts.init(this.$refs.myChart_risk) // 危险度分布图
       const chart_risk = echarts.init(this.$refs.myChart_risk) // 危险度分布图
       const chart_complex_scale = echarts.init(this.$refs.myChart_complex_scale) // 算法复杂度分布
       const chart_complex_scale = echarts.init(this.$refs.myChart_complex_scale) // 算法复杂度分布
@@ -1792,7 +1816,7 @@ export default {
       })
       })
     },
     },
     // 下载报告
     // 下载报告
-    down() {
+    down () {
       const content = this.$refs.pdfContent
       const content = this.$refs.pdfContent
       html2canvas(content).then((canvas) => {
       html2canvas(content).then((canvas) => {
         var contentWidth = canvas.width
         var contentWidth = canvas.width
@@ -1841,6 +1865,7 @@ export default {
   display: flex !important;
   display: flex !important;
   flex-direction: column !important;
   flex-direction: column !important;
   align-items: center !important;
   align-items: center !important;
+
   .pdf_box {
   .pdf_box {
     box-sizing: border-box;
     box-sizing: border-box;
     width: 80%;
     width: 80%;
@@ -1849,6 +1874,7 @@ export default {
     display: flex;
     display: flex;
     flex-direction: column;
     flex-direction: column;
     align-content: center;
     align-content: center;
+
     .report_banner {
     .report_banner {
       width: 100%;
       width: 100%;
       height: 2000px;
       height: 2000px;
@@ -1858,27 +1884,32 @@ export default {
       display: flex;
       display: flex;
       flex-direction: column;
       flex-direction: column;
       align-items: center;
       align-items: center;
+
       h1 {
       h1 {
         margin-top: 350px;
         margin-top: 350px;
         font-size: 82px;
         font-size: 82px;
         font-weight: bold;
         font-weight: bold;
         color: #000;
         color: #000;
       }
       }
+
       .report_table {
       .report_table {
         margin-top: 250px;
         margin-top: 250px;
         width: 500px;
         width: 500px;
         height: auto;
         height: auto;
+
         .table_item {
         .table_item {
           width: 100%;
           width: 100%;
           height: 40px;
           height: 40px;
           border-bottom: none;
           border-bottom: none;
           display: flex;
           display: flex;
           align-items: center;
           align-items: center;
+
           p {
           p {
             width: 200px;
             width: 200px;
             text-align: center;
             text-align: center;
             font-size: 18px;
             font-size: 18px;
           }
           }
+
           span {
           span {
             width: 100%;
             width: 100%;
             text-align: left;
             text-align: left;
@@ -1887,16 +1918,19 @@ export default {
           }
           }
         }
         }
       }
       }
+
       h4 {
       h4 {
         margin-top: 100px;
         margin-top: 100px;
         font-size: 18px;
         font-size: 18px;
       }
       }
     }
     }
+
     .report_content {
     .report_content {
       box-sizing: border-box;
       box-sizing: border-box;
       padding: 0 30px;
       padding: 0 30px;
       width: 100%;
       width: 100%;
       min-height: 500px;
       min-height: 500px;
+
       h3 {
       h3 {
         margin-top: 50px;
         margin-top: 50px;
         text-align: center;
         text-align: center;
@@ -1912,11 +1946,13 @@ export default {
     color: #000;
     color: #000;
     margin: 30px 0 30px;
     margin: 30px 0 30px;
   }
   }
+
   .text {
   .text {
     font-size: 16px;
     font-size: 16px;
     text-indent: 36px;
     text-indent: 36px;
     margin-bottom: 10px;
     margin-bottom: 10px;
   }
   }
+
   .echart-box {
   .echart-box {
     width: 100%;
     width: 100%;
     min-height: 300px;
     min-height: 300px;
@@ -1925,6 +1961,7 @@ export default {
     align-items: center;
     align-items: center;
     margin-top: 30px;
     margin-top: 30px;
   }
   }
+
   .echart_desc {
   .echart_desc {
     font-size: 12px;
     font-size: 12px;
     text-align: center;
     text-align: center;