Matrix-Detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661
  1. <template>
  2. <div class="matrix-detail">
  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. <div class="loop"></div>
  12. <span class="svg-icon svg-icon-gray svg-icon-md">
  13. <SvgIcon svgid="svg-wind-site"></SvgIcon>
  14. </span>
  15. </div>
  16. <div
  17. class="item"
  18. :class="data.color"
  19. v-for="(data, index) of panel1Data.datas"
  20. :key="index"
  21. >
  22. <div>{{ data.test }}</div>
  23. <div>{{ data.num }}</div>
  24. </div>
  25. </div>
  26. </Col>
  27. <Col :span="12" class="left-50-16">
  28. <div class="panel">
  29. <div class="dot left top"></div>
  30. <div class="dot left bottom"></div>
  31. <div class="dot right top"></div>
  32. <div class="dot right bottom"></div>
  33. <div class="item">
  34. <div class="loop"></div>
  35. <span class="svg-icon svg-icon-gray svg-icon-md">
  36. <SvgIcon
  37. :svgid="'svg-photovoltaic'"
  38. style="margin: 3px 0px -3px 1px"
  39. ></SvgIcon>
  40. </span>
  41. </div>
  42. <div
  43. class="item"
  44. :class="data.color"
  45. v-for="(data, index) of panel2Data.datas"
  46. :key="index"
  47. >
  48. <div>{{ data.test }}</div>
  49. <div>{{ data.num }}</div>
  50. </div>
  51. </div>
  52. </Col>
  53. </Row>
  54. <div class="panel-box">
  55. <div v-for="(table, k) of newTables" :key="k">
  56. <div class="panel-title">
  57. <div class="panel-title-name">
  58. <i class="svg-icon svg-icon-sm svg-icon-green">
  59. <SvgIcon :svgid="'svg-wind-site'"></SvgIcon>
  60. </i>
  61. <span>某某某风电场</span>
  62. <div
  63. class="sub-title-item"
  64. v-for="(data, index) of table.subTitleDatas"
  65. :key="index"
  66. >
  67. <span class="sub-title">{{ data.text }}</span>
  68. <span class="sub-count" :class="data.color">{{ data.num }}</span>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="panel-body">
  73. <div class="card" v-for="j of table.count" :key="j" :class="'green'">
  74. {{ "A" + j }}
  75. </div>
  76. <!-- 站位用 保证卡片布局最后一行不会有问题 -->
  77. <i class="blank" v-for="i in table.count" :key="i"></i>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. import Row from "@/components/coms/grid/row.vue";
  85. import Col from "@/components/coms/grid/col.vue";
  86. import SvgIcon from "@com/coms/icon/svg-icon.vue";
  87. import util from "@/helper/util.js";
  88. export default {
  89. // 名称
  90. name: "LightMatrix1",
  91. // 使用组件
  92. components: {
  93. Row,
  94. Col,
  95. SvgIcon,
  96. },
  97. // 数据
  98. data() {
  99. return {
  100. panel1Data: {
  101. first: {
  102. icon: "svg-wind-site",
  103. },
  104. datas: [
  105. {
  106. color: "write",
  107. test: "接入风机",
  108. num: 256,
  109. },
  110. {
  111. color: "blue",
  112. test: "· 运行",
  113. num: 256,
  114. },
  115. {
  116. color: "green",
  117. test: "· 待机",
  118. num: 256,
  119. },
  120. {
  121. color: "pink",
  122. test: "· 限电",
  123. num: 256,
  124. },
  125. {
  126. color: "red",
  127. test: "· 故障",
  128. num: 256,
  129. },
  130. {
  131. color: "orange",
  132. test: "· 检修",
  133. num: 256,
  134. },
  135. {
  136. color: "write",
  137. test: "· 受累",
  138. num: 256,
  139. },
  140. {
  141. color: "gray",
  142. test: "· 离线",
  143. num: 256,
  144. },
  145. ],
  146. },
  147. panel2Data: {
  148. first: {
  149. icon: "svg-photovoltaic",
  150. },
  151. datas: [
  152. {
  153. color: "write",
  154. test: "接入风机",
  155. num: 256,
  156. },
  157. {
  158. color: "blue",
  159. test: "· 运行",
  160. num: 256,
  161. },
  162. {
  163. color: "green",
  164. test: "· 待机",
  165. num: 256,
  166. },
  167. {
  168. color: "pink",
  169. test: "· 限电",
  170. num: 256,
  171. },
  172. {
  173. color: "red",
  174. test: "· 故障",
  175. num: 256,
  176. },
  177. {
  178. color: "orange",
  179. test: "· 检修",
  180. num: 256,
  181. },
  182. {
  183. color: "write",
  184. test: "· 受累",
  185. num: 256,
  186. },
  187. {
  188. color: "gray",
  189. test: "· 离线",
  190. num: 256,
  191. },
  192. ],
  193. },
  194. tables: [
  195. {
  196. col: 42,
  197. subTitleDatas: [
  198. {
  199. text: "接入台数",
  200. num: 256,
  201. color: "write",
  202. },
  203. {
  204. text: "待机台数",
  205. num: 256,
  206. color: "green",
  207. },
  208. {
  209. text: "并网台数",
  210. num: 256,
  211. color: "blue",
  212. },
  213. {
  214. text: "限电台数",
  215. num: 256,
  216. color: "pink",
  217. },
  218. {
  219. text: "故障台数",
  220. num: 256,
  221. color: "red",
  222. },
  223. {
  224. text: "检修台数",
  225. num: 256,
  226. color: "orange",
  227. },
  228. {
  229. text: "受累台数",
  230. num: 256,
  231. color: "write",
  232. },
  233. {
  234. text: "离线台数",
  235. num: 256,
  236. color: "gray",
  237. },
  238. {
  239. text: "风速",
  240. num: 256,
  241. color: "gray",
  242. },
  243. {
  244. text: "预测功率",
  245. num: 256,
  246. color: "gray",
  247. },
  248. {
  249. text: "保证功率",
  250. num: 256,
  251. color: "gray",
  252. },
  253. {
  254. text: "应发功率",
  255. num: 256,
  256. color: "gray",
  257. },
  258. {
  259. text: "实际功率",
  260. num: 256,
  261. color: "gray",
  262. },
  263. {
  264. text: "AGC指令",
  265. num: 256,
  266. color: "gray",
  267. },
  268. {
  269. text: "出线功率",
  270. num: 256,
  271. color: "gray",
  272. },
  273. ],
  274. datas: [
  275. {
  276. tag: "A01",
  277. color: "blue",
  278. },
  279. ],
  280. },
  281. ],
  282. newTables: [
  283. {
  284. count: 43,
  285. },
  286. {
  287. count: 43 * 3,
  288. },
  289. {
  290. count: 43 * 3,
  291. },
  292. {
  293. count: 43 * 3,
  294. },
  295. {
  296. count: 43 * 2,
  297. },
  298. {
  299. count: 43,
  300. },
  301. {
  302. count: 43 * 3,
  303. },
  304. {
  305. count: 43,
  306. },
  307. {
  308. count: 43,
  309. },
  310. {
  311. count: 43 * 6,
  312. },
  313. ],
  314. };
  315. },
  316. // 函数
  317. methods: {},
  318. // 生命周期钩子
  319. beforeCreate() {
  320. // 创建前
  321. },
  322. created() {
  323. // 创建后
  324. let tempData = [];
  325. for (let i = 0; i < 200; i++) {
  326. tempData.push(util.copy(this.tables[0].datas[0]));
  327. if (i % 13 == 0) {
  328. tempData[i].color = "green";
  329. }
  330. if (i % 17 == 0) {
  331. tempData[i].color = "pink";
  332. }
  333. if (i % 23 == 0) {
  334. tempData[i].color = "orange";
  335. }
  336. if (i % 29 == 0) {
  337. tempData[i].color = "red";
  338. }
  339. if (i % 31 == 0) {
  340. tempData[i].color = "write";
  341. }
  342. if (i % 37 == 0) {
  343. tempData[i].color = "gray";
  344. }
  345. }
  346. this.tables[0].datas = util.copy(tempData);
  347. for (let i = 0; i < 5; i++) {
  348. this.tables.push(util.copy(this.tables[0]));
  349. }
  350. this.newTables.forEach((value) => {
  351. value.subTitleDatas = util.copy(this.tables[0].subTitleDatas);
  352. });
  353. },
  354. beforeMount() {
  355. // 渲染前
  356. },
  357. mounted() {
  358. // 渲染后
  359. },
  360. beforeUpdate() {
  361. // 数据更新前
  362. },
  363. updated() {
  364. // 数据更新后
  365. },
  366. };
  367. </script>
  368. <style lang="less" scoped>
  369. @panelHeight: 6.481vh;
  370. @titleHeight: 25px;
  371. .matrix-detail {
  372. .panel-2 {
  373. .left-50-16 {
  374. width: calc(50% - 8px);
  375. }
  376. }
  377. .panel {
  378. width: 100%;
  379. border: 1px solid @darkgray;
  380. position: relative;
  381. padding: 8px 16px;
  382. background-color: fade(@darkgray, 20%);
  383. display: flex;
  384. .dot {
  385. width: 3px;
  386. height: 3px;
  387. border-radius: 50%;
  388. background-color: @write;
  389. position: absolute;
  390. &.left {
  391. left: 4px;
  392. }
  393. &.right {
  394. right: 4px;
  395. }
  396. &.top {
  397. top: 4px;
  398. }
  399. &.bottom {
  400. bottom: 4px;
  401. }
  402. }
  403. .item {
  404. flex: 1;
  405. display: flex;
  406. align-items: center;
  407. justify-content: center;
  408. flex-direction: column;
  409. color: @write;
  410. position: relative;
  411. .loop {
  412. position: absolute;
  413. width: 42px;
  414. height: 42px;
  415. border-radius: 50%;
  416. border: 1px solid @darkgray;
  417. background-color: fade(@darkgray, 20);
  418. left: calc(50% - 21px);
  419. top: calc(50% - 21px);
  420. }
  421. &.write {
  422. color: @write;
  423. }
  424. &.green {
  425. color: @green;
  426. }
  427. &.blue {
  428. color: @darkBlue;
  429. }
  430. &.pink {
  431. color: @pink;
  432. }
  433. &.red {
  434. color: @red;
  435. }
  436. &.orange {
  437. color: @orange;
  438. }
  439. &.gray {
  440. color: @gray;
  441. }
  442. div {
  443. &:first-child {
  444. font-size: 12px;
  445. }
  446. &:last-child {
  447. font-size: 16px;
  448. font-family: "Bicubik";
  449. }
  450. }
  451. }
  452. .item2 {
  453. flex: 1;
  454. display: flex;
  455. width: 20%;
  456. flex-wrap: wrap;
  457. .name {
  458. color: @gray;
  459. width: 50%;
  460. text-align: center;
  461. }
  462. .num2 {
  463. width: 50%;
  464. color: @yellow;
  465. text-align: left;
  466. }
  467. .num1 {
  468. width: 50%;
  469. color: @yellow;
  470. text-align: center;
  471. position: relative;
  472. &::after {
  473. content: "";
  474. position: absolute;
  475. width: 1.481vh;
  476. height: 0.556vh;
  477. background-color: @yellow;
  478. left: 1.204vh;
  479. top: 10px;
  480. }
  481. }
  482. .num3 {
  483. width: 50%;
  484. color: @yellow;
  485. text-align: left;
  486. }
  487. }
  488. }
  489. .panel-box {
  490. margin-top: 8px;
  491. flex-grow: 1;
  492. & > div {
  493. margin: 4px 0;
  494. }
  495. .panel-title {
  496. width: 100%;
  497. height: @titleHeight;
  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. align-items: center;
  505. padding: 0 16px;
  506. i {
  507. margin-right: 8px;
  508. }
  509. .sub-title-item {
  510. display: flex;
  511. flex: 1;
  512. .sub-title {
  513. flex: 0 0 auto;
  514. color: @gray;
  515. font-size: 12px;
  516. margin: 0 8px 0 12px;
  517. }
  518. .sub-count {
  519. flex: 1 0 auto;
  520. font-size: 14px;
  521. font-family: "Bicubik";
  522. font-weight: 500;
  523. &.write {
  524. color: @write;
  525. }
  526. &.green {
  527. color: @green;
  528. }
  529. &.blue {
  530. color: @darkBlue;
  531. }
  532. &.pink {
  533. color: @pink;
  534. }
  535. &.red {
  536. color: @red;
  537. }
  538. &.orange {
  539. color: @orange;
  540. }
  541. &.gray {
  542. color: @gray;
  543. }
  544. }
  545. }
  546. }
  547. }
  548. .panel-body {
  549. height: calc(100% - 7.407vh);
  550. padding: 0;
  551. // margin: 4px 0;
  552. width: 100%;
  553. display: flex;
  554. flex-direction: row;
  555. flex-wrap: wrap;
  556. justify-content: space-between;
  557. justify-content: flex-start;
  558. .blank {
  559. margin-right: 3px;
  560. flex: 1 0 40px;
  561. }
  562. .card {
  563. margin-right: 3px;
  564. margin-top: 2px;
  565. flex: 1 0 40px;
  566. }
  567. .card {
  568. border-radius: 4px;
  569. text-align: center;
  570. border: 1px solid;
  571. font-size: 12px;
  572. height: 20px;
  573. line-height: 20px;
  574. &.write {
  575. color: @black;
  576. border-color: @write;
  577. background-color: @write;
  578. }
  579. &.green {
  580. color: @green;
  581. border-color: @green;
  582. }
  583. &.blue {
  584. color: @darkBlue;
  585. border-color: @darkBlue;
  586. }
  587. &.pink {
  588. color: @pink;
  589. border-color: @pink;
  590. }
  591. &.red {
  592. color: @write;
  593. border-color: @red;
  594. background-color: @red;
  595. }
  596. &.orange {
  597. color: @orange;
  598. border-color: @orange;
  599. }
  600. &.gray {
  601. color: @write;
  602. border-color: @darkgray;
  603. background-color: @darkgray;
  604. }
  605. }
  606. }
  607. }
  608. }
  609. </style>