QYF-GitLab1
2025-03-03 f2b450b76a1b161728c6008de07671f14631b34d
模型库菜单
3个文件已修改
1个文件已添加
78 ■■■■ 已修改文件
src/components/TreeMenu.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/index.ts 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/model/children/childrenModel01.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/model/index.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/TreeMenu.vue
@@ -27,7 +27,7 @@
</template>
<script setup lang="ts">
import { ref, watch,defineProps } from "vue";
import { ref, watch, defineProps } from "vue";
import { useRouter } from "vue-router";
import { Document, FolderOpened } from "@element-plus/icons-vue";
@@ -44,37 +44,17 @@
  children?: TreeNode[];
}
const treeData = ref<TreeNode[]>([
const modelTreeData = ref<TreeNode[]>([
  {
    label: "模型管理",
    icon: "Document",
    path: "/model",
  },
  {
    label: "可视化仿真",
    label: "型号",
    icon: "FolderOpened",
    children: [
      {
        label: "测试仿真",
        path: "/simulation-test",
        icon: "FolderOpened",
        children: [
          {
            label: "仿真详情",
            path: "/simulation-config",
            icon: "Document",
          },
          {
            label: "测试报告",
            path: "/simulation-result",
            icon: "Document",
          },
        ],
        label: "型号1",
        path: "/model/childrenModel01",
      },
      {
        label: "实时仿真",
        path: "/simulation-test",
        icon: "Document",
        label: "型号2",
      },
    ],
  },
@@ -85,7 +65,7 @@
  label: "label",
};
const filteredData = ref(treeData.value);
const filteredData = ref(modelTreeData.value);
const filterNode = (value: string, data: TreeNode) => {
  if (!value) return true;
@@ -98,11 +78,14 @@
  }
};
watch(
  () => props.menuItem,
  (value) => {
    console.log(value,'tree');
    if (value == "/" || value == "/model") {
      filteredData.value = modelTreeData.value;
    } else {
      filteredData.value = []
    }
  }
);
</script>
src/router/index.ts
@@ -10,13 +10,17 @@
    {
      path: '/model',
      name: 'model',
      component: () => import('../views/model/index.vue')
      redirect: '/model/childrenModel01',
      component: () => import('../views/model/index.vue'),
      children: [
        {
          path: '/model/childrenModel01',
          name: 'childrenModel01',
          component: () => import('../views/model/children/childrenModel01.vue')
        },
      ]
    },
    {
      path: '/kinematic',
      name: 'kinematic',
      component: () => import('../views/model/index.vue')
    },
    {
      path: '/simulation-config',
      name: 'simulationConfig',
@@ -31,7 +35,7 @@
      path: '/simulation-test',
      name: 'simulationTest',
      component: () => import('../views/simulation/test.vue')
    },
    },
    {
      path: '/system/user',
      name: 'systemUser',
src/views/model/children/childrenModel01.vue
New file
@@ -0,0 +1,14 @@
<template>
  <div class="kinematic">
    <h2>着陆器模型库</h2>
  </div>
</template>
<script setup lang="ts">
</script>
<style lang="less" scoped>
.kinematic {
  padding: 20px;
}
</style>
src/views/model/index.vue
@@ -1,6 +1,6 @@
<template>
  <div class="kinematic">
    <h2>运动学模型</h2>
    <RouterView />
  </div>
</template>
@@ -8,7 +8,4 @@
</script>
<style lang="less" scoped>
.kinematic {
  padding: 20px;
}
</style>