Yxgl.vue 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div id="yxgl_box">
  3. <el-menu
  4. :default-active="menuActive"
  5. class="el-menu-vertical-demo"
  6. :collapse="isCollapse"
  7. @open="handleOpen"
  8. @close="handleClose"
  9. >
  10. <el-sub-menu index="/#">
  11. <template #title>
  12. <el-icon><Platform /></el-icon>
  13. <span>运行中心</span>
  14. </template>
  15. <el-menu-item index="StatisticalAnalysis">
  16. <el-icon><Histogram /></el-icon>
  17. <template #title>统计分析</template>
  18. </el-menu-item>
  19. </el-sub-menu>
  20. <el-sub-menu index="2">
  21. <template #title>
  22. <el-icon><Tools /></el-icon>
  23. <span>管理中心</span>
  24. </template>
  25. <el-menu-item index="oauth">
  26. <el-icon><UserFilled /></el-icon>
  27. <template #title>用户权限</template>
  28. </el-menu-item>
  29. <el-menu-item index="dms">
  30. <el-icon><Ticket /></el-icon>
  31. <template #title>数据管理</template>
  32. </el-menu-item>
  33. </el-sub-menu>
  34. </el-menu>
  35. <div
  36. class="viewBox"
  37. :style="{ width: isCollapse ? 'calc(100vw - 60px)' : 'calc(100% - 200px)' }"
  38. >
  39. <StatisticalAnalysis />
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import StatisticalAnalysis from "@/views/yxgl/StatisticalAnalysis.vue";
  45. export default {
  46. name: "yxgl",
  47. data() {
  48. return {
  49. isCollapse: false,
  50. menuActive: "StatisticalAnalysis",
  51. };
  52. },
  53. // 2. 局部注册组件(键值同名可简写)
  54. components: {
  55. StatisticalAnalysis, // 完整写法:MyButton: MyButton
  56. },
  57. mounted() {},
  58. methods: {
  59. handleOpen(key, keyPath) {
  60. console.log(key, keyPath);
  61. },
  62. handleClose(key, keyPath) {
  63. console.log(key, keyPath);
  64. },
  65. },
  66. };
  67. </script>
  68. <style lang="less" scoped>
  69. #yxgl_box {
  70. width: 100vw;
  71. height: calc(100vh - 120px);
  72. margin: 0;
  73. display: flex;
  74. overflow: hidden;
  75. }
  76. .el-menu-vertical-demo:not(.el-menu--collapse) {
  77. width: 200px;
  78. height: calc(100vh - 120px);
  79. margin: 0;
  80. // background: #08224a;
  81. }
  82. .viewBox {
  83. width: calc(100vw - 200px);
  84. margin: 0;
  85. height: calc(100vh - 120px);
  86. position: relative;
  87. overflow: hidden;
  88. overflow-y: auto;
  89. background-color: #eee;
  90. }
  91. </style>