BusinessPvDetail.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <script>
  2. import {requireImg} from "@/utils/requireImg";
  3. import businessPvMoneyChart from "@/components/business/analysis/pv/BusinessPvMoneyChart.vue";
  4. import apiOperationAnalysis from "@/api/operation/apiOperationAnalysis";
  5. export default {
  6. props: {
  7. queryData: Object
  8. },
  9. components: {
  10. businessPvMoneyChart
  11. },
  12. data() {
  13. return {
  14. running: 0,
  15. total: 0,
  16. tableData: [
  17. {
  18. icon: 'business/energy/pv.png',
  19. title: '总发电量',
  20. num: 0,
  21. unit: 'kWh'
  22. },{
  23. icon: 'business/energy/pv.png',
  24. title: '发电时间',
  25. num: 0,
  26. unit: 'h'
  27. },{
  28. icon: 'business/energy/pv.png',
  29. title: '总收益',
  30. num: 0,
  31. unit: '元'
  32. }
  33. ]
  34. }
  35. },
  36. mounted() {
  37. this.init()
  38. },
  39. methods: {
  40. requireImg,
  41. init() {
  42. this.getData()
  43. },
  44. refresh() {
  45. this.$util.asyncPromise(
  46. this.getData(),
  47. this.$refs.BusinessHotDistributeChart.getData()
  48. )
  49. },
  50. getData() {
  51. return apiOperationAnalysis.getEnergyAnalysisCpv(this.queryData).then(res=>{
  52. let data = this.$util.dataUtil.circleChartArrToObj(res)
  53. this.running = data['function']
  54. this.total = data['whole']
  55. this.tableData[0].num = data['electricTotal']
  56. this.tableData[1].num = data['electricDate']
  57. this.tableData[2].num = data['profitTotal']
  58. })
  59. }
  60. },
  61. }
  62. </script>
  63. <template>
  64. <div class="businessEnergyDetail">
  65. <div>
  66. <div class="businessEnergyDetail-top">
  67. <a-row>
  68. <a-col :span="11">
  69. <div style="margin: 10% 0 0 30%">
  70. <a-avatar :size="28" :src="requireImg('business/energy/device-pv.png')"></a-avatar>
  71. <span style="font-size: 20px;display: inline-block;margin-left: 20%">{{ running }}</span>
  72. </div>
  73. <div style="margin: 10% 0 0 30%;color: #B2B2B2;font-size: 14px">正在运行(台)</div>
  74. </a-col>
  75. <a-col :span="2">
  76. <div style="text-align: center;width: 100%;line-height: 60px;font-size: 20px">/</div>
  77. </a-col>
  78. <a-col :span="11">
  79. <div style="margin: 10% 0 0 30%">
  80. <a-avatar :size="28" :src="requireImg('business/energy/device-pv.png')"></a-avatar>
  81. <span style="font-size: 20px;display: inline-block;margin-left: 20%">{{ total }}</span>
  82. </div>
  83. <div style="margin: 10% 0 0 30%;color: #B2B2B2;font-size: 14px">总数量(台)</div>
  84. </a-col>
  85. </a-row>
  86. </div>
  87. <div>
  88. <BusinessEnergySummaryTbl :data="tableData" :title-width="100" :unit-width="60"/>
  89. </div>
  90. <div class="businessEnergyDetail-chart">
  91. <businessPvMoneyChart ref="businessPvMoneyChart" :query-data="queryData" :height="200" />
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <style lang="less" scoped>
  97. .businessEnergyDetail {
  98. width: 100%;
  99. height: 100%;
  100. .businessEnergyDetail-top {
  101. background-color: #f7fbff;
  102. width: 85%;
  103. margin: 0 auto 8px;
  104. height: 100px;
  105. }
  106. .businessEnergyDetail-icon {
  107. display: inline-block;
  108. margin-right: 6px;
  109. vertical-align: middle;
  110. }
  111. .businessEnergyDetail-num {
  112. display: inline-block;
  113. padding: 0 20px;
  114. color: #4D4D4D;
  115. background-color: #f7fbff;
  116. }
  117. .businessEnergyDetail-chart {
  118. width: 100%;
  119. margin: 30px auto 12px;
  120. padding: 0 15px;
  121. }
  122. }
  123. </style>