소스 검색

merge:多模式仿真地图上传代码合并

linchengzhe 1 년 전
부모
커밋
7dbe8d920e

+ 4 - 2
src/api/index.js

@@ -7,7 +7,8 @@ import modelLibrary from './modelLibrary.js' // 模型库
 import algorithmsLibrary from './algorithmsLibrary.js' // 算法库
 import mainPage from './mainPage.js' // 首页
 import systemManagement from "./systemManagement.js"; //系统管理
-import userInfo from "./userInfo.js";
+import userInfo from "./userInfo.js"; 
+import multimode  from "./multimode.js"; // 多模式仿真
 
 const api = {
     common,
@@ -17,7 +18,8 @@ const api = {
     algorithmsLibrary,
     mainPage,
     systemManagement,
-    userInfo
+    userInfo,
+    multimode
 }
 
 export default api;

+ 21 - 0
src/api/multimode.js

@@ -0,0 +1,21 @@
+const basePart = '/simulation/resource/server';
+
+
+
+export default{
+  queryMulationList: basePart+'/simulationProject/selectMultiSimulationProject', // 获取仿真任务列表
+  deleteMulationById:basePart + '/simulationProject/deleteMultiSimulationProject', // 删除仿真任务
+  updateMulationStatus:basePart + '/simulationProject/updateMultiSimulationProjectStatus', // 更新任务状态
+  queryMulationDetailById: basePart + '/simulationProject/getMultiSimulationProjectDetail', // 获取仿真任务详情 
+  queryMulationSceneList :basePart + '/simulationProject/selectMultiSimulationSceneList', // 任务场景列表
+  viewMulationSceneResult: basePart +'/simulationProject/viewMultiSimulationProjectResult', // 查看场景评价结果
+  createMulationTask:basePart + '/simulationProject/addMultiSimulationProject', // 创建仿真任务
+  addMulationSceneList:basePart + '/simulationProject/addMultiSimulationScene', // 添加仿真场景列表数据
+  deleteMulationScene :basePart + '/simulationProject/deleteMultiSimulationScene', // 删除多模式场景
+  saveMulationTask : basePart + '/simulationProject/submitMultiSimulationProjectDetail', // 提交多模式任务
+  queryMulationMapList:basePart + '/simulationMap/selectSimulationMapList', // 地图上传列表
+  addMulationMap : basePart + '/simulationMap/uploadSimulationMap', //新增多模式仿真地图
+  queryMapDetailByID: basePart + '/simulationMap/getSimulationMap', // 获取地图详情
+  updateMapDetail:basePart + '/simulationMap/updateSimulationMap', // 更新地图信息
+  deleteMapById:basePart + '/simulationMap/deleteSimulationMap', // 删除地图列表
+}

+ 10 - 0
src/router/multimodeSimulation.js

@@ -30,4 +30,14 @@ export default [
         },
         component: () => import("@/views/multimodeSimulation/evaluationResults.vue"),
     },
+    {
+        path: "/simulationMap",
+        name: "simulationMap",
+        meta: {
+            tabname: "地图上传",
+            menuKind: "simulationMap",
+            login: true
+        },
+        component: () => import("@/views/multimodeSimulation/simulationMap.vue"),
+    },
 ]

+ 54 - 39
src/views/multimodeSimulation/evaluationResults.vue

@@ -36,14 +36,13 @@
         margin-top: 30px;
       "
     >
-      在本次场景中,共发生X次碰撞/未发生碰撞,X次异常停车/未发生异常停车,冲出车道X次。
+      {{ describe }}
     </p>
     <tableList
       ref="table"
       style="margin: 30px 30px"
       :columns="columns"
       :getDataWay="getDataWay"
-      :pagination="pagination"
       index
     >
       <el-table-column label="操作" slot="cgInfos" align="center" width="180">
@@ -84,14 +83,16 @@
         </el-option>
       </el-select>
     </div>
-    <div style="width: 100%; height: 500px; border: 2px dashed #ccc;padding: 10px;" >
+    <div
+      style="width: 100%; height: 500px; border: 2px dashed #ccc; padding: 10px"
+    >
       <video
         ref="videoPlayer"
         controls
-        style="width: 100%; height: 100%;"
+        style="width: 100%; height: 100%"
         :controls="true"
       >
