123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205 |
- <script>
- import Card from "@/components/common/card.vue";
- import CoreData from "@/components/common/coreData.vue";
- import Query from "@/components/common/query.vue";
- import CarbonEmissionCharts from "@/components/doubleCarbon/overview/charts/carbonEmissionChart.vue";
- import CarbonQuotaChart from "@/components/doubleCarbon/overview/charts/carbonQuotaChart.vue";
- import DoubleCarbonNews from "@/components/doubleCarbon/overview/charts/doubleCarbonNews.vue";
- import CarbonOverviewPercent from "@/components/doubleCarbon/overview/charts/carbonOverviewPercent.vue";
- import apiCarbonOverview from "@/api/carbon/apiCarbonOverview";
- export default {
- components: {
- Card,
- CoreData,
- Query,
- CarbonEmissionCharts,
- CarbonQuotaChart,
- DoubleCarbonNews,
- CarbonOverviewPercent,
- },
- data() {
- return {
- queryData: {
- companyId: '0',
- timeRange: this.$util.dateUtil.getNearlyMonthRange()
- },
- coreData: [
- {
- type: 1,
- title: '碳配额存量',
- content: "",
- numDesc: "%",
- },
- {
- title: '碳排放总量(tco2e)',
- num: 0,
- historyDesc: '同比',
- historyNum: 0
- },
- {
- title: '单位面积碳排放(tco2e/m²)',
- num: 0,
- historyDesc: '同比',
- historyNum: 0
- },
- {
- title: '人均碳排放(tco2e/人)',
- num: 0,
- historyDesc: '同比',
- historyNum: 0
- },
- {
- title: '光伏减排(tco2e)',
- num: 0,
- historyDesc: '同比',
- historyNum: 0
- },
- {
- type: 1,
- title: '值得关注',
- showStar: true,
- content: ''
- },
- ],
- newsData: []
- }
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.$util.asyncPromise(
- this.getCoreData(),
- this.getNewsData()
- )
- },
- reset() {
- },
- search(data) {
- this.$util.asyncPromise(
- this.getCoreData(),
- this.getNewsData(),
- this.$refs.CarbonEmissionCharts.getData(),
- this.$refs.CarbonQuotaChart.getData(),
- this.$refs.CarbonOverviewPercent.getData(),
- )
- },
- getCoreData() {
- return apiCarbonOverview.getCoreData(this.queryData).then(res=>{
- this.coreData[0].content = res.list[0].value
- this.coreData[1].num = res.list[1].value
- this.coreData[1].historyNum = res.list[1].compare
- this.coreData[2].num = res.list[2].value
- this.coreData[2].historyNum = res.list[2].compare
- this.coreData[3].num = res.list[3].value
- this.coreData[3].historyNum = res.list[3].compare
- this.coreData[4].num = res.list[4].value
- this.coreData[4].historyNum = res.list[4].compare
- this.coreData[5].content = res.worthAttention
- })
- },
- getNewsData() {
- return apiCarbonOverview.getCarbonNews(this.queryData).then(res=>{
- this.newsData = res;
- console.log(this.newsData)
- });
- }
- }
- }
- </script>
- <template>
- <div class="doubleCarbon-overview">
- <div class="page-query-core">
- <a-row>
- <a-col>
- <div style="width: 100%">
- <Query :show="['company', 'time']" :query-data.sync="queryData" :reset="reset" :search="search"></Query>
- </div>
- </a-col>
- <a-col>
- <div style="width: 100%">
- <Card title="核心指标">
- <CoreData :data-list="coreData"></CoreData>
- </Card>
- </div>
- </a-col>
- </a-row>
- </div>
- <div style="margin-top: 12px">
- <a-row :gutter="[12,12]">
- <a-col :span="18">
- <div class="ioc-card-content">
- <Card title="碳排放分析">
- <div class="doubleCarbon-overview-analyse">
- <CarbonEmissionCharts ref="CarbonEmissionCharts" :query-data="queryData" :height="450" />
- </div>
- </Card>
- </div>
- </a-col>
- <a-col :span="6">
- <div class="ioc-card-content">
- <Card title="碳配额构成">
- <div class="doubleCarbon-overview-quota">
- <CarbonQuotaChart ref="CarbonQuotaChart" :query-data="queryData" :height="450" />
- </div>
- </Card>
- </div>
- </a-col>
- <a-col :span="18">
- <div class="ioc-card-content">
- <Card title="双碳新闻">
- <div style="width: 97%;margin: 0 auto">
- <a-divider style="margin: 0;padding: 0"></a-divider>
- </div>
- <div class="doubleCarbon-overview-news">
- <DoubleCarbonNews :data="newsData" />
- </div>
- </Card>
- </div>
- </a-col>
- <a-col :span="6">
- <div class="ioc-card-content">
- <Card title="碳排放占比">
- <div class="doubleCarbon-overview-percent">
- <CarbonOverviewPercent ref="CarbonOverviewPercent" :query-data="queryData" :height="300" />
- </div>
- </Card>
- </div>
- </a-col>
- </a-row>
- </div>
- </div>
- </template>
- <style lang="less" scoped>
- .doubleCarbon-overview {
- width: 100%;
- height: auto;
- padding-bottom: 15px;
- vertical-align: top;
- .doubleCarbon-overview-analyse {
- padding: 12px;
- }
- .doubleCarbon-overview-quota {
- padding: 12px;
- }
- .doubleCarbon-overview-news {
- padding: 0 12px;
- height: 300px;
- }
- .doubleCarbon-overview-percent {
- padding: 0 12px;
- height: 300px;
- }
- }
- </style>
|