center.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569
  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'],
  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: [24, 45],
  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. this.chart.setOption({
  268. xAxis: {
  269. type: 'category',
  270. data: [
  271. '00:00-03:00',
  272. '03:00-06:00',
  273. '06:00-09:00',
  274. '09:00-12:00',
  275. '12:00-15:00',
  276. '15:00-18:00',
  277. '18:00-21:00',
  278. '21:00-00:00'
  279. ]
  280. },
  281. yAxis: {
  282. type: 'value'
  283. },
  284. series: [
  285. {
  286. data: [120, 200, 150, 80, 70, 110, 130],
  287. type: 'line',
  288. smooth: true,
  289. symbol: '',
  290. symbolSize: 15,
  291. lineStyle: {
  292. color: '#5470C6',
  293. width: 6,
  294. type: 'dashed'
  295. },
  296. itemStyle: {
  297. borderWidth: 3,
  298. borderColor: '#EE6666',
  299. color: 'yellow'
  300. }
  301. }
  302. ]
  303. // color: ['#00DDFF', '#37A2FF'],
  304. // tooltip: {
  305. // trigger: 'axis',
  306. // type: 'category',
  307. // },
  308. // /* 标识 */
  309. // legend: {
  310. // data: ['实际', '计划'],
  311. // textStyle:{
  312. // color: '#ffffff'//字体颜色
  313. // }
  314. // },
  315. // /* 周围边距 */
  316. // grid: {
  317. // left: '3%',
  318. // right: '3%',
  319. // bottom: '1%',
  320. // top: '13%',
  321. // containLabel: true
  322. // },
  323. // xAxis: [
  324. // {
  325. // type: 'category',
  326. // boundaryGap: false,
  327. // 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'],
  328. // axisLabel: {//x轴文字的配置
  329. // show: true,
  330. // textStyle: {
  331. // color: '#ffffff',
  332. // }
  333. // },
  334. // }
  335. // ],
  336. // yAxis: [
  337. // {
  338. // type: 'value',
  339. // axisLabel: {
  340. // textStyle: {
  341. // fontSize: 10,
  342. // color: '#ffffffff',
  343. // margin: 15
  344. // },
  345. // }
  346. // }
  347. // ],
  348. // series: [
  349. // {
  350. // name: this.$t('实际'),
  351. // type: 'line',
  352. // symbol: "none",
  353. // 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]
  354. // },
  355. // {
  356. // name: this.$t('计划'),
  357. // type: 'line',
  358. // symbol: "none",
  359. // 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]
  360. // },
  361. // ]
  362. })
  363. },
  364. initChartDialog() {
  365. // 基于准备好的dom,初始化echarts实例
  366. this.chart1 = this.echarts.init(document.getElementById('naturalGasChartDialog'))
  367. this.chart1.setOption({
  368. xAxis: {
  369. type: 'category',
  370. data: [
  371. '00:00-03:00',
  372. '03:00-06:00',
  373. '06:00-09:00',
  374. '09:00-12:00',
  375. '12:00-15:00',
  376. '15:00-18:00',
  377. '18:00-21:00',
  378. '21:00-00:00'
  379. ]
  380. },
  381. yAxis: {
  382. type: 'value'
  383. },
  384. series: [
  385. {
  386. data: [120, 200, 150, 80, 70, 110, 130],
  387. type: 'line',
  388. smooth: true,
  389. symbol: '',
  390. symbolSize: 15,
  391. label: {
  392. show: true,
  393. position: 'top'
  394. },
  395. lineStyle: {
  396. color: '#5470C6',
  397. width: 6,
  398. type: 'dashed'
  399. },
  400. itemStyle: {
  401. borderWidth: 3,
  402. borderColor: '#EE6666',
  403. color: 'yellow'
  404. }
  405. }
  406. ]
  407. // color: ['#00DDFF', '#37A2FF'],
  408. // tooltip: {
  409. // trigger: 'axis',
  410. // type: 'category',
  411. // },
  412. // /* 标识 */
  413. // legend: {
  414. // data: ['实际', '计划'],
  415. // textStyle:{
  416. // color: '#ffffff'//字体颜色
  417. // }
  418. // },
  419. // /* 周围边距 */
  420. // grid: {
  421. // left: '3%',
  422. // right: '3%',
  423. // bottom: '1%',
  424. // top: '13%',
  425. // containLabel: true
  426. // },
  427. // xAxis: [
  428. // {
  429. // type: 'category',
  430. // boundaryGap: false,
  431. // 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'],
  432. // axisLabel: {//x轴文字的配置
  433. // show: true,
  434. // textStyle: {
  435. // color: '#ffffff',
  436. // }
  437. // },
  438. // }
  439. // ],
  440. // yAxis: [
  441. // {
  442. // type: 'value',
  443. // axisLabel: {
  444. // textStyle: {
  445. // fontSize: 10,
  446. // color: '#ffffffff',
  447. // margin: 15
  448. // },
  449. // }
  450. // }
  451. // ],
  452. // series: [
  453. // {
  454. // name: this.$t('实际'),
  455. // type: 'line',
  456. // symbol: "none",
  457. // 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]
  458. // },
  459. // {
  460. // name: this.$t('计划'),
  461. // type: 'line',
  462. // symbol: "none",
  463. // 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]
  464. // },
  465. // ]
  466. })
  467. }
  468. }
  469. };
  470. </script>
  471. <style lang="scss" scoped>
  472. #center {
  473. display: flex;
  474. flex-direction: column;
  475. .up {
  476. width: 100%;
  477. display: flex;
  478. flex-wrap: wrap;
  479. justify-content: space-around;
  480. .item {
  481. border-radius: 0.0625rem;
  482. padding-top: 0.2rem;
  483. margin-top: 0.1rem;
  484. width: 32%;
  485. height: 0.875rem;
  486. }
  487. }
  488. .bottom-data {
  489. .item-box {
  490. float: right;
  491. position: relative;
  492. width: 20%;
  493. color: #d3d6dd;
  494. // 金币
  495. .coin {
  496. position: absolute;
  497. left: 0.1rem;
  498. top: 0.2125rem;
  499. font-size: 0.25rem;
  500. color: #ffc107;
  501. }
  502. .colorYellow {
  503. color: yellowgreen;
  504. }
  505. }
  506. }
  507. .center {
  508. padding: 0.07rem 0.05rem;
  509. padding-bottom: 0;
  510. width: 100%;
  511. display: flex;
  512. justify-content: space-between;
  513. float: right;
  514. position: relative;
  515. .percentNum {
  516. width: 19%;
  517. }
  518. }
  519. .down {
  520. padding: 0.07rem 0.05rem;
  521. padding-bottom: 0;
  522. width: 100%;
  523. display: flex;
  524. height: 3.1875rem;
  525. justify-content: space-between;
  526. .bg-color-black {
  527. border-radius: 0.0625rem;
  528. }
  529. .ranking {
  530. padding: 0.125rem;
  531. width: 59%;
  532. }
  533. .percent {
  534. width: 40%;
  535. display: flex;
  536. flex-wrap: wrap;
  537. .bg-color-black {
  538. border-radius: 0.0625rem;
  539. position: relative;
  540. .alarmIcon {
  541. width: 40px !important;
  542. //height: 40px !important;
  543. position: absolute;
  544. left: 50%;
  545. top: 50%;
  546. transform: translate(-50%, -50%);
  547. }
  548. }
  549. .item {
  550. width: 100%;
  551. height: 1rem;
  552. }
  553. .water {
  554. padding-top:60px;
  555. width: 100%;
  556. height: 2rem;
  557. }
  558. }
  559. }
  560. }
  561. </style>