taskid:110 remark:'commit'

This commit is contained in:
fks-xuxinyue
2024-07-26 15:12:56 +08:00
parent e05a813a1e
commit 744aae1bba
22 changed files with 580 additions and 15 deletions

View File

@@ -0,0 +1,28 @@
<template>
<div class="detailTable">
</div>
<div class="total"> </div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import { http } from '/nerv-lib/util/http';
defineOptions({
energyType: 'carbonAssetsDetail', // 与页面路由name一致缓存才可生效
});
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
</script>
<style lang="less" scoped>
.detailTable {
height: 80%;
}
.total {
height: 20%;
}
</style>

View File

@@ -0,0 +1,319 @@
<template>
<div class="mainContant" v-if="homePage">
<a-card class="card" style="margin-right: 1%; margin-bottom: 1%">
<div class="top" style="background: rgba(252, 139, 78, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-1.svg"
/></div>
<div class="moneyTitle">全国碳账户估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
<div class="moneyDetail"
><img width="34px" height="34px" src="../../../../src/icon/carbonAssetsSearch-1.svg"
/></div>
</div>
<div class="title">
<img width="24px" height="24px" src="../../../../src/icon/carbonAssetsTitle-1.svg" />
<span>全国碳账户余额</span>
</div>
<div class="bottom">
<div class="calculation TLCard">
<div class="money">75,000.00</div>
<div class="moneyType">期初余额tCO2</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="calculation TLCard">
<div class="money">20,000.00</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
增加tCO2
</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
<div class="calculation TLCard">
<div class="money">20,000.00</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
减少tCO2
</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
<div class="calculation TLCard">
<div class="money">75,000.00</div>
<div class="moneyType">期末余额tCO2</div>
</div>
</div>
</a-card>
<a-card class="card" style="margin-bottom: 1%">
<div class="top" style="background: rgba(234, 71, 54, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-2.svg"
/></div>
<div class="moneyTitle">地方碳账户估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
<div class="moneyDetail"
><img width="34px" height="34px" src="../../../../src/icon/carbonAssetsSearch-2.svg"
/></div>
</div>
<div class="title">
<img width="24px" height="24px" src="../../../../src/icon/carbonAssetsTitle-2.svg" />
<span>地方碳账户余额</span>
</div>
<div class="bottom">
<div class="calculation TRCard">
<div class="money">75,000.00</div>
<div class="moneyType">期初余额tCO2</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="calculation TRCard">
<div class="money">20,000.00</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
增加tCO2
</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
<div class="calculation TRCard">
<div class="money">20,000.00</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
减少tCO2
</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
<div class="calculation TRCard">
<div class="money">75,000.00</div>
<div class="moneyType">期末余额tCO2</div>
</div>
</div>
</a-card>
<a-card class="card" style="margin-right: 1%">
<div class="top" style="background: rgba(65, 163, 224, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-3.svg"
/></div>
<div class="moneyTitle">CCER资产估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
<div class="moneyDetail"
><img width="34px" height="34px" src="../../../../src/icon/carbonAssetsSearch-3.svg"
/></div>
</div>
<div class="title">
<img width="24px" height="24px" src="../../../../src/icon/carbonAssetsTitle-3.svg" />
<span>全国碳账户余额</span>
</div>
<div class="bottom">
<div class="calculation BLCard">
<div class="money">75,000.00</div>
<div class="moneyType">期初余额tCO2</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="calculation BLCard">
<div class="money">20,000.00</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsIncrease.svg" />
增加tCO2
</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsReduce.svg" />
<div class="calculation BLCard">
<div class="money">20,000.00</div>
<div class="moneyType">
<img width="20px" height="17px" src="../../../../src/icon/carbonAssetsLower.svg" />
减少tCO2
</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsEqual.svg" />
<div class="calculation BLCard">
<div class="money">75,000.00</div>
<div class="moneyType">期末余额tCO2</div>
</div>
</div>
</a-card>
<a-card class="card">
<div class="top" style="background: rgba(37, 192, 150, 0.05)">
<div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-4.svg"
/></div>
<div class="moneyTitle">全国碳账户估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">300,000.00</div>
</div>
<div class="title" style="justify-content: center">
<img
width="17px"
height="17px"
style="transform: rotate(90deg)"
src="../../../../src/icon/carbonAssetsEqual.svg" />
</div>
<div class="bottom">
<div class="BRCard">
<div class="money">300,000.00</div>
<div class="moneyType">全国碳账户资产估值</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="BRCard">
<div class="money">300,000.00</div>
<div class="moneyType">地方碳账户资产估值</div>
</div>
<img width="17px" height="17px" src="../../../../src/icon/carbonAssetsAdd.svg" />
<div class="BRCard">
<div class="money">300,000.00</div>
<div class="moneyType">CCER碳资产估值</div>
</div>
</div>
</a-card>
</div>
<div class="detail" v-else>
<carbonAssetsDetail />
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import carbonAssetsDetail from './carbonAssetsDetail/index.vue';
defineOptions({
energyType: 'carbonAssets', // 与页面路由name一致缓存才可生效
});
const homePage = ref(true);
</script>
<style lang="less" scoped>
.mainContant {
background: #f1f2f6;
display: flex;
flex-wrap: wrap;
.card {
width: 49%;
height: 49%;
.TLCard {
background: linear-gradient(180deg, rgba(255, 249, 246, 1) 0%, rgba(255, 255, 255, 1) 100%);
border: 1px solid rgba(252, 139, 78, 0.3);
}
.TRCard {
background: linear-gradient(180deg, rgba(254, 245, 244, 1) 0%, rgba(255, 255, 255, 1) 100%);
border: 1px solid rgba(241, 100, 69, 0.2);
}
.BLCard {
background: linear-gradient(180deg, rgba(245, 250, 254, 1) 0%, rgba(255, 255, 255, 1) 100%);
border: 1px solid rgba(72, 168, 228, 0.3);
}
}
}
:deep(.ant-card-body) {
height: 100%;
}
.top {
height: 40%;
width: 100%;
border-radius: 8px;
display: flex;
align-items: center;
.moneyImg {
width: 20%;
display: flex;
justify-content: center;
}
.moneyTitle {
width: 35%;
display: flex;
justify-content: center;
opacity: 1;
font-size: 20px;
font-weight: 700;
color: rgba(0, 0, 0, 1);
text-align: left;
vertical-align: top;
}
.moneyTotal {
width: 35%;
display: flex;
justify-content: center;
opacity: 1;
font-size: 40px;
font-weight: 400;
line-height: 52px;
text-align: left;
}
.moneyDetail {
width: 10%;
display: flex;
justify-content: center;
cursor: pointer;
}
}
.title {
height: 20%;
width: 100%;
display: flex;
align-items: center;
> span {
font-size: 20px;
font-weight: 700;
letter-spacing: 1.2px;
line-height: 26px;
color: rgba(0, 0, 0, 1);
text-align: left;
vertical-align: top;
margin-left: 10px;
}
}
.bottom {
height: 40%;
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
.calculation {
width: 22%;
height: 100%;
opacity: 1;
border-radius: 8px;
padding: 10px;
.money {
opacity: 1;
font-size: 28px;
font-weight: 400;
letter-spacing: 0px;
line-height: 50px;
color: rgba(0, 0, 0, 1);
text-align: left;
vertical-align: top;
}
.moneyType {
opacity: 1;
font-size: 14px;
font-weight: 700;
line-height: 45px;
color: rgba(0, 0, 0, 1);
text-align: left;
vertical-align: top;
}
}
.BRCard {
width: 30%;
height: 100%;
opacity: 1;
background: linear-gradient(180deg, rgba(244, 252, 250, 1) 0%, rgba(255, 255, 255, 1) 100%);
border: 1px solid rgba(42, 197, 155, 0.3);
padding: 10px;
.money {
opacity: 1;
font-size: 28px;
font-weight: 400;
letter-spacing: 0px;
line-height: 50px;
color: rgba(0, 0, 0, 1);
text-align: left;
vertical-align: top;
}
.moneyType {
opacity: 1;
font-size: 14px;
font-weight: 700;
line-height: 45px;
color: rgba(0, 0, 0, 1);
text-align: left;
vertical-align: top;
}
}
}
</style>