-        <source src="https://media.w3.org/2010/05/sintel/trailer.mp4" type="video/mp4" />
+        <source :src="videoList[viewKey]" type="video/mp4" />
         您的浏览器不支持视频标签。
       </video>
     </div>
@@ -109,60 +110,74 @@ export default {
       viewKey: '1',
       viewOptions: [
         {
-          value: '1',
+          value: '0',
           label: '总视角',
         },
         {
-          value: '2',
-          label: '车辆A',
-        },
-        {
-          value: '3',
-          label: '车辆B',
+          value: '1',
+          label: '多仿真视角',
         },
       ],
+      videoList: [], // 视频地址列表
+      describe: '', // 评价描述
       columns: [
         {
           label: '事故类型',
           prop: 'type',
         },
         {
-          label: '发生时间',
-          prop: 'time',
+          label: '状态',
+          prop: 'status',
         },
       ],
-      pagination: {
-        //分页使用
-        currentPage: 1,
-        pageSize: 10,
-        position: 'right',
-        pageSizes: [10, 30, 50, 100, 200],
-        layout: 'sizes, total, prev, pager, next, jumper',
-      },
       getDataWay: {
         //加载表格数据
         dataType: 'data',
         type: 'post',
         // firstRequest: false,
-        data: [
-          {
-            type: '碰撞',
-            time: '2024-01-30 16:15:43',
-          },
-          {
-            type: '异常停车',
-            time: '2024-01-20 07:15:43',
-          },
-          {
-            type: '冲出车道',
-            time: '2024-01-05 11:15:43',
-          },
-        ],
-        param: {
-          share: '0',
-        },
+        data: [],
+        param: {},
       },
     }
   },
+  methods: {
+    // 获取评价信息
+    getMulationSceneResult(id) {
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.viewMulationSceneResult,
+        data: {
+          sceneId: id,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.describe = res.info.phrases
+          this.getDataWay.data = [
+            {
+              type: '碰撞',
+              status: res.info.collisionDetail[0].abnormalTimeDescription,
+            },
+            {
+              type: '异常停车',
+              status: res.info.abnormalParkingDetail[0].abnormalTimeDescription,
+            },
+            {
+              type: '冲出车道',
+              status: res.info.outOfPavementDetail[0].abnormalTimeDescription,
+            },
+          ]
+          this.videoList = [
+            res.info.projectResultOverallUrl,
+            res.info.projectResultSimulationUrl,
+          ]
+        } else {
+          this.$message.error(res.message || '查询信息失败')
+        }
+      })
+    },
+  },
+  mounted() {
+    this.$route.query.id && this.getMulationSceneResult(this.$route.query.id)
+  },
 }
 </script>

+ 164 - 45
src/views/multimodeSimulation/simulationEdit.vue

@@ -69,7 +69,7 @@
     </p>
     <div style="display: flex; justify-content: end; margin: 20px 50px">
       <el-button
-        v-if="isEdit"
+        v-if="configBtnShow"
         class="addBtn"
         icon="el-icon-circle-plus-outline"
         @click="addConfig"
@@ -77,7 +77,7 @@
         >添加</el-button
       >
       <el-button
-        v-if="isEdit"
+        v-if="configBtnShow"
         class="addBtn"
         icon="el-icon-circle-plus-outline"
         @click="copyConfig"
@@ -86,6 +86,7 @@
       >
     </div>
     <tableList
+      v-if="tableShow"
       ref="table"
       style="margin: 0 30px 30px"
       :columns="columns"
@@ -95,12 +96,23 @@
     >
       <el-table-column label="操作" slot="cgInfos" align="center" width="180">
         <template v-slot="scope">
-          <span v-if="!isEdit" @click="toEvaluate" class="elIcon"> 评价结果 </span>
-          <span v-if="isEdit" @click="navigatorEdit" class="elIcon"> 编辑 </span>
-          <span v-if="isEdit" @click="" class="elIcon"> 删除 </span>
+          <span v-if="!isEdit" @click="toEvaluate(scope.row)" class="elIcon">
+            评价结果
+          </span>
+          <span v-if="isEdit" @click="navigatorEdit(scope.row.id)" class="elIcon">
+            编辑
+          </span>
+          <span v-if="isEdit" @click="deleteScene(scope.row.id)" class="elIcon">
+            删除
+          </span>
         </template>
       </el-table-column>
     </tableList>
