LightMatrix2.vue 18 KB

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