index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537
  1. <template>
  2. <div id="front" style="width: 100%; height: 100%">
  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">BCC {{ $t('生产运行总览') }}</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"
  31. style="width: 3.25rem; text-align: left;background-color: #0f1325;"
  32. @click="changeDashboard(1)"
  33. >
  34. <span class="react-before"></span>
  35. <span class="text"></span>
  36. </div>
  37. <div class="react-right ml-3" style="background-color: #0f1325;" @click="changeDashboard(2)">
  38. <span class="text colorBlue"></span>
  39. </div>
  40. <div class="react-right ml-3" style="background-color: #0f1325;" @click="openNewWindow">
  41. <span class="text colorBlue"></span>
  42. </div>
  43. <!--<div style="margin-top: -30px">
  44. <iframe src="./index" frameborder="0" width="100%" height="700px"></iframe>
  45. </div>-->
  46. </div>
  47. <div style="width: 40%" class="d-flex">
  48. <div class="react-left bg-color-blue mr-3">
  49. <span class="text fw-b">{{ $t('北京时间') }}:</span>
  50. </div>
  51. <div
  52. class="react-left mr-4"
  53. style="width: 6.25rem; background-color: #0f1325; text-align: right;"
  54. >
  55. <span class="react-after"></span>
  56. <span class="text">{{dateYear}} {{dateWeek}} {{dateDay}}</span>
  57. </div>
  58. </div>
  59. </div>
  60. <div class="body-box" v-if="dashboard === 1">
  61. <div class="three-content-box">
  62. <div style="display: flex;">
  63. <div style="width:1920px;display: flex;">
  64. <div>
  65. <material-balance />
  66. </div>
  67. <div>
  68. <chart-right/>
  69. </div>
  70. </div>
  71. <div class="right" style="1270px">
  72. <steam-balance />
  73. </div>
  74. </div>
  75. </div>
  76. <div class="three-bototm-box">
  77. <dv-border-box-12 style="width: 438px;height: 260px;">
  78. <nap-tank />
  79. <!--<bottom-left />-->
  80. </dv-border-box-12>
  81. <dv-border-box-12 style="width: 438px;height: 260px;">
  82. <ethylene-tank />
  83. </dv-border-box-12>
  84. <dv-border-box-12 style="width: 438px;height: 260px;">
  85. <acrylic-tank />
  86. </dv-border-box-12>
  87. <dv-border-box-12 style="width: 438px;height: 260px;">
  88. <product-tank />
  89. </dv-border-box-12>
  90. <dv-border-box-12 style="width: 438px;height: 260px;">
  91. <!-- <product-tank /> -->
  92. </dv-border-box-12>
  93. <dv-border-box-12 style="width: 438px;height: 260px;">
  94. <!-- <product-tank /> -->
  95. </dv-border-box-12>
  96. <dv-border-box-12 style="width: 438px;height: 260px;">
  97. <!-- <product-tank /> -->
  98. </dv-border-box-12>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="body-box" v-if="dashboard === 2">
  103. <!-- 第三行数据 -->
  104. <div>
  105. <front-two />
  106. </div>
  107. </div>
  108. <div class="body-box" v-if="dashboard === 3">
  109. <!-- 第三行数据 -->
  110. <div class="frist-content-box">
  111. <div>
  112. <dv-border-box-12>
  113. <center-right2 />
  114. </dv-border-box-12>
  115. </div>
  116. <div>
  117. <dv-border-box-12>
  118. <center-left2 />
  119. </dv-border-box-12>
  120. </div>
  121. <!-- 中间 -->
  122. <div>
  123. <center-left1 />
  124. </div>
  125. <div>
  126. <dv-border-box-13>
  127. <center-right1 />
  128. </dv-border-box-13>
  129. </div>
  130. </div>
  131. <!-- 第四行数据 -->
  132. <div class="bototm-box">
  133. <dv-border-box-13>
  134. <bottom-left />
  135. </dv-border-box-13>
  136. <dv-border-box-12>
  137. <bottom-right />
  138. </dv-border-box-12>
  139. </div>
  140. </div>
  141. </div>
  142. </template>
  143. <script>
  144. import centerLeft1 from "@/views/front/centerLeft1";
  145. import centerLeft2 from "@/views/front/centerLeft2";
  146. import centerRight1 from "@/views/front/centerRight1";
  147. import centerRight2 from "@/views/front/centerRight2";
  148. import center from "@/views/front/center";
  149. import bottomLeft from "@/views/front/bottomLeft";
  150. import bottomRight from "@/views/front/bottomRight";
  151. import frontTwo from "@/views/front/frontTwo";
  152. import materialBalance from "@/views/front/materialBalance";
  153. import steamBalance from "@/views/front/steamBalance";
  154. import chartRight from "@/views/front/ChartRight";
  155. import napTank from "@/views/front/napTank";
  156. import ethyleneTank from "@/views/front/ethyleneTank";
  157. import acrylicTank from "@/views/front/acrylicTank";
  158. import productTank from "@/views/front/productTank";
  159. import dayjs from "dayjs";
  160. import '@/common/flexible.js';
  161. import dataV from '@jiaminghi/data-view';
  162. export default {
  163. data() {
  164. return {
  165. loading: true,
  166. dashboard: 1,
  167. dateDay: null,
  168. dateYear: null,
  169. dateWeek: null,
  170. weekday: [this.$t('周日'),this.$t('周一'),this.$t('周二'),this.$t('周三'),this.$t('周四'),this.$t('周五'),this.$t('周六')],
  171. timer:null
  172. };
  173. },
  174. components: {
  175. centerLeft1,
  176. centerLeft2,
  177. centerRight1,
  178. centerRight2,
  179. center,
  180. bottomLeft,
  181. bottomRight,
  182. frontTwo,
  183. materialBalance,
  184. steamBalance,
  185. chartRight,
  186. napTank,
  187. ethyleneTank,
  188. acrylicTank,
  189. productTank
  190. },
  191. mounted() {
  192. this.cancelLoading();
  193. this.timer = setInterval(()=>{
  194. const date= dayjs(new Date());
  195. this.dateDay = date.format('HH:mm:ss');
  196. this.dateYear = date.format('YYYY年MM月DD日');
  197. this.dateWeek = date.format(this.weekday[date.day()]);
  198. },1000);
  199. },
  200. beforeDestroy(){
  201. if(this.timer){
  202. clearInterval(this.timer);
  203. }
  204. },
  205. methods: {
  206. cancelLoading() {
  207. setTimeout(() => {
  208. this.loading = false;
  209. }, 500);
  210. },
  211. changeDashboard(val) {
  212. if (val === 1) {
  213. this.dashboard = 1
  214. }else if (val === 2) {
  215. this.dashboard = 2
  216. }else if (val === 3) {
  217. this.dashboard = 3
  218. }
  219. },
  220. openNewWindow() {
  221. window.open('index.html#/bccHome?redirect=%2Findex');//path是文件的全路径地址cpms/index.html#/login?redirect=%2Findex
  222. }
  223. }
  224. };
  225. </script>
  226. <style lang="scss" scoped>
  227. </style>
  228. <!--
  229. <template>
  230. <div id="elec-index" ref="appRef">
  231. <dv-loading v-if="loading">Loading...</dv-loading>
  232. <div v-else class="host-body">
  233. <div class="d-flex jc-center">
  234. <dv-decoration-10 style="width:33.3%;height:.0625rem;" />
  235. <div class="d-flex jc-center">
  236. <dv-decoration-8 :color="['#568aea', '#000000']" style="width:2.5rem;height:.625rem;" />
  237. <div class="title">
  238. <span class="title-text">Electricity Power Plant Monitoring</span>
  239. <dv-decoration-6
  240. class="title-bototm"
  241. :reverse="true"
  242. :color="['#50e3c2', '#67a1e5']"
  243. style="width:3.125rem;height:.1rem;"
  244. />
  245. </div>
  246. <dv-decoration-8
  247. :reverse="true"
  248. :color="['#568aea', '#000000']"
  249. style="width:2.5rem;height:.625rem;"
  250. />
  251. </div>
  252. <dv-decoration-10 style="width:33.3%;height:.0625rem; transform: rotateY(180deg);" />
  253. </div>
  254. &lt;!&ndash; 第二行 &ndash;&gt;
  255. <div class="d-flex jc-between px-2">
  256. <div class="d-flex" style="width: 40%">
  257. <div
  258. class="react-right ml-4"
  259. style="width: 6.25rem; text-align: left;background-color: #0f1325;"
  260. >
  261. <span class="react-before"></span>
  262. <span class="text">数据分析1</span>
  263. </div>
  264. <div class="react-right ml-3" style="background-color: #0f1325;">
  265. <span class="text colorBlue">数据分析2</span>
  266. </div>
  267. </div>
  268. <div style="width: 40%" class="d-flex">
  269. <div class="react-left bg-color-blue mr-3">
  270. <span class="text fw-b">vue-big-screen</span>
  271. </div>
  272. <div
  273. class="react-left mr-4"
  274. style="width: 6.25rem; background-color: #0f1325; text-align: right;"
  275. >
  276. <span class="react-after"></span>
  277. <span class="text">{{dateYear}} {{dateWeek}} {{dateDay}}</span>
  278. </div>
  279. </div>
  280. </div>
  281. <div class="body-box">
  282. &lt;!&ndash; 第三行数据 &ndash;&gt;
  283. <div class="content-box">
  284. <div>
  285. <dv-border-box-12>
  286. <centerLeft1 />
  287. </dv-border-box-12>
  288. </div>
  289. <div>
  290. <dv-border-box-12>
  291. <centerLeft2 />
  292. </dv-border-box-12>
  293. </div>
  294. &lt;!&ndash; 中间 &ndash;&gt;
  295. <div>
  296. <center />
  297. </div>
  298. &lt;!&ndash; 中间 &ndash;&gt;
  299. <div>
  300. <centerRight2 />
  301. </div>
  302. <div>
  303. <dv-border-box-13>
  304. <centerRight1 />
  305. </dv-border-box-13>
  306. </div>
  307. </div>
  308. &lt;!&ndash; 第四行数据 &ndash;&gt;
  309. <div class="bototm-box">
  310. <dv-border-box-13>
  311. <bottomLeft />
  312. </dv-border-box-13>
  313. <dv-border-box-12>
  314. <bottomRight />
  315. </dv-border-box-12>
  316. </div>
  317. </div>
  318. </div>
  319. </div>
  320. </template>
  321. <script>
  322. import centerLeft1 from "./centerLeft1";
  323. import centerLeft2 from "./centerLeft2";
  324. import centerRight1 from "./centerRight1";
  325. import centerRight2 from "./centerRight2";
  326. import center from "./center";
  327. import bottomLeft from "./bottomLeft";
  328. import bottomRight from "./bottomRight";
  329. import '@/assets/styles/index.scss' // global css
  330. import '@/common/flexible.js';
  331. import dayjs from "dayjs";
  332. export default {
  333. data() {
  334. return {
  335. loading: true,
  336. dashboard: 1,
  337. dateDay: null,
  338. dateYear: null,
  339. dateWeek: null,
  340. weekday: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
  341. timer:null
  342. };
  343. },
  344. components: {
  345. centerLeft1,
  346. centerLeft2,
  347. centerRight1,
  348. centerRight2,
  349. center,
  350. bottomLeft,
  351. bottomRight
  352. },
  353. mounted() {
  354. this.timer = setInterval(()=>{
  355. const date= dayjs(new Date());
  356. this.dateDay = date.format('HH:mm:ss');
  357. this.dateYear = date.format('YYYY年MM月DD日');
  358. this.dateWeek = date.format(this.weekday[date.day()]);
  359. },1000),
  360. this.setScale();
  361. window.addEventListener("resize", this.debounce(this.setScale, 100));
  362. // * 适配处理
  363. this.cancelLoading();
  364. },
  365. methods: {
  366. cancelLoading() {
  367. setTimeout(() => {
  368. this.loading = false;
  369. }, 500);
  370. },
  371. getScale() {
  372. let { width, height } = this;
  373. let wh = window.innerHeight / height;
  374. let ww = window.innerWidth / width;
  375. console.log(ww < wh ? ww : wh);
  376. return ww < wh ? ww : wh;
  377. },
  378. setScale() {
  379. if(window.innerHeight ==1080){
  380. this.height = 1080
  381. }else{
  382. this.height = 937
  383. }
  384. this.scale = this.getScale();
  385. if (this.$refs.ScaleBox) {
  386. this.$refs.ScaleBox.style.setProperty("&#45;&#45;scale", this.scale);
  387. }
  388. },
  389. debounce(fn, delay) {
  390. let delays = delay || 500;
  391. let timer;
  392. return function () {
  393. let th = this;
  394. let args = arguments;
  395. if (timer) {
  396. clearTimeout(timer);
  397. }
  398. timer = setTimeout(function () {
  399. timer = null;
  400. fn.apply(th, args);
  401. }, delays);
  402. };
  403. },
  404. }
  405. };
  406. </script>
  407. <style lang="scss">
  408. #elec-index {
  409. color: #d3d6dd;
  410. background-color: #000000;
  411. width: 100%;
  412. height: 100vh;
  413. .bg {
  414. padding: 0.2rem 0.2rem 0 0.2rem;
  415. background-size: cover;
  416. background-position: center center;
  417. background-image: url("../../../assets/image/pageBg.png");
  418. }
  419. .host-body {
  420. .title {
  421. position: relative;
  422. width: 6.25rem;
  423. text-align: center;
  424. background-size: cover;
  425. background-repeat: no-repeat;
  426. .title-text {
  427. font-size: 0.3rem;
  428. position: absolute;
  429. bottom: 0;
  430. left: 50%;
  431. top: 6%;
  432. transform: translate(-50%);
  433. font-weight: 900;
  434. }
  435. .title-bototm {
  436. position: absolute;
  437. bottom: -0.375rem;
  438. left: 50%;
  439. transform: translate(-50%);
  440. }
  441. }
  442. // 平行四边形
  443. .react-left {
  444. cursor: pointer;
  445. font-size: 0.225rem;
  446. width: 3.75rem;
  447. height: 0.625rem;
  448. line-height: 0.625rem;
  449. text-align: center;
  450. transform: skewX(-45deg);
  451. .react-after {
  452. position: absolute;
  453. right: -0.3125rem;
  454. top: 0;
  455. height: 0.625rem;
  456. width: 0.625rem;
  457. background-color: #0f1325;
  458. transform: skewX(45deg);
  459. }
  460. .text {
  461. display: inline-block;
  462. transform: skewX(45deg);
  463. }
  464. }
  465. .react-right {
  466. cursor: pointer;
  467. font-size: 0.225rem;
  468. width: 3.75rem;
  469. height: 0.625rem;
  470. line-height: 0.625rem;
  471. text-align: center;
  472. transform: skewX(45deg);
  473. .react-before {
  474. position: absolute;
  475. left: -0.3125rem;
  476. top: 0;
  477. height: 0.625rem;
  478. width: 0.625rem;
  479. background-color: #0f1325;
  480. transform: skewX(-45deg);
  481. }
  482. .text {
  483. display: inline-block;
  484. transform: skewX(-45deg);
  485. }
  486. }
  487. .body-box {
  488. margin-top: 0.2rem;
  489. display: flex;
  490. flex-direction: column;
  491. //下方区域的布局
  492. .content-box {
  493. display: grid;
  494. grid-template-columns: 2fr 3fr 5fr 3fr 2fr;
  495. }
  496. // 底部数据
  497. .bototm-box {
  498. margin-top: 0.125rem;
  499. display: grid;
  500. grid-template-columns: repeat(2, 50%);
  501. }
  502. }
  503. }
  504. }
  505. .fs-xl {
  506. font-size: 0.14rem;
  507. }
  508. </style>
  509. -->