+    <div style="display: flex; justify-content: center; margin-top: 30px">
+      <el-button type="primary" @click="createTask">保存</el-button>
+      <el-button type="primary" @click="saveTask">提交</el-button>
+      <el-button @click="cancelHandle">取消</el-button>
+    </div>
   </div>
 </template>
 
@@ -114,23 +126,26 @@ export default {
   data() {
     return {
       isEdit: true, // 模式, 默认编辑模式 false 预览
+      tableShow: false, // 是否显示表格,新增默认不显示
+      configBtnShow: false,
+      projectId: '', // 仿真任务id
       baseInfo: {
         projectName: '', // 项目名称
-        projectMaxSeconds: 0, // 最大仿真时间
+        projectMaxSeconds: '', // 最大仿真时间
         projectDescription: '', // 项目描述
       },
       columns: [
         {
           label: '地图文件',
-          prop: 'id',
+          prop: 'mapName',
         },
         {
           label: '车辆数量',
-          prop: 'projectName',
+          prop: 'carNums',
         },
         {
           label: '创建时间',
-          prop: 'sceneNums',
+          prop: 'createTime',
         },
         {
           label: '操作',
@@ -148,56 +163,160 @@ export default {
       },
       getDataWay: {
         //加载表格数据
-        dataType: 'data',
+        dataType: 'url',
         type: 'post',
-        // firstRequest: false,
-        data: [
-          {
-            id: 'd1245825a1aa5a6',
-            projectKey: '20240130-1',
-            projectName: '1007',
-            projectStatus: 0,
-            projectStatusValue: '未开始',
-            createTime: '2024-01-30 16:15:43',
-            sceneNums: 1,
-          },
-          {
-            id: 'd4582d2a6',
-            projectKey: '20240130-1',
-            projectName: '1007',
-            projectStatus: 1,
-            projectStatusValue: '已结束',
-            createTime: '2024-01-30 16:15:43',
-            sceneNums: 1,
-          },
-        ],
+        data: this.$api.multimode.queryMulationSceneList,
         param: {
-          share: '0',
+          projectId: this.$route.query.id || '',
         },
       },
     }
   },
   mounted() {
-    console.log('加桌', this.$route.query.mode)
-    this.isEdit = this.$route.query.mode == 'edit' ? true : false
+    this.isEdit = ['edit', 'add'].includes(this.$route.query.mode)
+      ? true
+      : false
+    this.configBtnShow = this.$route.query.mode == 'edit' ? true : false
+    if (['edit', 'preview'].includes(this.$route.query.mode)) {
+      this.tableShow = true
+    }
+    if (this.$route.query.id) {
+      this.projectId = this.$route.query.id
+      this.getTaskDetailById(this.$route.query.id)
+    }
   },
   methods: {
+    // 获取任务详情信息
+    getTaskDetailById(id) {
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.queryMulationDetailById,
+        data: {
+          projectId: id,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.baseInfo = {
+            projectName: res.info.projectName, // 项目名称
+            projectMaxSeconds: res.info.projectMaxSeconds, // 最大仿真时间
+            projectDescription: res.info.projectDescription, // 项目描述
+          }
+        } else {
+          this.$message.error(res.message || '查询信息失败')
+        }
+      })
+    },
+    deleteScene(id) {
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.deleteMulationScene,
+        data: {
+          sceneId: id,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.refreshList({ projectId: this.projectId })
+          this.$message.success('删除成功')
+        } else {
+          this.$message.error(res.message || '删除失败')
+        }
+      })
+    },
+    // 提交
+    saveTask() {
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.saveMulationTask,
+        data: {
+          projectId: this.projectId,
+          projectName: this.baseInfo.projectName,
+          projectMaxSeconds: this.baseInfo.projectMaxSeconds,
+          projectDescription: this.baseInfo.projectDescription,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('提交成功')
+          this.$router.push({
+            path:'/multimodeSimulation'
+          })
+        } else {
+          this.$message.error(res.message || '提交失败')
+        }
+      })
+    },
+    // 刷新场景列表
+    refreshList(param) {
+      param
+        ? this.$refs['table'].loadData(param)
+        : this.$refs['table'].loadData()
+    },
     copyConfig() {},
