WindSite.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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. <router-link
  14. v-for="(menuData, index) of menuDatas"
  15. :key="index"
  16. :to="menuData.path"
  17. >
  18. <div
  19. class="page-common-body-menu-item"
  20. @click="clickMenu(index)"
  21. :class="{ active: activeIndex == index }"
  22. >
  23. <span
  24. class="svg-icon"
  25. :class="
  26. activeIndex == index ? 'svg-icon-yellow' : 'svg-icon-green'
  27. "
  28. >
  29. <SvgIcon :svgid="menuData.icon"></SvgIcon>
  30. </span>
  31. </div>
  32. </router-link>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </template>
  38. <script>
  39. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  40. export default {
  41. // 名称
  42. name: "WindSite",
  43. // 使用组件
  44. components: {
  45. SvgIcon,
  46. },
  47. // 数据
  48. data() {
  49. return {
  50. activeIndex: 0,
  51. menuDatas: [
  52. {
  53. icon: "svg-s场站监视",
  54. path: "/monitor/windsite/home",
  55. },
  56. {
  57. icon: "svg-s指标列表",
  58. path: "/monitor/windsite/draughtfanlist",
  59. },
  60. // {
  61. // icon: "svg-agc",
  62. // path: "/monitor/windsite/matrix",
  63. // },
  64. // {
  65. // icon: "svg-agc",
  66. // path: "/monitor/windsite/lightmatrix",
  67. // },
  68. // {
  69. // icon: "svg-intranet-involvement",
  70. // path: "/monitor/windsite/box",
  71. // },
  72. // {
  73. // icon: "svg-matrix",
  74. // path: "/monitor/windsite/info",
  75. // },
  76. {
  77. icon: "svg-s测风塔",
  78. path: "/monitor/windsite/tower",
  79. },
  80. // {
  81. // icon: "svg-easy-compass",
  82. // path: "/monitor/windsite/Inverter-Info",
  83. // },
  84. // {
  85. // icon: "svg-easy-compass",
  86. // path: "/monitor/windsite/map",
  87. // },
  88. // {
  89. // icon: "svg-easy-compass",
  90. // path: "/monitor/windsite/map1",
  91. // },
  92. {
  93. icon: "svg-matrix",
  94. path: "/monitor/windsite/matrix",
  95. },
  96. {
  97. icon: "svg-s总貌",
  98. path: "/monitor/windsite/generalappearance",
  99. },
  100. {
  101. icon: "svg-s升压站",
  102. path: "/monitor/windsite/boosterstation",
  103. },
  104. {
  105. icon: "svg-s地图",
  106. path: "/monitor/windsite/map",
  107. },
  108. ],
  109. };
  110. },
  111. // 函数
  112. methods: {
  113. clickMenu: function (index) {
  114. this.activeIndex = index;
  115. },
  116. },
  117. created() {
  118. this.menuDatas.forEach((ele) => {
  119. ele.path = ele.path + "/" + this.$route.params.wpId;
  120. });
  121. },
  122. mounted() {},
  123. watch: {
  124. $route(res) {
  125. this.menuDatas.forEach((ele) => {
  126. let tempEle = ele.path.split("/");
  127. if (
  128. tempEle[tempEle.length - 1].indexOf("FDC") !== -1 ||
  129. tempEle[tempEle.length - 1].indexOf("GDC") !== -1
  130. ) {
  131. tempEle[tempEle.length - 1] = res.params.wpId;
  132. ele.path = tempEle.toString().replace(/,/g, "/");
  133. }
  134. });
  135. },
  136. },
  137. };
  138. </script>
  139. <style lang="less" scoped>
  140. .wind-site {
  141. .page-common-body {
  142. display: flex;
  143. flex-direction: row;
  144. margin-top: 0.741vh;
  145. .page-common-body-router {
  146. overflow: auto;
  147. overflow-x: hidden;
  148. height: calc(100vh - 7.037vh);
  149. flex: 1 1 auto;
  150. }
  151. .page-common-body-menu {
  152. width: 7.407vh;
  153. padding: 0 1.481vh 1.481vh 1.481vh;
  154. .page-common-body-menu-box {
  155. border: 0.093vh solid @darkgray;
  156. background-color: fade(@darkgray, 30%);
  157. padding: 2.222vh 0.185vh;
  158. position: relative;
  159. .page-common-body-menu-border {
  160. position: absolute;
  161. width: 0.37vh;
  162. height: 0.37vh;
  163. background-color: @write;
  164. border-radius: 50%;
  165. &.left {
  166. left: -0.185vh;
  167. }
  168. &.right {
  169. right: -0.185vh;
  170. }
  171. &.top {
  172. top: -0.185vh;
  173. }
  174. &.bottom {
  175. bottom: -0.185vh;
  176. }
  177. }
  178. .page-common-body-menu-item {
  179. border: 0.093vh solid fade(@green, 40%);
  180. width: 3.889vh;
  181. height: 3.889vh;
  182. border-radius: 0.278vh;
  183. margin-top: 0.741vh;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. cursor: pointer;
  188. a {
  189. line-height: 0;
  190. }
  191. // &:first-child {
  192. // margin-top: 0;
  193. // }
  194. &.active {
  195. border-color: fade(@yellow, 40%);
  196. position: relative;
  197. &::after {
  198. content: "";
  199. width: calc(100% - 0.37vh);
  200. height: calc(100% - 0.37vh);
  201. position: absolute;
  202. border: 0.093vh solid @yellow;
  203. box-shadow: 0 0 0.37vh @yellow;
  204. top: 0.093vh;
  205. left: 0.093vh;
  206. }
  207. }
  208. }
  209. }
  210. }
  211. }
  212. }
  213. </style>