123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210 |
- <script>
- import Card from "@/components/common/card.vue";
- import CoreData from "@/components/common/coreData.vue";
- import Query from "@/components/common/query.vue";
- import CarbonPvEmissionChart from "@/components/doubleCarbon/PV/charts/carbonPvEmissionChart.vue";
- import CarbonPvQuotaChart from "@/components/doubleCarbon/PV/charts/carbonPvQuotaChart.vue";
- import apiCarbonPv from "@/api/carbon/apiCarbonPv";
- export default {
- components: {
- Card,
- CoreData,
- Query,
- CarbonPvEmissionChart,
- CarbonPvQuotaChart,
- },
- data() {
- return {
- queryData: {
- companyId: "0",
- timeRange: this.$util.dateUtil.getNearlyMonthRange(),
- },
- companyOptions: [
- {
- label: '全部',
- value: '0'
- }
- ],
- coreData: [
- {
- title: "光伏累计减排(tco2e/年内)",
- num: 0,
- historyDesc: "同比",
- historyNum: 0,
- },
- {
- title: "光伏发电量(kWh/天)",
- num: 0,
- historyDesc: "同比",
- historyNum: 0,
- },
- {
- title: "光伏节约金额(元/天)",
- num: 0,
- historyDesc: "同比",
- historyNum: 0,
- },
- {
- title: "光伏补贴金额(元/天)",
- num: 0,
- historyDesc: "同比",
- historyNum: 0,
- },
- {
- type: 1,
- title: "值得关注",
- showStar: true,
- content: "建议扩大光伏 发电面积",
- },
- ],
- newsData: [
- {
- title: "xxxxxxxxxx",
- tag: "双碳小知识",
- author: "张峰",
- time: "2022-02-02 15:00:00",
- },
- ],
- };
- },
- mounted() {
- this.init();
- },
- methods: {
- init() {
- this.$store.loadingStore().loadingWithApi(this.getCoreData(), 2000);
- },
- reset() {},
- search(data) {
- this.$util.asyncPromise(
- this.getCoreData(),
- this.$refs.CarbonPvEmissionChart.getData(),
- this.$refs.CarbonPvEmissionChart.getData()
- );
- },
- getCoreData() {
- return apiCarbonPv.getCoreData(this.queryData).then((res) => {
- this.coreData[0].num = res.list[0].value;
- this.coreData[0].historyNum = res.list[0].compare;
- 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].content = res.worthAttention;
- });
- },
- callBackCompanyOption(options) {
- this.companyOptions = [
- {
- label: '全部',
- value: '0'
- }
- ]
- if (options) {
- options.forEach(item=>{
- this.companyOptions.push(item);
- })
- }
- this.$forceUpdate()
- },
- },
- };
- </script>
- <template>
- <div class="doubleCarbon-pv">
- <div class="page-query-core">
- <a-row>
- <a-col
- style="
- background: #fff;
- height: 60px;
- padding: 10px;
- border-radius: 5px;
- margin-bottom: 10px;
- "
- >
- <div style="width: 100%">
- <Query
- :show="['company', 'time']"
- :query-data.sync="queryData"
- :reset="reset"
- :search="search"
- :company-options="companyOptions"
- ></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-pv-analyse">
- <CarbonPvEmissionChart
- ref="CarbonPvEmissionChart"
- :query-data="queryData"
- :callBackCompanyOption="callBackCompanyOption"
- :height="450"
- />
- </div>
- </Card>
- </div>
- </a-col>
- <a-col :span="6">
- <div class="ioc-card-content">
- <Card title="光伏减排排名">
- <div class="doubleCarbon-pv-quota">
- <CarbonPvQuotaChart
- ref="CarbonPvQuotaChart"
- :query-data="queryData"
- :height="450"
- />
- </div>
- </Card>
- </div>
- </a-col>
- </a-row>
- </div>
- </div>
- </template>
- <style lang="less" scoped>
- .doubleCarbon-pv {
- width: 100%;
- height: auto;
- padding-bottom: 15px;
- vertical-align: top;
- .doubleCarbon-pv-analyse {
- padding: 12px;
- }
- .doubleCarbon-pv-quota {
- padding: 12px;
- }
- .doubleCarbon-pv-news {
- padding: 0 12px;
- height: 300px;
- }
- .doubleCarbon-pv-percent {
- padding: 0 12px;
- height: 300px;
- }
- }
- </style>
|