LightMatrix1.vue 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. <template >
  2. <el-scrollbar>
  3. <div class="light-matrix">
  4. <Row class="panel-2" type="">
  5. <Col :span="12" class="left-50-16">
  6. <div class="panel">
  7. <div class="dot left top"></div>
  8. <div class="dot left bottom"></div>
  9. <div class="dot right top"></div>
  10. <div class="dot right bottom"></div>
  11. <div class="item">
  12. <div class="loop"></div>
  13. <span class="svg-icon svg-icon-gray svg-icon-md">
  14. <SvgIcon svgid="svg-wind-site"></SvgIcon>
  15. </span>
  16. </div>
  17. <div class="item write" @click="changeShow('jrfj_FDC')">
  18. <div class="curStyle">
  19. <div>接入风机</div>
  20. <div>{{ sourceMap.fcjrnum || "---" }}</div>
  21. </div>
  22. </div>
  23. <div class="item blue" @click="changeShow('yx_FDC', 1)">
  24. <div class="curStyle">
  25. <div>· 运行</div>
  26. <div>{{ sourceMap.fcyxnum || "---" }}</div>
  27. </div>
  28. </div>
  29. <div class="item green" @click="changeShow('dj_FDC', 0)">
  30. <div class="curStyle">
  31. <div>· 待机</div>
  32. <div>{{ sourceMap.fcdjnum || "---" }}</div>
  33. </div>
  34. </div>
  35. <div class="item pink" @click="changeShow('xd_FDC', 5)">
  36. <div class="curStyle">
  37. <div>· 限电</div>
  38. <div>{{ sourceMap.fcxdnum || "---" }}</div>
  39. </div>
  40. </div>
  41. <div class="item red" @click="changeShow('gz_FDC', 2)">
  42. <div class="curStyle">
  43. <div>· 故障</div>
  44. <div>{{ sourceMap.fcgznum || "---" }}</div>
  45. </div>
  46. </div>
  47. <div class="item orange" @click="changeShow('jx_FDC', 4)">
  48. <div class="curStyle">
  49. <div>· 检修</div>
  50. <div>{{ sourceMap.fcwhnum || "---" }}</div>
  51. </div>
  52. </div>
  53. <div class="item write" @click="changeShow('sl_FDC', 6)">
  54. <div class="curStyle">
  55. <div>· 受累</div>
  56. <div>{{ sourceMap.fcslnum || "---" }}</div>
  57. </div>
  58. </div>
  59. <div class="item gray" @click="changeShow('lx_FDC', 3)">
  60. <div class="curStyle">
  61. <div>· 离线</div>
  62. <div>{{ sourceMap.fclxnum || "---" }}</div>
  63. </div>
  64. </div>
  65. </div>
  66. </Col>
  67. <Col :span="12" class="left-50-16">
  68. <div class="panel">
  69. <div class="dot left top"></div>
  70. <div class="dot left bottom"></div>
  71. <div class="dot right top"></div>
  72. <div class="dot right bottom"></div>
  73. <div class="item">
  74. <div class="loop"></div>
  75. <span class="svg-icon svg-icon-gray svg-icon-md">
  76. <SvgIcon
  77. :svgid="'svg-photovoltaic'"
  78. style="margin: 3px 0px -3px 1px"
  79. ></SvgIcon>
  80. </span>
  81. </div>
  82. <div class="item write" @click="changeShow('jrfj1_GDC')">
  83. <div class="curStyle">
  84. <div>逆变器</div>
  85. <div>{{ sourceMap.gfjrnum || "---" }}</div>
  86. </div>
  87. </div>
  88. <div class="item blue" @click="changeShow('yx1_GDC', 1)">
  89. <div class="curStyle">
  90. <div>· 运行</div>
  91. <div>{{ sourceMap.gfyxnum || "---" }}</div>
  92. </div>
  93. </div>
  94. <div class="item greenv" @click="changeShow('dj1_GDC', 0)">
  95. <div class="curStyle">
  96. <div>· 待机</div>
  97. <div>{{ sourceMap.gfdjnum || "---" }}</div>
  98. </div>
  99. </div>
  100. <div class="item pink" @click="changeShow('xd1_GDC', 5)">
  101. <div class="curStyle">
  102. <div>· 限电</div>
  103. <div>{{ sourceMap.gfxdnum || "---" }}</div>
  104. </div>
  105. </div>
  106. <div class="item red" @click="changeShow('gz1_GDC', 2)">
  107. <div class="curStyle">
  108. <div>· 故障</div>
  109. <div>{{ sourceMap.gfgznum || "---" }}</div>
  110. </div>
  111. </div>
  112. <div class="item orange" @click="changeShow('jx1_GDC', 4)">
  113. <div class="curStyle">
  114. <div>· 检修</div>
  115. <div>{{ sourceMap.gfwhnum || "---" }}</div>
  116. </div>
  117. </div>
  118. <div class="item write" @click="changeShow('sl1_GDC', 6)">
  119. <div class="curStyle">
  120. <div>· 受累</div>
  121. <div>{{ sourceMap.gfslnum || "---" }}</div>
  122. </div>
  123. </div>
  124. <div class="item gray curStyle" @click="changeShow('lx1_GDC', 3)">
  125. <div class="curStyle">
  126. <div>· 离线</div>
  127. <div>{{ sourceMap.gflxnum || "---" }}</div>
  128. </div>
  129. </div>
  130. </div>
  131. </Col>
  132. </Row>
  133. <div class="panel-box">
  134. <div v-for="(pItem, pIndex) in sourceMap.fjmap" :key="pIndex">
  135. <div class="panel-title" v-if="sourceMap.fjmap[pIndex][0].wpId.includes('FDC')">
  136. <div class="panel-title-name">
  137. <i class="svg-icon svg-icon-sm svg-icon-green">
  138. <SvgIcon :svgid="'svg-wind-site'"></SvgIcon>
  139. </i>
  140. <span>{{
  141. sourceMap.fczbmap[sourceMap.fjmap[pIndex][0].wpId].name ||
  142. "------"
  143. }}</span>
  144. <div
  145. class="sub-title-item"
  146. v-for="(fcItem, fcIndex) in fcStateArray"
  147. :key="fcIndex"
  148. >
  149. <span class="sub-title">{{ fcItem.text }}</span>
  150. <span class="sub-count" :class="fcItem.color">{{
  151. sourceMap.fczbmap[sourceMap.fjmap[pIndex][0].wpId][fcItem.key]
  152. }}</span>
  153. </div>
  154. </div>
  155. </div>
  156. <div class="panel-title" v-if="sourceMap.fjmap[pIndex][0].wpId.includes('GDC')">
  157. <div class="panel-title-name">
  158. <i class="svg-icon svg-icon-sm svg-icon-green">
  159. <SvgIcon :svgid="'svg-wind-site'"></SvgIcon>
  160. </i>
  161. <span>{{
  162. sourceMap.fczbmap[sourceMap.fjmap[pIndex][0].wpId].name ||
  163. "------"
  164. }}</span>
  165. <div
  166. class="sub-title-item"
  167. v-for="(fcItem, fcIndex) in fcStateArray1"
  168. :key="fcIndex"
  169. >
  170. <span class="sub-title">{{ fcItem.text }}</span>
  171. <span class="sub-count" :class="fcItem.color">{{
  172. sourceMap.fczbmap[sourceMap.fjmap[pIndex][0].wpId][fcItem.key]
  173. }}</span>
  174. </div>
  175. </div>
  176. </div>
  177. <div class="panel-body">
  178. <div
  179. class="card"
  180. v-for="(cItem, cIndex) of pItem"
  181. :key="cIndex"
  182. v-show="cItem.isShow"
  183. :class="cItem.color"
  184. @click="goDetails(cItem)"
  185. >
  186. {{ cItem.wtnum }}
  187. </div>
  188. <!-- 站位用 保证卡片布局最后一行不会有问题 -->
  189. <i class="blank" v-for="i in pItem.length" :key="i"></i>
  190. </div>
  191. </div>
  192. </div>
  193. </div>
  194. </el-scrollbar>
  195. </template>
  196. <script>
  197. import Row from "@/components/coms/grid/row.vue";
  198. import Col from "@/components/coms/grid/col.vue";
  199. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  200. import util from "@/helper/util.js";
  201. import store from "@store/index.js";
  202. import { isNumber } from "util";
  203. import { setInterval, clearInterval } from "timers";
  204. export default {
  205. // 名称
  206. name: "LightMatrix1",
  207. // 使用组件
  208. components: {
  209. Row,
  210. Col,
  211. SvgIcon,
  212. },
  213. // 数据
  214. data() {
  215. return {
  216. timmer: null, // 计时器
  217. sourceMap: {}, // 核心数据
  218. fillCategory: null, // 过滤条件
  219. fillFjzt: null, // 过滤条件
  220. fcStateArray: [
  221. {
  222. text: "接入台数",
  223. color: "write",
  224. key: "jrts",
  225. },
  226. {
  227. text: "待机台数",
  228. color: "green",
  229. key: "djts",
  230. },
  231. {
  232. text: "并网台数",
  233. color: "blue",
  234. key: "yxts",
  235. },
  236. {
  237. text: "限电台数",
  238. color: "purple",
  239. key: "xdts",
  240. },
  241. {
  242. text: "故障台数",
  243. color: "red",
  244. key: "gzts",
  245. },
  246. {
  247. text: "检修台数",
  248. color: "orange",
  249. key: "whts",
  250. },
  251. {
  252. text: "受累台数",
  253. color: "write",
  254. key: "slts",
  255. },
  256. {
  257. text: "离线台数",
  258. color: "gray",
  259. key: "lxts",
  260. },
  261. {
  262. text: "风速",
  263. color: "gray",
  264. key: "ssfs",
  265. },
  266. {
  267. text: "预测功率",
  268. color: "gray",
  269. key: "ycgl",
  270. },
  271. {
  272. text: "保证功率",
  273. color: "gray",
  274. key: "bzgl",
  275. },
  276. {
  277. text: "应发功率",
  278. color: "gray",
  279. key: "yfgl",
  280. },
  281. {
  282. text: "实际功率",
  283. color: "gray",
  284. key: "sjgl",
  285. },
  286. {
  287. text: "AGC指令",
  288. color: "gray",
  289. key: "agcygsd",
  290. },
  291. {
  292. text: "出线功率",
  293. color: "gray",
  294. key: "agccxyg",
  295. },
  296. ],
  297. fcStateArray1: [
  298. {
  299. text: "接入台数",
  300. color: "write",
  301. key: "jrts",
  302. },
  303. {
  304. text: "待机台数",
  305. color: "green",
  306. key: "djts",
  307. },
  308. {
  309. text: "并网台数",
  310. color: "blue",
  311. key: "yxts",
  312. },
  313. {
  314. text: "限电台数",
  315. color: "purple",
  316. key: "xdts",
  317. },
  318. {
  319. text: "故障台数",
  320. color: "red",
  321. key: "gzts",
  322. },
  323. {
  324. text: "检修台数",
  325. color: "orange",
  326. key: "whts",
  327. },
  328. {
  329. text: "受累台数",
  330. color: "write",
  331. key: "slts",
  332. },
  333. {
  334. text: "离线台数",
  335. color: "gray",
  336. key: "lxts",
  337. },
  338. {
  339. text: "日照强度",
  340. color: "gray",
  341. key: "ssfs",
  342. },
  343. {
  344. text: "预测功率",
  345. color: "gray",
  346. key: "ycgl",
  347. },
  348. {
  349. text: "保证功率",
  350. color: "gray",
  351. key: "bzgl",
  352. },
  353. {
  354. text: "应发功率",
  355. color: "gray",
  356. key: "yfgl",
  357. },
  358. {
  359. text: "实际功率",
  360. color: "gray",
  361. key: "sjgl",
  362. },
  363. {
  364. text: "AGC指令",
  365. color: "gray",
  366. key: "agcygsd",
  367. },
  368. {
  369. text: "出线功率",
  370. color: "gray",
  371. key: "agccxyg",
  372. },
  373. ],
  374. };
  375. },
  376. // 函数
  377. methods: {
  378. // 根据风机状态码返回对应 class
  379. getColor(fjzt) {
  380. switch (fjzt) {
  381. case 0:
  382. return "green";
  383. case 1:
  384. return "blue";
  385. case 2:
  386. return "red";
  387. case 3:
  388. return "gray";
  389. case 4:
  390. return "orange";
  391. case 5:
  392. return "pink";
  393. case 6:
  394. return "pink";
  395. }
  396. },
  397. // 切换显示种类
  398. changeShow(category, fjzt, skipFill) {
  399. // if (!skipFill) {
  400. // console.log("!skipFill:", !skipFill);
  401. // if (this.fillCategory === category) {
  402. // console.log("fillCategory:", this.fillCategory);
  403. // console.log("fillFjz:", this.fillFjzt);
  404. // this.fillCategory = null;
  405. // this.fillFjzt = null;
  406. // } else {
  407. this.fillCategory = category;
  408. this.fillFjzt = fjzt;
  409. // }
  410. // }
  411. let fjmap = this.BASE.deepCopy(this.sourceMap.fjmap);
  412. fjmap.forEach((pEle) => {
  413. console.log("pele:", pEle);
  414. pEle.forEach((cEle) => {
  415. console.log("cele:", cEle);
  416. cEle.isShow = true;
  417. if (!this.fillCategory) {
  418. cEle.isShow = true;
  419. // cEle.isShow=false;
  420. } else if (cEle.wpId.indexOf(category.split("_")[1]) !== -1) {
  421. if (isNumber(fjzt)) {
  422. cEle.fjzt === fjzt ? (cEle.isShow = true) : (cEle.isShow = false);
  423. } else {
  424. cEle.isShow = true;
  425. // cEle.isShow = false;
  426. }
  427. } else {
  428. cEle.isShow = true;
  429. }
  430. });
  431. });
  432. this.sourceMap.fjmap = fjmap;
  433. },
  434. // 请求服务
  435. requestData(showLoading) {
  436. let that = this;
  437. that.API.requestData({
  438. showLoading,
  439. method: "POST",
  440. subUrl: "matrix/matrixPush",
  441. success(res) {
  442. if (res) {
  443. console.log("resmap:", res);
  444. let sourceMap = res.data;
  445. let fjmap = [];
  446. for (let key in sourceMap) {
  447. if (key !== "fczbmap" && key !== "fjmap") {
  448. sourceMap[key] += "";
  449. } else if (key === "fjmap") {
  450. sourceMap[key].forEach((pItem) => {
  451. pItem.forEach((cItem) => {
  452. cItem.color = that.getColor(cItem.fjzt);
  453. cItem.isShow = true;
  454. });
  455. });
  456. }
  457. }
  458. that.sourceMap = sourceMap;
  459. console.log("sourceMap:", that.sourceMap);
  460. if (that.fillCategory) {
  461. that.changeShow(that.fillCategory, that.fillFjzt, true);
  462. }
  463. } else {
  464. that.sourceMap = {};
  465. }
  466. },
  467. });
  468. },
  469. // 查看风机详情
  470. goDetails(item) {
  471. if (item.wpId.indexOf("FDC") !== -1) {
  472. this.$router.push({
  473. path: `/monitor/windsite/info/${item.wpId}/${item.wtId}`,
  474. });
  475. } else {
  476. this.$router.push({
  477. path: `windsite/inverter-info/${item.wpId}/${item.wtId}`,
  478. });
  479. }
  480. },
  481. },
  482. created() {
  483. let that = this;
  484. that.$nextTick(() => {
  485. that.requestData(false);
  486. that.timmer = setInterval(() => {
  487. that.requestData(false);
  488. }, that.$store.state.websocketTimeSec);
  489. });
  490. },
  491. unmounted() {
  492. clearInterval(this.timmer);
  493. this.timmer = null;
  494. },
  495. };
  496. </script>
  497. <style lang="less" scoped>
  498. @panelHeight: 6.481vh;
  499. @titleHeight: 2.7778vh;
  500. .light-matrix {
  501. // width: calc(100% - 1.111vh);
  502. height: calc(100vh - 7.222vh);
  503. display: flex;
  504. flex-direction: column;
  505. .panel-2 {
  506. .left-50-16 {
  507. width: calc(50% - 0.741vh);
  508. }
  509. }
  510. .panel {
  511. width: 100%;
  512. border: 0.093vh solid @darkgray;
  513. position: relative;
  514. padding: 0.7407vh 1.4815vh;
  515. background-color: fade(@darkgray, 20%);
  516. display: flex;
  517. .dot {
  518. width: 0.185vh;
  519. height: 0.185vh;
  520. border-radius: 50%;
  521. background-color: @write;
  522. position: absolute;
  523. &.left {
  524. left: 0.37vh;
  525. }
  526. &.right {
  527. right: 0.37vh;
  528. }
  529. &.top {
  530. top: 0.37vh;
  531. }
  532. &.bottom {
  533. bottom: 0.37vh;
  534. }
  535. }
  536. .item {
  537. flex: 1;
  538. display: flex;
  539. align-items: center;
  540. justify-content: center;
  541. flex-direction: column;
  542. color: @write;
  543. position: relative;
  544. .loop {
  545. position: absolute;
  546. width: 4.444vh;
  547. height: 4.444vh;
  548. border-radius: 50%;
  549. border: 0.093vh solid @darkgray;
  550. background-color: fade(@darkgray, 20);
  551. left: calc(50% - 2.222vh);
  552. top: calc(50% - 2.222vh);
  553. }
  554. &.write {
  555. color: @write;
  556. }
  557. &.green {
  558. color: @green;
  559. }
  560. &.blue {
  561. color: @darkBlue;
  562. }
  563. &.pink {
  564. color: @pink;
  565. }
  566. &.red {
  567. color: @red;
  568. }
  569. &.orange {
  570. color: @orange;
  571. }
  572. &.gray {
  573. color: @gray;
  574. }
  575. div {
  576. line-height: 2.222vh;
  577. &:first-child {
  578. font-size: @fontsize-s;
  579. }
  580. &:last-child {
  581. font-size: @fontsize;
  582. font-family: "Bicubik";
  583. }
  584. }
  585. }
  586. .item2 {
  587. flex: 1;
  588. display: flex;
  589. width: 20%;
  590. flex-wrap: wrap;
  591. .name {
  592. color: @gray;
  593. width: 50%;
  594. text-align: center;
  595. }
  596. .num2 {
  597. width: 50%;
  598. color: @yellow;
  599. text-align: left;
  600. }
  601. .num1 {
  602. width: 50%;
  603. color: @yellow;
  604. text-align: center;
  605. position: relative;
  606. &::after {
  607. content: "";
  608. position: absolute;
  609. width: 1.481vh;
  610. height: 0.556vh;
  611. background-color: @yellow;
  612. left: 1.204vh;
  613. top: 0.741vh;
  614. }
  615. }
  616. .num3 {
  617. width: 50%;
  618. color: @yellow;
  619. text-align: left;
  620. }
  621. }
  622. }
  623. .panel-box {
  624. margin-top: 0.7407vh;
  625. flex-grow: 1;
  626. .panel-title {
  627. width: 100%;
  628. height: @titleHeight;
  629. line-height: @titleHeight;
  630. background-color: fade(@darkgray, 40%);
  631. .panel-title-name {
  632. font-size: @fontsize-s;
  633. color: @green;
  634. display: flex;
  635. align-items: center;
  636. padding: 0 16px;
  637. i {
  638. margin-right: 0.7407vh;
  639. }
  640. .sub-title-item {
  641. display: flex;
  642. flex: 1;
  643. justify-content: center;
  644. .sub-title {
  645. flex: 0 0 auto;
  646. color: @gray;
  647. font-size: 12px;
  648. margin: 0 0.556vh 0 1.481vh;
  649. }
  650. .sub-count {
  651. flex: 1 0 auto;
  652. font-size: 14px;
  653. font-family: "Bicubik";
  654. font-weight: 500;
  655. &.write {
  656. color: @write;
  657. }
  658. &.green {
  659. color: @green;
  660. }
  661. &.blue {
  662. color: @darkBlue;
  663. }
  664. &.pink {
  665. color: @pink;
  666. }
  667. &.red {
  668. color: @red;
  669. }
  670. &.orange {
  671. color: @orange;
  672. }
  673. &.gray {
  674. color: @gray;
  675. }
  676. }
  677. }
  678. }
  679. }
  680. .panel-body {
  681. height: calc(100% - 7.407vh);
  682. padding: 0.3704vh;
  683. width: 100%;
  684. display: flex;
  685. flex-direction: row;
  686. flex-wrap: wrap;
  687. justify-content: space-between;
  688. justify-content: flex-start;
  689. .blank {
  690. margin-right: 2px;
  691. flex: 1 0 40px;
  692. }
  693. .card {
  694. margin-right: 2px;
  695. margin-top: 2px;
  696. flex: 1 0 40px;
  697. cursor: pointer;
  698. }
  699. .card {
  700. border-radius: 0.37vh;
  701. padding: 0.185vh 0.3704vh;
  702. text-align: center;
  703. border: 0.093vh solid;
  704. font-size: 12px;
  705. &.write {
  706. color: @black;
  707. border-color: @write;
  708. background-color: @write;
  709. }
  710. &.green {
  711. color: @green;
  712. border-color: @green;
  713. }
  714. &.blue {
  715. color: @darkBlue;
  716. border-color: @darkBlue;
  717. }
  718. &.pink {
  719. color: @pink;
  720. border-color: @pink;
  721. }
  722. &.red {
  723. color: @write;
  724. border-color: @red;
  725. background-color: @red;
  726. }
  727. &.orange {
  728. color: @orange;
  729. border-color: @orange;
  730. }
  731. &.gray {
  732. color: @write;
  733. border-color: @darkgray;
  734. background-color: @darkgray;
  735. }
  736. }
  737. }
  738. }
  739. .curStyle {
  740. cursor: pointer;
  741. text-align: center;
  742. }
  743. }
  744. </style>