Status.vue 19 KB

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