Status.vue 15 KB

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