Browse Source

优化碳排管理

temp
fks-xuxinyue 3 months ago
parent
commit
c4548fc81d
  1. 21
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue
  2. 24
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  3. 16
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue
  4. 57
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue
  5. 7
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue
  6. 59
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  7. 39
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
  8. 221
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
  9. 50
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue

21
hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue

@ -50,11 +50,7 @@
</div> </div>
<div style="display: flex; margin-top: 20px; height: calc(85% - 20px)"> <div style="display: flex; margin-top: 20px; height: calc(85% - 20px)">
<div class="detailTable"> <div class="detailTable">
<ns-view-list-table <ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 1280 }">
v-bind="tableConfig"
:model="data"
ref="mainRef"
:scroll="{ x: 1280 }">
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'accountType'"> <template v-if="column.dataIndex === 'accountType'">
<span v-if="record.accountType">{{ record.accountType.label }}</span> <span v-if="record.accountType">{{ record.accountType.label }}</span>
@ -206,12 +202,23 @@
year: year.value, year: year.value,
}); });
const transactionTypeValue = ref(); const transactionTypeValue = ref();
const selectValue = ref([]);
const changeSelect = (value, selectedOptions) => { const changeSelect = (value, selectedOptions) => {
debugger;
// transactionTypeValue.value = selectedOptions.flatMap((group) => // transactionTypeValue.value = selectedOptions.flatMap((group) =>
// group.flatMap((node) => [node.value, ...(node.children?.map((child) => child.value) || [])]), // group.flatMap((node) => [node.value, ...(node.children?.map((child) => child.value) || [])]),
// ); // );
transactionTypeValue.value = value.flat(); const aaa = JSON.parse(JSON.stringify(value));
aaa.forEach((item) => {
if (item.length > 1) {
item.shift();
selectValue.value.push(item);
} else {
selectValue.value.push(item);
}
});
transactionTypeValue.value = Array.from(new Set(selectValue.value.flat()));
selectValue.value = [];
}; };
const searchTableList = () => { const searchTableList = () => {
year.value = queryParams.value.year; year.value = queryParams.value.year;

24
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue

@ -171,13 +171,13 @@
<span>{{ data.cnValue }}</span> <span>{{ data.cnValue }}</span>
</div> </div>
<div class="actionMore"> <div class="actionMore">
<EditOutlined v-if="!data.parentId" @click="editGroup(data)" /> <PlusCircleOutlined v-if="!data.parentId" @click="addUnit(data)" />
<EditOutlined v-else @click="editUnit(data)" />
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" /> <MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" />
<PlusCircleOutlined <EditOutlined
v-if="!data.parentId"
style="margin-left: 6px" style="margin-left: 6px"
@click="addUnit(data)" /> v-if="!data.parentId"
@click="editGroup(data)" />
<EditOutlined style="margin-left: 6px" v-else @click="editUnit(data)" />
</div> </div>
</div> </div>
</template> </template>
@ -480,9 +480,9 @@
// //
const deleteTreeNode = (data) => { const deleteTreeNode = (data) => {
Modal.confirm({ Modal.confirm({
title: '警告', // title: '',
icon: createVNode(ExclamationCircleOutlined), icon: createVNode(ExclamationCircleOutlined),
content: '确定要删除么?', content: '您将删除此节点。其数据将保留并移至“未分类”区域,仍可访问。确定删除吗?',
okText: '确认', okText: '确认',
okType: 'primary', okType: 'primary',
cancelText: '取消', cancelText: '取消',
@ -710,11 +710,11 @@
pageNum: 1, pageNum: 1,
pageSize: 999, pageSize: 999,
ids: mainRef.value.nsTableRef.tableState.selectedRowKeys, ids: mainRef.value.nsTableRef.tableState.selectedRowKeys,
bibliography:mainRef.value.nsTableRef.formParamsRef.bibliography, bibliography: mainRef.value.nsTableRef.formParamsRef.bibliography,
emissionGas:mainRef.value.nsTableRef.formParamsRef.emissionGas, emissionGas: mainRef.value.nsTableRef.formParamsRef.emissionGas,
carbonDatabase:mainRef.value.nsTableRef.formParamsRef.carbonDatabase, carbonDatabase: mainRef.value.nsTableRef.formParamsRef.carbonDatabase,
emissionProcess:mainRef.value.nsTableRef.formParamsRef.emissionProcess, emissionProcess: mainRef.value.nsTableRef.formParamsRef.emissionProcess,
emissionSources:mainRef.value.nsTableRef.formParamsRef.emissionSources, emissionSources: mainRef.value.nsTableRef.formParamsRef.emissionSources,
}; };
const config = { const config = {
responseType: 'blob', responseType: 'blob',

16
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/carbonEmissions/index.vue

@ -7,15 +7,19 @@
:pagination="false" :pagination="false"
:scroll="{ x: 1700, y: 480 }"> :scroll="{ x: 1700, y: 480 }">
<template #title> <template #title>
<a-date-picker v-model:value="selectYear" picker="year" valueFormat="YYYY" /> <a-date-picker
v-model:value="selectYear"
@change="changeYearData"
picker="year"
valueFormat="YYYY" />
<span style="margin-left: 30px"> <span style="margin-left: 30px">
<a-button type="primary" @click="changeYearData">查询</a-button> <a-button type="primary" ghost @click="reset">重置</a-button>
<a-button type="primary" ghost style="margin-left: 6px" @click="reset">重置</a-button> <a-button type="primary" style="margin-left: 6px" @click="clickSelect">搜索</a-button>
</span> </span>
</template> </template>
<template #bodyCell="{ column, text }"> <template #bodyCell="{ column, text }">
<span>{{ text || '-' }}</span> <span>{{ text || '-' }}</span>
</template> </template>
</a-table> </a-table>
<!-- <a-pagination <!-- <a-pagination
:current="queryParams.pageNum" :current="queryParams.pageNum"
@ -58,6 +62,8 @@
// //
const changeYearData = () => { const changeYearData = () => {
queryParams.value.year = selectYear.value; queryParams.value.year = selectYear.value;
};
const clickSelect = () => {
getTableList(); getTableList();
}; };
const reset = () => { const reset = () => {

57
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/energyConsumption/index.vue

@ -373,17 +373,26 @@
dataIndex: 'energyType', dataIndex: 'energyType',
width: 100, width: 100,
ellipsis: true, ellipsis: true,
customRender: (text: any) => {
return text.text !== undefined ? text : '-';
},
}, },
{ {
title: '计量单位', title: '计量单位',
className: 'unitName', className: 'unitName',
dataIndex: 'unitName', dataIndex: 'unitName',
width: 100, width: 100,
customRender: (text: any) => {
return text.text !== undefined ? text : '-';
},
}, },
{ {
title: '全年', title: '全年',
dataIndex: 'yearly', dataIndex: 'yearly',
width: 100, width: 100,
customRender: (text: any) => {
return text.text !== undefined ? text : '-';
},
}, },
{ {
title: '1月', title: '1月',
@ -394,11 +403,11 @@
let color; let color;
switch (value.record.janFlag) { switch (value.record.janFlag) {
case 1: case 1:
text = value.record.jan ? value.record.jan : ''; text = value.record.jan ? value.record.jan : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.jan ? value.record.jan : ''; text = value.record.jan ? value.record.jan : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -415,11 +424,11 @@
let color; let color;
switch (value.record.febFlag) { switch (value.record.febFlag) {
case 1: case 1:
text = value.record.feb ? value.record.feb : ''; text = value.record.feb ? value.record.feb : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.feb ? value.record.feb : ''; text = value.record.feb ? value.record.feb : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -436,11 +445,11 @@
let color; let color;
switch (value.record.marFlag) { switch (value.record.marFlag) {
case 1: case 1:
text = value.record.mar ? value.record.mar : ''; text = value.record.mar ? value.record.mar : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.mar ? value.record.mar : ''; text = value.record.mar ? value.record.mar : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -457,11 +466,11 @@
let color; let color;
switch (value.record.aprFlag) { switch (value.record.aprFlag) {
case 1: case 1:
text = value.record.apr ? value.record.apr : ''; text = value.record.apr ? value.record.apr : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.apr ? value.record.apr : ''; text = value.record.apr ? value.record.apr : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -478,11 +487,11 @@
let color; let color;
switch (value.record.mayFlag) { switch (value.record.mayFlag) {
case 1: case 1:
text = value.record.may ? value.record.may : ''; text = value.record.may ? value.record.may : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.may ? value.record.may : ''; text = value.record.may ? value.record.may : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -499,11 +508,11 @@
let color; let color;
switch (value.record.junFlag) { switch (value.record.junFlag) {
case 1: case 1:
text = value.record.jun ? value.record.jun : ''; text = value.record.jun ? value.record.jun : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.jun ? value.record.jun : ''; text = value.record.jun ? value.record.jun : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -520,11 +529,11 @@
let color; let color;
switch (value.record.julFlag) { switch (value.record.julFlag) {
case 1: case 1:
text = value.record.jul ? value.record.jul : ''; text = value.record.jul ? value.record.jul : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.jul ? value.record.jul : ''; text = value.record.jul ? value.record.jul : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -541,11 +550,11 @@
let color; let color;
switch (value.record.augFlag) { switch (value.record.augFlag) {
case 1: case 1:
text = value.record.aug ? value.record.aug : ''; text = value.record.aug ? value.record.aug : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.aug ? value.record.aug : ''; text = value.record.aug ? value.record.aug : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -562,11 +571,11 @@
let color; let color;
switch (value.record.sepFlag) { switch (value.record.sepFlag) {
case 1: case 1:
text = value.record.sep ? value.record.sep : ''; text = value.record.sep ? value.record.sep : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.sep ? value.record.sep : ''; text = value.record.sep ? value.record.sep : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -583,11 +592,11 @@
let color; let color;
switch (value.record.octFlag) { switch (value.record.octFlag) {
case 1: case 1:
text = value.record.oct ? value.record.oct : ''; text = value.record.oct ? value.record.oct : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.oct ? value.record.oct : ''; text = value.record.oct ? value.record.oct : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -604,11 +613,11 @@
let color; let color;
switch (value.record.novFlag) { switch (value.record.novFlag) {
case 1: case 1:
text = value.record.nov ? value.record.nov : ''; text = value.record.nov ? value.record.nov : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.nov ? value.record.nov : ''; text = value.record.nov ? value.record.nov : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }
@ -625,11 +634,11 @@
let color; let color;
switch (value.record.decFlag) { switch (value.record.decFlag) {
case 1: case 1:
text = value.record.dece ? value.record.dece : ''; text = value.record.dece ? value.record.dece : '-';
color = 'rgba(243, 97, 99, 1)'; color = 'rgba(243, 97, 99, 1)';
break; break;
case 0: case 0:
text = value.record.dece ? value.record.dece : ''; text = value.record.dece ? value.record.dece : '-';
color = 'rgba(57, 215, 187, 1)'; color = 'rgba(57, 215, 187, 1)';
break; break;
} }

7
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/quickCalculation/index.vue

@ -23,6 +23,7 @@
:tree-data="gData" :tree-data="gData"
:show-line="{ showLeafIcon: false }" :show-line="{ showLeafIcon: false }"
show-line show-line
block-node
@expand="onExpand" @expand="onExpand"
@select="onSelect" @select="onSelect"
style="padding: 0 16px !important"> style="padding: 0 16px !important">
@ -231,8 +232,8 @@
}; };
const truncatedName = (name) => { const truncatedName = (name) => {
if (name) { if (name) {
if (name.length > 8) { if (name.length > 15) {
return name.substring(0, 8) + '...'; return name.substring(0, 15) + '...';
} }
} }
return name; return name;
@ -529,7 +530,7 @@
console.log(setFactorRef.value.nsTableRef.rowSelection); console.log(setFactorRef.value.nsTableRef.rowSelection);
setFactorRef.value.nsTableRef.params.emissionList = [0]; setFactorRef.value.nsTableRef.params.emissionList = [0];
setFactorRef.value.nsTableRef.treeElRef.selectedKeys = []; setFactorRef.value.nsTableRef.treeElRef.selectedKeys = [];
// setFactorRef.value.nsTableRef.rowSelection.selectedRowKeys = []; setFactorRef.value.nsTableRef.rowSelection.selectedRowKeys = undefined;
setFactorRef.value.nsTableRef.reload(); setFactorRef.value.nsTableRef.reload();
}); });
} }

59
hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue

@ -1,6 +1,6 @@
<template> <template>
<!-- 首页 --> <!-- 首页 -->
<div v-if="isMainPage"> <div v-if="isMainPage" style="height: 100%">
<ns-view-list-table v-bind="tableConfig" :scroll="{ x: 750 }" :model="data" ref="mainRef" /> <ns-view-list-table v-bind="tableConfig" :scroll="{ x: 750 }" :model="data" ref="mainRef" />
</div> </div>
<!-- 填报页 --> <!-- 填报页 -->
@ -153,10 +153,7 @@
formState.value.orgId = orgId.value; formState.value.orgId = orgId.value;
formState.value.startTime = formState.value.reportScope[0]; formState.value.startTime = formState.value.reportScope[0];
formState.value.endTime = formState.value.reportScope[1]; formState.value.endTime = formState.value.reportScope[1];
if ( if (text.value === '新增报告') {
oldStartTime.value === formState.value.startTime &&
oldEndTime.value === formState.value.endTime
) {
spinning.value = true; spinning.value = true;
fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => { fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {
visible.value = false; visible.value = false;
@ -164,26 +161,38 @@
spinning.value = false; spinning.value = false;
}); });
} else { } else {
Modal.confirm({ if (
title: '修改日期后会导致数据丢失是否保留数据?', oldStartTime.value === formState.value.startTime &&
icon: createVNode(ExclamationCircleOutlined), oldEndTime.value === formState.value.endTime
onOk() { ) {
spinning.value = true; spinning.value = true;
fetch(carbonInventoryCheck.createOrUpdate, formState.value) fetch(carbonInventoryCheck.createOrUpdate, formState.value).then((res) => {
.then((res) => { visible.value = false;
visible.value = false; mainRef.value?.nsTableRef.reload();
mainRef.value?.nsTableRef.reload(); spinning.value = false;
spinning.value = false; });
}) } else {
.catch((error) => { Modal.confirm({
message.error(error ? error : '保存失败!'); title: '修改日期会导致已有数据丢失,是否继续修改?',
}); icon: createVNode(ExclamationCircleOutlined),
}, onOk() {
onCancel() { spinning.value = true;
console.log('Cancel'); fetch(carbonInventoryCheck.createOrUpdate, formState.value)
}, .then((res) => {
class: 'test', visible.value = false;
}); mainRef.value?.nsTableRef.reload();
spinning.value = false;
})
.catch((error) => {
message.error(error ? error : '保存失败!');
});
},
onCancel() {
console.log('Cancel');
},
class: 'test',
});
}
} }
}) })
.catch((error) => { .catch((error) => {

39
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue

@ -52,24 +52,26 @@
</div> </div>
</div> </div>
</div> </div>
<div class="contant"> <a-spin :spinning="spinning">
<div class="chartsPart"> <div class="contant">
<template v-for="(item, index) in data" :key="index"> <div class="chartsPart">
<div class="electricityConsumption"> <template v-for="(item, index) in data" :key="index">
<div :id="'ydlChart_' + index" style="height: 100%; width: 100%"></div> <div class="electricityConsumption">
</div> <div :id="'ydlChart_' + index" style="height: 100%; width: 100%"></div>
</template> </div>
</div> </template>
<div class="tablePart"> </div>
<a-table <div class="tablePart">
:columns="columns" <a-table
:data-source="data" :columns="columns"
bordered :data-source="data"
:pagination="false" bordered
:scroll="{ x: 1300, y: 300 }"> :pagination="false"
</a-table> :scroll="{ x: 1300, y: 300 }">
</a-table>
</div>
</div> </div>
</div> </a-spin>
</div> </div>
</template> </template>
@ -88,6 +90,7 @@
const fetch = (api, params = { orgId }) => { const fetch = (api, params = { orgId }) => {
return http.post(api, params); return http.post(api, params);
}; };
const spinning = ref(false);
const selectYear = ref<Dayjs>(dayjs(new Date().getFullYear().toString())); const selectYear = ref<Dayjs>(dayjs(new Date().getFullYear().toString()));
const selectMonth = ref<Dayjs>(dayjs().startOf('year').month(0)); const selectMonth = ref<Dayjs>(dayjs().startOf('year').month(0));
// / // /
@ -250,10 +253,12 @@
yearAndMonth: 'year', yearAndMonth: 'year',
}); });
const getTableData = () => { const getTableData = () => {
spinning.value = true;
fetch(carbonPlanning.whole, queryParams.value).then((res) => { fetch(carbonPlanning.whole, queryParams.value).then((res) => {
data.value = res.data; data.value = res.data;
setTimeout(() => { setTimeout(() => {
drawEcharts(); drawEcharts();
spinning.value = false;
}, 500); }, 500);
}); });
}; };

221
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue

@ -8,122 +8,124 @@
<a-button type="primary" @click="changeParentData">返回</a-button> <a-button type="primary" @click="changeParentData">返回</a-button>
</div> </div>
</div> </div>
<div class="contant"> <a-spin :spinning="spinning">
<a-card class="chartsPart" v-if="showPart"> <div class="contant">
<div class="chart" ref="chartRef"></div> <a-card class="chartsPart" v-if="showPart">
<div class="contrast"> <div class="chart" ref="chartRef"></div>
<div class="model"> <div class="contrast">
<div class="quantity"> <div class="model">
<span>{{ lastYearActualUsage }}</span> <div class="quantity">
kwh <span>{{ lastYearActualUsage }}</span>
kwh
</div>
<div class="quantityTitle">{{ Number(props.year) - 1 }}年实际用量</div>
</div> </div>
<div class="quantityTitle">{{ Number(props.year) - 1 }}年实际用量</div> <div class="model">
</div> <div class="quantity">
<div class="model"> <span>{{ actualUsage }}</span>
<div class="quantity"> kwh
<span>{{ actualUsage }}</span> </div>
kwh <div class="quantityTitle">{{ props.year }}年实际用量</div>
</div> </div>
<div class="quantityTitle">{{ props.year }}年实际用量</div> <div class="model">
</div> <div class="quantity">
<div class="model"> <span>{{ budget }}</span>
<div class="quantity"> kwh
<span>{{ budget }}</span> </div>
kwh <div class="quantityTitle">{{ props.year }}年预算</div>
</div> </div>
<div class="quantityTitle">{{ props.year }}年预算</div> <div class="model">
</div> <div class="quantity">
<div class="model"> <span>{{ referenceValue }}</span>
<div class="quantity"> kwh
<span>{{ referenceValue }}</span> </div>
kwh <div class="quantityTitle">基准值</div>
</div>
<div class="model">
<div class="quantity" style="align-items: center; display: flex">
<img
width="20px"
height="28px"
v-if="count < 0"
src="../../../../../src/icon/carbonPlanningDown.svg" />
<span v-if="count < 0" style="margin-left: 5px">{{ Math.abs(count) }}%</span>
<img
width="20px"
height="28px"
v-if="count > 0"
src="../../../../../src/icon/carbonPlanningUp.svg" />
<span v-if="count > 0" style="margin-left: 5px">{{ count }}%</span>
<span v-if="count === 0" style="margin-left: 5px">{{ count }}%</span>
</div>
<div class="quantityTitle">实际|预算</div>
</div> </div>
<div class="quantityTitle">基准值</div>
</div> </div>
<div class="model"> <div class="hide">
<div class="quantity" style="align-items: center; display: flex"> <div style="cursor: pointer" @click="hideTopPart">
<img <CaretUpOutlined />
width="20px" <span>隐藏</span>
height="28px"
v-if="count < 0"
src="../../../../../src/icon/carbonPlanningDown.svg" />
<span v-if="count < 0" style="margin-left: 5px">{{ Math.abs(count) }}%</span>
<img
width="20px"
height="28px"
v-if="count > 0"
src="../../../../../src/icon/carbonPlanningUp.svg" />
<span v-if="count > 0" style="margin-left: 5px">{{ count }}%</span>
<span v-if="count === 0" style="margin-left: 5px">{{ count }}%</span>
</div> </div>
<div class="quantityTitle">实际|预算</div>
</div> </div>
</div> </a-card>
<div class="hide"> <a-card class="tablePart" :bordered="false">
<div style="cursor: pointer" @click="hideTopPart"> <div class="show" v-if="!showPart">
<CaretUpOutlined /> <div style="cursor: pointer" @click="showTopPart">
<span>隐藏</span> <CaretDownOutlined />
<span>展开</span>
</div>
</div> </div>
</div> <div class="button" style="margin-bottom: 12px">
</a-card> <a-button type="primary" @click="editData"> 批量设置 </a-button>
<a-card class="tablePart" :bordered="false"> <a-button type="primary" style="margin-left: 6px" @click="setBasicData">
<div class="show" v-if="!showPart"> 基准值设置
<div style="cursor: pointer" @click="showTopPart"> </a-button>
<CaretDownOutlined />
<span>展开</span>
</div> </div>
</div> <a-table
<div class="button" style="margin-bottom: 12px"> :columns="columns"
<a-button type="primary" @click="editData"> 批量设置 </a-button> :data-source="data"
<a-button type="primary" style="margin-left: 6px" @click="setBasicData"> rowKey="id"
基准值设置 bordered
</a-button> :rowSelection="{
</div> selectedRowKeys: selectedRowKeys,
<a-table onChange: onSelectionChange,
:columns="columns" }"
:data-source="data" :pagination="false">
rowKey="id" <template #bodyCell="{ column, text, record }">
bordered <template v-if="column.key === 'action'">
:rowSelection="{ <span>
selectedRowKeys: selectedRowKeys, <a @click="editData(record)">修改预算值</a>
onChange: onSelectionChange, </span>
}" </template>
:pagination="false">
<template #bodyCell="{ column, text, record }">
<template v-if="column.key === 'action'">
<span>
<a @click="editData(record)">修改预算值</a>
</span>
</template> </template>
</template> <template #summary>
<template #summary> <a-table-summary-row>
<a-table-summary-row> <a-table-summary-cell></a-table-summary-cell>
<a-table-summary-cell></a-table-summary-cell> <a-table-summary-cell :colSpan="2">合计</a-table-summary-cell>
<a-table-summary-cell :colSpan="2">合计</a-table-summary-cell> <a-table-summary-cell>
<a-table-summary-cell> <a-typography-text>{{ totalLastYearActualUsage + unit }}</a-typography-text>
<a-typography-text>{{ totalLastYearActualUsage + unit }}</a-typography-text> </a-table-summary-cell>
</a-table-summary-cell> <a-table-summary-cell>
<a-table-summary-cell> <a-typography-text>{{ totalActualUsage + unit }}</a-typography-text>
<a-typography-text>{{ totalActualUsage + unit }}</a-typography-text> </a-table-summary-cell>
</a-table-summary-cell> <a-table-summary-cell>
<a-table-summary-cell> <a-typography-text>{{ totalReferenceValue + unit }}</a-typography-text>
<a-typography-text>{{ totalReferenceValue + unit }}</a-typography-text> </a-table-summary-cell>
</a-table-summary-cell> <a-table-summary-cell>
<a-table-summary-cell> <a-typography-text>-</a-typography-text>
<a-typography-text>-</a-typography-text> </a-table-summary-cell>
</a-table-summary-cell> <a-table-summary-cell>
<a-table-summary-cell> <a-typography-text>-</a-typography-text>
<a-typography-text>-</a-typography-text> </a-table-summary-cell>
</a-table-summary-cell> <a-table-summary-cell>
<a-table-summary-cell> <a-typography-text>{{ totalBudget + unit }}</a-typography-text>
<a-typography-text>{{ totalBudget + unit }}</a-typography-text> </a-table-summary-cell>
</a-table-summary-cell> <a-table-summary-cell></a-table-summary-cell>
<a-table-summary-cell></a-table-summary-cell> </a-table-summary-row>
</a-table-summary-row> </template>
</template> </a-table>
</a-table> </a-card>
</a-card> </div>
</div> </a-spin>
<!-- 批量设置 --> <!-- 批量设置 -->
<a-modal :visible="open" title="批量设置" @ok="handleOk" @cancel="onCancel"> <a-modal :visible="open" title="批量设置" @ok="handleOk" @cancel="onCancel">
<a-form ref="formRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol"> <a-form ref="formRef" :model="formState" :label-col="labelCol" :wrapper-col="wrapperCol">
@ -317,6 +319,7 @@
const fetch = (api, params = { orgId }) => { const fetch = (api, params = { orgId }) => {
return http.post(api, params); return http.post(api, params);
}; };
const spinning = ref(false);
// //
const emit = defineEmits(['change-data']); const emit = defineEmits(['change-data']);
const changeParentData = () => { const changeParentData = () => {
@ -345,6 +348,7 @@
const totalLastYearActualUsage = ref(); const totalLastYearActualUsage = ref();
const totalReferenceValue = ref(); const totalReferenceValue = ref();
const getTableData = () => { const getTableData = () => {
spinning.value = true;
fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then(async (res) => { fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then(async (res) => {
let resUnit = await getEnumEnergy({ params: { code: props.resourceType } }); let resUnit = await getEnumEnergy({ params: { code: props.resourceType } });
unit.value = resUnit.data.unit; unit.value = resUnit.data.unit;
@ -358,6 +362,7 @@
lastActualUsageList.value = data.value.map((item) => item.lastYearActualUsage); lastActualUsageList.value = data.value.map((item) => item.lastYearActualUsage);
formState.value.lastYearList = lastActualUsageList.value; formState.value.lastYearList = lastActualUsageList.value;
} }
getChartData();
}); });
}; };
getTableData(); getTableData();
@ -646,9 +651,9 @@
lastYearActualUsage.value = res.data.lastYearActualUsage; lastYearActualUsage.value = res.data.lastYearActualUsage;
count.value = res.data.count; count.value = res.data.count;
chart(); chart();
spinning.value = false;
}); });
}; };
getChartData();
const chart = () => { const chart = () => {
chartInstance = echarts.init(chartRef.value); chartInstance = echarts.init(chartRef.value);
const option = { const option = {
@ -996,7 +1001,7 @@
:deep(.ant-card-bordered) { :deep(.ant-card-bordered) {
border: unset; border: unset;
} }
:deep(.ant-input-number-handler-wrap){ :deep(.ant-input-number-handler-wrap) {
display: none; display: none;
} }
</style> </style>

50
hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue

@ -38,30 +38,32 @@
</div> </div>
</div> </div>
</div> </div>
<div class="contant"> <a-spin :spinning="spinning">
<div class="chartsPart"> <div class="contant">
<div class="ballChart" ref="ballChartRef"></div> <div class="chartsPart">
<div class="pillarChart" ref="pillarChartRef"></div> <div class="ballChart" ref="ballChartRef"></div>
</div> <div class="pillarChart" ref="pillarChartRef"></div>
<div class="tablePart"> </div>
<a-table <div class="tablePart">
:columns="columns" <a-table
:data-source="data" :columns="columns"
bordered :data-source="data"
:pagination="false" bordered
row-key="itemizeId" :pagination="false"
:onRow="onRow" row-key="itemizeId"
:customRow="customRow"> :onRow="onRow"
<template #bodyCell="{ column, text, record }"> :customRow="customRow">
<template v-if="column.key === 'action'"> <template #bodyCell="{ column, text, record }">
<span> <template v-if="column.key === 'action'">
<a @click="detailData(record)">详情</a> <span>
</span> <a @click="detailData(record)">详情</a>
</span>
</template>
</template> </template>
</template> </a-table>
</a-table> </div>
</div> </div>
</div> </a-spin>
</div> </div>
<div class="totalContant" v-else> <div class="totalContant" v-else>
<categoryDeatil <categoryDeatil
@ -136,6 +138,7 @@
const fetch = (api, params = { orgId }) => { const fetch = (api, params = { orgId }) => {
return http.post(api, params); return http.post(api, params);
}; };
const spinning = ref(false);
const selectYearValue = ref<Dayjs>(dayjs(new Date().getFullYear().toString())); const selectYearValue = ref<Dayjs>(dayjs(new Date().getFullYear().toString()));
const selectMonthValue = ref<Dayjs>(dayjs().startOf('year').month(0)); const selectMonthValue = ref<Dayjs>(dayjs().startOf('year').month(0));
const electricTotal = ref(true); const electricTotal = ref(true);
@ -371,6 +374,7 @@
fetch(carbonPlanning.yearAndMonthAchievement, getBallQuery.value).then((res) => { fetch(carbonPlanning.yearAndMonthAchievement, getBallQuery.value).then((res) => {
ballValue.value = res.data; ballValue.value = res.data;
drawSQ(); drawSQ();
spinning.value = false;
}); });
}; };
let ballChartInstance: echarts.ECharts | null = null; let ballChartInstance: echarts.ECharts | null = null;
@ -489,6 +493,7 @@
// //
const unit = ref(); const unit = ref();
const getYearData = () => { const getYearData = () => {
spinning.value = true;
treeCheckedKeys.value = []; treeCheckedKeys.value = [];
fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then(async (res) => { fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then(async (res) => {
let resUnit = await getEnumEnergy({ params: { code: props.energyType } }); let resUnit = await getEnumEnergy({ params: { code: props.energyType } });
@ -516,6 +521,7 @@
getMonthData(); getMonthData();
}; };
const getMonthData = () => { const getMonthData = () => {
spinning.value = true;
fetch(carbonPlanning.searchListByMonth, monthQueryParams.value).then(async (res) => { fetch(carbonPlanning.searchListByMonth, monthQueryParams.value).then(async (res) => {
let resUnit = await getEnumEnergy({ params: { code: props.energyType } }); let resUnit = await getEnumEnergy({ params: { code: props.energyType } });
unit.value = resUnit.data.unit; unit.value = resUnit.data.unit;

Loading…
Cancel
Save