Status.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734
  1. <template>
  2. <div class="status">
  3. <div class="panel-box">
  4. <StatusPanel
  5. class="panel-item"
  6. v-for="(data, index) of datas"
  7. :key="index"
  8. :data="data"
  9. ></StatusPanel>
  10. <StatusPanelStatic class="panel-item" />
  11. </div>
  12. <div class="table-box">
  13. <ComTable :data="tableData"></ComTable>
  14. </div>
  15. <div class="table-box">
  16. <ComTable1 :data="tableData1"></ComTable1>
  17. </div>
  18. <div class="table-box">
  19. <ComTable1 :data="tableData2"></ComTable1>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. import StatusPanel from "./components/status-panel.vue";
  25. import StatusPanelStatic from "./components/static.vue";
  26. import ComTable from "@com/coms/table/table.vue";
  27. import ComTable1 from "./table.vue"
  28. import util from "@/helper/util.js";
  29. import store from "@store/index.js";
  30. export default {
  31. // 名称
  32. name: "Status",
  33. // 使用组件
  34. components: {
  35. StatusPanel,
  36. ComTable,
  37. ComTable1,
  38. StatusPanelStatic,
  39. },
  40. // 数据
  41. data() {
  42. return {
  43. timmer: null, // 遮罩开关
  44. sourceMap: {}, // 核心数据
  45. datas: [],
  46. wpId1: "",
  47. dwkGzqd: "",
  48. plGzqd: "",
  49. zhGzqd: "",
  50. mchGzqd: "",
  51. hzjGzqd: "",
  52. tableData: {
  53. column: [
  54. {
  55. name: "场站名称",
  56. field: "wpName",
  57. unit: "",
  58. is_num: false,
  59. is_light: false,
  60. },
  61. // {
  62. // name: "调度名称",
  63. // field: "ddname",
  64. // unit: "",
  65. // is_num: false,
  66. // is_light: false,
  67. // },
  68. {
  69. name: "装机容量",
  70. field: "zjrl",
  71. unit: "MW",
  72. is_num: true,
  73. is_light: false,
  74. },
  75. {
  76. name: "发电量",
  77. field: "fdl",
  78. unit: "万kwh",
  79. is_num: true,
  80. is_light: false,
  81. },
  82. {
  83. name: "上网电量",
  84. field: "swdl",
  85. unit: "万kwh",
  86. is_num: true,
  87. is_light: false,
  88. },
  89. {
  90. name: "利用小时",
  91. field: "lyxs",
  92. unit: "",
  93. is_num: true,
  94. is_light: false,
  95. },
  96. {
  97. name: "风速m/s",
  98. field: "fs",
  99. unit: "日照强度w/m2",
  100. is_num: true,
  101. is_light: false,
  102. },
  103. {
  104. name: "功率",
  105. field: "gl",
  106. unit: "MW",
  107. is_num: true,
  108. is_light: false,
  109. },
  110. {
  111. name: "出线功率",
  112. field: "cxgl",
  113. unit: "MW",
  114. is_num: true,
  115. is_light: false,
  116. },
  117. {
  118. name: "理论功率",
  119. field: "llgl",
  120. unit: "MW",
  121. is_num: true,
  122. is_light: false,
  123. },
  124. {
  125. name: "保证功率",
  126. field: "bzgl",
  127. unit: "MW",
  128. is_num: true,
  129. is_light: false,
  130. },
  131. {
  132. name: "预测功率",
  133. field: "ycgl",
  134. unit: "MW",
  135. is_num: true,
  136. is_light: false,
  137. },
  138. {
  139. name: "AGC指令",
  140. field: "agczl",
  141. unit: "MW",
  142. is_num: true,
  143. is_light: false,
  144. },
  145. {
  146. name: "理论发电量",
  147. field: "llfdl",
  148. unit: "万kwh",
  149. is_num: true,
  150. is_light: false,
  151. },
  152. {
  153. name: "SCADA发电量",
  154. field: "scadafdl",
  155. unit: "万kwh",
  156. is_num: true,
  157. is_light: false,
  158. },
  159. {
  160. name: "维修损失电量",
  161. field: "whss",
  162. unit: "万kwh",
  163. is_num: true,
  164. is_light: false,
  165. },
  166. {
  167. name: "故障损失电量",
  168. field: "gzss",
  169. unit: "万kwh",
  170. is_num: true,
  171. is_light: false,
  172. },
  173. {
  174. name: "受理损失电量",
  175. field: "slss",
  176. unit: "万kwh",
  177. is_num: true,
  178. is_light: false,
  179. },
  180. {
  181. name: "限电损失电量",
  182. field: "xdss",
  183. unit: "万kwh",
  184. is_num: true,
  185. is_light: false,
  186. },
  187. {
  188. name: "性能损失电量",
  189. field: "xnss",
  190. unit: "万kwh",
  191. is_num: true,
  192. is_light: false,
  193. },
  194. ],
  195. data: [],
  196. },
  197. tableData1: {
  198. column: [
  199. {
  200. // name: "场站名称",
  201. field: "wpName",
  202. unit: "",
  203. is_num: false,
  204. is_light: false,
  205. },
  206. // {
  207. // name: "调度名称",
  208. // field: "ddname",
  209. // unit: "",
  210. // is_num: false,
  211. // is_light: false,
  212. // },
  213. {
  214. // name: "装机容量",
  215. field: "zjrl",
  216. unit: "MW",
  217. is_num: true,
  218. is_light: false,
  219. },
  220. {
  221. // name: "发电量",
  222. field: "fdl",
  223. unit: "万kwh",
  224. is_num: true,
  225. is_light: false,
  226. },
  227. {
  228. // name: "上网电量",
  229. field: "swdl",
  230. unit: "万kwh",
  231. is_num: true,
  232. is_light: false,
  233. },
  234. {
  235. // name: "利用小时",
  236. field: "lyxs",
  237. unit: "",
  238. is_num: true,
  239. is_light: false,
  240. },
  241. {
  242. // name: "风速m/s",
  243. // name: "光照强度w/㎡",
  244. field: "fs",
  245. unit: "日照强度w/㎡",
  246. is_num: true,
  247. is_light: false,
  248. },
  249. {
  250. // name: "功率",
  251. field: "gl",
  252. unit: "MW",
  253. is_num: true,
  254. is_light: false,
  255. },
  256. {
  257. // name: "出线功率",
  258. field: "cxgl",
  259. unit: "MW",
  260. is_num: true,
  261. is_light: false,
  262. },
  263. {
  264. // name: "理论功率",
  265. field: "llgl",
  266. unit: "MW",
  267. is_num: true,
  268. is_light: false,
  269. },
  270. {
  271. // name: "保证功率",
  272. field: "bzgl",
  273. unit: "MW",
  274. is_num: true,
  275. is_light: false,
  276. },
  277. {
  278. // name: "预测功率",
  279. field: "ycgl",
  280. unit: "MW",
  281. is_num: true,
  282. is_light: false,
  283. },
  284. {
  285. // name: "AGC指令",
  286. field: "agczl",
  287. unit: "MW",
  288. is_num: true,
  289. is_light: false,
  290. },
  291. {
  292. // name: "理论发电量",
  293. field: "llfdl",
  294. unit: "万kwh",
  295. is_num: true,
  296. is_light: false,
  297. },
  298. {
  299. // name: "SCADA发电量",
  300. field: "scadafdl",
  301. unit: "万kwh",
  302. is_num: true,
  303. is_light: false,
  304. },
  305. {
  306. // name: "维修损失电量",
  307. field: "whss",
  308. unit: "万kwh",
  309. is_num: true,
  310. is_light: false,
  311. },
  312. {
  313. // name: "故障损失电量",
  314. field: "gzss",
  315. unit: "万kwh",
  316. is_num: true,
  317. is_light: false,
  318. },
  319. {
  320. // name: "受理损失电量",
  321. field: "slss",
  322. unit: "万kwh",
  323. is_num: true,
  324. is_light: false,
  325. },
  326. {
  327. // name: "限电损失电量",
  328. field: "xdss",
  329. unit: "万kwh",
  330. is_num: true,
  331. is_light: false,
  332. },
  333. {
  334. // name: "性能损失电量",
  335. field: "xnss",
  336. unit: "万kwh",
  337. is_num: true,
  338. is_light: false,
  339. },
  340. ],
  341. data: [],
  342. },
  343. tableData2: {
  344. column: [
  345. {
  346. // name: "场站名称",
  347. field: "wpName",
  348. unit: "",
  349. is_num: false,
  350. is_light: false,
  351. },
  352. // {
  353. // name: "调度名称",
  354. // field: "ddname",
  355. // unit: "",
  356. // is_num: false,
  357. // is_light: false,
  358. // },
  359. {
  360. // name: "装机容量",
  361. field: "zjrl",
  362. unit: "MW",
  363. is_num: true,
  364. is_light: false,
  365. },
  366. {
  367. // name: "发电量",
  368. field: "fdl",
  369. unit: "万kwh",
  370. is_num: true,
  371. is_light: false,
  372. },
  373. {
  374. // name: "上网电量",
  375. field: "swdl",
  376. unit: "万kwh",
  377. is_num: true,
  378. is_light: false,
  379. },
  380. {
  381. // name: "利用小时",
  382. field: "lyxs",
  383. unit: "",
  384. is_num: true,
  385. is_light: false,
  386. },
  387. {
  388. // name: "风速m/s",
  389. // name: "光照强度w/㎡",
  390. field: "fs",
  391. unit: "日照强度w/㎡",
  392. is_num: true,
  393. is_light: false,
  394. },
  395. {
  396. // name: "功率",
  397. field: "gl",
  398. unit: "MW",
  399. is_num: true,
  400. is_light: false,
  401. },
  402. {
  403. // name: "出线功率",
  404. field: "cxgl",
  405. unit: "MW",
  406. is_num: true,
  407. is_light: false,
  408. },
  409. {
  410. // name: "理论功率",
  411. field: "llgl",
  412. unit: "MW",
  413. is_num: true,
  414. is_light: false,
  415. },
  416. {
  417. // name: "保证功率",
  418. field: "bzgl",
  419. unit: "MW",
  420. is_num: true,
  421. is_light: false,
  422. },
  423. {
  424. // name: "预测功率",
  425. field: "ycgl",
  426. unit: "MW",
  427. is_num: true,
  428. is_light: false,
  429. },
  430. {
  431. // name: "AGC指令",
  432. field: "agczl",
  433. unit: "MW",
  434. is_num: true,
  435. is_light: false,
  436. },
  437. {
  438. // name: "理论发电量",
  439. field: "llfdl",
  440. unit: "万kwh",
  441. is_num: true,
  442. is_light: false,
  443. },
  444. {
  445. // name: "SCADA发电量",
  446. field: "scadafdl",
  447. unit: "万kwh",
  448. is_num: true,
  449. is_light: false,
  450. },
  451. {
  452. // name: "维修损失电量",
  453. field: "whss",
  454. unit: "万kwh",
  455. is_num: true,
  456. is_light: false,
  457. },
  458. {
  459. // name: "故障损失电量",
  460. field: "gzss",
  461. unit: "万kwh",
  462. is_num: true,
  463. is_light: false,
  464. },
  465. {
  466. // name: "受理损失电量",
  467. field: "slss",
  468. unit: "万kwh",
  469. is_num: true,
  470. is_light: false,
  471. },
  472. {
  473. // name: "限电损失电量",
  474. field: "xdss",
  475. unit: "万kwh",
  476. is_num: true,
  477. is_light: false,
  478. },
  479. {
  480. // name: "性能损失电量",
  481. field: "xnss",
  482. unit: "万kwh",
  483. is_num: true,
  484. is_light: false,
  485. },
  486. ],
  487. data: [],
  488. },
  489. };
  490. },
  491. methods: {
  492. // 请求服务
  493. requestData(showLoading) {
  494. let that = this;
  495. that.API.requestData({
  496. showLoading,
  497. method: "POST",
  498. subUrl: "monitor/monitor",
  499. success(res) {
  500. if (res.data) {
  501. // console.log("resData:", res.data);
  502. let sourceMap = res.data;
  503. let datas = [];
  504. let data = [];
  505. let data1 = [];
  506. let data2 = [];
  507. sourceMap.maps.forEach((ele) => {
  508. sourceMap.vos.forEach((vEle) => {});
  509. that.wpId1 = sourceMap.vos.find((findEle) => {
  510. return findEle.wpName === ele.name;
  511. }).wpId;
  512. datas.push({
  513. title: ele.name,
  514. wpId: sourceMap.vos.find((findEle) => {
  515. return findEle.wpName === ele.name;
  516. }).wpId,
  517. weather: {
  518. type: "cloudy",
  519. temperature: 11,
  520. },
  521. breakOff: ele.fczt === 3,
  522. category: {
  523. score: ele.zjts,
  524. datas: [
  525. { text: "运行", num: ele.yxts, color: "green" },
  526. { text: "待机", num: ele.djts, color: "purple" },
  527. { text: "限电", num: ele.xdts, color: "yellow" },
  528. { text: "检修", num: ele.whts, color: "orange" },
  529. { text: "故障", num: ele.gzts, color: "red" },
  530. { text: "受累", num: ele.slts || 0, color: "blue" },
  531. { text: "离线", num: ele.lxts, color: "gray" },
  532. ],
  533. },
  534. items: [
  535. {
  536. // f1: ("AGC" + ele.name.replace(/风电场/g, "") + ":"),
  537. f1: "AGC:",
  538. f2: "设定",
  539. f3: ele.agcygsd,
  540. f4: "出线",
  541. f5: ele.agccxyg,
  542. is_light: !ele.zxzt_acgzt,
  543. },
  544. {
  545. f1: "升压站:",
  546. f2: "Uab",
  547. f3: ele.uab,
  548. f4: "Ia",
  549. f5: ele.ia,
  550. is_light: !ele.zxzt_syzzt,
  551. },
  552. {
  553. f1: ele.name.includes("风") ? "风功:" : "光功:",
  554. f2: "未来15分钟",
  555. f3: ele.ycgl,
  556. f4: "",
  557. f5: "",
  558. is_light: !ele.zxzt_fjzt,
  559. },
  560. {
  561. f1: "测风塔:",
  562. // f2: "风速",
  563. f2: ele.name.includes("风") ? "风速" : "光照强度",
  564. // f3: (ele.cftfs || 0) + "m/s",
  565. f3: ele.name.includes("风")
  566. ? (ele.cftfs || 0) + "m/s"
  567. : sourceMap.vos.find((findEle) => {
  568. return findEle.wpName === ele.name;
  569. }).fs,
  570. f4: ele.name.includes("风") ? "风向" : "",
  571. f5: ele.name.includes("风") ? ele.cftfx || 0 : "",
  572. is_light: !ele.zxzt_cftzt,
  573. },
  574. {
  575. f1: "电能量表:",
  576. f2: "",
  577. f3: ele.dnlb,
  578. f4: "",
  579. f5: "",
  580. is_light: !ele.zxzt_djlzt,
  581. },
  582. ],
  583. });
  584. });
  585. //风电场
  586. let fdcArr = sourceMap.vos.filter((ele) => {
  587. return ele.wpId.includes("FDC");
  588. });
  589. let fdhj = sourceMap.vos.filter((ele) => {
  590. return ele.wpId.includes("-1");
  591. });
  592. let zj = sourceMap.vos.filter((ele) => {
  593. return ele.wpId.includes("0");
  594. });
  595. data2.push(zj[0])
  596. fdcArr.push(fdhj[0]);
  597. // console.log(fdcArr)
  598. fdcArr.forEach((ele) => {
  599. // console.log('vos:', sourceMap.vos)
  600. ele.row_span = [];
  601. ele.col_span = [];
  602. ele.is_light = false;
  603. data.push(ele);
  604. });
  605. //光电厂
  606. let gdcArr = sourceMap.vos.filter((ele) => {
  607. return ele.wpId.includes("GDC");
  608. });
  609. let gdhj = sourceMap.vos.filter((ele) => {
  610. return ele.wpId.includes("-2");
  611. });
  612. gdcArr.push(gdhj[0]);
  613. // console.log(gdcArr)
  614. gdcArr.forEach((ele) => {
  615. // console.log('vos:', sourceMap.vos)
  616. ele.row_span = [];
  617. ele.col_span = [];
  618. ele.is_light = false;
  619. data1.push(ele);
  620. });
  621. // sourceMap.vos.forEach((ele) => {
  622. // // console.log('vos:', sourceMap.vos)
  623. // ele.row_span = [];
  624. // ele.col_span = [];
  625. // ele.is_light = false;
  626. // data.push(ele);
  627. // });
  628. // for(let i=0;i<sourceMap.vos.length;i++){
  629. // // console.log('vos:',sourceMap.vos)
  630. // data.push(sourceMap.vos[0],sourceMap.vos[1],sourceMap.vos[2],sourceMap.vos[3],sourceMap.vos[4],sourceMap.vos[5],sourceMap.vos[11])
  631. // data1.push(sourceMap.vos[6],sourceMap.vos[7],sourceMap.vos[8],sourceMap.vos[9],sourceMap.vos[10],sourceMap.vos[11])
  632. // }
  633. // that.unique(data,that.wpId1);
  634. // // that.unique(data1,sourceMap.vos.find((findEle) => {
  635. // // return findEle.wpName === ele.name;
  636. // // }).wpId);
  637. // console.log('vosData:',data);
  638. // // console.log('vosData1:',data1)
  639. that.sourceMap = sourceMap;
  640. that.datas = datas;
  641. that.tableData.data = data;
  642. that.tableData1.data = data1;
  643. that.tableData2.data = data2;
  644. } else {
  645. that.sourceMap = {};
  646. that.datas = [];
  647. that.tableData.data = [];
  648. that.tableData1.data = [];
  649. }
  650. },
  651. });
  652. },
  653. },
  654. created() {
  655. let that = this;
  656. that.$nextTick(() => {
  657. that.requestData(false);
  658. that.timmer = setInterval(() => {
  659. that.requestData(false);
  660. }, that.$store.state.websocketTimeSec);
  661. });
  662. },
  663. mounted() {},
  664. unmounted() {
  665. clearInterval(this.timmer);
  666. this.timmer = null;
  667. },
  668. };
  669. </script>
  670. <style lang="less" scoped>
  671. .status {
  672. width: 100%;
  673. height: calc(100vh - 7.222vh);
  674. overflow: auto;
  675. display: flex;
  676. flex-direction: column;
  677. .panel-box {
  678. width: 100%;
  679. display: flex;
  680. flex-direction: row;
  681. flex-wrap: wrap;
  682. .panel-item {
  683. width: calc(20% - 1.185vh);
  684. margin-left: 1.481vh;
  685. margin-bottom: 1.481vh;
  686. &:nth-child(5n + 1) {
  687. margin-left: 0;
  688. }
  689. }
  690. }
  691. .table-box {
  692. border: 0.093vh solid @darkgray;
  693. position: relative;
  694. overflow: auto;
  695. flex-grow: 1;
  696. &::after,
  697. &::before {
  698. content: "";
  699. position: absolute;
  700. width: 0.185vh;
  701. height: 0.185vh;
  702. background-color: @write;
  703. top: 0.37vh;
  704. }
  705. &::after {
  706. left: 0.37vh;
  707. }
  708. &::before {
  709. right: 0.37vh;
  710. }
  711. }
  712. }
  713. </style>