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 style="display: flex; margin-top: 20px; height: calc(85% - 20px)">
<div class="detailTable">
<ns-view-list-table
v-bind="tableConfig"
:model="data"
ref="mainRef"
:scroll="{ x: 1280 }">
<ns-view-list-table v-bind="tableConfig" :model="data" ref="mainRef" :scroll="{ x: 1280 }">
<template #bodyCell="{ column, text, record }">
<template v-if="column.dataIndex === 'accountType'">
<span v-if="record.accountType">{{ record.accountType.label }}</span>
@ -206,12 +202,23 @@
year: year.value,
});
const transactionTypeValue = ref();
const selectValue = ref([]);
const changeSelect = (value, selectedOptions) => {
debugger;
// transactionTypeValue.value = selectedOptions.flatMap((group) =>
// 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 = () => {
year.value = queryParams.value.year;

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

@ -171,13 +171,13 @@
<span>{{ data.cnValue }}</span>
</div>
<div class="actionMore">
<EditOutlined v-if="!data.parentId" @click="editGroup(data)" />
<EditOutlined v-else @click="editUnit(data)" />
<PlusCircleOutlined v-if="!data.parentId" @click="addUnit(data)" />
<MinusCircleOutlined style="margin-left: 6px" @click="delUnit(data)" />
<PlusCircleOutlined
v-if="!data.parentId"
<EditOutlined
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>
</template>
@ -480,9 +480,9 @@
//
const deleteTreeNode = (data) => {
Modal.confirm({
title: '警告',
// title: '',
icon: createVNode(ExclamationCircleOutlined),
content: '确定要删除么?',
content: '您将删除此节点。其数据将保留并移至“未分类”区域,仍可访问。确定删除吗?',
okText: '确认',
okType: 'primary',
cancelText: '取消',
@ -710,11 +710,11 @@
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,
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',

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Loading…
Cancel
Save