-    addConfig() {},
-    toEvaluate(){
+    // 新增场景列表
+    addConfig() {
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.addMulationSceneList,
+        data: {
+          projectId: this.projectId,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('添加成功')
+          this.refreshList({ projectId: this.projectId })
+        } else {
+          this.$message.error(res.message || '添加失败')
+        }
+      })
+    },
+    // 创建仿真任务
+    createTask() {
+      if (
+        this.baseInfo.projectName &&
+        this.baseInfo.projectMaxSeconds &&
+        this.baseInfo.projectDescription
+      ) {
+        this.$axios({
+          method: 'post',
+          url: this.$api.multimode.createMulationTask,
+          data: {
+            projectName: this.baseInfo.projectName,
+            projectMaxSeconds: this.baseInfo.projectMaxSeconds,
+            projectDescription: this.baseInfo.projectDescription,
+          },
+        }).then((res) => {
+          if (res.code == 200) {
+            this.$message.success('仿真任务创建成功')
+            this.getDataWay.param.projectId = res.info.projectId
+            this.projectId = res.info.projectId
+            this.isEdit = false
+            this.configBtnShow = true
+            this.tableShow = true
+          } else {
+            this.$message.error(res.message || '查询信息失败')
+          }
+        })
+      } else {
+        this.$message.warning('请填写完整信息后再保存')
+      }
+    },
+    cancelHandle() {
+      this.$router.back()
+    },
+    // 跳转场景评价
+    toEvaluate(row) {
       this.$router.push({
         path: '/evaluationResults',
+        query: { id: row.id },
+      })
+    },
+    navigatorEdit(id) {
+      this.$router.push({
+        name: 'multimodeSimulationEdit',
+        query: {
+          sceneId: id,
+        },
       })
     },
-	navigatorEdit(){
-		this.$router.push({
-			name: 'multimodeSimulationEdit',
-			query: {
-				sceneId: 'b1e8fb96cf8a41d9a0364d29a9289628'
-			}
-			
-		})
-	}
   },
 }
 </script>

+ 108 - 41
src/views/multimodeSimulation/simulationHome.vue

@@ -9,7 +9,6 @@
           clearable
           placeholder="请输入"
           maxlength="60"
-          @keyup.enter.native="doSearch"
         >
         </el-input>
       </template>
@@ -21,11 +20,10 @@
           clearable
           placeholder="请输入"
           maxlength="60"
-          @keyup.enter.native="doSearch"
         >
         </el-input>
       </template>
-      <template slot="searchItem1">
+      <template slot="searchItem4">
         <span class="label">项目进度</span>
         <el-select
           v-model="searchParams.projectStatus"
@@ -33,20 +31,35 @@
           clearable
           placeholder="请输入"
           maxlength="60"
-          @keyup.enter.native="doSearch"
         >
-          <el-optopn></el-optopn>
+          <el-option
+            v-for="(item, idx) in [
+              { label: '未开始', value: '0' },
+              { label: '运行中', value: '1' },
+              { label: '已终止', value: '2' },
+              { label: '已完成', value: '3' },
+            ]"
+            :label="item.label"
+            :value="item.value"
+            :key="idx"
+          ></el-option>
         </el-select>
       </template>
       <template slot="searchBtn1">
         <el-button type="primary" @click="doSearch">查询</el-button>
       </template>
       <template slot="searchBtn2">
-        <el-button type="primary" @click="doReset">重置</el-button>
+        <!-- <el-button type="primary" @click="doReset">重置</el-button> -->
       </template>
     </search-layout>
     <div></div>
     <div style="display: flex; justify-content: end; margin: 20px 50px">
+      <el-button
+        class="addBtn"
+        icon="el-icon-circle-plus-outline"
+        @click="mapConfig"
+        type="primary"
+        >地图管理</el-button>
       <el-button
         class="addBtn"
         icon="el-icon-circle-plus-outline"
@@ -67,16 +80,38 @@
         <template v-slot="scope">
           <!-- <span v-if="scope.row.projectStatus==1" @click="" class="elIcon"> 查看 </span> -->
           <span
-            v-if="scope.row.projectStatus == '1'"
-            @click="jumpDetailPage('preview')"
+            v-if="scope.row.projectStatus == '3'"
+            @click="jumpDetailPage('preview',scope.row.id)"
             class="elIcon"
           >
             查看
           </span>
-          <span v-else @click="jumpDetailPage('edit')" class="elIcon">
+          <span
+            v-if="scope.row.projectStatus == '0'"
+            @click="jumpDetailPage('edit',scope.row.id)"
+            class="elIcon"
+          >
             编辑
           </span>
