index.vue 14 KB

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