WindSite.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. // text: "场站监视",
  56. // },
  57. {
  58. icon: "svg-s指标列表",
  59. path: "/monitor/windsite/draughtfanlist",
  60. text: "指标列表",
  61. },
  62. // {
  63. // icon: "svg-agc",
  64. // path: "/monitor/windsite/matrix",
  65. // text: "指标列表",
  66. // },
  67. // {
  68. // icon: "svg-agc",
  69. // path: "/monitor/windsite/lightmatrix",
  70. // text: "指标列表",
  71. // },
  72. // {
  73. // icon: "svg-intranet-involvement",
  74. // path: "/monitor/windsite/box",
  75. // text: "指标列表",
  76. // },
  77. // {
  78. // icon: "svg-matrix",
  79. // path: "/monitor/windsite/info",
  80. // text: "指标列表",
  81. // },
  82. {
  83. icon: "svg-s测风塔",
  84. path: "/monitor/windsite/tower",
  85. text: "测风塔",
  86. },
  87. // {
  88. // icon: "svg-easy-compass",
  89. // path: "/monitor/windsite/Inverter-Info",
  90. // text: "测风塔",
  91. // },
  92. // {
  93. // icon: "svg-easy-compass",
  94. // path: "/monitor/windsite/map",
  95. // text: "测风塔",
  96. // },
  97. // {
  98. // icon: "svg-easy-compass",
  99. // path: "/monitor/windsite/map1",
  100. // text: "测风塔",
  101. // },
  102. {
  103. icon: "svg-matrix",
  104. path: "/monitor/windsite/matrix",
  105. text: "矩阵",
  106. },
  107. {
  108. icon: "svg-s总貌",
  109. path: "/monitor/windsite/generalappearance",
  110. text: "总貌图",
  111. },
  112. {
  113. icon: "svg-s升压站",
  114. path: "/monitor/windsite/boosterstation",
  115. text: "升压站",
  116. },
  117. // {
  118. // icon: "svg-s地图",
  119. // path: "/monitor/windsite/map",
  120. // text: "地图",
  121. // },
  122. ],
  123. };
  124. },
  125. // 函数
  126. methods: {
  127. clickMenu: function (index) {
  128. this.activeIndex = index;
  129. this.$store.dispatch("changeModuleName", this.menuDatas[index].text);
  130. },
  131. },
  132. created() {
  133. this.menuDatas.forEach((ele) => {
  134. ele.path = ele.path + "/" + this.$route.params.wpId;
  135. });
  136. },
  137. mounted() {},
  138. watch: {
  139. $route(res) {
  140. this.menuDatas.forEach((ele) => {
  141. let tempEle = ele.path.split("/");
  142. if (
  143. tempEle[tempEle.length - 1].indexOf("FDC") !== -1 ||
  144. tempEle[tempEle.length - 1].indexOf("GDC") !== -1
  145. ) {
  146. tempEle[tempEle.length - 1] = res.params.wpId;
  147. ele.path = tempEle.toString().replace(/,/g, "/");
  148. }
  149. });
  150. },
  151. },
  152. };
  153. </script>
  154. <style lang="less" scoped>
  155. .wind-site {
  156. .page-common-body {
  157. display: flex;
  158. flex-direction: row;
  159. margin-top: 0.741vh;
  160. .page-common-body-router {
  161. overflow: auto;
  162. overflow-x: hidden;
  163. height: calc(100vh - 7.037vh);
  164. flex: 1 1 auto;
  165. }
  166. .page-common-body-menu {
  167. width: 7.407vh;
  168. padding: 0 1.481vh 1.481vh 1.481vh;
  169. .page-common-body-menu-box {
  170. border: 0.093vh solid @darkgray;
  171. background-color: fade(@darkgray, 30%);
  172. padding: 2.222vh 0.185vh;
  173. position: relative;
  174. .page-common-body-menu-border {
  175. position: absolute;
  176. width: 0.37vh;
  177. height: 0.37vh;
  178. background-color: @write;
  179. border-radius: 50%;
  180. &.left {
  181. left: -0.185vh;
  182. }
  183. &.right {
  184. right: -0.185vh;
  185. }
  186. &.top {
  187. top: -0.185vh;
  188. }
  189. &.bottom {
  190. bottom: -0.185vh;
  191. }
  192. }
  193. .page-common-body-menu-item {
  194. border: 0.093vh solid fade(@green, 40%);
  195. width: 3.889vh;
  196. height: 3.889vh;
  197. border-radius: 0.278vh;
  198. margin-top: 0.741vh;
  199. display: flex;
  200. align-items: center;
  201. justify-content: center;
  202. cursor: pointer;
  203. a {
  204. line-height: 0;
  205. }
  206. // &:first-child {
  207. // margin-top: 0;
  208. // }
  209. &.active {
  210. border-color: fade(@yellow, 40%);
  211. position: relative;
  212. &::after {
  213. content: "";
  214. width: calc(100% - 0.37vh);
  215. height: calc(100% - 0.37vh);
  216. position: absolute;
  217. border: 0.093vh solid @yellow;
  218. box-shadow: 0 0 0.37vh @yellow;
  219. top: 0.093vh;
  220. left: 0.093vh;
  221. }
  222. }
  223. }
  224. }
  225. }
  226. }
  227. }
  228. </style>