View File

@@ -466,6 +466,7 @@
const addTreeNode = ref();
const handleOk = (e: MouseEvent) => {
editTreeNode.value.emissionName = addTreeNode.value;
editTreeNode.value.orgId = orgId.value;
http.post(carbonEmissionFactorLibrary.creat, editTreeNode.value).then(() => {
getOrgTree();
NsMessage.success('操作成功');
@@ -550,7 +551,9 @@
const onClose = () => {
visible.value = false;
formData.value = {};
formData.value = {
orgId: orgId.value,
};
userAuthList.value.splice(0);
};
const closeUnitManag = () => {
@@ -588,6 +591,7 @@
formData.value = {
carbonEmissionPrefix: 't',
numberOfReferences: '10',
orgId: orgId.value,
};
userAuthList.value.splice(0);
});

View File

@@ -355,7 +355,7 @@
carbonInventoryCheck,
} from '/@/api/carbonEmissionFactorLibrary';
import { group } from '/@/api/deviceManage';
import { debug } from 'node:console';
import { debug, log } from 'node:console';
defineOptions({
energyType: 'fillInPage', // 与页面路由name一致缓存才可生效
components: {
@@ -474,6 +474,8 @@
queryEmissionData.value.categoryId = info.node.conId;
getEmissionStatistic();
} else if (isClickedTplx.value) {
queryFlowDirection.value.categoryId = info.node.conId;
getCarbonFlowDirection();
}
};
// 获取碳盘查报告树
@@ -488,6 +490,7 @@
categoryId.value = res.data[0].children[0].conId;
formState.value.categoryId = categoryId.value;
queryEmissionData.value.categoryId = categoryId.value;
queryFlowDirection.value.categoryId = categoryId.value;
selectedIds.value = getAllIds(gData.value);
}
getEmissionSourceTree();
@@ -602,6 +605,7 @@
// 类别配置树点击确定
const queryConfigure = ref({
orgId: orgId.value,
reportId: props.reportId,
});
const submitCategory = () => {
fetch(carbonInventoryCheck.updateCategoryTree, queryConfigure.value).then((res) => {
@@ -957,8 +961,13 @@
.validate()
.then(() => {
console.log('values', editFormState, toRaw(editFormState));
editFormState.value.factorId = editFormState.value.factorId.join(',');
if (editFormState.value.collectionNode.value) {
if (editFormState.value.factorId.length > 0) {
editFormState.value.factorId = editFormState.value.factorId.join(',');
}
if (editFormState.value.dataSources.value) {
editFormState.value.dataSources = editFormState.value.dataSources.value;
}
if (editFormState.value.collectionNode) {
editFormState.value.collectionNode = editFormState.value.collectionNode.value;
}
fetch(carbonInventoryCheck.updateTable, editFormState.value).then((res) => {
@@ -1000,10 +1009,23 @@
fillInPage.value = false;
isClickedPftj.value = false;
isClickedTplx.value = true;
getCarbonFlowDirection();
setTimeout(() => {
drawEcharts();
}, 500);
};
// 获取碳排流向数据
const queryFlowDirection = ref({
orgId: orgId.value,
reportId: props.reportId,
year: props.year,
categoryId: categoryId.value,
});
const getCarbonFlowDirection = () => {
fetch(carbonInventoryCheck.carbonFlowDirection, queryFlowDirection.value).then((res) => {
console.log(res);
});
};
// 获取排放统计数据
const queryEmissionData = ref({
orgId: orgId.value,
@@ -1015,13 +1037,30 @@
const getEmissionStatistic = () => {
fetch(carbonInventoryCheck.emissionStatistic, queryEmissionData.value).then((res) => {
pftjData.value = res.data.body;
const data = res.data.title;
// 将数据表头数据按顺序组织
const orderedKeys = res.data.title.map((obj) => Object.keys(obj)[0]); // 获取原始键的顺序
const result: { [key: string]: string } = {};
res.data.title.forEach((obj) => {
const key = Object.keys(obj)[0];
result[key] = obj[key];
});
// 确保按照原始顺序返回结果
const orderedResult: { [key: string]: string } = {};
orderedKeys.forEach((key) => {
if (result[key] !== undefined) {
orderedResult[key] = result[key];
}
});
const data = orderedResult;
// 将数据转换为 DataItem 数组
tableHeader.value = [];
pftjColumn.value = [
{
title: '排放分类',
dataIndex: 'emissionCategory',
dataIndex: 'emissionClassify',
customCell: (record, rowIndex) => {
if (rowIndex == undefined) {
return {
@@ -1029,10 +1068,10 @@
colSpan: 0,
};
}
const rowSpan = getRowSpan('emissionCategory', record, pftjData.value);
const rowSpan = getRowSpan('emissionClassify', record, pftjData.value);
if (
rowIndex != 0 &&
pftjData.value[rowIndex - 1].emissionCategory == record.emissionCategory
pftjData.value[rowIndex - 1].emissionClassify == record.emissionClassify
) {
return {
rowSpan: 0,
@@ -1431,7 +1470,6 @@
min-width: fit-content;
> div {
background-color: @white;
flex: 1;
}
display: flex;

View File

@@ -4,7 +4,7 @@
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" />
</div>
<!-- 填报页 -->
<div v-if="fillInPage">
<div v-if="fillInPage" style="height: 100%">
<fillIn :reportId="reportId" :year="year" @change-data="updateData" />
</div>
<!-- 新增报告弹窗 -->