elecindex.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616
  1. <template>
  2. <div id="elec-index" ref="appRef">
  3. <dv-loading v-if="loading">Loading...</dv-loading>
  4. <div v-else class="host-body bg">
  5. <div class="d-flex jc-center">
  6. <dv-decoration-10 style="width:33.3%;height:.0625rem;" />
  7. <div class="d-flex jc-center">
  8. <dv-decoration-8 :color="['#568aea', '#000000']" style="width:2.5rem;height:.625rem;" />
  9. <div class="title">
  10. <span class="title-text">电厂监控大屏</span>
  11. <dv-decoration-6
  12. class="title-bototm"
  13. :reverse="true"
  14. :color="['#50e3c2', '#67a1e5']"
  15. style="width:3.125rem;height:.1rem;"
  16. />
  17. </div>
  18. <dv-decoration-8
  19. :reverse="true"
  20. :color="['#568aea', '#000000']"
  21. style="width:2.5rem;height:.625rem;"
  22. />
  23. </div>
  24. <dv-decoration-10 style="width:33.3%;height:.0625rem; transform: rotateY(180deg);" />
  25. </div>
  26. <!-- 第二行 -->
  27. <div class="d-flex jc-between px-2">
  28. <div class="d-flex" style="width: 40%">
  29. <div
  30. class="react-right ml-4" v-bind:style="{backgroundColor:bgCol1,width:wh,textAlign:tAlign}"
  31. @click="changeDashboard(1)">
  32. <span class="react-before"></span>
  33. <span class="text" id="aa">数据监控</span>
  34. </div>
  35. <div class="react-right ml-3" v-bind:style="{backgroundColor:bgCol2,width:wh,textAlign:tAlign}"
  36. @click="changeDashboard(2)">
  37. <span class="text colorBlue"></span>
  38. <span class="text" id="bb">蒸汽平衡</span>
  39. </div>
  40. <div class="react-right ml-2" v-bind:style="{backgroundColor:bgCol3,width:wh,textAlign:tAlign}"
  41. @click="changeDashboard(3)">
  42. <span class="text colorBlue"></span>
  43. <span class="text" id="cc">环保监控</span>
  44. </div>
  45. </div>
  46. <div style="width: 40%" class="d-flex">
  47. <div class="react-left bg-color-blue mr-3">
  48. <span class="text fw-b">北京时间</span>
  49. </div>
  50. <div
  51. class="react-left mr-3"
  52. style="width: 6.25rem; background-color: #0f1325;"
  53. >
  54. <span style="text-align: center" class="text">{{dateYear}} {{dateWeek}} {{dateDay}}</span>
  55. </div>
  56. <div class="react-left mr-3" style="width: 2.25rem; background-color: #0f1325;" @click="openNewWindow">
  57. <span class="text fw-b"> <svg-icon icon-class="fullscreen" /></span>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="body-box" v-if="dashboard === 1">
  62. <!-- 第三行数据 -->
  63. <div class="content-box">
  64. <div>
  65. <dv-border-box-12>
  66. <centerLeft1 :monthData="monthData"/>
  67. </dv-border-box-12>
  68. </div>
  69. <!-- 中间 -->
  70. <div>
  71. <center :dashboardelecdata="dashboardelecdata"/>
  72. </div>
  73. <!-- 中间 -->
  74. <div>
  75. <centerRight2 :dashboardelecdata="[dashboardelecdata,monthData]"/>
  76. </div>
  77. <div>
  78. <dv-border-box-13>
  79. <centerRight1 :fiftydayData="fiftydayData"/>
  80. </dv-border-box-13>
  81. </div>
  82. </div>
  83. <!-- 第四行数据 -->
  84. <div class="bototm-box">
  85. <dv-border-box-13>
  86. <bottomLeft :monthData="monthData"/>
  87. </dv-border-box-13>
  88. <div class="bototm-box1">
  89. <dv-border-box-12>
  90. <bottom-right :weekData="weekData"/>
  91. </dv-border-box-12>
  92. <div class="bototm-box2">
  93. <dv-border-box-12>
  94. <div class="bg-color-black">
  95. <div class="d-flex pt-2 pl-2">
  96. <span style="color:#5cd9e8">
  97. <icon name="chart-bar"></icon>
  98. </span>
  99. <div class="d-flex">
  100. <span class="fs-xl text mx-2">天然气日消耗情况</span>
  101. </div>
  102. </div>
  103. <div>
  104. <bottom-right1 />
  105. </div>
  106. </div>
  107. </dv-border-box-12>
  108. <dv-border-box-12>
  109. <div class="bg-color-black">
  110. <div class="d-flex pt-2 pl-2">
  111. <span style="color:#5cd9e8">
  112. <icon name="chart-bar"></icon>
  113. </span>
  114. <div class="d-flex">
  115. <span class="fs-xl text mx-2">瞬时值</span>
  116. </div>
  117. </div>
  118. <div>
  119. <bottom-right2 />
  120. </div>
  121. </div>
  122. </dv-border-box-12>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
  127. <div class="body-box" v-if="dashboard === 2">
  128. <div>
  129. <front-elec-two></front-elec-two>
  130. </div>
  131. </div>
  132. <div class="body-box" v-if="dashboard === 3">
  133. <div>
  134. <front-elec-three></front-elec-three>
  135. </div>
  136. </div>
  137. </div>
  138. </div>
  139. </template>
  140. <script>
  141. import centerLeft1 from "./centerLeft1";
  142. import centerLeft2 from "./centerLeft2";
  143. import centerRight1 from "./centerRight1";
  144. import centerRight2 from "./centerRight2";
  145. import center from "./center";
  146. import bottomLeft from "./bottomLeft";
  147. import bottomRight from "./bottomRight";
  148. import bottomRight1 from "./echart/bottom/bottomRightChart1"
  149. import bottomRight2 from "./echart/bottom/bottomRightChart2"
  150. import frontElecTwo from "@/views/monitor/elec/frontElecTwo";
  151. import frontElecThree from "@/views/monitor/elec/frontElecThree";
  152. import '@/assets/styles/index.scss' // global css
  153. import '@/common/flexible.js';
  154. import dayjs from "dayjs";
  155. import {selectLast,selectMonth,selecctfiftyday} from "@/api/aspen/dashboarddayelec";
  156. import {selectWeek} from "@/api/aspen/dashboarddayeleceight";
  157. export default {
  158. data() {
  159. return {
  160. loading: true,
  161. dashboard: 1,
  162. dateDay: null,
  163. dateYear: null,
  164. dateWeek: null,
  165. weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  166. timer:null,
  167. bgCol1:"#0f1325",
  168. bgCol2:"#0f1325",
  169. bgCol3:"#0f1325",
  170. bgCol0:"#0a84ff",
  171. wh:"3.25rem",
  172. tAlign:"left",
  173. dashboardelecdata: {
  174. pageNum: 1,
  175. pageSize: 20,
  176. createrCode: null,
  177. createdate: null,
  178. updaterCode: null,
  179. updatedate: null,
  180. gtg1Lv: null,
  181. gtg1Wr: null,
  182. gtg2Lv: null,
  183. gtg2Wr: null,
  184. gtg3Lv: null,
  185. gtg3Wr: null,
  186. stg1Lv: null,
  187. stg1Wr: null,
  188. mwhLv: null,
  189. mwhWr: null,
  190. hhp: null,
  191. hp: null,
  192. lp: null,
  193. mp: null,
  194. totalConsumption: null,
  195. hhpNum: null,
  196. hhpTemp: null,
  197. hpNum: null,
  198. hpTemp: null,
  199. lpNum: null,
  200. lpTemp: null,
  201. mpNum: null,
  202. mpTemp: null,
  203. shihua: null,
  204. shiyou: null,
  205. shunshiliang: null,
  206. ypg: null,
  207. daodianliang: null,
  208. eveLec: null,
  209. fenggucha: null,
  210. bycElec: null,
  211. bocElec: null,
  212. dataDate: null,
  213. dateDay: null
  214. },
  215. monthData:{
  216. pageNum: 1,
  217. pageSize: 20,
  218. createrCode: null,
  219. createdate: null,
  220. updaterCode: null,
  221. updatedate: null,
  222. gtg1Lv: null,
  223. gtg1Wr: null,
  224. gtg2Lv: null,
  225. gtg2Wr: null,
  226. gtg3Lv: null,
  227. gtg3Wr: null,
  228. stg1Lv: null,
  229. stg1Wr: null,
  230. mwhLv: null,
  231. mwhWr: null,
  232. hhp: null,
  233. hp: null,
  234. lp: null,
  235. mp: null,
  236. totalConsumption: null,
  237. hhpNum: null,
  238. hhpTemp: null,
  239. hpNum: null,
  240. hpTemp: null,
  241. lpNum: null,
  242. lpTemp: null,
  243. mpNum: null,
  244. mpTemp: null,
  245. shihua: null,
  246. shiyou: null,
  247. shunshiliang: null,
  248. ypg: null,
  249. daodianliang: null,
  250. eveLec: null,
  251. fenggucha: null,
  252. bycElec: null,
  253. bocElec: null,
  254. dataDate: null,
  255. dateDay: null
  256. },
  257. weekData:{
  258. pageNum: 1,
  259. pageSize: 20,
  260. createrCode: null,
  261. createdate: null,
  262. updaterCode: null,
  263. updatedate: null,
  264. evconsume: null,
  265. elecp: null,
  266. hechengqi: null,
  267. u2: null,
  268. dataDate: null,
  269. dateDay: null
  270. },
  271. fiftydayData:{
  272. pageNum: 1,
  273. pageSize: 20,
  274. createrCode: null,
  275. createdate: null,
  276. updaterCode: null,
  277. updatedate: null,
  278. gtg1Lv: null,
  279. gtg1Wr: null,
  280. gtg2Lv: null,
  281. gtg2Wr: null,
  282. gtg3Lv: null,
  283. gtg3Wr: null,
  284. stg1Lv: null,
  285. stg1Wr: null,
  286. mwhLv: null,
  287. mwhWr: null,
  288. hhp: null,
  289. hp: null,
  290. lp: null,
  291. mp: null,
  292. totalConsumption: null,
  293. hhpNum: null,
  294. hhpTemp: null,
  295. hpNum: null,
  296. hpTemp: null,
  297. lpNum: null,
  298. lpTemp: null,
  299. mpNum: null,
  300. mpTemp: null,
  301. shihua: null,
  302. shiyou: null,
  303. shunshiliang: null,
  304. ypg: null,
  305. daodianliang: null,
  306. eveLec: null,
  307. fenggucha: null,
  308. bycElec: null,
  309. bocElec: null,
  310. dataDate: null,
  311. dateDay: null
  312. }
  313. };
  314. },
  315. components: {
  316. centerLeft1,
  317. centerLeft2,
  318. centerRight1,
  319. centerRight2,
  320. center,
  321. bottomLeft,
  322. bottomRight,
  323. bottomRight1,
  324. bottomRight2,
  325. frontElecTwo,
  326. frontElecThree
  327. },
  328. mounted() {
  329. if(this.dashboard===1){
  330. this.bgCol1="#1a5cd7"
  331. };
  332. this.timer = setInterval(()=>{
  333. const date= dayjs(new Date());
  334. this.dateDay = date.format('HH:mm:ss');
  335. this.dateYear = date.format('YYYY年MM月DD日');
  336. this.dateWeek = date.format(this.weekday[date.day()]);
  337. },1000),
  338. this.setScale();
  339. window.addEventListener("resize", this.debounce(this.setScale, 100));
  340. // * 适配处理
  341. this.cancelLoading();
  342. },
  343. created() {
  344. this.getList1();
  345. this.getMonthList1();
  346. this.getWeekList();
  347. this.getFiftydayList();
  348. // 每隔30秒请求一次数据
  349. window.setInterval(() => {
  350. setTimeout(() => {
  351. ///调取接口获取数据
  352. this.getList1();
  353. }, 0)
  354. }, 30000)
  355. // 一天请求一次数据
  356. window.setInterval(() => {
  357. setTimeout(() => {
  358. ///调取接口获取数据
  359. this.getMonthList1();
  360. }, 0)
  361. }, 1000 * 10 * 6 * 60 * 6)
  362. // 一天请求一次数据
  363. window.setInterval(() => {
  364. setTimeout(() => {
  365. ///调取接口获取数据
  366. this.getWeekList();
  367. }, 0)
  368. }, 1000 * 10 * 6 * 60 * 6)
  369. // 一天请求一次数据
  370. window.setInterval(() => {
  371. setTimeout(() => {
  372. ///调取接口获取数据
  373. this.getFiftydayList();
  374. }, 0)
  375. }, 1000 * 10 * 6 * 60 * 6)
  376. },
  377. methods: {
  378. /** 查询dashboarddayelec抓取数据列表 */
  379. getList1()
  380. {
  381. selectLast(this.queryParams).then(response => {
  382. this.dashboardelecdata = response.data;
  383. });
  384. },
  385. /** 查询dashboarddayelec近三十天抓取数据列表 */
  386. getMonthList1()
  387. {
  388. selectMonth(this.queryParams).then(response => {
  389. this.monthData = response.data;
  390. });
  391. },
  392. /** 查询dashboarddayelec近一周抓取数据列表 */
  393. getWeekList()
  394. {
  395. selectWeek(this.queryParams).then(response => {
  396. this.weekData = response.data;
  397. });
  398. },
  399. /** 查询dashboarddayelec近49天抓取数据列表 */
  400. getFiftydayList()
  401. {
  402. selecctfiftyday(this.queryParams).then(response => {
  403. this.fiftydayData = response.data;
  404. });
  405. },
  406. cancelLoading() {
  407. setTimeout(() => {
  408. this.loading = false;
  409. }, 500);
  410. },
  411. getScale() {
  412. let { width, height } = this;
  413. let wh = window.innerHeight / height;
  414. let ww = window.innerWidth / width;
  415. console.log(ww < wh ? ww : wh);
  416. return ww < wh ? ww : wh;
  417. },
  418. setScale() {
  419. if(window.innerHeight ==1080){
  420. this.height = 1080
  421. }else{
  422. this.height = 937
  423. }
  424. this.scale = this.getScale();
  425. if (this.$refs.ScaleBox) {
  426. this.$refs.ScaleBox.style.setProperty("--scale", this.scale);
  427. }
  428. },
  429. debounce(fn, delay) {
  430. let delays = delay || 500;
  431. let timer;
  432. return function () {
  433. let th = this;
  434. let args = arguments;
  435. if (timer) {
  436. clearTimeout(timer);
  437. }
  438. timer = setTimeout(function () {
  439. timer = null;
  440. fn.apply(th, args);
  441. }, delays);
  442. };
  443. },
  444. changeDashboard(val) {
  445. if (val === 1) {
  446. this.dashboard = 1
  447. this.bgCol1="#1a5cd7";
  448. this.bgCol2="#0f1325";
  449. this.bgCol3="#0f1325";
  450. }else if (val === 2) {
  451. this.dashboard = 2,
  452. this.bgCol2="#1a5cd7";
  453. this.bgCol1="#0f1325";
  454. this.bgCol3="#0f1325";
  455. }else if (val === 3) {
  456. this.dashboard = 3,
  457. this.bgCol3="#1a5cd7";
  458. this.bgCol1="#0f1325";
  459. this.bgCol2="#0f1325";
  460. }
  461. },
  462. openNewWindow() {
  463. let routeData = this.$router.resolve({
  464. path: "/elecDashboard",
  465. });
  466. window.open('/cpms/index.html#/elecDashboard', '_blank');
  467. },
  468. }
  469. };
  470. </script>
  471. <style lang="scss">
  472. #elec-index {
  473. color: #ffffff;
  474. background-color: #000000;
  475. width: 100%;
  476. height: 100vh;
  477. .bg {
  478. padding: 0.2rem 0.2rem 0 0.2rem;
  479. background-size: cover;
  480. background-position: center center;
  481. background-image: url("../../../assets/image/pageBg.png");
  482. }
  483. .host-body {
  484. .title {
  485. position: relative;
  486. width: 6.25rem;
  487. text-align: center;
  488. background-size: cover;
  489. background-repeat: no-repeat;
  490. .title-text {
  491. font-size: 0.4rem;
  492. position: absolute;
  493. bottom: 0;
  494. left: 50%;
  495. top: 30%;
  496. transform: translate(-50%);
  497. font-weight: 600;
  498. }
  499. .title-bototm {
  500. position: absolute;
  501. bottom: -0.375rem;
  502. left: 50%;
  503. transform: translate(-50%);
  504. }
  505. }
  506. // 平行四边形
  507. .react-left {
  508. cursor: pointer;
  509. font-size: 0.225rem;
  510. width: 3.75rem;
  511. height: 0.625rem;
  512. line-height: 0.625rem;
  513. text-align: center;
  514. transform: skewX(-45deg);
  515. .react-after {
  516. position: absolute;
  517. right: -0.3125rem;
  518. top: 0;
  519. height: 0.625rem;
  520. width: 0.625rem;
  521. background-color: #0f1325;
  522. transform: skewX(45deg);
  523. }
  524. .text {
  525. display: inline-block;
  526. transform: skewX(45deg);
  527. }
  528. }
  529. .react-right {
  530. cursor: pointer;
  531. font-size: 0.225rem;
  532. width: 3.75rem;
  533. height: 0.625rem;
  534. line-height: 0.625rem;
  535. text-align: center;
  536. transform: skewX(45deg);
  537. .react-before {
  538. position: relative;
  539. left: -1.3125rem;
  540. top: 0;
  541. height: 0.625rem;
  542. width: 0.625rem;
  543. background-color: #0f1325;
  544. transform: skewX(-45deg);
  545. }
  546. .text {
  547. display: inline-block;
  548. transform: skewX(-45deg);
  549. }
  550. }
  551. .body-box {
  552. margin-top: 0.2rem;
  553. display: flex;
  554. flex-direction: column;
  555. //下方区域的布局
  556. .content-box {
  557. display: grid;
  558. grid-template-columns: 6fr 7fr 2fr 2fr;
  559. }
  560. // 底部数据
  561. .bototm-box {
  562. display: grid;
  563. grid-template-columns: repeat(2, 50%);
  564. grid-template-rows: repeat(2,100%);
  565. }
  566. .bototm-box1 {
  567. display: grid;
  568. grid-template-rows: repeat(2,50%);
  569. }
  570. .bototm-box2 {
  571. display: grid;
  572. grid-template-columns: repeat(2,50%);
  573. }
  574. }
  575. }
  576. }
  577. #aa{
  578. position: absolute;
  579. right: 100px;
  580. }
  581. #bb{
  582. position: absolute;
  583. right: 100px;
  584. }
  585. #cc{
  586. position: absolute;
  587. right: 80px;
  588. }
  589. .fs-xl {
  590. font-size: 0.18rem;
  591. }
  592. </style>