Health4.vue 3.7 KB

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