Health4.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <template>
  2. <div class="wind-site">
  3. <div class="page-common-body">
  4. <div class="page-common-body-router">
  5. <router-view />
  6. </div>
  7. <div class="page-common-body-menu">
  8. <div class="page-common-body-menu-box">
  9. <div class="page-common-body-menu-border left top"></div>
  10. <div class="page-common-body-menu-border left bottom"></div>
  11. <div class="page-common-body-menu-border right top"></div>
  12. <div class="page-common-body-menu-border right bottom"></div>
  13. <div
  14. class="page-common-body-menu-item"
  15. v-for="(menuData, index) of menuDatas"
  16. :key="index"
  17. @click="clickMenu(index)"
  18. :class="{ active: activeIndex == index }"
  19. >
  20. <router-link :to="menuData.path">
  21. <span
  22. class="svg-icon"
  23. :class="
  24. activeIndex == index ? 'svg-icon-yellow' : 'svg-icon-green'
  25. "
  26. >
  27. <SvgIcon :svgid="menuData.icon"></SvgIcon>
  28. </span>
  29. </router-link>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  38. export default {
  39. setup() {},
  40. components: { SvgIcon },
  41. data() {
  42. return {
  43. activeIndex: 0,
  44. wpId: "",
  45. wtId: "",
  46. menuDatas: [
  47. {
  48. icon: "svg-q实时监视",
  49. path: "/health/health0",
  50. text: "风机实时监视",
  51. },
  52. {
  53. icon: "svg-q健康",
  54. path: "/health/health10",
  55. text: "风机健康总览",
  56. },
  57. {
  58. icon: "svg-q趋势",
  59. path: "/health/health4/healthLineChart2",
  60. text: "风机健康趋势",
  61. },
  62. {
  63. icon: "svg-q曲线",
  64. path: "/health/health4/healthLineChart",
  65. text: "风机健康曲线",
  66. },
  67. ],
  68. };
  69. },
  70. created() {
  71. this.wtId = this.$route.params.wtId;
  72. this.wpId = this.$route.params.wpId;
  73. this.menuDatas.forEach((ele) => {
  74. ele.path += "/" + this.wpId + "/" + this.wtId;
  75. });
  76. },
  77. methods: {
  78. clickMenu(index) {
  79. this.activeIndex = index;
  80. this.$store.dispatch("changeModuleName", this.menuDatas[index].text);
  81. },
  82. },
  83. };
  84. </script>
  85. <style lang="less" scoped>
  86. .wind-site {
  87. .page-common-body {
  88. display: flex;
  89. flex-direction: row;
  90. margin-top: 0.741vh;
  91. .page-common-body-router {
  92. overflow: auto;
  93. overflow-x: hidden;
  94. height: calc(100vh - 7.037vh);
  95. flex: 1 1 auto;
  96. }
  97. .page-common-body-menu {
  98. width: 7.407vh;
  99. padding: 0 1.481vh 1.481vh 1.481vh;
  100. .page-common-body-menu-box {
  101. border: 0.093vh solid @darkgray;
  102. background-color: fade(@darkgray, 30%);
  103. padding: 2.222vh 0.185vh;
  104. position: relative;
  105. .page-common-body-menu-border {
  106. position: absolute;
  107. width: 0.37vh;
  108. height: 0.37vh;
  109. background-color: @write;
  110. border-radius: 50%;
  111. &.left {
  112. left: -0.185vh;
  113. }
  114. &.right {
  115. right: -0.185vh;
  116. }
  117. &.top {
  118. top: -0.185vh;
  119. }
  120. &.bottom {
  121. bottom: -0.185vh;
  122. }
  123. }
  124. .page-common-body-menu-item {
  125. border: 0.093vh solid fade(@green, 40%);
  126. width: 3.889vh;
  127. height: 3.889vh;
  128. border-radius: 0.278vh;
  129. margin-top: 0.741vh;
  130. display: flex;
  131. align-items: center;
  132. justify-content: center;
  133. cursor: pointer;
  134. a {
  135. line-height: 0;
  136. }
  137. &:first-child {
  138. margin-top: 0;
  139. }
  140. &.active {
  141. border-color: fade(@yellow, 40%);
  142. position: relative;
  143. &::after {
  144. content: "";
  145. width: calc(100% - 0.37vh);
  146. height: calc(100% - 0.37vh);
  147. position: absolute;
  148. border: 0.093vh solid @yellow;
  149. box-shadow: 0 0 0.37vh @yellow;
  150. top: 0.093vh;
  151. left: 0.093vh;
  152. }
  153. }
  154. }
  155. }
  156. }
  157. }
  158. }
  159. </style>