Explorar el Código

feat:多模式仿真页面路由拆分

linchengzhe hace 1 año
padre
commit
2a33a33efa

+ 11 - 29
src/router/index.js

@@ -67,6 +67,17 @@ const routes = [{
       redirect: '/index',
       children: sceneLibrary,
     },
+    {
+      path: "/multimodeSimulation",
+      name: "multimodeSimulation",
+      meta: {
+        tabname: "多模式仿真",
+        login: true
+      },
+      component: () => import("@/views/multimodeSimulation/index"),
+      redirect: '/index',
+      children: multimodeSimulation,
+    },
     {
       path: "/workManagement",
       name: "workManagement",
@@ -100,35 +111,6 @@ const routes = [{
       // redirect: '/index',
       // children: personalInformation,
     },
-    {
-      path: "/test",
-      name: "multimodeSimulation",
-      meta: {
-        tabname: "多模式仿真",
-        login: true
-      },
-      component: () => import("@/views/multimodeSimulation"),
-    },
-    {
-      path: "test2",
-      name: "simulationEdit",
-      meta: {
-        tabname: "多模式仿真详情",
-        menuKind: "simulationEdit",
-        login: true
-      },
-      component: () => import("@/views/multimodeSimulation/simulationEdit.vue")
-    },
-    {
-      path: "test3",
-      name: "evaluationResults",
-      meta: {
-        tabname: "多模式仿真评价结果",
-        menuKind: "evaluationResults",
-        login: true
-      },
-      component: () => import("@/views/multimodeSimulation/evaluationResults.vue")
-    }
   ]
   // .concat([{
   //   path: "*",

+ 31 - 21
src/router/multimodeSimulation.js

@@ -1,23 +1,33 @@
 // 多模式仿真模块路由
-export default [{
-  path: "/test",
-  name: "multimodeSimulation",
-  meta: {
-      tabname: "多模式仿真",
-      menuKind: "multimodeSimulation",
-      login: true
-  },
-  component: () => import("@/views/multimodeSimulation/simulationEdit.vue"),
-  children: [{
-      path: "/test2",
-      name: "simulationEdit",
-      meta: {
-          tabname: "多模式仿真详情",
-          menuKind: "simulationEdit",
-          login: true
-      },
-      component: () => import("@/views/multimodeSimulation/simulationEdit.vue")
-  },
-  ]
-},
+export default [
+    {
+        path: "/multimodeSimulation",
+        name: "simulationHome",
+        meta: {
+            tabname: "多模式仿真",
+            menuKind: "multimodeSimulation",
+            login: true
+        },
+        component: () => import("@/views/multimodeSimulation/simulationHome.vue"),
+    },
+    {
+        path: "/simulationEdit",
+        name: "simulationEdit",
+        meta: {
+            tabname: "多模式仿真详情",
+            menuKind: "simulationEdit",
+            login: true
+        },
+        component: () => import("@/views/multimodeSimulation/simulationEdit.vue"),
+    },
+    {
+        path: "/evaluationResults",
+        name: "evaluationResults",
+        meta: {
+            tabname: "评价结果",
+            menuKind: "evaluationResults",
+            login: true
+        },
+        component: () => import("@/views/multimodeSimulation/evaluationResults.vue"),
+    },
 ]

+ 16 - 187
src/views/multimodeSimulation/index.vue

@@ -1,197 +1,26 @@
 <template>
-  <div class="multimodeSimulation">
-    <search-layout :needBox="true">
-      <template slot="searchItem1">
-        <span class="label">项目ID</span>
-        <el-input
-          v-model="searchParams.projectId"
-          size="small"
-          clearable
-          placeholder="请输入"
-          maxlength="60"
-          @keyup.enter.native="doSearch"
-        >
-        </el-input>
-      </template>
-      <template slot="searchItem1">
-        <span class="label">项目名称</span>
-        <el-input
-          v-model="searchParams.projectName"
-          size="small"
-          clearable
-          placeholder="请输入"
-          maxlength="60"
-          @keyup.enter.native="doSearch"
-        >
-        </el-input>
-      </template>
-      <template slot="searchItem1">
-        <span class="label">项目进度</span>
-        <el-select
-          v-model="searchParams.projectStatus"
-          size="small"
-          clearable
-          placeholder="请输入"
-          maxlength="60"
-          @keyup.enter.native="doSearch"
-        >
-          <el-optopn></el-optopn>
-        </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>
-      </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="simulationColumns"
-      :getDataWay="getDataWay"
-      :pagination="pagination"
-      index
-    >
-      <el-table-column label="操作" slot="cgInfos" align="center" width="180">
-        <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')"
-            class="elIcon"
-          >
-            查看
-          </span>
-          <span v-else @click="jumpDetailPage('edit')" class="elIcon">
-            编辑
-          </span>
-          <span @click="" class="elIcon"> 删除 </span>
-        </template>
-      </el-table-column>
-    </tableList>
+  <div>
+      <router-view></router-view>
   </div>
 </template>
+
 <script>
-import searchLayout from '@/components/grid/searchLayout'
-import tableList from '@/components/grid/TableList'
-import { mapState } from 'vuex'
+//import  from '';
+
 export default {
-  name: 'multimodeSimulation', // 多模式仿真
-  components: { searchLayout, tableList },
+  name: "multimodeSimulation", // 场景库
+  components: {},
   data() {
-    return {
-      searchParams: {
-        projectId: '', // 项目id
-        projectName: '', // 项目名称
-        projectStatus: '', // 项目进度
-      },
-      // 多模式仿真表头
-      simulationColumns: [
-        {
-          label: '项目ID',
-          prop: 'id',
-        },
-        {
-          label: '项目名称',
-          prop: 'projectName',
-        },
-        {
-          label: '场景数量',
-          prop: 'sceneNums',
-        },
-        {
-          label: '创建时间',
-          prop: 'createTime',
-        },
-        {
-          label: '进度',
-          prop: 'projectStatusValue',
-        },
-        {
-          label: '操作',
-          prop: 'cgInfos',
-          template: true,
-        },
-      ],
-      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: [
-          {
-            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',
-        },
-      },
-    }
+      return {};
   },
-  methods: {
-    doSearch() {},
-    doReset() {},
-    addConfig() {
-      this.$router.push({
-        path: '/test2',
-        query: {mode:'edit'},
-      })
-    },
-    jumpDetailPage(mode) {
-      this.$router.push({
-        path: '/test2',
-        query: {mode},
-      })
-    },
-  },
-}
+
+  computed: {},
+
+  methods: {},
+
+  // mounted: {},
+};
 </script>
-<style lang='less' scoped>
-// @import './common/util.less';
-.naturalDrivingScenarioListPanel {
-  .inputBox {
-    .label {
-      min-width: 75px;
-    }
-  }
 
-  .btnsPanel {
-    text-align: right;
-  }
-}
+<style lang='less' scoped>
 </style>

+ 1 - 1
src/views/multimodeSimulation/simulationEdit.vue

@@ -186,7 +186,7 @@ export default {
     addConfig() {},
     toEvaluate(){
       this.$router.push({
-        path: '/test3',
+        path: '/evaluationResults',
       })
     }
   },

+ 197 - 0
src/views/multimodeSimulation/simulationHome.vue

@@ -0,0 +1,197 @@
+<template>
+  <div class="multimodeSimulation">
+    <search-layout :needBox="true">
+      <template slot="searchItem1">
+        <span class="label">项目ID</span>
+        <el-input
+          v-model="searchParams.projectId"
+          size="small"
+          clearable
+          placeholder="请输入"
+          maxlength="60"
+          @keyup.enter.native="doSearch"
+        >
+        </el-input>
+      </template>
+      <template slot="searchItem1">
+        <span class="label">项目名称</span>
+        <el-input
+          v-model="searchParams.projectName"
+          size="small"
+          clearable
+          placeholder="请输入"
+          maxlength="60"
+          @keyup.enter.native="doSearch"
+        >
+        </el-input>
+      </template>
+      <template slot="searchItem1">
+        <span class="label">项目进度</span>
+        <el-select
+          v-model="searchParams.projectStatus"
+          size="small"
+          clearable
+          placeholder="请输入"
+          maxlength="60"
+          @keyup.enter.native="doSearch"
+        >
+          <el-optopn></el-optopn>
+        </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>
+      </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="simulationColumns"
+      :getDataWay="getDataWay"
+      :pagination="pagination"
+      index
+    >
+      <el-table-column label="操作" slot="cgInfos" align="center" width="180">
+        <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')"
+            class="elIcon"
+          >
+            查看
+          </span>
+          <span v-else @click="jumpDetailPage('edit')" class="elIcon">
+            编辑
+          </span>
+          <span @click="" class="elIcon"> 删除 </span>
+        </template>
+      </el-table-column>
+    </tableList>
+  </div>
+</template>
+<script>
+import searchLayout from '@/components/grid/searchLayout'
+import tableList from '@/components/grid/TableList'
+import { mapState } from 'vuex'
+export default {
+  name: 'simulationHome', // 多模式仿真 
+  components: { searchLayout, tableList },
+  data() {
+    return {
+      searchParams: {
+        projectId: '', // 项目id
+        projectName: '', // 项目名称
+        projectStatus: '', // 项目进度
+      },
+      // 多模式仿真表头
+      simulationColumns: [
+        {
+          label: '项目ID',
+          prop: 'id',
+        },
+        {
+          label: '项目名称',
+          prop: 'projectName',
+        },
+        {
+          label: '场景数量',
+          prop: 'sceneNums',
+        },
+        {
+          label: '创建时间',
+          prop: 'createTime',
+        },
+        {
+          label: '进度',
+          prop: 'projectStatusValue',
+        },
+        {
+          label: '操作',
+          prop: 'cgInfos',
+          template: true,
+        },
+      ],
+      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: [
+          {
+            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',
+        },
+      },
+    }
+  },
+  methods: {
+    doSearch() {},
+    doReset() {},
+    addConfig() {
+      this.$router.push({
+        path: '/simulationEdit',
+        query: {mode:'edit'},
+      })
+    },
+    jumpDetailPage(mode) {
+      this.$router.push({
+        path: '/simulationEdit',
+        query: {mode},
+      })
+    },
+  },
+}
+</script>
+<style lang='less' scoped>
+// @import './common/util.less';
+.naturalDrivingScenarioListPanel {
+  .inputBox {
+    .label {
+      min-width: 75px;
+    }
+  }
+
+  .btnsPanel {
+    text-align: right;
+  }
+}
+</style>