GeneralAppearance.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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. </template>
  57. <script>
  58. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  59. import gax6 from "../components/gax6.vue";
  60. export default {
  61. // 名称
  62. name: "GeneralAppearance",
  63. // 使用组件
  64. components: {
  65. gax6,
  66. BtnGroup2,
  67. },
  68. // 数据
  69. data() {
  70. return {
  71. timmer: undefined,
  72. wpId: undefined, //场站
  73. wpnumMap: {}, //风机监视数量
  74. selectIndex: 0,
  75. rowIndex: 0,
  76. btnGroups: [
  77. {
  78. icon: "svg-wind-site",
  79. btns: [],
  80. },
  81. {
  82. icon: "svg-photovoltaic",
  83. btns: [],
  84. },
  85. ],
  86. };
  87. },
  88. created() {
  89. let that = this;
  90. that.wpId = that.$route.params.wpId;
  91. that.$nextTick(() => {
  92. that.getWp();
  93. that.requestData();
  94. that.timmer = setInterval(() => {
  95. that.requestData();
  96. }, that.$store.state.websocketTimeSec);
  97. });
  98. },
  99. // 函数
  100. methods: {
  101. select(res) {
  102. this.$router.replace({
  103. path: `/monitor/windsite/generalappearance/${res.code}`,
  104. });
  105. },
  106. getWp() {
  107. let that = this;
  108. that.API.requestData({
  109. method: "GET",
  110. subUrl: "powercompare/windfarmAllAjax",
  111. success(res) {
  112. let btnGroup = [
  113. {
  114. icon: "svg-wind-site",
  115. btns: [],
  116. },
  117. {
  118. icon: "svg-photovoltaic",
  119. btns: [],
  120. },
  121. ];
  122. res.data.forEach((ele, index) => {
  123. if (ele.id.indexOf("FDC") !== -1) {
  124. btnGroup[0].btns.push({
  125. text: ele.name,
  126. code: ele.id,
  127. });
  128. } else {
  129. btnGroup[1].btns.push({
  130. text: ele.name,
  131. code: ele.id,
  132. });
  133. }
  134. });
  135. that.btnGroups = btnGroup;
  136. that.renderBtnActiveIndex();
  137. },
  138. });
  139. },
  140. requestData() {
  141. let that = this;
  142. that.API.requestData({
  143. method: "POST",
  144. subUrl: "monitor/findGeneralAppearance",
  145. data: {
  146. wpId: that.wpId,
  147. },
  148. success(res) {
  149. if (res.code == 200) that.wpnumMap = res.data.fczbmap.jczbmap;
  150. },
  151. });
  152. },
  153. renderBtnActiveIndex() {
  154. this.btnGroups.forEach((pEle, pIndex) => {
  155. pEle.btns.forEach((cEle, cIndex) => {
  156. if (cEle.code === this.wpId) {
  157. this.rowIndex = pIndex;
  158. this.selectIndex = cIndex;
  159. }
  160. });
  161. });
  162. },
  163. },
  164. unmounted() {
  165. clearInterval(this.timmer);
  166. this.timmer = null;
  167. },
  168. watch: {
  169. $route(res) {
  170. this.wpId = res.params.wpId;
  171. if (res.params.wpId) {
  172. this.requestData();
  173. this.renderBtnActiveIndex();
  174. }
  175. },
  176. },
  177. };
  178. </script>
  179. <style lang="less" scoped>
  180. .general-appearance {
  181. width: 100%;
  182. height: calc(100vh - 90px);
  183. display: flex;
  184. flex-direction: column;
  185. .btn-group-tabs {
  186. display: flex;
  187. flex-direction: row;
  188. }
  189. .general-appearance-body {
  190. flex-grow: 1;
  191. }
  192. .panel-title {
  193. width: 100%;
  194. background-color: fade(@darkgray, 40%);
  195. margin-top: 1.481vh;
  196. padding: 6px;
  197. display: flex;
  198. align-items: center;
  199. .panel-title-name {
  200. color: @green;
  201. display: flex;
  202. align-items: center;
  203. line-height: 0;
  204. font-size: 0;
  205. i,
  206. span {
  207. margin: 0 0 0 1.481vh;
  208. line-height: 0;
  209. font-size: 13px;
  210. }
  211. }
  212. .sub-title-item {
  213. display: flex;
  214. align-items: center;
  215. margin-left: 16px;
  216. .sub-title {
  217. font-size: 13px;
  218. margin-left: 6px;
  219. }
  220. .sub-count {
  221. font-size: 13px;
  222. font-weight: 500;
  223. }
  224. img {
  225. height: 31px;
  226. }
  227. }
  228. }
  229. }
  230. </style>