Info.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. <template>
  2. <div class="wind-site-info">
  3. <div class="wind-site-menu">
  4. <div class="wind-site-title">选择风机</div>
  5. <div class="wind-site-body">
  6. <collapse-list :list="WindSites" />
  7. </div>
  8. </div>
  9. <div class="wind-site-info-body">
  10. <div class="info-menu mg-b-16">
  11. <div class="info-menu-item" v-for="(item, index) in InfoBtns.data" :key="item" :class="{ active: InfoBtns.activeIndex == index }" @click="onInfoMenuItemClick(item, index)">{{ item.text }}</div>
  12. </div>
  13. <el-row>
  14. <el-col :span="16" class="pd-r-16" style="text-align: center;">
  15. <!-- 基本信息 使用 v-if 每次点击重新加载 -->
  16. <!-- 使用 v-show 首次全部加载 之后隐藏 点击后显示 -->
  17. <base-info v-show="InfoBtns.activeIndex == 0" />
  18. <!-- <base-info v-if="InfoBtns.activeIndex == 2" /> -->
  19. <StandAloneImg class="sai" v-show="InfoBtns.activeIndex != 0" :activeIndex="InfoBtns.activeIndex" @selectSvg="selectSvg"></StandAloneImg>
  20. <generator class="saig" v-show="InfoBtns.activeIndex == 1"></generator>
  21. <gearbox class="saig" v-show="InfoBtns.activeIndex == 2"></gearbox>
  22. </el-col>
  23. <el-col :span="8">
  24. <warning />
  25. </el-col>
  26. </el-row>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. import collapseList from "@/components/coms/collapse/collapse-list.vue";
  32. import BaseInfo from "./Base-Info.vue";
  33. import Warning from "./Warning.vue";
  34. import StandAloneImg from "./StandAloneImg.vue";
  35. import generator from "./pages/generator.vue";
  36. import gearbox from "./pages/gear-box.vue";
  37. export default {
  38. components: { collapseList, BaseInfo, Warning, StandAloneImg, generator, gearbox },
  39. props: {
  40. id: {
  41. type: String,
  42. default: "",
  43. },
  44. },
  45. data() {
  46. return {
  47. WindSites: [
  48. {
  49. id: "1",
  50. text: "某某风电场",
  51. children: [
  52. {
  53. id: "1",
  54. text: "2E01",
  55. color: "green",
  56. },
  57. {
  58. id: "2",
  59. text: "2E01",
  60. color: "red",
  61. },
  62. {
  63. id: "3",
  64. text: "2E01",
  65. color: "blue",
  66. },
  67. ],
  68. },
  69. {
  70. id: "2",
  71. text: "某某风电场",
  72. children: [
  73. {
  74. id: "1",
  75. text: "2E01",
  76. color: "green",
  77. },
  78. {
  79. id: "2",
  80. text: "2E01",
  81. color: "green",
  82. },
  83. {
  84. id: "3",
  85. text: "2E01",
  86. color: "green",
  87. },
  88. ],
  89. },
  90. {
  91. id: "2",
  92. text: "某某风电场",
  93. children: [
  94. {
  95. id: "1",
  96. text: "2E01",
  97. color: "green",
  98. },
  99. {
  100. id: "2",
  101. text: "2E01",
  102. color: "green",
  103. },
  104. {
  105. id: "3",
  106. text: "2E01",
  107. color: "green",
  108. },
  109. ],
  110. },
  111. ],
  112. InfoBtns: {
  113. activeIndex: 0,
  114. data: [
  115. {
  116. id: "base-info",
  117. text: "基本信息",
  118. },
  119. {
  120. id: "generator",
  121. text: "发电机",
  122. },
  123. {
  124. id: "gear-box",
  125. text: "齿轮箱",
  126. },
  127. {
  128. id: "pitch",
  129. text: "变桨",
  130. },
  131. {
  132. id: "yaw",
  133. text: "偏航",
  134. },
  135. {
  136. id: "hydraulic-pressure",
  137. text: "液压",
  138. },
  139. {
  140. id: "cabin-info",
  141. text: "机舱信息",
  142. },
  143. {
  144. id: "principal-axis",
  145. text: "主轴",
  146. },
  147. ],
  148. },
  149. };
  150. },
  151. methods: {
  152. onInfoMenuItemClick(item, index) {
  153. this.InfoBtns.activeIndex = index;
  154. },
  155. selectSvg: function(index) {
  156. this.InfoBtns.activeIndex = index;
  157. },
  158. },
  159. };
  160. </script>
  161. <style lang="less" scoped>
  162. .wind-site-info {
  163. display: flex;
  164. .sai {
  165. width: 70%;
  166. }
  167. .saig {
  168. margin-top: -100px;
  169. }
  170. .wind-site-menu {
  171. flex: 0 0 13.889vh;
  172. color: @gray;
  173. background: fade(@darkgray, 10);
  174. height: calc(100vh - 8.519vh);
  175. .wind-site-title {
  176. font-size: 1.667vh;
  177. font-weight: 600;
  178. padding: 1.481vh;
  179. }
  180. }
  181. .wind-site-info-body {
  182. flex: auto;
  183. padding-left: 1.481vh;
  184. .info-menu {
  185. .info-menu-item {
  186. display: inline-block;
  187. padding: 0.741vh 1.481vh;
  188. border: 1px solid fade(@darkgray, 80);
  189. border-radius: 4px;
  190. color: @gray;
  191. font-size: @fontsize-s;
  192. font-weight: 600;
  193. letter-spacing: 1px;
  194. cursor: pointer;
  195. &.active {
  196. color: @white;
  197. background: fade(@purple, 80);
  198. }
  199. & + .info-menu-item {
  200. margin-left: 0.741vh;
  201. }
  202. }
  203. }
  204. }
  205. }
  206. </style>