index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758
  1. <template>
  2. <a-spin :spinning="loading">
  3. <div class="energy-overView">
  4. <commonSearch hasAreaSearch ref="commonSearch" type="nodate" @search="handleSearch"></commonSearch>
  5. <div class="top-container u-flex">
  6. <div class="nengyuanzhan u-flex common-box">
  7. <div class="common-title">能源站信息</div>
  8. <img src="../../../../assets/louyu.png" alt="" />
  9. <a-descriptions :column="2">
  10. <a-descriptions-item label="建筑名称">{{ energySpace.name }}</a-descriptions-item>
  11. <a-descriptions-item label="建筑面积">{{ energySpace.builtarea }} ㎡</a-descriptions-item>
  12. <a-descriptions-item label="空调面积">{{ energySpace.aircondarea }} ㎡</a-descriptions-item>
  13. <a-descriptions-item label="采暖面积">{{ energySpace.heatarea }} ㎡</a-descriptions-item>
  14. <!-- <el-descriptions-item label="用能人数">{{energySpace.}}</el-descriptions-item> -->
  15. <!-- <el-descriptions-item label="建筑年代">{{energySpace.}}</el-descriptions-item> -->
  16. <!-- <el-descriptions-item label="建筑用途">{{energySpace.}}</el-descriptions-item> -->
  17. </a-descriptions>
  18. </div>
  19. <div class="peak-flat-valley common-box">
  20. <div class="common-title">峰平谷电能统计</div>
  21. <!-- 统计数据 -->
  22. <div class="number-data u-flex-jac">
  23. <div class="u-flex-cjac f1">
  24. <div>电费</div>
  25. <div>--</div>
  26. </div>
  27. <a-divider type="vertical" />
  28. <div class="u-flex-cjac" style="flex: 1.5;">
  29. <div>单价信息</div>
  30. <div class="u-flex">
  31. <div class="u-flex-cjac" style="margin-right: 6px;">
  32. <div>尖时</div>
  33. <div>1.0000元/kWh</div>
  34. </div>
  35. <div class="u-flex-cjac" style="margin-right: 6px;">
  36. <div>峰时</div>
  37. <div>1.0000元/kWh</div>
  38. </div>
  39. <div class="u-flex-cjac" style="margin-right: 6px;">
  40. <div>平时</div>
  41. <div>1.0000元/kWh</div>
  42. </div>
  43. <div class="u-flex-cjac" style="margin-right: 6px;">
  44. <div>谷时</div>
  45. <div>1.0000元/kWh</div>
  46. </div>
  47. </div>
  48. </div>
  49. </div>
  50. <!-- 饼状图 -->
  51. <div class="u-flex pies-container">
  52. <div class="money-pie f1">
  53. <div class="pie-layout u-flex">
  54. <div class="pie-chart" ref="moneyPie"></div>
  55. <div class="legend">
  56. <div class="u-flex item" v-for="(item, index) in dataLists" :key="index">
  57. <div class="example"></div>
  58. <div class="text">{{item.name}}</div>
  59. <div class="number">{{item.number}}</div>
  60. <!-- KWh -->
  61. <div class="pieValue">{{item.pieValue}}%</div>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <!-- kWh相关饼状图 -->
  67. <div class="kWh-pie f1">
  68. <div class="pie-layout u-flex">
  69. <div class="pie-chart" ref="kWhPie"></div>
  70. <div class="legend">
  71. <div class="u-flex item" v-for="(item, index) in dataLists" :key="index">
  72. <div class="example"></div>
  73. <div class="text">{{item.name}}</div>
  74. <div class="number">{{item.number}}</div>
  75. <!-- KWh -->
  76. <div class="pieValue">{{item.pieValue}}%</div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <div class="bottom-container u-flex">
  85. <div class="yongdian_qushi common-box">
  86. <div class="common-title">总用电趋势</div>
  87. <div class="totalEle-trend" ref="totalEleTrend"></div>
  88. </div>
  89. <div class="yongleng_qushi common-box">
  90. <div class="common-title">总用冷量趋势</div>
  91. <div class="totalCooling-trend" ref="totalCoolingTrend"></div>
  92. </div>
  93. <div class="xiaobi_qushi common-box">
  94. <div class="common-title">系统能效比趋势</div>
  95. <div class="totalEERatio-trend" ref="totalEERatioTrend"></div>
  96. </div>
  97. </div>
  98. </div>
  99. </a-spin>
  100. </template>
  101. <script>
  102. import * as echarts from 'echarts'
  103. import commonSearch from '../components/commonSearch'
  104. import { httpAction, getAction } from '@/api/manage'
  105. // import { emsdata } from '../emsdata';
  106. export default {
  107. name: 'energyDashboard',
  108. components: {
  109. commonSearch,
  110. },
  111. data() {
  112. return {
  113. description: '能效总览',
  114. loading: false,
  115. energySpace: {},
  116. demandStatistics: {
  117. jishi: null,
  118. fengzhi: null,
  119. mubiao: null,
  120. co2: null,
  121. shidu: null,
  122. wendu: null,
  123. },
  124. dataLists: [
  125. { name: '尖时', number: 11514.45, pieValue: 34.37 },
  126. { name: '峰时', number: 9485.32, pieValue: 28.32 },
  127. { name: '平时', number: 7969.53, pieValue: 23.79 },
  128. { name: '谷时', number: 4527.72, pieValue: 13.52 }
  129. ],
  130. sortTop5Name: [],
  131. nowMonthData: [],
  132. lastMonthData: [],
  133. // sortTop5Name: ['电信盘','烧机设备', '插座', '全空气机组', '照明', ],
  134. // nowMonthData: [7773.50, 8809.40, 10065.20, 17371.00, 20478.60],
  135. // lastMonthData: [-6979.80, -6458.10 -13762.10, -16628.50, -8037.70],
  136. totalEleTrend: {
  137. daysplit: [],
  138. kongtiao: [],
  139. zhaoming: [],
  140. dongli: [],
  141. qita: [],
  142. },
  143. zongbiao: [],
  144. url: {
  145. list: '/emsStatistics/energyOverview',
  146. },
  147. }
  148. },
  149. created() {},
  150. mounted() {
  151. this.$nextTick(() => {
  152. this.initPieMoney()
  153. this.initPieKWH()
  154. this.initTotalEleTrend()
  155. this.initTotalCoolingTrend()
  156. this.initTotalEERatioTrend()
  157. // this.getEnergyoverview()
  158. })
  159. },
  160. methods: {
  161. getEnergyoverview() {
  162. // {spaceId: 277797283102721}
  163. this.loading = true
  164. var data = this.$refs.commonSearch.queryParams
  165. getAction(this.url.list, data).then((res) => {
  166. if(res.success){
  167. // 获取数据
  168. }else{
  169. this.$message.warning(res.message);
  170. }
  171. }).finally(() => {
  172. this.$nextTick(() => {
  173. // this.initSortTop5()
  174. // this.initPieDianliang()
  175. // this.initTotalEleTrend()
  176. })
  177. this.loading = false;
  178. })
  179. },
  180. handleSearch(param) {
  181. this.getEnergyoverview()
  182. },
  183. // kWh相关饼图
  184. initPieKWH(){
  185. var chartDom = this.$refs.kWhPie
  186. var myChart = echarts.init(chartDom);
  187. var option;
  188. option = {
  189. series: [
  190. {
  191. type: 'gauge',
  192. radius: '70%',
  193. center: ['50%', '50%'],
  194. clockwise: true, // 仪表盘刻度是否是顺时针增长
  195. startAngle: '90', // 开始角度
  196. endAngle: '-269.9999', // 结束角度
  197. splitNumber: 36, // 仪表盘刻度的分割段数
  198. detail: {
  199. offsetCenter: [0, -20],
  200. formatter: ' '
  201. },
  202. detail: { // 仪表盘详情,用于显示数据-value
  203. show: true, // 是否显示详情,默认 true
  204. offsetCenter: [0, -4],// 相对于仪表盘中心的偏移位置
  205. color: '#000',
  206. fontWeight: '600',
  207. fontSize: '18',
  208. formatter: "{value}", // 格式化函数或者字符串
  209. },
  210. title: { //仪表盘标题-name。
  211. show: true, //是否显示标题,默认 true
  212. offsetCenter: [0, 16], // 相对于仪表盘中心的偏移位置
  213. color: '#000',
  214. fontWeight: '100',
  215. fontSize: '14',
  216. },
  217. pointer: { // 指针
  218. show: false
  219. },
  220. axisLine: {
  221. show: true,
  222. lineStyle: {
  223. color: [
  224. [0.3437, '#5470C6'],
  225. [0.6269, '#91CC75'],
  226. [0.8648, '#FAC858'],
  227. [1, '#EE6666']
  228. // [0.3437, '#e2e14f'],
  229. // [0.6269, '#00a7fb'],
  230. // [0.8648, '#00e0fb'],
  231. // [1, '#00ffb4']
  232. ],
  233. width: 18
  234. }
  235. },
  236. axisTick: { // 刻度线
  237. show: false
  238. },
  239. splitLine: { // 分割线
  240. show: true,
  241. distance: -18, // 分割线与轴线的距离(在哪儿显示)
  242. length: 18,
  243. lineStyle: {
  244. color: '#f1f1f1',
  245. width: 2
  246. }
  247. },
  248. axisLabel: {
  249. show: false
  250. },
  251. data: [
  252. {
  253. value: 33497.02,
  254. name: 'KWh'
  255. }
  256. ]
  257. },
  258. {
  259. type: 'pie',
  260. name: '内层细圆环',
  261. radius: ['52%', '53%'],
  262. center: ['50%', '50%'],
  263. hoverAnimation: false,
  264. startAngle: 200,
  265. itemStyle: {
  266. color: '#E3EBFA'
  267. },
  268. label: {
  269. show: false
  270. },
  271. data: [100]
  272. },
  273. {
  274. type: 'pie',
  275. name: '外层细圆环',
  276. radius: ['72%', '71%'],
  277. center: ['50%', '50%'],
  278. hoverAnimation: false,
  279. startAngle: 200,
  280. itemStyle: {
  281. color: '#E3EBFA'
  282. },
  283. label: {
  284. show: false
  285. },
  286. data: [100]
  287. }
  288. ]
  289. };
  290. option && myChart.setOption(option);
  291. window.addEventListener("resize",function (){
  292. myChart.resize();
  293. });
  294. },
  295. // 金额相关饼图
  296. initPieMoney(){
  297. var chartDom = this.$refs.moneyPie
  298. var myChart = echarts.init(chartDom);
  299. var option;
  300. option = {
  301. series: [
  302. {
  303. type: 'gauge',
  304. radius: '70%',
  305. center: ['50%', '50%'],
  306. clockwise: true, // 仪表盘刻度是否是顺时针增长
  307. startAngle: '90', // 开始角度
  308. endAngle: '-269.9999', // 结束角度
  309. splitNumber: 36, // 仪表盘刻度的分割段数
  310. detail: {
  311. offsetCenter: [0, -20],
  312. formatter: ' '
  313. },
  314. detail: { // 仪表盘详情,用于显示数据-value
  315. show: true, // 是否显示详情,默认 true
  316. offsetCenter: [0, -4],// 相对于仪表盘中心的偏移位置
  317. color: '#000',
  318. fontWeight: '600',
  319. fontSize: '18',
  320. formatter: "{value}", // 格式化函数或者字符串
  321. },
  322. title: { //仪表盘标题-name。
  323. show: true, //是否显示标题,默认 true
  324. offsetCenter: [0, 16], // 相对于仪表盘中心的偏移位置
  325. color: '#000',
  326. fontWeight: '100',
  327. fontSize: '14',
  328. },
  329. pointer: { // 指针
  330. show: false
  331. },
  332. axisLine: {
  333. show: true,
  334. lineStyle: {
  335. color: [
  336. [0.3437, '#5470C6'],
  337. [0.6269, '#91CC75'],
  338. [0.8648, '#FAC858'],
  339. [1, '#EE6666']
  340. // [0.3437, '#e2e14f'],
  341. // [0.6269, '#00a7fb'],
  342. // [0.8648, '#00e0fb'],
  343. // [1, '#00ffb4']
  344. ],
  345. width: 18
  346. }
  347. },
  348. axisTick: { // 刻度线
  349. show: false
  350. },
  351. splitLine: { // 分割线
  352. show: true,
  353. distance: -18, // 分割线与轴线的距离(在哪儿显示)
  354. length: 18,
  355. lineStyle: {
  356. color: '#f1f1f1',
  357. width: 2
  358. }
  359. },
  360. axisLabel: {
  361. show: false
  362. },
  363. data: [
  364. {
  365. value: 33497.02,
  366. name: '元'
  367. }
  368. ]
  369. },
  370. {
  371. type: 'pie',
  372. name: '内层细圆环',
  373. radius: ['52%', '53%'],
  374. center: ['50%', '50%'],
  375. hoverAnimation: false,
  376. startAngle: 200,
  377. itemStyle: {
  378. color: '#E3EBFA'
  379. },
  380. label: {
  381. show: false
  382. },
  383. data: [100]
  384. },
  385. {
  386. type: 'pie',
  387. name: '外层细圆环',
  388. radius: ['72%', '71%'],
  389. center: ['50%', '50%'],
  390. hoverAnimation: false,
  391. startAngle: 200,
  392. itemStyle: {
  393. color: '#E3EBFA'
  394. },
  395. label: {
  396. show: false
  397. },
  398. data: [100]
  399. }
  400. ]
  401. };
  402. option && myChart.setOption(option);
  403. window.addEventListener("resize",function (){
  404. myChart.resize();
  405. });
  406. },
  407. // 总用电趋势图 柱状图
  408. initTotalEleTrend() {
  409. console.log(this.totalEleTrend.daysplit)
  410. var _this = this
  411. var chartDom = this.$refs.totalEleTrend
  412. var myChart = echarts.init(chartDom)
  413. var option
  414. option = {
  415. // title: {
  416. // text: '用能趋势',
  417. // left: 'center'
  418. // },
  419. tooltip: {
  420. trigger: 'axis',
  421. axisPointer: {
  422. type: 'shadow',
  423. },
  424. },
  425. legend: {
  426. bottom: 0,
  427. },
  428. grid: {
  429. top: '10%',
  430. left: '3%',
  431. right: '4%',
  432. bottom: '25px',
  433. containLabel: true,
  434. },
  435. xAxis: {
  436. type: 'category',
  437. data: ['6月','7月','8月','9月','10月','11月','12月','1月','2月','3月','4月','5月',]
  438. // data: this.totalEleTrend.daysplit,
  439. },
  440. yAxis: {
  441. type: 'value',
  442. },
  443. toolbox: {
  444. show: true,
  445. feature: {
  446. saveAsImage: {},
  447. },
  448. },
  449. series: [
  450. {
  451. name: '尖时',
  452. type: 'bar',
  453. stack: 'total',
  454. color: '#5470C6',
  455. emphasis: {
  456. focus: 'series',
  457. },
  458. data: [150, 212, 201, 154, 190, 330, 410, 320, 199, 254, 324, 225]
  459. // data: this.totalEleTrend.dongli,
  460. },
  461. {
  462. name: '峰时',
  463. type: 'bar',
  464. stack: 'total',
  465. color: '#91CC75',
  466. // label: { // 是否显示柱形图上数字
  467. // show: true
  468. // },
  469. // emphasis: { // 悬浮时是否模糊其他柱形图
  470. // focus: 'series'
  471. // },
  472. data: [120, 132, 101, 134, 90, 230, 210, 209, 150, 140, 152, 143]
  473. // data: this.totalEleTrend.kongtiao,
  474. },
  475. {
  476. name: '平时',
  477. type: 'bar',
  478. stack: 'total',
  479. color: '#EE6666',
  480. // emphasis: {
  481. // focus: 'series'
  482. // },
  483. data: [220, 182, 191, 234, 290, 330, 310, 320, 145, 222, 245, 301]
  484. // data: this.totalEleTrend.zhaoming,
  485. },
  486. {
  487. name: '谷时',
  488. type: 'bar',
  489. stack: 'total',
  490. color: '#FAC858',
  491. // barWidth: '50%',
  492. // emphasis: {
  493. // focus: 'series'
  494. // },
  495. data: [320, 302, 301, 334, 390, 330, 320, 300, 310, 316, 304, 322]
  496. // data: this.totalEleTrend.qita,
  497. },
  498. ],
  499. }
  500. option && myChart.setOption(option)
  501. window.addEventListener('resize', function () {
  502. myChart.resize()
  503. })
  504. },
  505. // 总用冷量趋势图
  506. initTotalCoolingTrend() {
  507. var _this = this
  508. var chartDom = this.$refs.totalCoolingTrend
  509. var myChart = echarts.init(chartDom)
  510. var option
  511. option = {
  512. tooltip: {
  513. trigger: 'axis',
  514. axisPointer: {
  515. type: 'shadow',
  516. },
  517. },
  518. legend: {
  519. bottom: 0,
  520. },
  521. grid: {
  522. top: '10%',
  523. left: '3%',
  524. right: '4%',
  525. bottom: '25px',
  526. containLabel: true,
  527. },
  528. xAxis: {
  529. type: 'category',
  530. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  531. },
  532. yAxis: {
  533. type: 'value'
  534. },
  535. toolbox: {
  536. show: true,
  537. feature: {
  538. saveAsImage: {},
  539. },
  540. },
  541. series: [
  542. {
  543. name: '用冷量',
  544. type: 'line',
  545. data: [150, 230, 224, 218, 135, 147, 260],
  546. }
  547. ]
  548. }
  549. option && myChart.setOption(option)
  550. window.addEventListener('resize', function () {
  551. myChart.resize()
  552. })
  553. },
  554. // 系统能效比趋势图
  555. initTotalEERatioTrend() {
  556. var _this = this
  557. var chartDom = this.$refs.totalEERatioTrend
  558. var myChart = echarts.init(chartDom)
  559. var option
  560. option = {
  561. tooltip: {
  562. trigger: 'axis',
  563. axisPointer: {
  564. type: 'shadow',
  565. },
  566. },
  567. legend: {
  568. bottom: 0,
  569. },
  570. grid: {
  571. top: '10%',
  572. left: '3%',
  573. right: '4%',
  574. bottom: '25px',
  575. containLabel: true,
  576. },
  577. xAxis: {
  578. type: 'category',
  579. data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  580. },
  581. yAxis: {
  582. type: 'value'
  583. },
  584. toolbox: {
  585. show: true,
  586. feature: {
  587. saveAsImage: {},
  588. },
  589. },
  590. series: [
  591. {
  592. name: '能效数值',
  593. type: 'line',
  594. color: '#91CC75',
  595. data: [150, 230, 224, 218, 135, 147, 260],
  596. }
  597. ]
  598. }
  599. option && myChart.setOption(option)
  600. window.addEventListener('resize', function () {
  601. myChart.resize()
  602. })
  603. },
  604. },
  605. }
  606. </script>
  607. <style lang="less" scoped>
  608. @import '~@/assets/less/uStyle.less';
  609. </style>
  610. <style lang="less" scoped>
  611. .energy-overView {
  612. min-height: calc(100vh - 84px);
  613. padding: 0 10px;
  614. .common-title {
  615. text-align: center;
  616. font-weight: bold;
  617. font-size: 18px;
  618. color: #1b2128;
  619. }
  620. .common-box {
  621. box-shadow: 0 2px 10px rgba(153, 153, 153, 0.1);
  622. padding: 1.1vh 1.2vh;
  623. background-color: #fff;
  624. // padding: 16px 20px;
  625. }
  626. .info-container {
  627. width: 100%;
  628. .item-info {
  629. padding: 1.4vh 0;
  630. // padding: 22px 0;
  631. text-align: center;
  632. .name {
  633. font-size: 14px;
  634. }
  635. .value {
  636. margin-top: 15px;
  637. font-size: 20px;
  638. }
  639. }
  640. }
  641. .top-container {
  642. height: 40vh;
  643. // height: calc(50vh - 124px);
  644. .nengyuanzhan {
  645. width: 33%;
  646. margin-right: 10px;
  647. flex-direction: column;
  648. justify-content: space-between;
  649. align-items: center;
  650. padding-bottom: 1.2vh;
  651. // padding-bottom: 30px;
  652. img {
  653. object-fit: contain;
  654. }
  655. .ant-descriptions {
  656. background-color: #ffffff;
  657. }
  658. }
  659. .peak-flat-valley{
  660. // width: calc(100% - 33% - 10px);
  661. flex: 1;
  662. // 统计数据部分
  663. .number-data{
  664. height: 40px;
  665. }
  666. // 饼状图部分
  667. .pies-container{
  668. padding-top: 16px;
  669. height: calc(100% - 60px);
  670. // 金额饼状图
  671. .money-pie{
  672. height: 100%;
  673. }
  674. // kWh饼状图
  675. .kWh-pie {
  676. height: 100%;
  677. }
  678. .pie-layout{
  679. height: 100%;
  680. }
  681. .pie-chart{
  682. width: 50%;
  683. height: 100%;
  684. }
  685. .legend{
  686. flex: 1;
  687. display: flex;
  688. flex-direction: column;
  689. justify-content: space-around;
  690. // align-items: start;
  691. align-items: flex-start;
  692. padding: 10px;
  693. font-size: 13px;
  694. .item{
  695. width: 100%;
  696. align-items: center;
  697. .example{
  698. width: 20px;
  699. height: 10px;
  700. background: #000;
  701. margin-right: 10px;
  702. }
  703. .text{
  704. min-width: 40px;
  705. }
  706. .number{
  707. min-width: 80px;
  708. // margin-right: 22px;
  709. }
  710. .pieValue{
  711. }
  712. }
  713. }
  714. }
  715. }
  716. }
  717. .bottom-container {
  718. height: calc(50vh - 60px);
  719. margin-top: 10px;
  720. .yongdian_qushi {
  721. width: 33%;
  722. margin-right: 10px;
  723. .totalEle-trend {
  724. height: calc(100% - 25px);
  725. }
  726. }
  727. .yongleng_qushi {
  728. flex: 1;
  729. margin-right: 10px;
  730. .totalCooling-trend {
  731. height: calc(100% - 25px);
  732. }
  733. }
  734. .xiaobi_qushi {
  735. flex: 1;
  736. .totalEERatio-trend {
  737. height: calc(100% - 25px);
  738. }
  739. }
  740. }
  741. }
  742. </style>