appCenter.vue 2.8 KB

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