-          <span @click="" class="elIcon"> 删除 </span>
+          <span v-if="scope.row.projectStatus == '3'" class="elIcon">
+             下载
+          </span>
+          <span @click="deleteById(scope.row)" class="elIcon"> 删除 </span>
+          <span
+            v-if="scope.row.projectStatus == '2'"
+            @click="updateTask(scope.row)"
+            class="elIcon"
+          >
+            终止
+          </span>
+
+          <span
+            v-if="scope.row.projectStatus == '0'"
+            @click="updateTask(scope.row)"
+            class="elIcon"
+          >
+            运行
+          </span>
         </template>
       </el-table-column>
     </tableList>
@@ -87,7 +122,7 @@ import searchLayout from '@/components/grid/searchLayout'
 import tableList from '@/components/grid/TableList'
 import { mapState } from 'vuex'
 export default {
-  name: 'simulationHome', // 多模式仿真 
+  name: 'simulationHome', // 多模式仿真
   components: { searchLayout, tableList },
   data() {
     return {
@@ -134,48 +169,80 @@ export default {
       },
       getDataWay: {
         //加载表格数据
-        dataType: 'data',
+        dataType: 'url',
         type: 'post',
-        // firstRequest: false,
-        data: [
-          {
-            id: 'd1245825a1aa5a6',
-            projectKey: '20240130-1',
-            projectName: '1007',
-            projectStatus: 0,
-            projectStatusValue: '未开始',
-            createTime: '2024-01-30 16:15:43',
-            sceneNums: 1,
-          },
-          {
-            id: 'd4582d2a6',
-            projectKey: '20240130-1',
-            projectName: '1007',
-            projectStatus: 1,
-            projectStatusValue: '已结束',
-            createTime: '2024-01-30 16:15:43',
-            sceneNums: 1,
-          },
-        ],
-        param: {
-          share: '0',
-        },
+        data: this.$api.multimode.queryMulationList,
+        param: {},
       },
     }
   },
   methods: {
-    doSearch() {},
-    doReset() {},
+    refreshList(param) {
+      param
+        ? this.$refs['table'].loadData(param)
+        : this.$refs['table'].loadData()
+    },
+    doSearch() {
+      this.refreshList({ ...this.searchParams })
+    },
+    doReset() {
+      this.searchParams = {
+        projectId: '', // 项目id
+        projectName: '', // 项目名称
+        projectStatus: '', // 项目进度
+      }
+      this.refreshList()
+    },
+    // 仿真任务状态更新
+    updateTask(row) {
+      const { id, projectStatus } = row
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.updateMulationStatus,
+        data: {
+          projectId: id,
+          projectStatus: projectStatus == 0 || 2 ? 1 : 2,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('状态更新成功')
+          this.doSearch()
+        } else {
+          this.$message.error(res.message || '更新失败')
+        }
+      })
+    },
+    // 删除仿真列表
+    deleteById(row) {
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.deleteMulationById,
+        data: { projectId: row.id },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('删除成功')
+          this.doSearch()
+        } else {
+          this.$message.error(res.message || '删除失败')
+        }
+      })
+    },
     addConfig() {
       this.$router.push({
         path: '/simulationEdit',
-        query: {mode:'edit'},
+        query: { mode: 'add' },
+      })
+    },
+    // 跳转地图管理
+    mapConfig(){
+      this.$router.push({
+        path: '/simulationMap',
       })
     },
-    jumpDetailPage(mode) {
+    jumpDetailPage(mode,id) {
       this.$router.push({
         path: '/simulationEdit',
-        query: {mode},
+        query: { mode,id },
       })
     },
   },

+ 358 - 0
src/views/multimodeSimulation/simulationMap.vue

