GeneralAppearance.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  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. <div class="sub-title-item">
  14. <img src="../../../assets/map/fan/black.png" />
  15. <span class="sub-title gray">接入台数</span>
  16. <span class="sub-count font-num white">{{ wpnumMap.jrts }}</span>
  17. </div>
  18. <div class="sub-title-item">
  19. <img src="../../../assets/map/fan/green.png" />
  20. <span class="sub-title green">待机台数</span>
  21. <span class="sub-count font-num green">{{ wpnumMap.djts }}</span>
  22. </div>
  23. <div class="sub-title-item">
  24. <img src="../../../assets/map/fan/blue.png" />
  25. <span class="sub-title blue">并网台数</span>
  26. <span class="sub-count font-num blue">{{ wpnumMap.yxts }}</span>
  27. </div>
  28. <div class="sub-title-item">
  29. <img src="../../../assets/map/fan/purple.png" />
  30. <span class="sub-title pink">限电台数</span>
  31. <span class="sub-count font-num pink">{{ wpnumMap.xdts }}</span>
  32. </div>
  33. <div class="sub-title-item">
  34. <img src="../../../assets/map/fan/red.png" />
  35. <span class="sub-title red">故障台数</span>
  36. <span class="sub-count font-num red">{{ wpnumMap.gzts }}</span>
  37. </div>
  38. <div class="sub-title-item">
  39. <img src="../../../assets/map/fan/orange.png" />
  40. <span class="sub-title orange">检修台数</span>
  41. <span class="sub-count font-num orange">{{ wpnumMap.whts }}</span>
  42. </div>
  43. <div class="sub-title-item">
  44. <img src="../../../assets/map/fan/black.png" />
  45. <span class="sub-title gray">离线台数</span>
  46. <span class="sub-count font-num gray">{{ wpnumMap.lxts }}</span>
  47. </div>
  48. </div>
  49. <div
  50. class="query-actions btnR"
  51. v-if="wpId == 'PL01_GC' || wpId == 'PL02_GC'"
  52. >
  53. <button
  54. class="btn"
  55. :class="wpId == 'PL01_GC' ? 'green' : ''"
  56. @click="pl('PL01_GC')"
  57. >
  58. 平罗一期
  59. </button>
  60. <button
  61. class="btn"
  62. :class="wpId == 'PL02_GC' ? 'green' : ''"
  63. @click="pl('PL02_GC')"
  64. >
  65. 平罗二期
  66. </button>
  67. </div>
  68. </div>
  69. <div>
  70. <MHS
  71. class="general-appearance-body"
  72. :data="fjmap"
  73. :zmmap="zmmap"
  74. v-if="wpId === 'MHS_FDC'"
  75. />
  76. <NSS
  77. class="general-appearance-body"
  78. :data="fjmap"
  79. :zmmap="zmmap"
  80. v-if="wpId === 'NSS_FDC'"
  81. />
  82. <QS
  83. class="general-appearance-body"
  84. :data="fjmap"
  85. :zmmap="zmmap"
  86. v-if="wpId === 'QS_FDC'"
  87. />
  88. <SBQ
  89. class="general-appearance-body"
  90. :data="fjmap"
  91. :zmmap="zmmap"
  92. v-if="wpId === 'SBQ_FDC'"
  93. />
  94. <XS
  95. class="general-appearance-body"
  96. :data="fjmap"
  97. :zmmap="zmmap"
  98. v-if="wpId === 'XS_FDC'"
  99. />
  100. <XH
  101. class="general-appearance-body"
  102. :data="fjmap"
  103. :zmmap="zmmap"
  104. v-if="wpId === 'XH_GDC'"
  105. />
  106. <DWK
  107. class="general-appearance-body"
  108. :data="fjmap"
  109. :zmmap="zmmap"
  110. v-if="wpId === 'DWK_GDC'"
  111. />
  112. <PL1
  113. class="general-appearance-body"
  114. :data="fjmap"
  115. :zmmap="zmmap"
  116. v-if="wpId === 'PL_GDC'"
  117. />
  118. <PL2
  119. class="general-appearance-body"
  120. :data="fjmap"
  121. :zmmap="zmmap"
  122. v-if="wpId === 'PL2_GDC'"
  123. />
  124. <MCH
  125. class="general-appearance-body"
  126. :data="fjmap"
  127. :zmmap="zmmap"
  128. v-if="wpId === 'MCH_GDC'"
  129. />
  130. <HZJ
  131. class="general-appearance-body"
  132. :data="fjmap"
  133. :zmmap="zmmap"
  134. v-if="wpId === 'HZJ_GDC'"
  135. />
  136. </div>
  137. </div>
  138. </template>
  139. <script>
  140. import BtnGroup2 from "@com/coms/btn/btn-group-double.vue";
  141. import MHS from "../components/generalappearance/mhs.vue";
  142. import NSS from "../components/generalappearance/nss.vue";
  143. import QS from "../components/generalappearance/qs.vue";
  144. import SBQ from "../components/generalappearance/sbq.vue";
  145. import XS from "../components/generalappearance/xs.vue";
  146. import XH from "../components/generalappearance/xh.vue";
  147. import DWK from "../components/generalappearance/dwk.vue";
  148. import PL1 from "../components/generalappearance/pl1.vue";
  149. import PL2 from "../components/generalappearance/pl2.vue";
  150. import MCH from "../components/generalappearance/mch.vue";
  151. import HZJ from "../components/generalappearance/hzj.vue";
  152. import api from "@api/cockpit/matrix/index.js";
  153. export default {
  154. // 名称
  155. name: "GeneralAppearance",
  156. // 使用组件
  157. components: {
  158. BtnGroup2,
  159. MHS,
  160. NSS,
  161. QS,
  162. SBQ,
  163. XS,
  164. XH,
  165. DWK,
  166. PL1,
  167. PL2,
  168. MCH,
  169. HZJ,
  170. },
  171. // 数据
  172. data() {
  173. return {
  174. timmer: undefined,
  175. wpId: undefined, //场站
  176. wpnumMap: {}, //风机监视数量
  177. fjmap: [], //场站风机详情
  178. zmmap: {},
  179. selectIndex: 0,
  180. rowIndex: 0,
  181. btnGroups: [
  182. {
  183. icon: "svg-wind-site",
  184. btns: [],
  185. },
  186. {
  187. icon: "svg-photovoltaic",
  188. btns: [],
  189. },
  190. ],
  191. };
  192. },
  193. created() {
  194. let that = this;
  195. that.wpId = that.$route.params.wpId;
  196. that.$nextTick(() => {
  197. that.getWp();
  198. that.timmer = setInterval(() => {
  199. that.requestData();
  200. }, that.$store.state.websocketTimeSec);
  201. });
  202. },
  203. // 函数
  204. methods: {
  205. select(res) {
  206. this.$router.replace({
  207. path: `/monitor/windsite/generalappearance/${res.code}`,
  208. });
  209. },
  210. getWp() {
  211. api.powercompareWindfarmAllAjax().then((res) => {
  212. let btnGroup = [
  213. {
  214. icon: "svg-wind-site",
  215. btns: [],
  216. },
  217. {
  218. icon: "svg-photovoltaic",
  219. btns: [],
  220. },
  221. ];
  222. res.data.forEach((ele, index) => {
  223. if (ele.id.indexOf("FDC") !== -1) {
  224. btnGroup[0].btns.push({
  225. text: ele.name,
  226. code: ele.id,
  227. });
  228. } else {
  229. btnGroup[1].btns.push({
  230. text: ele.name,
  231. code: ele.id,
  232. });
  233. // if(ele.id == 'PL_GDC'){
  234. // btnGroup[1].btns.push({
  235. // text: '平罗二期光伏电站',
  236. // code: 'PL2_GDC',
  237. // });
  238. // }
  239. }
  240. });
  241. this.btnGroups = btnGroup;
  242. this.renderBtnActiveIndex();
  243. });
  244. // let that = this;
  245. // that.API.requestData({
  246. // method: "GET",
  247. // subUrl: "powercompare/windfarmAllAjax",
  248. // success(res) {
  249. // let btnGroup = [
  250. // {
  251. // icon: "svg-wind-site",
  252. // btns: [],
  253. // },
  254. // {
  255. // icon: "svg-photovoltaic",
  256. // btns: [],
  257. // },
  258. // ];
  259. // res.data.forEach((ele, index) => {
  260. // if (ele.id.indexOf("FDC") !== -1) {
  261. // btnGroup[0].btns.push({
  262. // text: ele.name,
  263. // code: ele.id,
  264. // });
  265. // } else {
  266. // btnGroup[1].btns.push({
  267. // text: ele.name,
  268. // code: ele.id,
  269. // });
  270. // // if(ele.id == 'PL_GDC'){
  271. // // btnGroup[1].btns.push({
  272. // // text: '平罗二期光伏电站',
  273. // // code: 'PL2_GDC',
  274. // // });
  275. // // }
  276. // }
  277. // });
  278. // that.btnGroups = btnGroup;
  279. // that.renderBtnActiveIndex();
  280. // },
  281. // });
  282. },
  283. requestData() {
  284. api.monitorFindGeneralAppearance({
  285. wpId: this.wpId,
  286. }).then((res) => {
  287. if (res.code == 200) {
  288. this.wpnumMap = res.data.fczbmap.jczbmap;
  289. this.fjmap = res.data.fjmap[0];
  290. this.zmmap = res.data.zmmap;
  291. }
  292. });
  293. // let that = this;
  294. // that.API.requestData({
  295. // method: "POST",
  296. // subUrl: "monitor/findGeneralAppearance",
  297. // data: {
  298. // wpId: that.wpId,
  299. // },
  300. // success(res) {
  301. // if (res.code == 200) {
  302. // that.wpnumMap = res.data.fczbmap.jczbmap;
  303. // that.fjmap = res.data.fjmap[0];
  304. // that.zmmap = res.data.zmmap;
  305. // }
  306. // },
  307. // });
  308. },
  309. renderBtnActiveIndex() {
  310. this.btnGroups.forEach((pEle, pIndex) => {
  311. pEle.btns.forEach((cEle, cIndex) => {
  312. if (cEle.code === this.wpId) {
  313. this.rowIndex = pIndex;
  314. this.selectIndex = cIndex;
  315. }
  316. });
  317. });
  318. },
  319. pl(a) {
  320. //单指平罗2个总貌
  321. this.$router.replace({
  322. path: `/monitor/windsite/generalappearance/${a}`,
  323. });
  324. },
  325. },
  326. unmounted() {
  327. clearInterval(this.timmer);
  328. this.timmer = null;
  329. },
  330. watch: {
  331. $route(res) {
  332. this.wpId = res.params.wpId;
  333. if (res.params.wpId) {
  334. this.requestData();
  335. this.renderBtnActiveIndex();
  336. }
  337. },
  338. },
  339. };
  340. </script>
  341. <style lang="less" scoped>
  342. .general-appearance {
  343. width: 100%;
  344. height: calc(100vh - 90px);
  345. display: flex;
  346. flex-direction: column;
  347. .btn-group-tabs {
  348. display: flex;
  349. flex-direction: row;
  350. }
  351. .btnR {
  352. flex: 1;
  353. text-align: end;
  354. }
  355. .general-appearance-body {
  356. flex-grow: 1;
  357. }
  358. .panel-title {
  359. width: 100%;
  360. background-color: fade(@darkgray, 40%);
  361. margin-top: 1.481vh;
  362. padding: 6px;
  363. display: flex;
  364. align-items: center;
  365. .panel-title-name {
  366. color: @green;
  367. display: flex;
  368. align-items: center;
  369. line-height: 0;
  370. font-size: 0;
  371. i,
  372. span {
  373. margin: 0 0 0 1.481vh;
  374. line-height: 0;
  375. font-size: 13px;
  376. }
  377. }
  378. .sub-title-item {
  379. display: flex;
  380. align-items: center;
  381. margin-left: 16px;
  382. .sub-title {
  383. font-size: 13px;
  384. margin-left: 6px;
  385. }
  386. .sub-count {
  387. font-size: 13px;
  388. font-weight: 500;
  389. }
  390. img {
  391. height: 31px;
  392. }
  393. }
  394. }
  395. }
  396. </style>