center.vue 9.4 KB

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