@@ -0,0 +1,358 @@
+<template>
+  <div class="multimodeSimulation">
+    <search-layout :needBox="true">
+      <template slot="searchItem1">
+        <span class="label">地图名称</span>
+        <el-input
+          v-model="searchParams.mapName"
+          size="small"
+          clearable
+          placeholder="请输入"
+          maxlength="60"
+        >
+        </el-input>
+      </template>
+      <template slot="searchItem1">
+        <span class="label">地图描述</span>
+        <el-input
+          v-model="searchParams.mapDescription"
+          size="small"
+          clearable
+          placeholder="请输入"
+          maxlength="60"
+        >
+        </el-input>
+      </template>
+      <template slot="searchBtn1">
+        <el-button type="primary" @click="doSearch">查询</el-button>
+      </template>
+    </search-layout>
+    <div></div>
+    <div style="display: flex; justify-content: end; margin: 20px 50px">
+      <el-button
+        class="addBtn"
+        icon="el-icon-circle-plus-outline"
+        @click="addConfig"
+        type="primary"
+        >新增</el-button
+      >
+    </div>
+    <tableList
+      ref="table"
+      style="margin: 0 30px 30px"
+      :columns="mapColumns"
+      :getDataWay="getDataWay"
+      :pagination="pagination"
+      index
+    >
+      <el-table-column label="操作" slot="cgInfos" align="center" width="180">
+        <template v-slot="scope">
+          <span @click="editMapDetail(scope.row)" class="elIcon"> 编辑 </span>
+          <span @click="deleteMapById(scope.row)" class="elIcon"> 删除 </span>
+        </template>
+      </el-table-column>
+    </tableList>
+    <el-dialog
+      :title="isEdit ? '编辑地图' : '新增地图'"
+      :visible.sync="editVisible"
+      width="480px"
+      :close-on-click-modal="false"
+      :close-on-press-escape="false"
+      @close="closeDialog"
+    >
+      <el-form
+        ref="editInfo"
+        :model="editInfo"
+        label-width="150px"
+        style="display: flex; flex-wrap: wrap; justify-content: space-between"
+      >
+        <el-form-item label="地图名称">
+          <el-input
+            v-model="editInfo.mapName"
+            placeholder="请输入"
+            :disabled="isEdit"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="轨迹数量">
+          <el-input v-model="editInfo.pathNum" placeholder="请输入"></el-input>
+        </el-form-item>
+        <el-form-item label="地图描述">
+          <el-input
+            v-model="editInfo.mapDescription"
+            placeholder="请输入"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="OpenDrive文件" v-if="!isEdit">
+          <el-upload
+            :multiple="false"
+            action=""
+            class="upload-demo"
+            list-type="card"
+            :file-list="openFile"
+            :http-request="(e) => uploadHandle('opendrive', e)"
+            :on-remove="() => fileRemove('opendrive')"
+          >
+            <el-button size="small" type="primary">点击上传</el-button>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="Json文件" v-if="!isEdit">
+          <el-upload
+            :multiple="false"
+            action=""
+            class="upload-demo"
+            list-type="card"
+            :file-list="jsonFile"
+            :http-request="(e) => uploadHandle('json', e)"
+            :on-remove="() => fileRemove('json')"
+          >
+            <el-button size="small" type="primary">点击上传</el-button>
+          </el-upload>
+        </el-form-item>
+        <el-form-item label="Osgb文件" v-if="!isEdit">
+          <el-upload
+            :multiple="false"
+            action=""
+            class="upload-demo"
+            list-type="card"
+            :file-list="osgbFile"
+            :http-request="(e) => uploadHandle('osgb', e)"
+            :on-remove="() => fileRemove('osgb')"
+          >
+            <el-button size="small" type="primary">点击上传</el-button>
+          </el-upload>
+        </el-form-item>
+      </el-form>
+      <div style="width: 100%; display: flex; justify-content: center">
+        <el-button @click="closeDialog">取消</el-button>
+        <el-button @click="addMulationMap" type="primary">确认</el-button>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import searchLayout from '@/components/grid/searchLayout'
+import tableList from '@/components/grid/TableList'
+export default {
+  name: 'simulationHome', // 多模式仿真
+  components: { searchLayout, tableList },
+  data() {
+    return {
+      searchParams: {
+        mapName: '', // 地图名称
+        mapDescription: '', // 地图描述
+      },
+      selectMapId: '', // 当前编辑地图id
+      editVisible: false, // 地图编辑
+      isEdit: false,
+      openFile: [], // opendrive文件
+      jsonFile: [], // json文件
+      osgbFile: [], // osgb文件
+      // 地图管理表头
+      mapColumns: [
+        {
+          label: '地图名称',
+          prop: 'mapName',
+        },
+        {
+          label: '轨迹数量',
+          prop: 'pathNum',
+        },
+        {
+          label: '地图描述',
+          prop: 'mapDescription',
+        },
+        {
+          label: '创建时间',
+          prop: 'createTime',
+        },
+        {
+          label: '操作',
+          prop: 'cgInfos',
+          template: true,
+        },
+      ],
+      editInfo: {
+        mapName: '',
+        mapDescription: '',
+        pathNum: '',
+      }, // 编辑数据
+      pagination: {
+        //分页使用
+        currentPage: 1,
+        pageSize: 10,
+        position: 'right',
+        pageSizes: [10, 30, 50, 100, 200],
+        layout: 'sizes, total, prev, pager, next, jumper',
+      },
+      getDataWay: {
+        //加载表格数据
+        dataType: 'url',
+        type: 'post',
+        data: this.$api.multimode.queryMulationMapList,
+        param: {},
+      },
+    }
+  },
+  methods: {
+    refreshList(param) {
+      param
+        ? this.$refs['table'].loadData(param)
+        : this.$refs['table'].loadData()
+    },
+    doSearch() {
+      this.refreshList({ ...this.searchParams })
+    },
+    doReset() {
+      this.searchParams = {
+        mapName: '', // 地图名称
+        mapDescription: '', // 地图描述
+      }
+      this.refreshList()
+    },
+    // 仿真任务状态更新
+    updateTask(row) {
+      const { id, projectStatus } = row
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.updateMulationStatus,
+        data: {
+          projectId: id,
+          projectStatus: projectStatus == 0 || 2 ? 1 : 2,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.$message.success('状态更新成功')
+          this.doSearch()
+        } else {
+          this.$message.error(res.message || '更新失败')
+        }
+      })
+    },
+    uploadHandle(type, e) {
+      switch (type) {
+        case 'opendrive':
+          this.openFile = [e.file]
+          break
+        case 'json':
+          this.jsonFile = [e.file]
+          break
+        case 'osgb':
+          this.osgbFile = [e.file]
+          break
+      }
+    },
+    // 地图编辑
+    editMapDetail(row) {
+      const { id } = row
+      this.selectMapId = id
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.queryMapDetailByID,
+        data: {
+          mapId: id,
+        },
+      }).then((res) => {
+        if (res.code == 200) {
+          this.editInfo = {
+            mapName: res.info.mapName,
+            mapDescription: res.info.mapDescription,
+            pathNum: res.info.pathNum,
+          }
+          this.editVisible = true
+          this.isEdit = true
+        } else {
+          this.$message.error(res.message || '查询详情信息失败')
+        }
+      })
+    },
+    fileRemove(type) {
+      switch (type) {
+        case 'opendrive':
+          this.openFile = []
+          break
+        case 'json':
+          this.jsonFile = []
+          break
+        case 'osgb':
+          this.osgbFile = []
+          break
+      }
+    },
+    // 更新地图
+    updateMap() {
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.updateMapDetail,
+        data: {
+          mapId: this.selectMapId,
+          path_num:this.editInfo.pathNum,
+          map_description:this.editInfo.mapDescription
+        },
+      }).then((res) => {})
+    },
+    deleteMapById(row){
+      const { id } = row
+      this.$axios({
+        method: 'post',
+        url: this.$api.multimode.deleteMapById,
+        data: {
+          mapId: id,
+        },
+      }).then((res) => {})
+    },
+    addMulationMap() {
+      if (this.isEdit) {
+        this.updateMap()
+        return
+      }
+      // addMulationMap
+      let formData = new FormData()
+      const json = JSON.stringify(this.editInfo)
+      const blob = new Blob([json], {
+        type: 'application/json',
+      })
+      formData.append('content', blob)
+      formData.append('fileJson', this.jsonFile[0])
+      formData.append('fileDriver', this.openFile[0])
+      formData.append('fileOsgb', this.osgbFile[0])
+      this.$axios({
+        method: 'post',
+        url: this.$api.sceneLibrary.queryScoringRulesInfo,
+        data: formData,
+        withCredentials: true,
+        headers: {
+          'Content-type': 'multipart/form-data',
+        },
+      }).then((res) => {
+        console.log('res', res)
+      })
+    },
+    addConfig() {
+      this.editVisible = true
+      this.isEdit = false
+    },
+    closeDialog() {
+      this.editInfo = {
+        mapName: '',
+        mapDescription: '',
+        pathNum: '',
+      }
+      this.editVisible = false
+    },
+  },
+}
+</script>
+<style lang='less' scoped>
+// @import './common/util.less';
+.naturalDrivingScenarioListPanel {
+  .inputBox {
+    .label {
+      min-width: 75px;
+    }
+  }
+
+  .btnsPanel {
+    text-align: right;
+  }
+}
+</style>