GeneralAppearance.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256
  1. <template>
  2. <div class="general-appearance">
  3. <div class="btn-group-tabs">
  4. <BtnGroup2
  5. :btnGroups="btnGroups"
  6. :rowIndex="rowIndex"
  7. :index="selectIndex"
  8. @select="select"
  9. ></BtnGroup2>
  10. </div>
  11. <div class="panel-title">
  12. <div class="panel-title-name">
  13. <!-- <span class="svg-icon svg-icon-green svg-icon-sm">
  14. <SvgIcon svgid="svg-wind-site"></SvgIcon>
  15. </span>
  16. <span class="green">某某某风电场总貌</span> -->
  17. <div class="sub-title-item">
  18. <img src="../../../assets/map/fan/black.png" />
  19. <span class="sub-title gray">接入台数</span>
  20. <span class="sub-count font-num white">{{ wpnumMap.jrts }}</span>
  21. </div>
  22. <div class="sub-title-item">
  23. <img src="../../../assets/map/fan/green.png" />
  24. <span class="sub-title green">待机台数</span>
  25. <span class="sub-count font-num green">{{ wpnumMap.djts }}</span>
  26. </div>
  27. <div class="sub-title-item">
  28. <img src="../../../assets/map/fan/blue.png" />
  29. <span class="sub-title blue">并网台数</span>
  30. <span class="sub-count font-num blue">{{ wpnumMap.yxts }}</span>
  31. </div>
  32. <div class="sub-title-item">
  33. <img src="../../../assets/map/fan/purple.png" />
  34. <span class="sub-title pink">限电台数</span>
  35. <span class="sub-count font-num pink">{{ wpnumMap.xdts }}</span>
  36. </div>
  37. <div class="sub-title-item">
  38. <img src="../../../assets/map/fan/red.png" />
  39. <span class="sub-title red">故障台数</span>
  40. <span class="sub-count font-num red">{{ wpnumMap.gzts }}</span>
  41. </div>
  42. <div class="sub-title-item">
  43. <img src="../../../assets/map/fan/orange.png" />
  44. <span class="sub-title orange">检修台数</span>
  45. <span class="sub-count font-num orange">{{ wpnumMap.whts }}</span>
  46. </div>
  47. <div class="sub-title-item">
  48. <img src="../../../assets/map/fan/black.png" />
  49. <span class="sub-title gray">离线台数</span>
  50. <span class="sub-count font-num gray">{{ wpnumMap.lxts }}</span>
  51. </div>
  52. </div>
  53. </div>
  54. <!-- <gax6 class="general-appearance-body"></gax6> -->
  55. <div>
  56. <XS class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'XS_FDC'" />
  57. <XH class="general-appearance-body" :data="fjmap" :zmmap="zmmap" v-if="wpId === 'XH_GDC'" />
  58. </div>
  59. </div>
  60. </template>
  61. <script>
  62. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  63. // import gax6 from "../components/gax6.vue";
  64. import XS from "../components/generalappearance/xs/xs.vue";
  65. import XH from "../components/generalappearance/xh/xh.vue";
  66. export default {
  67. // 名称
  68. name: "GeneralAppearance",
  69. // 使用组件
  70. components: {
  71. // gax6,
  72. BtnGroup2,
  73. XS,
  74. XH
  75. },
  76. // 数据
  77. data() {
  78. return {
  79. timmer: undefined,
  80. wpId: undefined, //场站
  81. wpnumMap: {}, //风机监视数量
  82. fjmap: [], //场站风机详情
  83. zmmap: {},
  84. selectIndex: 0,
  85. rowIndex: 0,
  86. btnGroups: [
  87. {
  88. icon: "svg-wind-site",
  89. btns: [],
  90. },
  91. {
  92. icon: "svg-photovoltaic",
  93. btns: [],
  94. },
  95. ],
  96. };
  97. },
  98. created() {
  99. let that = this;
  100. that.wpId = that.$route.params.wpId;
  101. that.$nextTick(() => {
  102. that.getWp();
  103. that.timmer = setInterval(() => {
  104. that.requestData();
  105. }, that.$store.state.websocketTimeSec);
  106. });
  107. },
  108. // 函数
  109. methods: {
  110. select(res) {
  111. this.$router.replace({
  112. path: `/monitor/windsite/generalappearance/${res.code}`,
  113. });
  114. },
  115. getWp() {
  116. let that = this;
  117. that.API.requestData({
  118. method: "GET",
  119. subUrl: "powercompare/windfarmAllAjax",
  120. success(res) {
  121. let btnGroup = [
  122. {
  123. icon: "svg-wind-site",
  124. btns: [],
  125. },
  126. {
  127. icon: "svg-photovoltaic",
  128. btns: [],
  129. },
  130. ];
  131. res.data.forEach((ele, index) => {
  132. if (ele.id.indexOf("FDC") !== -1) {
  133. btnGroup[0].btns.push({
  134. text: ele.name,
  135. code: ele.id,
  136. });
  137. } else {
  138. btnGroup[1].btns.push({
  139. text: ele.name,
  140. code: ele.id,
  141. });
  142. }
  143. });
  144. that.btnGroups = btnGroup;
  145. that.renderBtnActiveIndex();
  146. },
  147. });
  148. },
  149. requestData() {
  150. let that = this;
  151. that.API.requestData({
  152. method: "POST",
  153. subUrl: "monitor/findGeneralAppearance",
  154. data: {
  155. wpId: that.wpId,
  156. },
  157. success(res) {
  158. if (res.code == 200) {
  159. that.wpnumMap = res.data.fczbmap.jczbmap;
  160. that.fjmap = res.data.fjmap[0];
  161. that.zmmap = res.data.zmmap;
  162. }
  163. },
  164. });
  165. },
  166. renderBtnActiveIndex() {
  167. this.btnGroups.forEach((pEle, pIndex) => {
  168. pEle.btns.forEach((cEle, cIndex) => {
  169. if (cEle.code === this.wpId) {
  170. this.rowIndex = pIndex;
  171. this.selectIndex = cIndex;
  172. }
  173. });
  174. });
  175. },
  176. },
  177. unmounted() {
  178. clearInterval(this.timmer);
  179. this.timmer = null;
  180. },
  181. watch: {
  182. $route(res) {
  183. this.wpId = res.params.wpId;
  184. if (res.params.wpId) {
  185. this.requestData();
  186. this.renderBtnActiveIndex();
  187. }
  188. },
  189. },
  190. };
  191. </script>
  192. <style lang="less" scoped>
  193. .general-appearance {
  194. width: 100%;
  195. height: calc(100vh - 90px);
  196. display: flex;
  197. flex-direction: column;
  198. .btn-group-tabs {
  199. display: flex;
  200. flex-direction: row;
  201. }
  202. .general-appearance-body {
  203. flex-grow: 1;
  204. }
  205. .panel-title {
  206. width: 100%;
  207. background-color: fade(@darkgray, 40%);
  208. margin-top: 1.481vh;
  209. padding: 6px;
  210. display: flex;
  211. align-items: center;
  212. .panel-title-name {
  213. color: @green;
  214. display: flex;
  215. align-items: center;
  216. line-height: 0;
  217. font-size: 0;
  218. i,
  219. span {
  220. margin: 0 0 0 1.481vh;
  221. line-height: 0;
  222. font-size: 13px;
  223. }
  224. }
  225. .sub-title-item {
  226. display: flex;
  227. align-items: center;
  228. margin-left: 16px;
  229. .sub-title {
  230. font-size: 13px;
  231. margin-left: 6px;
  232. }
  233. .sub-count {
  234. font-size: 13px;
  235. font-weight: 500;
  236. }
  237. img {
  238. height: 31px;
  239. }
  240. }
  241. }
  242. }
  243. </style>