index.vue 14 KB

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