index.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573
  1. <template>
  2. <div id="front" style="width: 100%; height: 100%; font-size: 12px" >
  3. <div class="host-body bg bgNew">
  4. <div class="d-flex jc-center">
  5. <dv-decoration-10 style="width:33.3%;height:.0625rem;" />
  6. <div class="d-flex jc-center">
  7. <dv-decoration-8 :color="['#568aea', '#000000']" style="width:2.5rem;height:.625rem;" />
  8. <div class="title">
  9. <span class="title-text">BCC {{ $t('生产运行总览') }}</span>
  10. <dv-decoration-6
  11. class="title-bototm"
  12. :reverse="true"
  13. :color="['#50e3c2', '#67a1e5']"
  14. style="width:3.125rem;height:.1rem;"
  15. />
  16. </div>
  17. <dv-decoration-8
  18. :reverse="true"
  19. :color="['#568aea', '#000000']"
  20. style="width:2.5rem;height:.625rem;"
  21. />
  22. </div>
  23. <dv-decoration-10 style="width:33.3%;height:.0625rem; transform: rotateY(180deg);" />
  24. </div>
  25. <!-- 第二行 -->
  26. <div class="d-flex jc-between px-2">
  27. <!--左侧 tab切换 -->
  28. <div class="d-flex" style="width: 40%">
  29. <div
  30. class="react-right ml-4"
  31. :style="tabIndex === 1 ? 'background-color: #1a5cd7; width: 3.25rem; text-align: left;' : 'width: 3.25rem; text-align: left;background-color: #0f1325;'"
  32. @click="handleTab(1)"
  33. >
  34. <span class="text">运行总览</span>
  35. </div>
  36. <div class="react-right ml-3" :style="tabIndex === 2 ? 'background-color: #1a5cd7;' : 'background-color: #0f1325;'" @click="handleTab(2)">
  37. <span class="text">物料平衡</span>
  38. </div>
  39. <div class="react-right ml-3" :style="tabIndex === 3 ? 'background-color: #1a5cd7;' : 'background-color: #0f1325;'" @click="handleTab(3)">
  40. <span class="text">蒸汽平衡</span>
  41. </div>
  42. </div>
  43. <!-- 右侧 时间 -->
  44. <div style="width: 40%" class="d-flex">
  45. <div class="react-left bg-color-blue mr-3" @click="toStop()">
  46. <!-- <span class="text fw-b">{{ $t('北京时间') }}:</span> -->
  47. <span class="text fw-b">{{swiperAutoText}}</span>
  48. </div>
  49. <div
  50. class="react-left mr-4"
  51. style="width: 6.25rem; background-color: #0f1325; text-align: right;"
  52. >
  53. <span class="react-after"></span>
  54. <span class="text">{{dateYear}} {{dateWeek}} {{dateDay}}</span>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="swiper-container swi_swiper body-box" ref="appRef" v-if="dashboard === 1">
  59. <div class="swiper-wrapper">
  60. <div class="swiper-slide">
  61. <dv-loading v-if="loading">Loading...</dv-loading>
  62. <!-- 运行总览 -->
  63. <el-row class="yunxing suofang" v-else>
  64. <!-- 左侧 -->
  65. <el-col :span="8" class="yunxing-left">
  66. <div id="app-container-Right">
  67. <div class="up">
  68. <annual-output :dashboarddata = 'dashboarddata'/>
  69. </div>
  70. <div class="middle">
  71. <dv-border-box-13>
  72. <energy-consumption :monthData = 'monthData' :transformdata = 'transformdatabottomright'/>
  73. </dv-border-box-13>
  74. </div>
  75. <div class="down">
  76. <dv-border-box-13>
  77. <product-proportion :dashboarddata = 'dashboarddata' :transformdata = 'transformdatabottomright'/>
  78. </dv-border-box-13>
  79. </div>
  80. <dv-border-box-12 style="height: 260px;overflow: hidden;">
  81. <bottom-right :dashboarddata = 'dashboarddata' :transformdata = 'transformdatabottomright'/>
  82. </dv-border-box-12>
  83. </div>
  84. </el-col>
  85. <!-- 中间 -->
  86. <el-col :span="8" class="yunxing-middle">
  87. <dv-border-box-12 style="width: 100%;height: 323px;">
  88. <nap-tank :dashboarddata = 'dashboarddata' :transformdata = 'transformdatanaptank'/>
  89. </dv-border-box-12>
  90. <dv-border-box-12 style="width: 100%;height: 323px;">
  91. <product-tank :dashboarddata = 'dashboarddata' :transformdata = 'transformdatanaptank'/>
  92. </dv-border-box-12>
  93. <dv-border-box-12 style="width: 100%;height: 323px;">
  94. <bottom-left :monthData = 'monthData' :height = 'height'/>
  95. </dv-border-box-12>
  96. </el-col>
  97. <!-- 右侧 -->
  98. <el-col :span="8" class="yunxing-right">
  99. <dv-border-box-12 style="width: 100%;height: 323px;">
  100. <ethylene-tank :dashboarddata = 'dashboarddata' :transformdata = 'transformdataethylenetank'/>
  101. </dv-border-box-12>
  102. <dv-border-box-12 style="width: 100%;height: 323px;">
  103. <acrylic-tank :dashboarddata = 'dashboarddata' :transformdata = 'transformdataacrylictank'/>
  104. </dv-border-box-12>
  105. <dv-border-box-12 style="width: 100%;height: 323px;">
  106. <bottom-energy :monthData = 'monthData' :height = 'height'/>
  107. </dv-border-box-12>
  108. </el-col>
  109. </el-row>
  110. </div>
  111. <div class="swiper-slide">
  112. <!-- 物料平衡 -->
  113. <el-row class="wuliao suofang">
  114. <material-balance :dashboarddata = 'dashboarddata'/>
  115. </el-row>
  116. </div>
  117. <div class="swiper-slide">
  118. <!-- 蒸汽平衡 -->
  119. <el-row class="zhengqi suofang">
  120. <steam-balance :dashboarddata = 'dashboarddata'/>
  121. </el-row>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <div class="body-box" v-if="dashboard === 2">
  127. <!-- 第三行数据 -->
  128. <div>
  129. <front-two />
  130. </div>
  131. </div>
  132. <div class="body-box" v-if="dashboard === 3">
  133. <!-- 第三行数据 -->
  134. <div class="frist-content-box">
  135. <div>
  136. <dv-border-box-12>
  137. <center-right2 />
  138. </dv-border-box-12>
  139. </div>
  140. <div>
  141. <dv-border-box-12>
  142. <center-left2 />
  143. </dv-border-box-12>
  144. </div>
  145. <!-- 中间 -->
  146. <div>
  147. <center-left1 />
  148. </div>
  149. <div>
  150. <dv-border-box-13>
  151. <center-right1 />
  152. </dv-border-box-13>
  153. </div>
  154. </div>
  155. <!-- 第四行数据 -->
  156. <div class="bototm-box">
  157. <dv-border-box-13>
  158. <bottom-left />
  159. </dv-border-box-13>
  160. <dv-border-box-12>
  161. <bottom-right />
  162. </dv-border-box-12>
  163. </div>
  164. </div>
  165. </div>
  166. </template>
  167. <script>
  168. import centerLeft1 from "@/views/front/centerLeft1";
  169. import centerLeft2 from "@/views/front/centerLeft2";
  170. import centerRight1 from "@/views/front/centerRight1";
  171. import centerRight2 from "@/views/front/centerRight2";
  172. import center from "@/views/front/center";
  173. import bottomLeft from "@/views/front/bottomLeft";
  174. import bottomEnergy from "@/views/front/bottomEnergy";
  175. import bottomRight from "@/views/front/bottomRight";
  176. import frontTwo from "@/views/front/frontTwo";
  177. import materialBalance from "@/views/front/materialBalance";
  178. import steamBalance from "@/views/front/steamBalance";
  179. import chartRight from "@/views/front/ChartRight";
  180. import napTank from "@/views/front/napTank";
  181. import ethyleneTank from "@/views/front/ethyleneTank";
  182. import acrylicTank from "@/views/front/acrylicTank";
  183. import productTank from "@/views/front/productTank";
  184. import annualOutput from "@/views/front/annualOutput";
  185. import energyConsumption from "@/views/front/energyConsumption";
  186. import productProportion from "@/views/front/productProportion";
  187. import dayjs from "dayjs";
  188. import '@/common/flexible.js';
  189. import dataV from '@jiaminghi/data-view';
  190. import {selectLast, selectMonth} from "@/api/aspen/dashboarddata";
  191. import drawMixin from "../../../utils/drawMixin"; //自适应缩放
  192. import Swiper from 'swiper'
  193. import 'swiper/dist/css/swiper.min.css'
  194. import 'swiper/dist/js/swiper.min.js'
  195. export default {
  196. mixins: [drawMixin],
  197. data() {
  198. return {
  199. loading: true,
  200. dashboard: 1,
  201. dateDay: null,
  202. dateYear: null,
  203. dateWeek: null,
  204. weekday: [this.$t('周日'),this.$t('周一'),this.$t('周二'),this.$t('周三'),this.$t('周四'),this.$t('周五'),this.$t('周六')],
  205. timer:null,
  206. dashboarddata: {
  207. energyYixi: null,
  208. energyBingxi: null,
  209. energyQingqi: null,
  210. energyJiawan: null,
  211. energyCsi: null,
  212. energyBenzene: null,
  213. energyToluene: null,
  214. energyXylene: null,
  215. energyTanliu: null,
  216. energyWashoil: null,
  217. energyTanwu: null,
  218. energyIma: null,
  219. energyCjiu: null,
  220. energyRpg: null,
  221. energyfeedNap: null,
  222. energyfeedYiwan: null,
  223. energyfeedTanwu: null,
  224. energyfeedTanliu: null,
  225. energyfeedLpg: null,
  226. energyOffgas: null,
  227. energyLpg: null,
  228. steamSsinfur: null,
  229. steamSsoutlet: null,
  230. steamSsoutaeu: null,
  231. steamSsoutesi: null,
  232. steamSsoutksan: null,
  233. steamSsoutsc: null,
  234. steamHsinsub: null,
  235. steamHsinlet: null,
  236. steamHsinksan: null,
  237. steamHsoutpjiu: null,
  238. steamHsoutaeu: null,
  239. steamHsoutlet: null,
  240. steamHsoutesan: null,
  241. steamHsoutphyi: null,
  242. steamHsoutpher: null,
  243. steamHsouthwu: null,
  244. steamHsoutkliu: null,
  245. steamHsoutsc: null,
  246. steamHhpsub: null,
  247. steamMsinaeu: null,
  248. steamMsinlet: null,
  249. steamMsinphyi: null,
  250. steamMsinkliu: null,
  251. steamMsoutflare: null,
  252. steamMsoutaeu: null,
  253. steamMsoutsctu: null,
  254. steamMsouteer: null,
  255. steamMsoutfur: null,
  256. steamMsoutva: null,
  257. steamMsouttracing: null,
  258. steamLsinsub: null,
  259. steamLsinpjiu: null,
  260. steamLsinaeu: null,
  261. steamLsineer: null,
  262. steamLsinpher: null,
  263. steamLsoutsctu: null,
  264. steamLsoutvjiu: null,
  265. steamLsoutewuliu: null,
  266. steamLsoutewusan: null,
  267. steamLsouttracing: null,
  268. steamLsoutesan: null,
  269. steamLsoutesi: null,
  270. steamLsoutother: null,
  271. napOne: null,
  272. napTwo: null,
  273. napThree: null,
  274. ehtOne: null,
  275. ehtTwo: null,
  276. ehtThree: null,
  277. ehtFour: null,
  278. ehtFive: null,
  279. acrOne: null,
  280. acrTwo: null,
  281. acrThree: null,
  282. acrFour: null,
  283. acrZero: null,
  284. proTwo: null,
  285. proOne: null,
  286. proThree: null,
  287. proFour: null,
  288. ssBcc: null,
  289. ssSub: null,
  290. ssEu: null,
  291. ssPgu: null,
  292. hhpBcc: null,
  293. hhpSub: null,
  294. hsBcc: null,
  295. hsSub: null,
  296. hsEu: null,
  297. hsPgu: null,
  298. msBcc: null,
  299. msEu: null,
  300. msPgu: null,
  301. lsBcc: null,
  302. lsEu: null,
  303. lsPgu: null,
  304. totalBcc: null,
  305. totalEu: null,
  306. zongBcc: null,
  307. zongEu: null,
  308. zongPgu: null,
  309. outputYixi: null,
  310. outputBx: null,
  311. outputAnnual: null,
  312. instantaneous: null,
  313. cumulative: null,
  314. steamHsoutklz:null
  315. },
  316. monthData: {
  317. dailyYixi: null,
  318. dailyBingxi: null,
  319. lossRate: null,
  320. energyConsumption: null,
  321. productPutput: null,
  322. dataDate: null,
  323. dateDay: null
  324. },
  325. // 重构页面
  326. tabIndex:1,
  327. goodSwiper:null,
  328. swiperAutoText:"暂停轮播",
  329. transformdatabottomright:"1.25,1",
  330. transformdatanaptank:"1.35,1.35",
  331. transformdataethylenetank:"1.3,1.2",
  332. transformdataacrylictank:"1.4,1.3",
  333. height:"260px"
  334. };
  335. },
  336. components: {
  337. centerLeft1,
  338. centerLeft2,
  339. centerRight1,
  340. centerRight2,
  341. center,
  342. bottomLeft,
  343. bottomEnergy,
  344. bottomRight,
  345. frontTwo,
  346. materialBalance,
  347. steamBalance,
  348. chartRight,
  349. napTank,
  350. ethyleneTank,
  351. acrylicTank,
  352. productTank,
  353. annualOutput,
  354. energyConsumption,
  355. productProportion,
  356. },
  357. computed: {
  358. },
  359. updated() {
  360. },
  361. mounted() {
  362. this.timer = setInterval(()=>{
  363. const date= dayjs(new Date());
  364. this.dateDay = date.format('HH:mm:ss');
  365. this.dateYear = date.format('YYYY年MM月DD日');
  366. this.dateWeek = date.format(this.weekday[date.day()]);
  367. },1000);
  368. this.$nextTick(() => {
  369. this.instantSwiper();
  370. });
  371. },
  372. created() {
  373. this.getList();
  374. this.getMonthList()
  375. // 每隔30秒请求一次数据
  376. window.setInterval(() => {
  377. ///调取接口获取数据
  378. this.getList();
  379. }, 30000)
  380. // 一天请求一次数据
  381. window.setInterval(() => {
  382. setTimeout(() => {
  383. ///调取接口获取数据
  384. this.getMonthList();
  385. }, 0)
  386. }, 1000 * 10 * 6 * 60 * 6);
  387. },
  388. beforeDestroy(){
  389. if(this.timer){
  390. clearInterval(this.timer);
  391. }
  392. },
  393. methods: {
  394. /** 查询dashboard抓取数据列表 */
  395. getList()
  396. {
  397. selectLast(this.queryParams).then(response => {
  398. this.dashboarddata = response.data;
  399. this.cancelLoading();
  400. });
  401. },
  402. /** 查询dashboard抓取数据列表 */
  403. getMonthList()
  404. {
  405. selectMonth(this.queryParams).then(response => {
  406. this.monthData = response.data;
  407. });
  408. },
  409. cancelLoading() {
  410. setTimeout(() => {
  411. this.loading = false;
  412. }, 500);
  413. },
  414. changeDashboard(val) {
  415. if (val === 1) {
  416. this.dashboard = 1
  417. }else if (val === 2) {
  418. this.dashboard = 2
  419. }else if (val === 3) {
  420. this.dashboard = 3
  421. }
  422. },
  423. openNewWindow() {
  424. let routeData = this.$router.resolve({
  425. path: "/BCCdashboardNew",
  426. });
  427. window.open('/cpms/index.html#/BCCdashboardNew', '_blank');
  428. // window.open('index.html#/bccHome?redirect=%2Findex');//path是文件的全路径地址cpms/index.html#/login?redirect=%2Findex
  429. },
  430. // 重构tab切换
  431. handleTab(id){
  432. this.tabIndex = id;
  433. this.goodSwiper.slideTo(id - 1, 1000, false);
  434. // this.goodSwiper.autoplay.start();
  435. // this.swiperAutoText = "暂停轮播";
  436. },
  437. instantSwiper() {
  438. let that = this;
  439. this.goodSwiper = new Swiper('.swi_swiper', {
  440. slidesPerView: 1,
  441. observer: true,
  442. observeParents: true,
  443. autoplay: {
  444. disableOnInteraction: false, //触碰后自动轮播也不会停止
  445. delay: 10000,
  446. },
  447. loop: false,
  448. on: {
  449. //滑动swiper使用的方法
  450. transitionStart: function() {
  451. that.tabIndex = this.activeIndex + 1;
  452. },
  453. }
  454. });
  455. },
  456. toStop(){
  457. if(this.swiperAutoText === "暂停轮播"){
  458. this.goodSwiper.autoplay.stop();
  459. this.swiperAutoText = "启动轮播";
  460. }else if(this.swiperAutoText === "启动轮播"){
  461. this.goodSwiper.autoplay.start();
  462. this.swiperAutoText = "暂停轮播";
  463. }
  464. }
  465. }
  466. };
  467. </script>
  468. <style lang="scss" scoped>
  469. #front{
  470. overflow: scroll !important;
  471. }
  472. #front .host-body .react-right .text{
  473. width: 100%;
  474. display: block;
  475. text-align: center;
  476. }
  477. #front .bg.bgNew{
  478. width: 100%;
  479. }
  480. .body-box{
  481. color: #d3d6dd;
  482. width: 1920px;
  483. height: 1080px;
  484. position: absolute;
  485. top: 50%;
  486. left: 50%;
  487. transform: translate(-50%, -50%);
  488. transform-origin: left top;
  489. overflow: hidden;
  490. }
  491. .yunxing{
  492. display: flex;
  493. &-left{
  494. }
  495. #app-container-Right {
  496. width: 100%;
  497. height: 100%;
  498. .up {
  499. width: 100%;
  500. display: flex;
  501. flex-wrap: wrap;
  502. justify-content: space-around;
  503. }
  504. .middle {
  505. padding: 0.07rem 0.05rem;
  506. padding-bottom: 0;
  507. width: 100%;
  508. display: flex;
  509. justify-content: space-between;
  510. }
  511. .down {
  512. padding: 0.07rem 0.05rem;
  513. padding-bottom: 0;
  514. width: 100%;
  515. display: flex;
  516. justify-content: space-between;
  517. }
  518. }
  519. }
  520. #front{
  521. overflow: unset !important;
  522. }
  523. .wuliao{
  524. transform: scale(1.4,1.3) translate(13%,10%) !important;
  525. }
  526. .zhengqi{
  527. transform: scale(1.55,1.2) translate(17%,8%) !important;
  528. }
  529. .yunxing-left #bottomRight .dv-scroll-board{
  530. width: 70%!important;
  531. margin:auto ;
  532. }
  533. </style>