Framework.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="main-container">
  3. <el-container>
  4. <el-aside class="main-aside">
  5. <SideMenu @selectQueue="onSelectQueue" @selectMenu="onSelectMenu"></SideMenu>
  6. </el-aside>
  7. <el-main class="content-area">
  8. <!-- 主要内容区域 -->
  9. <router-view v-slot="{ Component }">
  10. <component :is="Component" />
  11. </router-view>
  12. </el-main>
  13. </el-container>
  14. </div>
  15. </template>
  16. <script setup lang="ts">
  17. import { onMounted, ref, watch, watchEffect } from "vue";
  18. import { useRouter, useRoute } from "vue-router";
  19. import { RouterView } from "vue-router";
  20. import SideMenu from "@/components/SideMenu.vue";
  21. import { useMenuStore } from "@/stores/menu.js";
  22. const router = useRouter();
  23. //校验注册信息
  24. const onSelectQueue = (idData: any) => {
  25. // console.log(router.getRoutes());
  26. // 跳转到队列详情页并且传递队列ID作为查询参数
  27. // 假设队列详情页的路由路径是 '/workspace/queue'
  28. // 可以使用 router.push 方法来实现路由跳转
  29. router.push({ name: 'queue', params: { id: idData.id } });
  30. };
  31. const onSelectMenu = (menuData: any) => {
  32. router.push({ name: menuData.name });
  33. // if (menuData.name == "graph") {
  34. // router.push({ name: 'graph' });
  35. // }
  36. };
  37. </script>
  38. <style scoped lang="less">
  39. .main-container {
  40. width: 100%;
  41. // height: calc(100vh - 150px);
  42. &>.el-container {
  43. // width: 100%;
  44. // height: 100%;
  45. padding: 0px;
  46. margin: 0px;
  47. min-width: 0px;
  48. }
  49. }
  50. .content-area {
  51. // height: 100px;
  52. padding: 20px;
  53. width: calc(100% - 300px);
  54. overflow: auto;
  55. }
  56. .main-aside {
  57. width: 300px;
  58. border-right: 0px solid #e4e7ed;
  59. padding: 1px;
  60. }
  61. .site_header {
  62. width: 100%;
  63. box-sizing: border-box;
  64. /* background-color: #c5c5c5; */
  65. background-color: #eef6ff;
  66. padding: 0 20px;
  67. height: 50px;
  68. /* border-bottom: 1px solid #e4e7ed; */
  69. }
  70. .knowledge-base-icon {
  71. cursor: pointer;
  72. vertical-align: middle;
  73. margin-left: 10px;
  74. }
  75. </style>