Index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <el-container style="height: 100%">
  3. <el-header class="header" v-show="flag">
  4. <div class="logInfo">
  5. <img :src="'api' + logo" alt="" />
  6. <h3>{{ header }}</h3>
  7. </div>
  8. <div class="sysName">
  9. <h2>可视农业应用系统 实时监测基地生产环境</h2>
  10. <p>
  11. The visual agricultural application system monitors the production
  12. environment of the base in real time
  13. </p>
  14. </div>
  15. <span class="header_btn" @click="hCheckFun">[隐藏]</span>
  16. </el-header>
  17. <el-header class="header2" v-show="!flag">
  18. <h3>可视农业应用系统</h3>
  19. <span class="header_btn" @click="hCheckFun">[展开]</span>
  20. </el-header>
  21. <el-container style="overflow: auto">
  22. <el-aside width="200px">
  23. <el-menu
  24. :default-active="$route.path"
  25. :collapse-transition="false"
  26. class="el-menu-vertical-demo"
  27. :router="isRouter"
  28. active-text-color="rgb(57, 249, 190)"
  29. >
  30. <el-menu-item index="/index/list1">
  31. <i :class="iconObj[22]"></i>
  32. <span slot="title">设备列表</span>
  33. </el-menu-item>
  34. <el-menu-item index="/index/monitor1">
  35. <i :class="iconObj[20]"></i>
  36. <span slot="title">可视农业应用系统</span>
  37. </el-menu-item>
  38. </el-menu>
  39. </el-aside>
  40. <el-main>
  41. <router-view></router-view>
  42. </el-main>
  43. </el-container>
  44. </el-container>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. isRouter: true,
  51. iconObj: {
  52. 20: "iconfont icon-jiankong",
  53. 22: "iconfont icon-shebei",
  54. },
  55. flag: true,
  56. header: "",
  57. logo: "",
  58. active: 1,
  59. };
  60. },
  61. created: function () {
  62. this.getUserInfo();
  63. },
  64. computed: {},
  65. mounted() {},
  66. methods: {
  67. getUserInfo() {
  68. this.$axios({
  69. method: "POST",
  70. url: "logoheader",
  71. }).then((res) => {
  72. this.header = res.data.header;
  73. this.logo = res.data.logo;
  74. });
  75. },
  76. hCheckFun() {
  77. this.flag = !this.flag;
  78. },
  79. },
  80. };
  81. </script>
  82. <style scoped lang="less">
  83. .header {
  84. position: relative;
  85. width: 100%;
  86. height: 177px !important;
  87. border-bottom: 2px solid #272b3a;
  88. background: #272b3a no-repeat center / 100% 100%
  89. url(../assets/images/monitor/h_bg.jpg);
  90. .sysName {
  91. color: #fff;
  92. text-align: center;
  93. h2 {
  94. font-size: 20px;
  95. }
  96. p {
  97. font-size: 14px;
  98. }
  99. margin-top: 50px;
  100. }
  101. .logInfo {
  102. color: #fff;
  103. position: absolute;
  104. top: 10px;
  105. left: 20px;
  106. display: flex;
  107. flex-direction: row;
  108. align-items: center;
  109. img {
  110. width: auto;
  111. height: 40px;
  112. }
  113. h3 {
  114. margin: 0;
  115. margin-left: 20px;
  116. }
  117. }
  118. }
  119. .header2 {
  120. border-bottom: 2px solid #272b3a;
  121. position: relative;
  122. background-color: #323749;
  123. color: #fff;
  124. }
  125. .header_btn {
  126. position: absolute;
  127. color: #727272;
  128. font-size: 14px;
  129. right: 20px;
  130. bottom: 10px;
  131. cursor: pointer;
  132. }
  133. .header_btn:hover {
  134. color: #fff;
  135. }
  136. .el-aside {
  137. background: #474e60;
  138. .el-menu {
  139. background: #232735;
  140. .el-menu-item {
  141. color: #909399;
  142. }
  143. .is-active{
  144. background-color: rgba(45, 111, 102, 0.4);
  145. }
  146. .el-menu-item:focus,
  147. .el-menu-item:hover {
  148. color: #39f9be;
  149. background-color: rgba(45, 111, 102, 0.4);
  150. i{color: #39f9be;}
  151. }
  152. }
  153. }
  154. .el-main {
  155. padding: 0;
  156. background-color: #f6f6f6;
  157. }
  158. </style>