doubleCarbonOverview.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <script>
  2. import Card from "@/components/common/card.vue";
  3. import CoreData from "@/components/common/coreData.vue";
  4. import Query from "@/components/common/query.vue";
  5. import CarbonEmissionCharts from "@/components/doubleCarbon/overview/charts/carbonEmissionChart.vue";
  6. import CarbonQuotaChart from "@/components/doubleCarbon/overview/charts/carbonQuotaChart.vue";
  7. import DoubleCarbonNews from "@/components/doubleCarbon/overview/charts/doubleCarbonNews.vue";
  8. import CarbonOverviewPercent from "@/components/doubleCarbon/overview/charts/carbonOverviewPercent.vue";
  9. import apiCarbonOverview from "@/api/carbon/apiCarbonOverview";
  10. export default {
  11. components: {
  12. Card,
  13. CoreData,
  14. Query,
  15. CarbonEmissionCharts,
  16. CarbonQuotaChart,
  17. DoubleCarbonNews,
  18. CarbonOverviewPercent,
  19. },
  20. data() {
  21. return {
  22. queryData: {
  23. companyId: '0',
  24. timeRange: this.$util.dateUtil.getNearlyMonthRange()
  25. },
  26. coreData: [
  27. {
  28. type: 1,
  29. title: '碳配额存量',
  30. content: "",
  31. numDesc: "%",
  32. },
  33. {
  34. title: '碳排放总量(tco2e)',
  35. num: 0,
  36. historyDesc: '同比',
  37. historyNum: 0
  38. },
  39. {
  40. title: '单位面积碳排放(tco2e/m²)',
  41. num: 0,
  42. historyDesc: '同比',
  43. historyNum: 0
  44. },
  45. {
  46. title: '人均碳排放(tco2e/人)',
  47. num: 0,
  48. historyDesc: '同比',
  49. historyNum: 0
  50. },
  51. {
  52. title: '光伏减排(tco2e)',
  53. num: 0,
  54. historyDesc: '同比',
  55. historyNum: 0
  56. },
  57. {
  58. type: 1,
  59. title: '值得关注',
  60. showStar: true,
  61. content: ''
  62. },
  63. ],
  64. newsData: []
  65. }
  66. },
  67. mounted() {
  68. this.init();
  69. },
  70. methods: {
  71. init() {
  72. this.$util.asyncPromise(
  73. this.getCoreData(),
  74. this.getNewsData()
  75. )
  76. },
  77. reset() {
  78. },
  79. search(data) {
  80. this.$util.asyncPromise(
  81. this.getCoreData(),
  82. this.getNewsData(),
  83. this.$refs.CarbonEmissionCharts.getData(),
  84. this.$refs.CarbonQuotaChart.getData(),
  85. this.$refs.CarbonOverviewPercent.getData(),
  86. )
  87. },
  88. getCoreData() {
  89. return apiCarbonOverview.getCoreData(this.queryData).then(res=>{
  90. this.coreData[0].content = res.list[0].value
  91. this.coreData[1].num = res.list[1].value
  92. this.coreData[1].historyNum = res.list[1].compare
  93. this.coreData[2].num = res.list[2].value
  94. this.coreData[2].historyNum = res.list[2].compare
  95. this.coreData[3].num = res.list[3].value
  96. this.coreData[3].historyNum = res.list[3].compare
  97. this.coreData[4].num = res.list[4].value
  98. this.coreData[4].historyNum = res.list[4].compare
  99. this.coreData[5].content = res.worthAttention
  100. })
  101. },
  102. getNewsData() {
  103. return apiCarbonOverview.getCarbonNews(this.queryData).then(res=>{
  104. this.newsData = res;
  105. console.log(this.newsData)
  106. });
  107. }
  108. }
  109. }
  110. </script>
  111. <template>
  112. <div class="doubleCarbon-overview">
  113. <div class="page-query-core">
  114. <a-row>
  115. <a-col>
  116. <div style="width: 100%">
  117. <Query :show="['company', 'time']" :query-data.sync="queryData" :reset="reset" :search="search"></Query>
  118. </div>
  119. </a-col>
  120. <a-col>
  121. <div style="width: 100%">
  122. <Card title="核心指标">
  123. <CoreData :data-list="coreData"></CoreData>
  124. </Card>
  125. </div>
  126. </a-col>
  127. </a-row>
  128. </div>
  129. <div style="margin-top: 12px">
  130. <a-row :gutter="[12,12]">
  131. <a-col :span="18">
  132. <div class="ioc-card-content">
  133. <Card title="碳排放分析">
  134. <div class="doubleCarbon-overview-analyse">
  135. <CarbonEmissionCharts ref="CarbonEmissionCharts" :query-data="queryData" :height="450" />
  136. </div>
  137. </Card>
  138. </div>
  139. </a-col>
  140. <a-col :span="6">
  141. <div class="ioc-card-content">
  142. <Card title="碳配额构成">
  143. <div class="doubleCarbon-overview-quota">
  144. <CarbonQuotaChart ref="CarbonQuotaChart" :query-data="queryData" :height="450" />
  145. </div>
  146. </Card>
  147. </div>
  148. </a-col>
  149. <a-col :span="18">
  150. <div class="ioc-card-content">
  151. <Card title="双碳新闻">
  152. <div style="width: 97%;margin: 0 auto">
  153. <a-divider style="margin: 0;padding: 0"></a-divider>
  154. </div>
  155. <div class="doubleCarbon-overview-news">
  156. <DoubleCarbonNews :data="newsData" />
  157. </div>
  158. </Card>
  159. </div>
  160. </a-col>
  161. <a-col :span="6">
  162. <div class="ioc-card-content">
  163. <Card title="碳排放占比">
  164. <div class="doubleCarbon-overview-percent">
  165. <CarbonOverviewPercent ref="CarbonOverviewPercent" :query-data="queryData" :height="300" />
  166. </div>
  167. </Card>
  168. </div>
  169. </a-col>
  170. </a-row>
  171. </div>
  172. </div>
  173. </template>
  174. <style lang="less" scoped>
  175. .doubleCarbon-overview {
  176. width: 100%;
  177. height: auto;
  178. padding-bottom: 15px;
  179. vertical-align: top;
  180. .doubleCarbon-overview-analyse {
  181. padding: 12px;
  182. }
  183. .doubleCarbon-overview-quota {
  184. padding: 12px;
  185. }
  186. .doubleCarbon-overview-news {
  187. padding: 0 12px;
  188. height: 300px;
  189. }
  190. .doubleCarbon-overview-percent {
  191. padding: 0 12px;
  192. height: 300px;
  193. }
  194. }
  195. </style>