Matrix-Detail.vue 13 KB

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