appCenter.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="app-center">
  3. <div class="container">
  4. <!-- 左侧导航栏 -->
  5. <div class="sidebar">
  6. <div class="sidebar-menu">
  7. <div
  8. class="menu-item"
  9. :class="{ active: menuValue === 1 }"
  10. @click="handleMenuClick(1)"
  11. >
  12. <el-icon><Menu /></el-icon>
  13. <span>应用概览</span>
  14. </div>
  15. <div
  16. class="menu-item"
  17. v-if="$getUserType() != 1"
  18. :class="{ active: menuValue === 2 }"
  19. @click="handleMenuClick(2)"
  20. >
  21. <el-icon><Grid /></el-icon>
  22. <span>应用管理</span>
  23. </div>
  24. <div
  25. class="menu-item"
  26. :class="{ active: menuValue === 3 }"
  27. @click="handleMenuClick(3)"
  28. >
  29. <el-icon><Monitor /></el-icon>
  30. <span>应用监测</span>
  31. </div>
  32. </div>
  33. </div>
  34. <!-- 右侧主内容区 -->
  35. <div class="main-content">
  36. <AppOverview v-if="menuValue === 1" />
  37. <AppManagement v-if="menuValue === 2" />
  38. <AppMonitoring v-if="menuValue === 3" />
  39. </div>
  40. </div>
  41. </div>
  42. </template>
  43. <script>
  44. import AppOverview from "@/views/yygl/overview/index.vue";
  45. import AppManagement from "@/views/yygl/manage/index.vue";
  46. import AppMonitoring from "@/views/yygl/monitor/index.vue";
  47. export default {
  48. name: "AppCenter",
  49. components: {
  50. AppOverview,
  51. AppManagement,
  52. AppMonitoring,
  53. },
  54. data() {
  55. return {
  56. userInfo: this.$store.state.userInfo,
  57. userState: this.$store.state.userState,
  58. menuValue: 1,
  59. };
  60. },
  61. methods: {
  62. handleMenuClick(value) {
  63. console.log(value);
  64. this.menuValue = value;
  65. },
  66. },
  67. };
  68. </script>
  69. <style lang="less" scoped>
  70. .app-center {
  71. width: 100%;
  72. // min-height: 100vh;
  73. height: calc(100vh - 120px);
  74. background-color: #08224a;
  75. color: #ffffff;
  76. overflow-x: hidden;
  77. }
  78. .container {
  79. display: flex;
  80. width: 100%;
  81. height: 100%;
  82. background-color: #08224a;
  83. color: #ffffff;
  84. }
  85. /* 左侧导航栏样式 */
  86. .sidebar {
  87. width: 200px;
  88. background-color: #0a2a5a;
  89. border-right: 1px solid rgba(255, 255, 255, 0.1);
  90. .sidebar-menu {
  91. padding: 20px 0;
  92. .menu-item {
  93. display: flex;
  94. align-items: center;
  95. padding: 15px 20px;
  96. cursor: pointer;
  97. transition: all 0.3s ease;
  98. color: rgba(255, 255, 255, 0.8);
  99. i {
  100. margin-right: 12px;
  101. font-size: 18px;
  102. }
  103. &:hover {
  104. background-color: rgba(24, 144, 255, 0.2);
  105. color: #ffffff;
  106. }
  107. &.active {
  108. background-color: rgba(24, 144, 255, 0.3);
  109. color: #ffffff;
  110. border-right: 3px solid #1890ff;
  111. }
  112. }
  113. }
  114. }
  115. /* 右侧主内容区 */
  116. .main-content {
  117. flex: 1;
  118. padding: 20px 30px;
  119. overflow: auto;
  120. }
  121. </style>