LightMatrix2.vue 18 KB

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