diff --git a/hx-ai-intelligent/public/asset/file/emissionSource.xlsx b/hx-ai-intelligent/public/asset/file/emissionSource.xlsx
new file mode 100644
index 0000000..67e42be
Binary files /dev/null and b/hx-ai-intelligent/public/asset/file/emissionSource.xlsx differ
diff --git a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
index 2fbfe1b..a75e003 100644
--- a/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
+++ b/hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
@@ -26,6 +26,7 @@ export enum energyConsumption {
update = '/carbon-smart/api/carbon/stats/update',
del = '/carbon-smart/api/carbon/stats/del',
voucherDownloadList = '/carbon-smart/api/carbon/stats/voucherDownloadList',
+ energyAcquisition = '/carbon-smart/api/carbon/stats/energyAcquisition',
}
// 碳排管理-碳排速算接口
export enum quickCalculation {
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
index 9be85b4..b4329eb 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
@@ -644,8 +644,8 @@
params: {
orgId,
},
- title: '设备信息', // 弹窗title
- templateName: 'whiteListUser', // 所使用的文件名称
+ title: '排放源', // 弹窗title
+ templateName: 'emissionSource', // 所使用的文件名称
indexName: '设备id', // 匹配类型字段
message: [
{ label: '1、若必填项未填写,则不能进行导入操作' },
diff --git a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index copy.vue b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index copy.vue
new file mode 100644
index 0000000..715b3e8
--- /dev/null
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index copy.vue
@@ -0,0 +1,952 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ item.cnValue }}
+
+
+
+
+
+
+
+
+
+ 是
+ 否
+
+
+
+
+
+ {{ item.cnValue }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 上传
+
+
+
+
+
+ 取消
+ 确定
+
+
+
+
+
+
+
+
+
+
+
+ 下载
+
+
+
+
+
+ 取消
+ 确定
+
+
+
+
+
+
+
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 3b2bc53..a0924ae 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
@@ -32,15 +32,10 @@
:model="data"
ref="mainRef"
:scroll="{ x: 1500, y: 350 }">
-
@@ -60,18 +55,29 @@
:footer-style="{ textAlign: 'right' }"
destroyOnClose
@close="onClose">
+
-
+
+
+
+
+ {{ item.cnValue }}
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 上传
+
+
+
取消
确定
@@ -304,12 +324,14 @@
import { NsMessage } from '/nerv-lib/component';
import dayjs, { Dayjs } from 'dayjs';
import { http } from '/nerv-lib/util/http';
+ import { Cookies } from '/nerv-lib/util/cookie';
import { tableColumns } from '../config';
import {
energyConsumption,
carbonEmissionFactorLibrary,
uploadPic,
} from '/@/api/carbonEmissionFactorLibrary';
+ import { dict } from '/@/api';
import { group } from '/@/api/deviceManage';
defineOptions({
energyType: 'EnergyConsumption', // 与页面路由name一致缓存才可生效
@@ -320,8 +342,8 @@
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
- const fetch = (api, params = { orgId }) => {
- return http.post(api, params);
+ const fetch = (api, params = { orgId }, config) => {
+ return http.post(api, params, config);
};
const selectYear = ref(dayjs(new Date().getFullYear().toString()));
const total = ref();
@@ -392,6 +414,7 @@
type: 'primary',
handle: () => {
getDictList();
+ getSummaryMethod();
visible.value = true;
},
},
@@ -451,12 +474,9 @@
{
title: '1月',
dataIndex: 'jan',
- // customRender: ({ text, record }) => ({
- // children: text,
- // attrs: {
- // style: record.janFlag === 1 ? 'color: red' : 'color: blue'
- // }
- // })
+ // customRender: ({ text }: { text: string }) => {
+ // return {text};
+ // }
},
{
title: '2月',
@@ -568,7 +588,39 @@
},
rowKey: 'id',
});
-
+ const getColor = (value: string | number): string => {
+ if (typeof value === 'string') {
+ switch (value) {
+ case 'active':
+ return 'green';
+ case 'inactive':
+ return 'red';
+ default:
+ return 'black';
+ }
+ } else if (typeof value === 'number') {
+ return value > 30 ? 'blue' : 'purple'; // 示例:根据年龄设置颜色
+ }
+ return 'black';
+ };
+ const getSummaryMethod = () => {
+ fetch(energyConsumption.energyAcquisition, { orgId: orgId.value }).then((res) => {
+ addData.value = res.data.records;
+ });
+ };
+ const addColumns = [
+ { title: '月份', dataIndex: 'key' },
+ { title: '汇总方式', dataIndex: 'name' },
+ { title: '操作', key: 'action', dataIndex: 'age' },
+ ];
+ const addData = ref([]);
+ //开关
+ const changeSwitch = (data: any) => {
+ data.age = data.age === 1 ? 0 : 1;
+ data.name = data.age === 1 ? '自动' : '手动';
+ addData.value = [...addData.value];
+ console.log(addData.value);
+ };
defineExpose({
mainRef,
});
@@ -700,8 +752,12 @@
console.log('error', error);
});
};
+ const energyTypeOptions = ref([]);
// 获取字典值
- const getDictList = () => {
+ const getDictList = async () => {
+ // 获取能耗类型
+ const options = await dict({ params: { dicKey: 'ENERGY_TYPE' } });
+ energyTypeOptions.value = options.data.data;
// 获取排放类型的数据
fetch(energyConsumption.getDicList, { grp: 'EMISSION_TYPE' }).then((res) => {
emissionTypeDic.value = res.data;
@@ -854,10 +910,16 @@
const downLoad = (record) => {
const deleteId = ref(new FormData());
deleteId.value.append('id', record.id);
- fetch(uploadPic.download, deleteId.value)
+ const config = {
+ headers: {
+ responseType: 'blob',
+ },
+ };
+ fetch(uploadPic.download, deleteId.value, config)
.then((res) => {
+ debugger
// 创建一个 URL 对象,指向图片数据的 blob
- const url = window.URL.createObjectURL(new Blob([res.data]));
+ const url = window.URL.createObjectURL(new Blob([res]));
// 创建一个 标签,用于触发下载
const link = document.createElement('a');
link.href = url;
@@ -884,20 +946,20 @@
// 创建一个 标签,用于触发下载
const link = document.createElement('a');
link.href = url;
- debugger
link.setAttribute('download', ''); // 设置下载的文件名
document.body.appendChild(link);
link.click();
// 清理 URL 对象
window.URL.revokeObjectURL(url);
+ onCloseDownLoad();
})
.catch((error) => {
console.error('下载图片失败:', error);
});
};
const onCloseDownLoad = () => {
- selectedRowKeysSet.value = []
+ selectedRowKeysSet.value = [];
downLoadVisible.value = false;
};
@@ -914,6 +976,51 @@
display: flex;
justify-content: space-around;
}
+
+ .ns-form-title {
+ font-weight: bold;
+ user-select: text;
+ }
+ .title {
+ text-align: left;
+ height: 32px;
+ line-height: 32px;
+ font-weight: bold;
+ user-select: text;
+ position: relative;
+ padding-left: 9px;
+ }
+ .title::before {
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 50%;
+ transform: translateY(-50%);
+ height: 13px;
+ width: 3px;
+ border-radius: 1px;
+ background-color: #2778ff;
+ }
+ .blue-background.ant-switch-checked {
+ background-color: linear-gradient(
+ 180deg,
+ rgba(1, 206, 255, 1) 0%,
+ rgba(57, 215, 187, 1) 100%
+ ) !important;
+ }
+ .blue-background.ant-switch-checked .ant-switch-handle {
+ background-color: linear-gradient(
+ 180deg,
+ rgba(1, 206, 255, 1) 0%,
+ rgba(57, 215, 187, 1) 100%
+ ) !important;
+ }
+ .grey-background.ant-switch {
+ background-color: rgba(238, 238, 238, 1) !important;
+ }
+ .grey-background.ant-switch .ant-switch-handle {
+ background-color: rgba(238, 238, 238, 1) !important;
+ }
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 c85cfb3..f1ff8e2 100644
--- a/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
+++ b/hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
@@ -45,7 +45,7 @@
-
+
-
-
-
-
-
-
-
- {{ data.emissionSource }}
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ data.emissionSource }}
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+ 凭证
+
+
+
+ {{ record.dataSources.label }}
+
+
+ {{ record.carbonSource.label }}
+
+
+
+ 编辑
+
+
+
+
+
-
-
+
+
-
- 凭证
-
+ :pagination="false"
+ :scroll="{ x: 2000, y: 500 }">
-
- {{ record.dataSources.label }}
-
-
- {{ record.carbonSource.label }}
-
-
-
- 编辑
-
-
+ {{ text || '-' }}
-
-
-
-
-
- {{ text || '-' }}
-
-
-
-
+
+
+
+
+
@@ -340,7 +343,7 @@