center.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <template>
  2. <div id="center">
  3. <div class="up">
  4. <!--<div class="bg-color-black item" v-for="item in titleItem" :key="item.title">
  5. <p class="ml-3 colorBlue fw-b">{{item.title}}</p>
  6. <div>
  7. <dv-digital-flop :config="item.number" style="width:1.25rem;height:.625rem;" />
  8. </div>
  9. </div>-->
  10. <!-- 4个主要的数据 -->
  11. <div class="bottom-data">
  12. <div class="item-box" v-for="(item,index) in numberData" :key="index">
  13. <div class="d-flex">
  14. <span class="coin"></span>
  15. <dv-digital-flop :config="item.number" style="width:2.5rem;height:.525rem;" />
  16. </div>
  17. <p class="text" style="text-align: center;">
  18. {{item.text}}
  19. <span class="colorYellow">(MW)</span>
  20. </p>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="center">
  25. <centerChart class="percentNum" :id="rate[0].id" :tips="rate[0].tips" :colorObj="rate[0].colorData" />
  26. <centerChart class="percentNum" :id="rate[1].id" :tips="rate[1].tips" :colorObj="rate[1].colorData" />
  27. <centerChart class="percentNum" :id="rate[2].id" :tips="rate[2].tips" :colorObj="rate[2].colorData" />
  28. <centerChart class="percentNum" :id="rate[3].id" :tips="rate[3].tips" :colorObj="rate[3].colorData" />
  29. <centerChart class="percentNum" :id="rate[4].id" :tips="rate[4].tips" :colorObj="rate[4].colorData" />
  30. </div>
  31. <div class="down">
  32. <!-- <div class="ranking bg-color-black">-->
  33. <!-- <span style="color:#5cd9e8">-->
  34. <!-- <icon name="align-left"></icon>-->
  35. <!-- </span>-->
  36. <!-- <span class="fs-xl text mx-2 mb-1" style="display:block">每日能耗状态</span>-->
  37. <!-- <div id="naturalGasChart" style="width:100%;height:2.5rem;"></div>-->
  38. <!-- </div>-->
  39. <div class="ranking bg-color-black" @click="openChartUsed">
  40. <div class="d-flex pt-2 pl-2">
  41. <span style="color:#5cd9e8">
  42. <icon name="chart-bar"></icon>
  43. </span>
  44. <div class="d-flex">
  45. <span class="fs-xl text mx-2">每日煤耗状态</span>
  46. </div>
  47. </div>
  48. <div>
  49. <div id="naturalGasChart" style="width:100%;height:3rem;"></div>
  50. </div>
  51. <el-dialog class="my-info-dialog" :visible.sync="openChart" title="" @open="open" width="1600px" destroy-on-close append-to-body>
  52. <div id="naturalGasChartDialog" style="width:100%;height:600px;"></div>
  53. </el-dialog>
  54. </div>
  55. <div class="percent">
  56. <!-- 警铃 -->
  57. <!-- <div class="item bg-color-black">
  58. <svg-icon icon-class="alarm" class="alarmIcon" />
  59. </div> -->
  60. <div class="water">
  61. <dv-water-level-pond :config="water" style="height: 2rem" />
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import centerChart from "./echart/center/centerChartRate";
  69. export default {
  70. props: ['dashboardelecdata', 'latest24HourData'],
  71. data() {
  72. return {
  73. openChart: false,
  74. queryParams:{},
  75. numberData: [
  76. {
  77. number: {
  78. number: [parseInt(this.dashboardelecdata.gtg1Lv)],
  79. toFixed: 1,
  80. content: "{nt}"
  81. },
  82. text: "1#GTG"
  83. },
  84. {
  85. number: {
  86. number: [parseInt(this.dashboardelecdata.gtg2Lv)],
  87. toFixed: 1,
  88. content: "{nt}"
  89. },
  90. text: "2#GTG"
  91. },
  92. {
  93. number: {
  94. number: [parseInt(this.dashboardelecdata.gtg3Lv)],
  95. toFixed: 1,
  96. content: "{nt}"
  97. },
  98. text: "3#GTG"
  99. },
  100. {
  101. number: {
  102. number: [parseInt(this.dashboardelecdata.stg1Lv)],
  103. toFixed: 1,
  104. content: "{nt}"
  105. },
  106. text: "STG"
  107. },
  108. {
  109. number: {
  110. number: [parseInt(this.dashboardelecdata.mwhLv)],
  111. toFixed: 1,
  112. content: "{nt}"
  113. },
  114. text: "发电量"
  115. },
  116. ],
  117. ranking: {
  118. data: [
  119. {
  120. name: "公应工程",
  121. value: 55
  122. },
  123. {
  124. name: "BCC",
  125. value: 120
  126. },
  127. {
  128. name: "碳一",
  129. value: 78
  130. },
  131. {
  132. name: "EU",
  133. value: 66
  134. },
  135. {
  136. name: "电厂",
  137. value: 80
  138. },
  139. {
  140. name: "AE",
  141. value: 80
  142. },
  143. {
  144. name: "AA",
  145. value: 80
  146. },
  147. {
  148. name: "苯乙烯",
  149. value: 80
  150. }
  151. ],
  152. waitTime: 4000,
  153. carousel: "page",
  154. unit: "mw"
  155. },
  156. water: {
  157. data: [this.dashboardelecdata.sub],
  158. shape: "roundRect",
  159. formatter: "SUB {value}%",
  160. waveNum: 3
  161. },
  162. // 通过率和达标率的组件复用数据
  163. rate: [
  164. {
  165. id: "centerRate0",
  166. tips: parseInt(this.dashboardelecdata.mwhWr),
  167. colorData: {
  168. fontSize: 25,
  169. textStyle: "#3f83ff",
  170. series: {
  171. radius: ["60%", "95%", "85%", "90%"],
  172. color: ["#00bcd44a", "transparent"],
  173. dataColor: {
  174. normal: "#528cff",
  175. shadowColor: "#97e2f5"
  176. }
  177. }
  178. }
  179. },
  180. {
  181. id: "centerRate1",
  182. tips: parseInt(this.dashboardelecdata.stg1Wr),
  183. colorData: {
  184. fontSize: 23,
  185. textStyle: "#3fc0fb",
  186. series: {
  187. radius: ["65%", "85%", "85%", "90%"],
  188. color: ["#00bcd44a", "transparent"],
  189. dataColor: {
  190. normal: "#03a9f4",
  191. shadowColor: "#97e2f5"
  192. }
  193. }
  194. }
  195. },
  196. {
  197. id: "centerRate2",
  198. tips: parseInt(this.dashboardelecdata.gtg3Wr),
  199. colorData: {
  200. fontSize: 23,
  201. textStyle: "#67e0e3",
  202. series: {
  203. radius: ["65%", "85%", "85%", "90%"],
  204. color: ["#faf3a378", "transparent"],
  205. dataColor: {
  206. normal: "#ff9800",
  207. shadowColor: "#fcebad"
  208. }
  209. }
  210. }
  211. },
  212. {
  213. id: "centerRate3",
  214. tips: parseInt(this.dashboardelecdata.gtg2Wr),
  215. colorData: {
  216. fontSize: 23,
  217. textStyle: "#67e0e3",
  218. series: {
  219. radius: ["65%", "85%", "85%", "90%"],
  220. color: ["rgba(196,163,250,0.47)", "transparent"],
  221. dataColor: {
  222. normal: "#9d00ff",
  223. shadowColor: "#c9adfc"
  224. }
  225. }
  226. }
  227. },
  228. {
  229. id: "centerRate4",
  230. tips: parseInt(this.dashboardelecdata.gtg1Wr),
  231. colorData: {
  232. fontSize: 23,
  233. textStyle: "#67e0e3",
  234. series: {
  235. radius: ["65%", "85%", "85%", "90%"],
  236. color: ["rgba(163,250,177,0.47)", "transparent"],
  237. dataColor: {
  238. normal: "#00ff0d",
  239. shadowColor: "#b2fcad"
  240. }
  241. }
  242. }
  243. }
  244. ]
  245. };
  246. },
  247. components: {
  248. centerChart
  249. // centerChart1,
  250. // centerChart2
  251. },
  252. mounted() {
  253. this.initChart();
  254. },
  255. methods: {
  256. openChartUsed(){
  257. this.openChart = true
  258. },
  259. open(){
  260. this.$nextTick(() => {
  261. this.initChartDialog()
  262. })
  263. },
  264. initChart() {
  265. // 基于准备好的dom,初始化echarts实例
  266. this.chart = this.echarts.init(document.getElementById('naturalGasChart'))
  267. const hourArray = [];
  268. const carbonArray = [];
  269. let data = this.latest24HourData;
  270. for (let i = 0; i < data.length; i++) {
  271. if (i % 4 == 0) {
  272. hourArray.push(data[i].pullDate.toString().substr(14, 5));
  273. carbonArray.push(data[i].carbonRealTime);
  274. }
  275. }
  276. hourArray.reverse();
  277. carbonArray.reverse();
  278. this.chart.setOption({
  279. xAxis: {
  280. type: 'category',
  281. data: hourArray
  282. },
  283. yAxis: {
  284. type: 'value',
  285. name: 'Unit:(t)'
  286. },
  287. series: [
  288. {
  289. data: carbonArray,
  290. type: 'line',
  291. smooth: true,
  292. symbol: '',
  293. symbolSize: 15,
  294. lineStyle: {
  295. color: '#5470C6',
  296. width: 6,
  297. type: 'dashed'
  298. },
  299. itemStyle: {
  300. borderWidth: 3,
  301. borderColor: '#EE6666',
  302. color: 'yellow'
  303. }
  304. }
  305. ]
  306. // color: ['#00DDFF', '#37A2FF'],
  307. // tooltip: {
  308. // trigger: 'axis',
  309. // type: 'category',
  310. // },
  311. // /* 标识 */
  312. // legend: {
  313. // data: ['实际', '计划'],
  314. // textStyle:{
  315. // color: '#ffffff'//字体颜色
  316. // }
  317. // },
  318. // /* 周围边距 */
  319. // grid: {
  320. // left: '3%',
  321. // right: '3%',
  322. // bottom: '1%',
  323. // top: '13%',
  324. // containLabel: true
  325. // },
  326. // xAxis: [
  327. // {
  328. // type: 'category',
  329. // boundaryGap: false,
  330. // data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
  331. // axisLabel: {//x轴文字的配置
  332. // show: true,
  333. // textStyle: {
  334. // color: '#ffffff',
  335. // }
  336. // },
  337. // }
  338. // ],
  339. // yAxis: [
  340. // {
  341. // type: 'value',
  342. // axisLabel: {
  343. // textStyle: {
  344. // fontSize: 10,
  345. // color: '#ffffffff',
  346. // margin: 15
  347. // },
  348. // }
  349. // }
  350. // ],
  351. // series: [
  352. // {
  353. // name: this.$t('实际'),
  354. // type: 'line',
  355. // symbol: "none",
  356. // data: [20, 32, 1, 34, 90, 30, 20, 20, 32, 1, 34, 90, 40, 10, 20, 82, 11, 34, 20, 30, 10, 20, 82, 11, 34, 20, 40, 10]
  357. // },
  358. // {
  359. // name: this.$t('计划'),
  360. // type: 'line',
  361. // symbol: "none",
  362. // data: [20, 82, 11, 24, 20, 30, 10, 20, 82, 11, 24, 20, 10, 20, 20, 32, 21, 34, 10, 30, 20, 20, 32, 21, 34, 19, 13, 20]
  363. // },
  364. // ]
  365. })
  366. },
  367. initChartDialog() {
  368. // 基于准备好的dom,初始化echarts实例
  369. this.chart1 = this.echarts.init(document.getElementById('naturalGasChartDialog'))
  370. this.chart1.setOption({
  371. xAxis: {
  372. type: 'category',
  373. data: [
  374. '00:00-03:00',
  375. '03:00-06:00',
  376. '06:00-09:00',
  377. '09:00-12:00',
  378. '12:00-15:00',
  379. '15:00-18:00',
  380. '18:00-21:00',
  381. '21:00-00:00'
  382. ]
  383. },
  384. yAxis: {
  385. type: 'value',
  386. name: 'Unit:(t)'
  387. },
  388. series: [
  389. {
  390. data: [120, 200, 150, 80, 70, 110, 130],
  391. type: 'line',
  392. smooth: true,
  393. symbol: '',
  394. symbolSize: 15,
  395. label: {
  396. show: true,
  397. position: 'top'
  398. },
  399. lineStyle: {
  400. color: '#5470C6',
  401. width: 6,
  402. type: 'dashed'
  403. },
  404. itemStyle: {
  405. borderWidth: 3,
  406. borderColor: '#EE6666',
  407. color: 'yellow'
  408. }
  409. }
  410. ]
  411. // color: ['#00DDFF', '#37A2FF'],
  412. // tooltip: {
  413. // trigger: 'axis',
  414. // type: 'category',
  415. // },
  416. // /* 标识 */
  417. // legend: {
  418. // data: ['实际', '计划'],
  419. // textStyle:{
  420. // color: '#ffffff'//字体颜色
  421. // }
  422. // },
  423. // /* 周围边距 */
  424. // grid: {
  425. // left: '3%',
  426. // right: '3%',
  427. // bottom: '1%',
  428. // top: '13%',
  429. // containLabel: true
  430. // },
  431. // xAxis: [
  432. // {
  433. // type: 'category',
  434. // boundaryGap: false,
  435. // data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31'],
  436. // axisLabel: {//x轴文字的配置
  437. // show: true,
  438. // textStyle: {
  439. // color: '#ffffff',
  440. // }
  441. // },
  442. // }
  443. // ],
  444. // yAxis: [
  445. // {
  446. // type: 'value',
  447. // axisLabel: {
  448. // textStyle: {
  449. // fontSize: 10,
  450. // color: '#ffffffff',
  451. // margin: 15
  452. // },
  453. // }
  454. // }
  455. // ],
  456. // series: [
  457. // {
  458. // name: this.$t('实际'),
  459. // type: 'line',
  460. // symbol: "none",
  461. // data: [20, 32, 1, 34, 90, 30, 20, 20, 32, 1, 34, 90, 40, 10, 20, 82, 11, 34, 20, 30, 10, 20, 82, 11, 34, 20, 40, 10]
  462. // },
  463. // {
  464. // name: this.$t('计划'),
  465. // type: 'line',
  466. // symbol: "none",
  467. // data: [20, 82, 11, 24, 20, 30, 10, 20, 82, 11, 24, 20, 10, 20, 20, 32, 21, 34, 10, 30, 20, 20, 32, 21, 34, 19, 13, 20]
  468. // },
  469. // ]
  470. })
  471. }
  472. }
  473. };
  474. </script>
  475. <style lang="scss" scoped>
  476. #center {
  477. display: flex;
  478. flex-direction: column;
  479. .up {
  480. width: 100%;
  481. display: flex;
  482. flex-wrap: wrap;
  483. justify-content: space-around;
  484. .item {
  485. border-radius: 0.0625rem;
  486. padding-top: 0.2rem;
  487. margin-top: 0.1rem;
  488. width: 32%;
  489. height: 0.875rem;
  490. }
  491. }
  492. .bottom-data {
  493. .item-box {
  494. float: right;
  495. position: relative;
  496. width: 20%;
  497. color: #d3d6dd;
  498. // 金币
  499. .coin {
  500. position: absolute;
  501. left: 0.1rem;
  502. top: 0.2125rem;
  503. font-size: 0.25rem;
  504. color: #ffc107;
  505. }
  506. .colorYellow {
  507. color: yellowgreen;
  508. }
  509. }
  510. }
  511. .center {
  512. padding: 0.07rem 0.05rem;
  513. padding-bottom: 0;
  514. width: 100%;
  515. display: flex;
  516. justify-content: space-between;
  517. float: right;
  518. position: relative;
  519. .percentNum {
  520. width: 19%;
  521. }
  522. }
  523. .down {
  524. padding: 0.07rem 0.05rem;
  525. padding-bottom: 0;
  526. width: 100%;
  527. display: flex;
  528. height: 3.1875rem;
  529. justify-content: space-between;
  530. .bg-color-black {
  531. border-radius: 0.0625rem;
  532. }
  533. .ranking {
  534. padding: 0.125rem;
  535. width: 59%;
  536. }
  537. .percent {
  538. width: 40%;
  539. display: flex;
  540. flex-wrap: wrap;
  541. .bg-color-black {
  542. border-radius: 0.0625rem;
  543. position: relative;
  544. .alarmIcon {
  545. width: 40px !important;
  546. //height: 40px !important;
  547. position: absolute;
  548. left: 50%;
  549. top: 50%;
  550. transform: translate(-50%, -50%);
  551. }
  552. }
  553. .item {
  554. width: 100%;
  555. height: 1rem;
  556. }
  557. .water {
  558. padding-top:60px;
  559. width: 100%;
  560. height: 2rem;
  561. }
  562. }
  563. }
  564. }
  565. </style>