center.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  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">
  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:2.5rem;"></div>
  50. </div>
  51. </div>
  52. <div class="percent">
  53. <div class="item bg-color-black">
  54. <svg-icon icon-class="alarm" class="alarmIcon" />
  55. </div>
  56. <div class="water">
  57. <dv-water-level-pond :config="water" style="height: 1.5rem" />
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script>
  64. import centerChart from "./echart/center/centerChartRate";
  65. export default {
  66. props: ['dashboardelecdata'],
  67. data() {
  68. return {
  69. queryParams:{},
  70. numberData: [
  71. {
  72. number: {
  73. number: [parseInt(this.dashboardelecdata.gtg1Lv)],
  74. toFixed: 1,
  75. content: "{nt}"
  76. },
  77. text: "1#GTG"
  78. },
  79. {
  80. number: {
  81. number: [parseInt(this.dashboardelecdata.gtg2Lv)],
  82. toFixed: 1,
  83. content: "{nt}"
  84. },
  85. text: "2#GTG"
  86. },
  87. {
  88. number: {
  89. number: [parseInt(this.dashboardelecdata.gtg3Lv)],
  90. toFixed: 1,
  91. content: "{nt}"
  92. },
  93. text: "3#GTG"
  94. },
  95. {
  96. number: {
  97. number: [parseInt(this.dashboardelecdata.stg1Lv)],
  98. toFixed: 1,
  99. content: "{nt}"
  100. },
  101. text: "STG"
  102. },
  103. {
  104. number: {
  105. number: [parseInt(this.dashboardelecdata.mwhLv)],
  106. toFixed: 1,
  107. content: "{nt}"
  108. },
  109. text: "发电量"
  110. },
  111. ],
  112. ranking: {
  113. data: [
  114. {
  115. name: "公应工程",
  116. value: 55
  117. },
  118. {
  119. name: "BCC",
  120. value: 120
  121. },
  122. {
  123. name: "碳一",
  124. value: 78
  125. },
  126. {
  127. name: "EU",
  128. value: 66
  129. },
  130. {
  131. name: "电厂",
  132. value: 80
  133. },
  134. {
  135. name: "AE",
  136. value: 80
  137. },
  138. {
  139. name: "AA",
  140. value: 80
  141. },
  142. {
  143. name: "苯乙烯",
  144. value: 80
  145. }
  146. ],
  147. waitTime: 4000,
  148. carousel: "page",
  149. unit: "mw"
  150. },
  151. water: {
  152. data: [24, 45],
  153. shape: "roundRect",
  154. formatter: "SUB {value}%",
  155. waveNum: 3
  156. },
  157. // 通过率和达标率的组件复用数据
  158. rate: [
  159. {
  160. id: "centerRate0",
  161. tips: parseInt(this.dashboardelecdata.mwhWr),
  162. colorData: {
  163. textStyle: "#3fc0fb",
  164. series: {
  165. color: ["#00bcd44a", "transparent"],
  166. dataColor: {
  167. normal: "#03a9f4",
  168. shadowColor: "#97e2f5"
  169. }
  170. }
  171. }
  172. },
  173. {
  174. id: "centerRate1",
  175. tips: parseInt(this.dashboardelecdata.stg1Wr),
  176. colorData: {
  177. textStyle: "#3fc0fb",
  178. series: {
  179. color: ["#00bcd44a", "transparent"],
  180. dataColor: {
  181. normal: "#03a9f4",
  182. shadowColor: "#97e2f5"
  183. }
  184. }
  185. }
  186. },
  187. {
  188. id: "centerRate2",
  189. tips: parseInt(this.dashboardelecdata.gtg3Wr),
  190. colorData: {
  191. textStyle: "#67e0e3",
  192. series: {
  193. color: ["#faf3a378", "transparent"],
  194. dataColor: {
  195. normal: "#ff9800",
  196. shadowColor: "#fcebad"
  197. }
  198. }
  199. }
  200. },
  201. {
  202. id: "centerRate3",
  203. tips: parseInt(this.dashboardelecdata.gtg2Wr),
  204. colorData: {
  205. textStyle: "#67e0e3",
  206. series: {
  207. color: ["rgba(196,163,250,0.47)", "transparent"],
  208. dataColor: {
  209. normal: "#9d00ff",
  210. shadowColor: "#c9adfc"
  211. }
  212. }
  213. }
  214. },
  215. {
  216. id: "centerRate4",
  217. tips: parseInt(this.dashboardelecdata.gtg1Wr),
  218. colorData: {
  219. textStyle: "#67e0e3",
  220. series: {
  221. color: ["rgba(163,250,177,0.47)", "transparent"],
  222. dataColor: {
  223. normal: "#00ff0d",
  224. shadowColor: "#b2fcad"
  225. }
  226. }
  227. }
  228. }
  229. ]
  230. };
  231. },
  232. components: {
  233. centerChart
  234. // centerChart1,
  235. // centerChart2
  236. },
  237. mounted() {
  238. this.initChart();
  239. console.log(150,this.dashboardelecdata.gtg1Lv)
  240. },
  241. methods: {
  242. initChart() {
  243. // 基于准备好的dom,初始化echarts实例
  244. this.chart = this.echarts.init(document.getElementById('naturalGasChart'))
  245. this.chart.setOption({
  246. xAxis: {
  247. type: 'category',
  248. data: [
  249. '00:00-03:00',
  250. '03:00-06:00',
  251. '06:00-09:00',
  252. '09:00-12:00',
  253. '12:00-15:00',
  254. '15:00-18:00',
  255. '18:00-21:00',
  256. '21:00-00:00'
  257. ]
  258. },
  259. yAxis: {
  260. type: 'value'
  261. },
  262. series: [
  263. {
  264. data: [120, 200, 150, 80, 70, 110, 130],
  265. type: 'line',
  266. smooth: true,
  267. symbol: '',
  268. symbolSize: 10,
  269. lineStyle: {
  270. color: '#5470C6',
  271. width: 4,
  272. type: 'dashed'
  273. },
  274. itemStyle: {
  275. borderWidth: 3,
  276. borderColor: '#EE6666',
  277. color: 'yellow'
  278. }
  279. }
  280. ]
  281. // color: ['#00DDFF', '#37A2FF'],
  282. // tooltip: {
  283. // trigger: 'axis',
  284. // type: 'category',
  285. // },
  286. // /* 标识 */
  287. // legend: {
  288. // data: ['实际', '计划'],
  289. // textStyle:{
  290. // color: '#ffffff'//字体颜色
  291. // }
  292. // },
  293. // /* 周围边距 */
  294. // grid: {
  295. // left: '3%',
  296. // right: '3%',
  297. // bottom: '1%',
  298. // top: '13%',
  299. // containLabel: true
  300. // },
  301. // xAxis: [
  302. // {
  303. // type: 'category',
  304. // boundaryGap: false,
  305. // 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'],
  306. // axisLabel: {//x轴文字的配置
  307. // show: true,
  308. // textStyle: {
  309. // color: '#ffffff',
  310. // }
  311. // },
  312. // }
  313. // ],
  314. // yAxis: [
  315. // {
  316. // type: 'value',
  317. // axisLabel: {
  318. // textStyle: {
  319. // fontSize: 10,
  320. // color: '#ffffffff',
  321. // margin: 15
  322. // },
  323. // }
  324. // }
  325. // ],
  326. // series: [
  327. // {
  328. // name: this.$t('实际'),
  329. // type: 'line',
  330. // symbol: "none",
  331. // 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]
  332. // },
  333. // {
  334. // name: this.$t('计划'),
  335. // type: 'line',
  336. // symbol: "none",
  337. // 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]
  338. // },
  339. // ]
  340. })
  341. }
  342. }
  343. };
  344. </script>
  345. <style lang="scss" scoped>
  346. #center {
  347. display: flex;
  348. flex-direction: column;
  349. .up {
  350. width: 100%;
  351. display: flex;
  352. flex-wrap: wrap;
  353. justify-content: space-around;
  354. .item {
  355. border-radius: 0.0625rem;
  356. padding-top: 0.2rem;
  357. margin-top: 0.1rem;
  358. width: 32%;
  359. height: 0.875rem;
  360. }
  361. }
  362. .bottom-data {
  363. margin-top: 10px;
  364. .item-box {
  365. float: right;
  366. position: relative;
  367. width: 20%;
  368. color: #d3d6dd;
  369. // 金币
  370. .coin {
  371. position: absolute;
  372. left: 0.1rem;
  373. top: 0.2125rem;
  374. font-size: 0.25rem;
  375. color: #ffc107;
  376. }
  377. .colorYellow {
  378. color: yellowgreen;
  379. }
  380. }
  381. }
  382. .center {
  383. padding: 0.07rem 0.05rem;
  384. padding-bottom: 0;
  385. width: 100%;
  386. display: flex;
  387. justify-content: space-between;
  388. float: right;
  389. position: relative;
  390. .percentNum {
  391. width: 19%;
  392. }
  393. }
  394. .down {
  395. padding: 0.07rem 0.05rem;
  396. padding-bottom: 0;
  397. width: 100%;
  398. display: flex;
  399. height: 3.1875rem;
  400. justify-content: space-between;
  401. .bg-color-black {
  402. border-radius: 0.0625rem;
  403. }
  404. .ranking {
  405. padding: 0.125rem;
  406. width: 59%;
  407. }
  408. .percent {
  409. width: 40%;
  410. display: flex;
  411. flex-wrap: wrap;
  412. .bg-color-black {
  413. border-radius: 0.0625rem;
  414. position: relative;
  415. .alarmIcon {
  416. width: 40px !important;
  417. height: 40px !important;
  418. position: absolute;
  419. left: 50%;
  420. top: 50%;
  421. transform: translate(-50%, -50%);
  422. }
  423. }
  424. .item {
  425. width: 100%;
  426. height: 1rem;
  427. }
  428. .water {
  429. width: 100%;
  430. }
  431. }
  432. }
  433. }
  434. </style>