浏览代码

feat:标准化测试场景下载

linchengzhe 1 年之前
父节点
当前提交
cb03c84a73
共有 2 个文件被更改,包括 54 次插入17 次删除
  1. 19 17
      src/api/workManagement.js
  2. 35 0
      src/views/workManagement/manualRunProjectList.vue

+ 19 - 17
src/api/workManagement.js

@@ -6,7 +6,7 @@ const selectDropDownByType = basePart + '/simulationProject/selectDropDownByType
 const selectDropDownByTypeNew = basePart + '/simulationProject/selectDropDownByTypeNew'; // 标准化测试详情中的下拉列表-new
 const selectMaxParallelism = basePart + '/simulationProject/selectMaxParallelism'; // 标准化测试详情中获取人员可用并行数
 const updateProjectNowRunState = basePart + '/simulationProject/updateProjectNowRunState'; // 标准化测试详情中修改工作运行状态
- 
+
 const selectProject = basePart + '/simulationProject/selectProject'; // 标准化测试列表
 const deleteProjectByids = basePart + '/simulationProject/deleteProjectByids'; // 删除标准化测试
 const exportProjectReportAndTaskFileById = basePart + '/simulationProject/exportProjectReportAndTaskFileById'; // 导出报告和任务包
@@ -17,6 +17,7 @@ const selectProjectTaskList = basePart + '/simulationProject/selectProjectTaskLi
 const selectProjectReportById = basePart + '/simulationProject/selectProjectReportById'; // 获取标准化测试工作详情-测试报告
 const selectProjectTaskById = basePart + '/simulationProject/selectProjectTaskById'; // 获取标准化测试工作详情-任务详情
 const exportProjectReportById = basePart + '/simulationProject/exportProjectReportById'; // 获取标准化测试工作详情-下载测试报告
+const exportEvaluateReport = basePart + '/simulationProject/exportProjectEvaluationReportAndTaskFileById';
 
 const selectAutomaticProject = basePart + '/simulationProject/selectAutomaticProject'; // 自动化测试列表
 const addOrUpdateAutomaticProject = basePart + '/simulationProject/addOrUpdateAutomaticProject'; // 添加/编辑自动化测试任务
@@ -29,7 +30,7 @@ const deleteAutomaticProjectByids = basePart + '/simulationProject/deleteAutomat
 const deleteAutomaticSubProjectByIds = basePart + '/simulationProject/deleteAutomaticSubProjectByIds'; // 删除自动化测试子任务
 const updateAutoProjectNowRunState = basePart + '/simulationProject/updateAutoProjectNowRunState'; // 修改自动化测试子任务状态
 
-const getEvaluationRuleDetail = basePart +'/simulationProject/getEvaluationRuleDetail'; // 标准化测试详情展示规则
+const getEvaluationRuleDetail = basePart + '/simulationProject/getEvaluationRuleDetail'; // 标准化测试详情展示规则
 
 const querySceneEvaluationDetail = basePart + '/simulationProject/querySceneEvaluationDetail'; // 标准化场景评价列表
 const carList = basePart + '/simulationProject/selectDropDownByTypeNew'; //多模式仿真获取车辆列表
@@ -41,9 +42,9 @@ const deleteRecord = basePart + '/simulationProject/deleteMultiSimulationSceneCa
 const settingsSimulation = basePart + '/simulationProject/setMultiSimulationSceneCarView';//设置仿真视角
 const saveOrUpdateSceneCarList = basePart + '/simulationProject/addOrUpdateMultiSimulationSceneCarList';//设置仿真视角
 const getMultiSimulationSceneDetail = basePart + '/simulationProject/getMultiSimulationSceneDetail';//获取多模式仿真场景详情
-const getStandardTestReport =  basePart + '/simulationProject/getProjectReportForAllReferenceScene'; // 标准化测试报告
+const getStandardTestReport = basePart + '/simulationProject/getProjectReportForAllReferenceScene'; // 标准化测试报告
 
-const selectAllSimulationMageGroupList =  basePart + '/simulationMageGroup/selectAllSimulationMageGroupList';
+const selectAllSimulationMageGroupList = basePart + '/simulationMageGroup/selectAllSimulationMageGroupList';
 
 export default {
     addOrUpdateProject,
@@ -57,23 +58,24 @@ export default {
     deleteProjectByids,
     exportProjectReportAndTaskFileById,
     exportProjectTaskFileById,
-	
-	
-	carList,
-	mapList,
-	algorithmList,
-	mapDetails,
-	sceneCarList,
-	deleteRecord,
-	settingsSimulation,
-	saveOrUpdateSceneCarList,
-	getMultiSimulationSceneDetail,
+
+
+    carList,
+    mapList,
+    algorithmList,
+    mapDetails,
+    sceneCarList,
+    deleteRecord,
+    settingsSimulation,
+    saveOrUpdateSceneCarList,
+    getMultiSimulationSceneDetail,
 
     selectProjectDetailsById,
     selectProjectTaskList,
     selectProjectReportById,
     selectProjectTaskById,
     exportProjectReportById,
+    exportEvaluateReport,
 
     selectAutomaticProject,
     addOrUpdateAutomaticProject,
@@ -88,6 +90,6 @@ export default {
     getEvaluationRuleDetail,
     querySceneEvaluationDetail,
     getStandardTestReport,
-	
-	selectAllSimulationMageGroupList
+
+    selectAllSimulationMageGroupList
 }

+ 35 - 0
src/views/workManagement/manualRunProjectList.vue

@@ -238,6 +238,7 @@
                         ></el-checkbox>
                         <el-checkbox label="任务文件包"></el-checkbox>
                     </el-checkbox-group>
+                    <el-button icon="el-icon-download" style="margin-left: 40px;" @click="downEvaluate">场景评价</el-button>
                 </div>
                 <span slot="footer">
                     <el-button type="primary" @click="confirmDown"
@@ -394,6 +395,36 @@ export default {
         };
     },
     methods: {
+        downEvaluate(){
+          let  url = this.$api.workManagement.exportEvaluateReport;
+          let fileName = `${this.curRow.projectName || ""}-场景报告.zip`;
+          let id = this.curRow.id;
+          this.$axios({
+                method: "post",
+                url,
+                responseType: "blob",
+                data: {
+                    id,
+                    projectType: "1",
+                },
+            }).then((res) => {
+                let blob = new Blob([res]);
+                if ("download" in document.createElement("a")) {
+                    // 非IE下载
+                    let emlink = document.createElement("a");
+                    emlink.download = fileName;
+                    emlink.style.display = "none";
+                    emlink.href = URL.createObjectURL(blob);
+                    document.body.appendChild(emlink);
+                    emlink.click();
+                    URL.revokeObjectURL(emlink.href);
+                    document.body.removeChild(emlink);
+                } else {
+                    // IE下载
+                    navigator.msSaveBlob(blob, fileName);
+                }
+            });
+        },
         // 若是有鼠标、键盘等操作事件,需要给定isTimer,否则该参数为交互事件
         doSearch(isTimer = false) {
             // if (this.createDate) {
@@ -707,6 +738,10 @@ export default {
 
 .checkboxPanel {
     text-align: center;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+
 
     .labelA {
         margin-right: 60px;