GeneralAppearance.vue 7.6 KB

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