diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
index 68b486a..cac49c8 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
@@ -558,6 +558,11 @@
const onSelectKeys = ref([]);
const onSelect = (selectedKey: string[], info: any) => {
if (selectedKey.length === 1) {
+ if (info.selectedNodes[0].emissionName === '全部') {
+ onSelectKeys.value = [];
+ } else {
+ onSelectKeys.value = [info.selectedNodes[0].id];
+ }
selectedKeys.value = selectedKey;
editTreeNode.value = {
id: info.selectedNodes[0].id,
@@ -566,7 +571,6 @@
sortNumber: info.selectedNodes[0].sortNumber,
parentEmissionId: info.selectedNodes[0].parentEmissionId,
};
- onSelectKeys.value = [info.selectedNodes[0].id];
emissionList.value = [...onSelectKeys.value, ...checkedIds.value];
mainRef.value?.nsTableRef.reload();
}
@@ -700,12 +704,17 @@
label: '导出',
type: 'primary',
handle: () => {
- // console.log( mainRef.value.nsTableRef.tableState.selectedRowKeys)
+ // console.log(mainRef.value.nsTableRef.formParamsRef)
const exportQuery = {
orgId: orgId.value,
pageNum: 1,
pageSize: 999,
ids: mainRef.value.nsTableRef.tableState.selectedRowKeys,
+ bibliography:mainRef.value.nsTableRef.formParamsRef.bibliography,
+ emissionGas:mainRef.value.nsTableRef.formParamsRef.emissionGas,
+ carbonDatabase:mainRef.value.nsTableRef.formParamsRef.carbonDatabase,
+ emissionProcess:mainRef.value.nsTableRef.formParamsRef.emissionProcess,
+ emissionSources:mainRef.value.nsTableRef.formParamsRef.emissionSources,
};
const config = {
responseType: 'blob',
@@ -717,7 +726,7 @@
// 创建一个
标签,用于触发下载
const link = document.createElement('a');
link.href = url;
- link.setAttribute('download', 'carbonFactor.xlsx'); // 设置下载的文件名
+ link.setAttribute('download', '碳排因子库导出.xlsx'); // 设置下载的文件名
document.body.appendChild(link);
link.click();
@@ -1254,12 +1263,12 @@
}
}
}
- :deep(
- .ant-form-item-label
- > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before
- ) {
- display: none !important;
- }
+ // :deep(
+ // .ant-form-item-label
+ // > label.ant-form-item-required:not(.ant-form-item-required-mark-optional)::before
+ // ) {
+ // display: none !important;
+ // }
:deep(.ant-form-item-label) {
z-index: 20;
text-align: right;
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts
index 7eab9ce..2a1c2de 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/config.ts
@@ -149,7 +149,7 @@ export const drawerColumns = [
export const setFactorConfig = (orgId) => {
return ref({
api: carbonEmissionFactorLibrary.getTableList,
- params: { orgId, pageNum: 1, pageSize: 9999, emissionList: [] },
+ params: { orgId, pageNum: 1, pageSize: 9999, emissionList: [0] },
treeConfig: {
header: {
icon: 'deviceType',
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
index 3e582e5..33851cf 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
@@ -57,7 +57,7 @@
否
-
+
标签,用于触发下载
const link = document.createElement('a');
link.href = url;
- link.setAttribute('download', 'carbonStats.xlsx'); // 设置下载的文件名
+ link.setAttribute('download', '能耗统计导出.xlsx'); // 设置下载的文件名
document.body.appendChild(link);
link.click();
@@ -342,13 +342,13 @@
});
},
},
- {
- label: '模板下载',
- type: 'primary',
- handle: () => {
- doWnload('/hx-ai-intelligent/asset/file/energyConsumption.xlsx');
- },
- },
+ // {
+ // label: '模板下载',
+ // type: 'primary',
+ // handle: () => {
+ // doWnload('/hx-ai-intelligent/asset/file/energyConsumption.xlsx');
+ // },
+ // },
// {
// label: '上传凭证',
// type: 'primary',
@@ -782,24 +782,18 @@
// 获取自动采集节点的数据
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
treeData.value = res.data;
- treeData.value = treeData.value.map((item) => ({
- value: item.id,
- label: item.pointName,
- children: item.children
- ? item.children.map((child) => ({
- value: child.id,
- label: child.pointName,
- children: child.children
- ? child.children.map((childs) => ({
- value: childs.id,
- label: childs.pointName,
- }))
- : [],
- }))
- : [],
- }));
+ treeData.value = transformData(treeData.value);
});
};
+ // 将数据转换为树形结构
+ const transformData = (data: any[]) => {
+ return data.map((item) => ({
+ title: item.pointName,
+ value: item.id,
+ key: item.id,
+ children: item.children ? transformData(item.children) : [],
+ }));
+ };
// 计算碳排切换
const emissionType = ref();
const changeRadio = (e) => {
@@ -819,7 +813,9 @@
.validate()
.then(() => {
console.log('values', formState, toRaw(formState));
- formState.value.year = selectYear.value.format('YYYY');
+ formState.value.year = mainRef.value.nsTableRef.formParamsRef.year
+ ? mainRef.value.nsTableRef.formParamsRef.year
+ : selectYear.value.format('YYYY');
if (formState.value.unit) {
formState.value.unit = formState.value.unit.join(',').split(',')[1];
}
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index copy.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index copy.vue
deleted file mode 100644
index ee8df02..0000000
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index copy.vue
+++ /dev/null
@@ -1,1632 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
- {{ cnValue.substring(0, cnValue.indexOf(searchValue)) }}
- {{ searchValue }}
- {{ cnValue.substring(cnValue.indexOf(searchValue) + searchValue.length) }}
-
- {{ cnValue }}
-
-
-
-
-
-
-
- 返回
-
-
-
-
-
-
-
-
-
- {{ data.emissionSource }}
-
-
-
-
-
-
-
-
-
-
-
-
-
- 凭证
-
-
-
- {{ record.dataSources.label }}
-
-
- {{ record.carbonSource.label }}
-
-
-
- 编辑
-
-
-
-
-
-
-
-
-
-
- {{ text || '-' }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ data.cnValue }}
-
-
-
-
-
-
- 取消
- 确定
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.cnValue }}
-
-
-
-
-
-
-
-
-
- 取消
- 确定
-
-
-
-
-
-
-
- {{ text }}
-
-
-
-
- 取消
- 批量下载
-
-
-
-
-
-
-
-
-
- 自行推估
- 定期量测
- 自动测量
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.cnValue }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 1.仅支持pdf格式文件或文件夹
- 2.文件名命名规则为【能源种类_年份】
- 3.每次上传自动覆盖
-
-
- 取消
- 确定
-
-
-
-
-
-
-
-
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
index 658c67b..f176d3c 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
@@ -308,80 +308,82 @@
-
-
-
-
-
- 自行推估
- 定期量测
- 自动测量
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.cnValue }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ 自行推估
+ 定期量测
+ 自动测量
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.cnValue }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -1121,19 +1123,21 @@
// 获取自动采集节点的数据
fetch(group.queryDeviceGroupTree, { energyType: value, orgId: orgId.value }).then((res) => {
collectingNodes.value = res.data;
- collectingNodes.value = collectingNodes.value.map((item) => ({
- value: item.id,
- label: item.pointName,
- children: item.children
- ? item.children.map((child) => ({
- value: child.id,
- label: child.pointName,
- }))
- : [],
- }));
+ collectingNodes.value = collectingNodes.value = transformData(collectingNodes.value);
});
};
+ // 将数据转换为树形结构
+ const transformData = (data: any[]) => {
+ return data.map((item) => ({
+ title: item.pointName,
+ value: item.id,
+ key: item.id,
+ children: item.children ? transformData(item.children) : [],
+ }));
+ };
+ const spinning = ref(false);
const selectNode = (value) => {
+ spinning.value = true;
const getConsumeData = ref({
acquisitionDate: acquisitionDate.value,
collectionNode: value,
@@ -1142,6 +1146,7 @@
});
fetch(carbonInventoryCheck.nodeCancellationConsumption, getConsumeData.value).then((res) => {
editFormState.value.consumption = res.data;
+ spinning.value = false;
});
};
// 上传附件
@@ -1696,6 +1701,13 @@
background: #c9e4ff;
}
}
+ :deep(.ant-empty) {
+ height: 80%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ }
}
.right {
flex: 1;
@@ -1811,4 +1823,11 @@
display: flex;
justify-content: right;
}
+ :deep(.ant-empty) {
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-direction: column;
+ }
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
index 74eb895..e3cb0f7 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
@@ -39,7 +39,11 @@
placeholder="请输入报告名称" />
-
+
@@ -79,6 +84,7 @@
import { carbonInventoryCheck } from '/@/api/carbonEmissionFactorLibrary';
import fillIn from './fillInPage/index.vue';
import { message } from 'ant-design-vue';
+ import dayjs, { Dayjs } from 'dayjs';
defineOptions({ name: 'CarbonInventoryCheck' });
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
@@ -105,6 +111,17 @@
const selectChange = (value) => {
formState.value.reportScope = '';
};
+ const defaultPickerValue = ref([
+ dayjs('2020'), // 默认开始日期
+ dayjs('2020'), // 默认结束日期
+ ]);
+ const openChange = (status) => {
+ if (status === false) {
+ if (formState.value.reportYear) {
+ defaultPickerValue.value = [dayjs('2022'), dayjs('2022')];
+ }
+ }
+ };
// 定义form表单的必填
const rules: Record = {
reportName: [{ required: true, message: '请输入报告名称', trigger: 'change' }],
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
index 4b15713..f07ea0c 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
@@ -360,6 +360,9 @@
background: #f2f2f2 !important;
color: black !important;
}
+ :deep(.ant-picker) {
+ border-radius: unset;
+ }
.month {
width: 50%;
display: flex;
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
index 2ec3dde..8e39645 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
@@ -96,28 +96,32 @@
-
+
@@ -135,16 +139,16 @@
v-model:value="formState.conversionRate"
:maxlength="15"
@keydown="handleKeyDown"
- suffix="%"
:disabled="disabled" />
+
%
+ kWh
@@ -247,6 +251,7 @@
QuestionCircleOutlined,
} from '@ant-design/icons-vue';
import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary';
+ import { getEnumEnergy } from '/@/api';
import * as echarts from 'echarts';
import { any, string } from 'vue-types';
import type { Dayjs } from 'dayjs';
@@ -265,8 +270,10 @@
nodeName: {
type: string,
},
+ resourceType: {
+ type: string,
+ },
});
- console.log(props, 'xxy');
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
@@ -291,11 +298,29 @@
itemizeId: props.parentId,
type: props.type,
});
+ console.log(props.type, '6666');
const ids = ref([]);
+ const lastActualUsageList = ref([]);
+ // 获取单位
+ const unit = ref();
+ const totalActualUsage = ref();
+ const totalBudget = ref();
+ const totalLastYearActualUsage = ref();
+ const totalReferenceValue = ref();
const getTableData = () => {
- fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then((res) => {
- data.value = res.data;
- ids.value = data.value.map((item) => item.id);
+ fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then(async (res) => {
+ let resUnit = await getEnumEnergy({ params: { code: props.resourceType } });
+ unit.value = resUnit.data.unit;
+ data.value = res.data.list;
+ totalActualUsage.value = res.data.actualUsage;
+ totalBudget.value = res.data.budget;
+ totalLastYearActualUsage.value = res.data.lastYearActualUsage;
+ totalReferenceValue.value = res.data.referenceValue;
+ if (data.value.length > 0) {
+ ids.value = data.value.map((item) => item.id);
+ lastActualUsageList.value = data.value.map((item) => item.lastYearActualUsage);
+ formState.value.lastYearList = lastActualUsageList.value;
+ }
});
};
getTableData();
@@ -313,14 +338,17 @@
{
title: Number(props.year) - 1 + '年实际用量',
dataIndex: 'lastYearActualUsage',
+ customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
},
{
title: props.year + '年实际用量',
dataIndex: 'actualUsage',
+ customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
},
{
title: '基准值',
dataIndex: 'referenceValue',
+ customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
},
{
title: '是否按去年折算',
@@ -329,10 +357,12 @@
{
title: '折算率',
dataIndex: 'conversionRate',
+ customRender: ({ text }: { text: number }) => `${text}%`, // 在这里添加单位
},
{
title: '2024年预算',
dataIndex: 'budget',
+ customRender: ({ text }: { text: number }) => `${text ? text + unit.value : 0 + unit.value}`, // 在这里添加单位
},
{
title: '操作',
@@ -346,10 +376,10 @@
const formRef = ref();
const formState = ref({});
const labelCol = { span: 6 };
- const wrapperCol = { span: 18 };
+ const wrapperCol = { span: 17 };
const editData = (record) => {
open.value = true;
- if (record.isLastYear) {
+ if (record.isLastYear !== undefined) {
formState.value.ids = [record.id];
if (record.lastYear === '是') {
formState.value.isLastYear = 1;
@@ -357,6 +387,7 @@
formState.value.isLastYear = 0;
}
formState.value.conversionRate = record.conversionRate;
+ formState.value.lastYearList = [record.lastYearActualUsage];
formState.value.budget = record.budget;
}
};
@@ -593,7 +624,7 @@
'基准值',
],
top: '0',
- left: '0',
+ right: '0',
textStyle: {
color: '#666',
fontSize: 12,
@@ -650,6 +681,30 @@
],
series: [
{
+ name: props.year + '年预算',
+ type: 'line',
+ // smooth: true, // 开启平滑曲线
+ symbol: 'emptyCircle', //标记的图形为实心圆
+ itemStyle: {
+ normal: {
+ color: 'rgba(255, 188, 70, 1)',
+ },
+ },
+ data: budgetList.value,
+ },
+ {
+ name: '基准值',
+ type: 'line',
+ // smooth: true, // 开启平滑曲线
+ symbol: 'emptyCircle', //标记的图形为实心圆
+ itemStyle: {
+ normal: {
+ color: 'rgba(195, 142, 255, 1)',
+ },
+ },
+ data: referenceValueList.value,
+ },
+ {
name: Number(props.year) - 1 + '年实际用量',
type: 'bar',
barWidth: 18,
@@ -707,28 +762,6 @@
},
data: actualUsageList.value,
},
- {
- name: props.year + '年预算',
- type: 'line',
- smooth: true, // 开启平滑曲线
- symbol: 'none', //标记的图形为实心圆
- lineStyle: {
- color: 'rgba(255, 188, 70, 1)',
- width: 2,
- },
- data: budgetList.value,
- },
- {
- name: '基准值',
- type: 'line',
- smooth: true, // 开启平滑曲线
- symbol: 'none', //标记的图形为实心圆
- lineStyle: {
- color: 'rgba(195, 142, 255, 1)',
- width: 2,
- },
- data: referenceValueList.value,
- },
],
};
chartInstance = echarts.init(chartRef.value);
@@ -827,8 +860,8 @@
background: #f7f9ff;
padding: 12px;
border-radius: 12px;
- background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(222, 255, 246, 1) 100%);
- border: 1px solid rgba(18, 174, 132, 1);
+ background: linear-gradient(180deg, #ffffff 0%, #defff663 100%);
+ border: 1px solid #12ae8424;
.quantity {
font-size: 12px;
font-weight: 400;
@@ -900,6 +933,11 @@
) {
display: none !important;
}
+ .unit {
+ position: absolute;
+ right: 10px;
+ top: 5px;
+ }