Browse Source

taskId:282,remark:'commit'

temp
fks-xuxinyue 3 months ago
parent
commit
b079a2b464
  1. 6
      hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts
  2. 6
      hx-ai-intelligent/src/icon/carbonPlanningDown.svg
  3. 6
      hx-ai-intelligent/src/icon/carbonPlanningUp.svg
  4. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/index.vue
  5. 2
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts
  6. 4
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  7. 1
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionStatistics/index.vue
  8. 18
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/fillInPage/index.vue
  9. 35
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
  10. 236
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
  11. 95
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/index.vue
  12. 63
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/index.vue
  13. 1
      hx-ai-intelligent/src/view/equipmentManage/group/index.vue

6
hx-ai-intelligent/src/api/carbonEmissionFactorLibrary.ts

@ -52,7 +52,7 @@ export enum carbonInventoryCheck {
update = '/carbon-smart/api/carbon/inventory/update', update = '/carbon-smart/api/carbon/inventory/update',
del = '/carbon-smart/api/carbon/inventory/del', del = '/carbon-smart/api/carbon/inventory/del',
// 获取排放源表格数据 // 获取排放源表格数据
findUnitById = '/carbon-smartapi/carbon/inventory/findById', findUnitById = '/carbon-smart/api/carbon/inventory/findById',
getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList', getDetailsList = '/carbon-smart/api/carbon/inventory/details/getDetailsList',
updateTable = '/carbon-smart/api/carbon/inventory/details/update', updateTable = '/carbon-smart/api/carbon/inventory/details/update',
// 排放统计接口 // 排放统计接口
@ -86,4 +86,8 @@ export enum carbonPlanning {
yearAndMonthAchievement = '/carbon-smart/api/carbon/planning/yearAndMonthAchievement', yearAndMonthAchievement = '/carbon-smart/api/carbon/planning/yearAndMonthAchievement',
annualElectricityConsumption = '/carbon-smart/api/carbon/planning/annualElectricityConsumption', annualElectricityConsumption = '/carbon-smart/api/carbon/planning/annualElectricityConsumption',
electricityUsageBackThen = '/carbon-smart/api/carbon/planning/electricityUsageBackThen', electricityUsageBackThen = '/carbon-smart/api/carbon/planning/electricityUsageBackThen',
detailedStatisticalDataTable = '/carbon-smart/api/carbon/planning/detailedStatisticalDataTable',
detailedStatisticalDataChart = '/carbon-smart/api/carbon/planning/detailedStatisticalDataChart',
batchOrUpdate = '/carbon-smart/api/carbon/planning/batchOrUpdate',
addNodes = '/carbon-smart/api/carbon/planning/addNodes',
} }

6
hx-ai-intelligent/src/icon/carbonPlanningDown.svg

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.72705078125" height="20.530746459960938" viewBox="0 0 16.72705078125 20.530746459960938" fill="none">
<path d="M8.83553 0.223206C8.71956 0.0818939 8.54638 0 8.36358 0C8.18079 0 8.00761 0.0818939 7.89164 0.223206L0.139786 9.14842C-0.120087 9.44533 -0.00717926 9.69086 0.391891 9.69086L3.29167 9.69086C3.69073 9.69086 4.01572 10.0111 4.01572 10.4054L4.01572 15.5251C4.01572 15.9194 4.3413 16.242 4.73977 16.242L11.988 16.242C12.3865 16.242 12.7121 15.9194 12.7121 15.5251L12.7121 10.4054C12.7121 10.0111 13.037 9.69086 13.4361 9.69086L16.3335 9.69086C16.7326 9.69086 16.8479 9.44533 16.588 9.14842L8.83553 0.223206Z" fill="#F36163" >
</path>
<path d="M4.55933 20.5308L12.1678 20.5308C12.4977 20.5308 12.7652 20.2633 12.7652 19.9334L12.7652 18.1411C12.7652 17.8112 12.4977 17.5437 12.1678 17.5437L4.55933 17.5437C4.22937 17.5437 3.96191 17.8112 3.96191 18.1411L3.96191 19.9334C3.96191 20.2633 4.2294 20.5308 4.55933 20.5308Z" fill="#F36163" >
</path>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

6
hx-ai-intelligent/src/icon/carbonPlanningUp.svg

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16.72705078125" height="20.530746459960938" viewBox="0 0 16.72705078125 20.530746459960938" fill="none">
<path d="M8.83553 0.223206C8.71956 0.0818939 8.54638 0 8.36358 0C8.18079 0 8.00761 0.0818939 7.89164 0.223206L0.139786 9.14842C-0.120087 9.44533 -0.00717926 9.69086 0.391891 9.69086L3.29167 9.69086C3.69073 9.69086 4.01572 10.0111 4.01572 10.4054L4.01572 15.5251C4.01572 15.9194 4.3413 16.242 4.73977 16.242L11.988 16.242C12.3865 16.242 12.7121 15.9194 12.7121 15.5251L12.7121 10.4054C12.7121 10.0111 13.037 9.69086 13.4361 9.69086L16.3335 9.69086C16.7326 9.69086 16.8479 9.44533 16.588 9.14842L8.83553 0.223206Z" fill="#F36163" >
</path>
<path d="M4.55933 20.5308L12.1678 20.5308C12.4977 20.5308 12.7652 20.2633 12.7652 19.9334L12.7652 18.1411C12.7652 17.8112 12.4977 17.5437 12.1678 17.5437L4.55933 17.5437C4.22937 17.5437 3.96191 17.8112 3.96191 18.1411L3.96191 19.9334C3.96191 20.2633 4.2294 20.5308 4.55933 20.5308Z" fill="#F36163" >
</path>
</svg>

After

Width:  |  Height:  |  Size: 1.0 KiB

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

@ -148,7 +148,7 @@
<div class="moneyImg" <div class="moneyImg"
><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-4.svg" ><img width="68px" height="68px" src="../../../../src/icon/carbonAssetsMoney-4.svg"
/></div> /></div>
<div class="moneyTitle">全国碳账户估值CNY</div> <div class="moneyTitle">碳资产总估值CNY</div>
<div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{ whole.whole }}</div> <div class="moneyTotal" style="color: rgba(229, 102, 22, 1)">{{ whole.whole }}</div>
</div> </div>
<div class="title" style="justify-content: center"> <div class="title" style="justify-content: center">

2
hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/config.ts

@ -191,7 +191,7 @@ export const formConfig = (disabled) => {
}, },
{ {
label: '参考文献', label: '参考文献',
field: 'reference', field: 'bibliography',
component: 'NsTextarea', component: 'NsTextarea',
componentProps: { componentProps: {
placeholder: '请输入参考文献', placeholder: '请输入参考文献',

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

@ -686,7 +686,7 @@
}, },
{ {
title: '参考文献', title: '参考文献',
dataIndex: 'reference', dataIndex: 'bibliography',
}, },
{ {
title: '引用数量', title: '引用数量',
@ -824,7 +824,7 @@
}, },
}, },
{ {
field: 'reference', field: 'bibliography',
label: '文献关键字', label: '文献关键字',
component: 'NsInput', component: 'NsInput',
componentProps: { componentProps: {

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

@ -37,7 +37,6 @@
energyConsumptionRef.value.mainRef.nsTableRef.reload(); energyConsumptionRef.value.mainRef.nsTableRef.reload();
} }
} else if (key === '2') { } else if (key === '2') {
debugger
if (carbonEmissionsRef.value) { if (carbonEmissionsRef.value) {
carbonEmissionsRef.value.getTableList(); // carbonEmissionsRef.value.getTableList(); //
} }

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

@ -1163,6 +1163,8 @@
let chartInstance: echarts.ECharts | null = null; let chartInstance: echarts.ECharts | null = null;
const drawEcharts = () => { const drawEcharts = () => {
chartInstance = echarts.init(tplxChart.value); chartInstance = echarts.init(tplxChart.value);
let listData = datalist.value;
let linkDatas = linksData.value;
let Color = [ let Color = [
'#61FEFF', '#61FEFF',
'#937FE6', '#937FE6',
@ -1180,6 +1182,8 @@
'#bbc951', '#bbc951',
'#FFC14B', '#FFC14B',
'#b785a6', '#b785a6',
'#c23531',
'#2f4554',
]; ];
let Color1 = [ let Color1 = [
'#04E0F3', '#04E0F3',
@ -1198,6 +1202,8 @@
'#bbc951', '#bbc951',
'#FFC14B', '#FFC14B',
'#b785a6', '#b785a6',
'#c23531',
'#2f4554',
]; ];
let sourceLabel = [ let sourceLabel = [
'right', 'right',
@ -1219,16 +1225,16 @@
]; ];
let itemStyleColor = []; let itemStyleColor = [];
let labelSource = []; let labelSource = [];
for (let i = 0; i < datalist.value.length; i++) { for (let i = 0; i < listData.length; i++) {
datalist.value[i].label = { listData[i].label = {
normal: { normal: {
position: sourceLabel[i], position: sourceLabel[i],
}, },
}; };
labelSource.push(sourceLabel[i]); labelSource.push(sourceLabel[i]);
} }
for (let d = 0; d < datalist.value.length; d++) { for (let d = 0; d < listData.length; d++) {
datalist.value[d].itemStyle = { listData[d].itemStyle = {
normal: { normal: {
color: { color: {
type: 'linear', type: 'linear',
@ -1250,7 +1256,7 @@
}, },
}, },
}; };
itemStyleColor.push(datalist.value[d]); itemStyleColor.push(listData[d]);
} }
const option = { const option = {
backgroundColor: 'transparent', backgroundColor: 'transparent',
@ -1270,7 +1276,7 @@
nodeWidth: 25, nodeWidth: 25,
focusNodeAdjacency: 'allEdges', focusNodeAdjacency: 'allEdges',
data: itemStyleColor, data: itemStyleColor,
links: linksData.value, links: linkDatas,
label: { label: {
normal: { normal: {
color: '#fff', color: '#fff',

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

@ -7,13 +7,15 @@
v-if="selectedTime" v-if="selectedTime"
style="margin-left: 5%" style="margin-left: 5%"
valueFormat="YYYY" valueFormat="YYYY"
:value="selectYear" v-model:value="selectYear"
@change="changeYear"
picker="year" /> picker="year" />
<a-date-picker <a-date-picker
v-else v-else
style="margin-left: 5%" style="margin-left: 5%"
valueFormat="YYYY-MM" valueFormat="YYYY-MM"
:value="selectMonth" v-model:value="selectMonth"
@change="changeMonth"
picker="month" /> picker="month" />
</div> </div>
<div class="operation"> <div class="operation">
@ -30,7 +32,13 @@
</template> </template>
</div> </div>
<div class="tablePart"> <div class="tablePart">
<a-table :columns="columns" :data-source="data" bordered :pagination="false"> </a-table> <a-table
:columns="columns"
:data-source="data"
bordered
:pagination="false"
:scroll="{ x: 1300, y: 300 }">
</a-table>
</div> </div>
</div> </div>
</div> </div>
@ -52,26 +60,35 @@
return http.post(api, params); return http.post(api, params);
}; };
const selectYear = ref<Dayjs>(dayjs(new Date().getFullYear().toString())); const selectYear = ref<Dayjs>(dayjs(new Date().getFullYear().toString()));
const selectMonth = ref<Dayjs>(); const selectMonth = ref<Dayjs>(dayjs().startOf('year').month(0));
// / // /
const monthStyles = ref('background: #f2f2f2'); const monthStyles = ref('background: #f2f2f2');
const yearStyles = ref('background: #2778ff'); const yearStyles = ref('background: #2778ff');
const selectedTime = ref(true); const selectedTime = ref(true);
const changeMonth = () => {
queryParams.value.yearMonth = selectMonth.value;
getTableData();
};
const changeToMonth = () => { const changeToMonth = () => {
monthStyles.value = 'background: #2778ff'; monthStyles.value = 'background: #2778ff';
yearStyles.value = 'background: #f2f2f2'; yearStyles.value = 'background: #f2f2f2';
queryParams.value.yearAndMonth = 'month'; queryParams.value.yearAndMonth = 'month';
queryParams.value.year = selectMonth.value; queryParams.value.yearMonth = selectMonth.value.format('YYYY-DD');
columns.value[2].title = '月份'; columns.value[2].title = '月份';
columns.value[2].dataIndex = 'month'; columns.value[2].dataIndex = 'yearMonth';
selectedTime.value = false; selectedTime.value = false;
getTableData(); getTableData();
}; };
const changeYear = () => {
queryParams.value.year = selectYear.value;
getTableData();
};
const changeToYear = () => { const changeToYear = () => {
monthStyles.value = 'background: #f2f2f2'; monthStyles.value = 'background: #f2f2f2';
yearStyles.value = 'background: #2778ff'; yearStyles.value = 'background: #2778ff';
queryParams.value.yearAndMonth = 'year'; queryParams.value.yearAndMonth = 'year';
queryParams.value.year = selectYear.value; delete queryParams.value.yearMonth;
// queryParams.value.year = selectYear.value;
columns.value[2].title = '年份'; columns.value[2].title = '年份';
columns.value[2].dataIndex = 'year'; columns.value[2].dataIndex = 'year';
selectedTime.value = true; selectedTime.value = true;
@ -85,7 +102,7 @@
const chart = echarts.init(document.getElementById(`ydlChart_${index}`)!); const chart = echarts.init(document.getElementById(`ydlChart_${index}`)!);
const handred = 100; const handred = 100;
let point = parseInt(item.budgetAchievement.replace("%", "")); let point = parseInt(item.budgetAchievement.replace('%', ''));
const option = { const option = {
backgroundColor: 'transparent', backgroundColor: 'transparent',
title: [ title: [
@ -197,7 +214,7 @@
}, },
{ {
title: '计量单位', title: '计量单位',
dataIndex: 'name', dataIndex: 'unitMeasurement',
}, },
{ {
title: '总实际用量', title: '总实际用量',

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

@ -13,23 +13,49 @@
<div class="chart" ref="chartRef"></div> <div class="chart" ref="chartRef"></div>
<div class="contrast"> <div class="contrast">
<div class="model"> <div class="model">
<div class="quantity"><span>12,500.00</span>kwh</div> <div class="quantity">
<div class="quantityTitle">2023年实际用量</div> <span>{{ lastYearActualUsage }}</span>
kwh
</div>
<div class="quantityTitle">{{ Number(props.year) - 1 }}年实际用量</div>
</div> </div>
<div class="model"> <div class="model">
<div class="quantity"><span>12,500.00</span>kwh</div> <div class="quantity">
<div class="quantityTitle">2024年实际用量</div> <span>{{ actualUsage }}</span>
kwh
</div>
<div class="quantityTitle">{{ props.year }}年实际用量</div>
</div> </div>
<div class="model"> <div class="model">
<div class="quantity"><span>12,500.00</span>kwh</div> <div class="quantity">
<div class="quantityTitle">2024年预算</div> <span>{{ budget }}</span>
kwh
</div>
<div class="quantityTitle">{{ props.year }}年预算</div>
</div> </div>
<div class="model"> <div class="model">
<div class="quantity"><span>12,500.00</span>kwh</div> <div class="quantity">
<span>{{ referenceValue }}</span>
kwh
</div>
<div class="quantityTitle">基准值</div> <div class="quantityTitle">基准值</div>
</div> </div>
<div class="model"> <div class="model">
<div class="quantity"><span>12,500.00</span>kwh</div> <div class="quantity">
<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 class="quantityTitle">实际|预算</div>
</div> </div>
</div> </div>
@ -64,6 +90,7 @@
selectedRowKeys: selectedRowKeys, selectedRowKeys: selectedRowKeys,
onChange: onSelectionChange, onChange: onSelectionChange,
}" }"
:scroll="{ x: 1300, y: 400 }"
:pagination="false"> :pagination="false">
<template #bodyCell="{ column, text, record }"> <template #bodyCell="{ column, text, record }">
<template v-if="column.key === 'action'"> <template v-if="column.key === 'action'">
@ -75,26 +102,26 @@
</a-table> </a-table>
</a-card> </a-card>
</div> </div>
<!-- 设置 --> <!-- 批量设置 -->
<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">
<a-form-item label="是否按去年折算"> <a-form-item label="是否按去年折算">
<a-select ref="select" :value="formState.value1"> <a-select ref="select" v-model:value="formState.isLastYear" @change="selectChange">
<a-select-option value="1"></a-select-option> <a-select-option :value="1"></a-select-option>
<a-select-option value="0"></a-select-option> <a-select-option :value="0"></a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
<a-form-item label="计算方式"> <!-- <a-form-item label="计算方式">
<a-select ref="select" :value="formState.value2"> <a-select ref="select" v-model:value="formState.countMethod">
<a-select-option value="1">手动</a-select-option> <a-select-option value="0">手动</a-select-option>
<a-select-option value="0">自动</a-select-option> <a-select-option value="1">自动</a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item> -->
<a-form-item label="折算率"> <a-form-item label="折算率">
<a-input :value="formState.name" suffix="%" disabled /> <a-input v-model:value="formState.conversionRate" suffix="%" :disabled="disabled" />
</a-form-item> </a-form-item>
<a-form-item label="预算值"> <a-form-item label="预算值">
<a-input :value="formState.email" suffix="kWh" disabled /> <a-input v-model:value="formState.budget" suffix="kWh" :disabled="!disabled" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
@ -105,7 +132,7 @@
:width="500" :width="500"
@close="onClose" @close="onClose"
:footer-style="{ textAlign: 'right' }"> :footer-style="{ textAlign: 'right' }">
<div> 节点站台照明 </div> <div> 节点{{ props.nodeName }} </div>
<a-table <a-table
:columns="drawerColumns" :columns="drawerColumns"
:data-source="newTableData" :data-source="newTableData"
@ -134,15 +161,34 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, defineEmits, reactive } from 'vue'; import { ref, defineEmits, reactive, toRaw } from 'vue';
import { http } from '/nerv-lib/util/http';
import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons-vue'; import { CaretUpOutlined, CaretDownOutlined } from '@ant-design/icons-vue';
import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary';
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { any, string } from 'vue-types';
// id // id
const props = defineProps({ const props = defineProps({
parentId: { parentId: {
type: Number, type: Number,
}, },
year: {
type: string,
},
type: {
type: Number,
},
nodeName: {
type: string,
},
}); });
console.log(props, 'xxy');
const orgId = ref('');
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
orgId.value = result;
const fetch = (api, params = { orgId }) => {
return http.post(api, params);
};
// //
const emit = defineEmits(['change-data']); const emit = defineEmits(['change-data']);
const changeParentData = () => { const changeParentData = () => {
@ -152,7 +198,20 @@
const selectedRowKeys = ref([]); const selectedRowKeys = ref([]);
const onSelectionChange = (selectedKeys, selectedRows) => { const onSelectionChange = (selectedKeys, selectedRows) => {
selectedRowKeys.value = selectedKeys; selectedRowKeys.value = selectedKeys;
formState.value.ids = selectedKeys;
}; };
const queryParams = ref({
orgId: orgId.value,
year: props.year,
itemizeId: props.parentId,
type: props.type,
});
const getTableData = () => {
fetch(carbonPlanning.detailedStatisticalDataTable, queryParams.value).then((res) => {
data.value = res.data;
});
};
getTableData();
const columns = ref([ const columns = ref([
{ {
title: '序号', title: '序号',
@ -162,35 +221,31 @@
}, },
{ {
title: '日期', title: '日期',
dataIndex: 'name', dataIndex: 'yearMonth',
}, },
{ {
title: '2023年实际用量', title: Number(props.year) - 1 + '年实际用量',
dataIndex: 'name', dataIndex: 'lastYearActualUsage',
}, },
{ {
title: '2024年实际用量', title: props.year + '年实际用量',
dataIndex: 'name', dataIndex: 'actualUsage',
}, },
{ {
title: '基准值', title: '基准值',
dataIndex: 'money', dataIndex: 'referenceValue',
}, },
{ {
title: '是否按去年折算', title: '是否按去年折算',
dataIndex: 'address', dataIndex: 'lastYear',
},
{
title: '计算方式',
dataIndex: 'address',
}, },
{ {
title: '折算率', title: '折算率',
dataIndex: 'address', dataIndex: 'conversionRate',
}, },
{ {
title: '2024年预算', title: '2024年预算',
dataIndex: 'address', dataIndex: 'budget',
}, },
{ {
title: '操作', title: '操作',
@ -198,35 +253,50 @@
}, },
]); ]);
const data = [ const data = ref([]);
{
key: '1',
name: 'John Brown',
money: '¥300,000.00',
address: 'New York No. 1 Lake Park',
},
{
key: '2',
name: 'Jim Green',
money: '¥1,256,000.00',
address: 'London No. 1 Lake Park',
},
{
key: '3',
name: 'Joe Black',
money: '¥120,000.00',
address: 'Sidney No. 1 Lake Park',
},
];
const open = ref(false); const open = ref(false);
const formRef = ref(); const formRef = ref();
const formState = ref({}); const formState = ref({});
const labelCol = { span: 6 }; const labelCol = { span: 6 };
const wrapperCol = { span: 18 }; const wrapperCol = { span: 18 };
const editData = () => { const editData = (record) => {
open.value = true; open.value = true;
if (record) {
formState.value.ids = [record.id];
if (record.lastYear === '是') {
formState.value.isLastYear = 1;
} else {
formState.value.isLastYear = 0;
}
formState.value.conversionRate = record.conversionRate;
formState.value.budget = record.budget;
}
};
const disabled = ref(true);
const selectChange = (value) => {
if (value === 1) {
disabled.value = false;
} else {
disabled.value = true;
}
};
const handleOk = () => {
formRef.value
.validate()
.then(() => {
console.log('values', formState, toRaw(formState));
fetch(carbonPlanning.batchOrUpdate, formState.value).then((res) => {
open.value = false;
formState.value = {};
getTableData();
});
})
.catch((error) => {
console.log('error', error);
});
}; };
const onCancel = () => { const onCancel = () => {
formState.value = {};
open.value = false; open.value = false;
}; };
const visible = ref(false); const visible = ref(false);
@ -258,6 +328,33 @@
// echarts // echarts
const chartRef = ref(null); const chartRef = ref(null);
let chartInstance: echarts.ECharts | null = null; let chartInstance: echarts.ECharts | null = null;
const XData = ref([]);
const actualUsageList = ref([]);
const lastYearActualUsageList = ref([]);
const budgetList = ref([]);
const referenceValueList = ref();
const actualUsage = ref();
const budget = ref();
const referenceValue = ref();
const lastYearActualUsage = ref();
const count = ref();
const getChartData = () => {
fetch(carbonPlanning.detailedStatisticalDataChart, queryParams.value).then((res) => {
console.log(res);
XData.value = res.data.yearMonth;
actualUsageList.value = res.data.actualUsageList;
lastYearActualUsageList.value = res.data.lastYearActualUsageList;
budgetList.value = res.data.budgetList;
referenceValueList.value = res.data.referenceValueList;
actualUsage.value = res.data.actualUsage;
budget.value = res.data.budget;
referenceValue.value = res.data.referenceValue;
lastYearActualUsage.value = res.data.lastYearActualUsage;
count.value = res.data.count;
chart();
});
};
getChartData();
const chart = () => { const chart = () => {
chartInstance = echarts.init(chartRef.value); chartInstance = echarts.init(chartRef.value);
const option = { const option = {
@ -278,7 +375,12 @@
bottom: '10%', bottom: '10%',
}, },
legend: { legend: {
data: ['昨日总人数', '今日实时人数', '昨日使用率', '今日使用率'], data: [
Number(props.year) - 1 + '年实际用量',
props.year + '年实际用量',
props.year + '年预算',
'基准值',
],
top: '0', top: '0',
left: '0', left: '0',
textStyle: { textStyle: {
@ -289,7 +391,7 @@
itemHeight: 10, // itemHeight: 10, //
}, },
xAxis: { xAxis: {
data: ['2020', '2021', '2022', '2023', '2024'], data: XData.value,
axisLine: { axisLine: {
show: true, //X线 show: true, //X线
lineStyle: { lineStyle: {
@ -337,7 +439,7 @@
], ],
series: [ series: [
{ {
name: '昨日总人数', name: Number(props.year) - 1 + '年实际用量',
type: 'bar', type: 'bar',
barWidth: 18, barWidth: 18,
itemStyle: { itemStyle: {
@ -345,10 +447,10 @@
color: '#6395f9', color: '#6395f9',
}, },
}, },
data: [24, 45, 43, 35, 76], data: lastYearActualUsageList.value,
}, },
{ {
name: '今日实时人数', name: props.year + '年实际用量',
type: 'bar', type: 'bar',
barWidth: 18, barWidth: 18,
itemStyle: { itemStyle: {
@ -356,10 +458,10 @@
color: '#62daab', color: '#62daab',
}, },
}, },
data: [133, 23, 114, 67, 89], data: actualUsageList.value,
}, },
{ {
name: '昨日使用率', name: props.year + '年预算',
type: 'line', type: 'line',
smooth: true, // 线 smooth: true, // 线
symbol: 'none', // symbol: 'none', //
@ -367,10 +469,10 @@
color: '#f4664a', color: '#f4664a',
width: 2, width: 2,
}, },
data: [4.2, 3.5, 2.9, 7.8, 2], data: budgetList.value,
}, },
{ {
name: '今日使用率', name: '基准值',
type: 'line', type: 'line',
smooth: true, // 线 smooth: true, // 线
symbol: 'none', // symbol: 'none', //
@ -378,16 +480,13 @@
color: '#f4664a', color: '#f4664a',
width: 2, width: 2,
}, },
data: [4, 6, 9, 8, 5], data: referenceValueList.value,
}, },
], ],
}; };
chartInstance = echarts.init(chartRef.value); chartInstance = echarts.init(chartRef.value);
chartInstance.setOption(option); chartInstance.setOption(option);
}; };
setTimeout(() => {
chart();
}, 500);
// / // /
const showPart = ref(true); const showPart = ref(true);
const hideTopPart = () => { const hideTopPart = () => {
@ -395,6 +494,7 @@
}; };
const showTopPart = () => { const showTopPart = () => {
showPart.value = true; showPart.value = true;
getChartData();
}; };
</script> </script>

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

@ -48,13 +48,28 @@
</div> </div>
</div> </div>
<div class="totalContant" v-else> <div class="totalContant" v-else>
<categoryDeatil @change-data="updateData" :parentId="parentId" /> <categoryDeatil @change-data="updateData" :parentId="parentId" :year="year" :type="type" :nodeName="nodeName" />
</div> </div>
<!-- 新增节点 --> <!-- 新增节点 -->
<a-drawer :visible="visible" :width="500" @close="onClose" :footer-style="{ textAlign: 'right' }"> <a-drawer :visible="visible" :width="500" @close="onClose" :footer-style="{ textAlign: 'right' }">
<p>Some contents...</p> <a-tree
<p>Some contents...</p> :expanded-keys="expandedKeys"
<p>Some contents...</p> :selectedKeys="selectedKeys"
:checkedKeys="treeCheckedKeys"
:tree-data="treeData"
v-if="treeData && treeData.length > 0"
class="draggable-tree"
@check="checkTreeNode"
checkable
block-node>
<template #title="data">
<div class="treeRow">
<div>
<span>{{ data.pointName }}</span>
</div>
</div>
</template>
</a-tree>
<template #footer> <template #footer>
<a-button style="margin-right: 8px" @click="onClose">取消</a-button> <a-button style="margin-right: 8px" @click="onClose">取消</a-button>
<a-button type="primary" @click="onSubmit">确定</a-button> <a-button type="primary" @click="onSubmit">确定</a-button>
@ -68,7 +83,9 @@
import * as echarts from 'echarts'; import * as echarts from 'echarts';
import { http } from '/nerv-lib/util/http'; import { http } from '/nerv-lib/util/http';
import categoryDeatil from './categoryDeatil.vue'; import categoryDeatil from './categoryDeatil.vue';
import { group } from '/@/api/deviceManage';
import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary'; import { carbonPlanning } from '/@/api/carbonEmissionFactorLibrary';
import type { TreeProps } from 'ant-design-vue';
import 'echarts-liquidfill'; import 'echarts-liquidfill';
defineOptions({ defineOptions({
energyType: 'all', // name energyType: 'all', // name
@ -78,6 +95,9 @@
tabId: { tabId: {
type: Number, type: Number,
}, },
energyType: {
type: String,
},
}); });
console.log(props, 'xxy'); console.log(props, 'xxy');
@ -88,7 +108,7 @@
return http.post(api, params); return http.post(api, params);
}; };
const selectYearValue = ref<Dayjs>(dayjs(new Date().getFullYear().toString())); const selectYearValue = ref<Dayjs>(dayjs(new Date().getFullYear().toString()));
const selectMonthValue = ref<Dayjs>(); const selectMonthValue = ref<Dayjs>(dayjs().startOf('year').month(0));
const electricTotal = ref(true); const electricTotal = ref(true);
// / // /
const monthStyles = ref('background: #f2f2f2'); const monthStyles = ref('background: #f2f2f2');
@ -98,7 +118,7 @@
monthStyles.value = 'background: #2778ff'; monthStyles.value = 'background: #2778ff';
yearStyles.value = 'background: #f2f2f2'; yearStyles.value = 'background: #f2f2f2';
columns.value[2].title = '月份'; columns.value[2].title = '月份';
columns.value[2].dataIndex = 'month'; columns.value[2].dataIndex = 'yearMonth';
selectedTime.value = false; selectedTime.value = false;
getMonthData(); getMonthData();
getBallQuery.value.yearAndMonth = 'month'; getBallQuery.value.yearAndMonth = 'month';
@ -277,7 +297,7 @@
let ballChartInstance: echarts.ECharts | null = null; let ballChartInstance: echarts.ECharts | null = null;
const drawSQ = () => { const drawSQ = () => {
ballChartInstance = echarts.init(ballChartRef.value); ballChartInstance = echarts.init(ballChartRef.value);
let ballData = (Number(ballValue.value)/100).toFixed(2) let ballData = (Number(ballValue.value) / 100).toFixed(2);
const option = { const option = {
series: [ series: [
{ {
@ -322,8 +342,48 @@
}; };
// //
const visible = ref(false); const visible = ref(false);
const getTreeData = ref({
orgId: orgId.value,
energyType: props.energyType,
});
const addNode = () => { const addNode = () => {
visible.value = true; visible.value = true;
fetch(group.queryDeviceGroupTree, getTreeData.value).then((res) => {
treeData.value = res.data;
// key
treeData.value = formatTreeData(treeData.value);
});
};
const genData: TreeProps['treeData'] = [];
const treeData = ref<TreeProps['treeData']>(genData);
const expandedKeys = ref<string[]>();
const selectedKeys = ref<string[]>([]);
const treeCheckedKeys = ref<string[]>([]);
const checkTreeNode = (checkedKeys, info) => {
treeCheckedKeys.value = checkedKeys;
addTreeNode.value.itemizeIds = treeCheckedKeys.value;
};
const formatTreeData = (treeData) => {
return treeData.map((node) => {
const newNode = { ...node };
newNode.key = String(node.id); // id key
if (node.children) {
newNode.children = formatTreeData(node.children);
}
return newNode;
});
};
const addTreeNode = ref({
orgId: orgId.value,
type: props.tabId,
year: selectYearValue.value.format('YYYY'),
});
const onSubmit = () => {
fetch(carbonPlanning.addNodes, addTreeNode.value).then((res) => {
data.value = res.data;
visible.value = false;
changeToYear();
});
}; };
const onClose = () => { const onClose = () => {
visible.value = false; visible.value = false;
@ -379,18 +439,24 @@
}); });
const changeYear = () => { const changeYear = () => {
yearQueryParams.value.year = selectYearValue.value; yearQueryParams.value.year = selectYearValue.value;
year.value = selectYearValue.value;
addTreeNode.value.year = selectYearValue.value;
getYearData(); getYearData();
}; };
const getYearData = () => { const getYearData = () => {
fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then((res) => { fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then((res) => {
data.value = res.data; data.value = res.data;
res.data.forEach((item) => {
treeCheckedKeys.value.push((item.itemizeId).toString());
});
}); });
}; };
// //
const monthQueryParams = ref({ const monthQueryParams = ref({
orgId: orgId.value, orgId: orgId.value,
type: props.tabId, type: props.tabId,
yearMonth: selectYearValue.value.format('YYYY'), year: selectYearValue.value.format('YYYY'),
yearMonth: selectMonthValue.value.format('YYYY-DD'),
}); });
const changeMonth = () => { const changeMonth = () => {
monthQueryParams.value.yearMonth = selectMonthValue.value; monthQueryParams.value.yearMonth = selectMonthValue.value;
@ -402,18 +468,23 @@
}); });
}; };
defineExpose({ defineExpose({
getYearData, changeToYear,
getBallData, electricTotal,
getYearPillarData,
}); });
const parentId = ref(); const parentId = ref();
const year = ref(selectYearValue.value.format('YYYY'));
const type = ref();
const nodeName = ref();
const detailData = (record) => { const detailData = (record) => {
electricTotal.value = false; electricTotal.value = false;
parentId.value = record.id; parentId.value = record.itemizeId;
type.value = props.tabId;
nodeName.value = record.itemizeName;
}; };
// //
const updateData = (type) => { const updateData = (type) => {
electricTotal.value = type; electricTotal.value = type;
changeToYear();
}; };
</script> </script>

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

@ -4,19 +4,19 @@
<all ref="allRef" /> <all ref="allRef" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="用电量"> <a-tab-pane key="2" tab="用电量">
<category ref="electricRef" :tabId="tabId" /> <category ref="electricRef" :tabId="tabId" :energyType="energyType" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="3" tab="用水量"> <a-tab-pane key="3" tab="用水量">
<category ref="useWaterRef" /> <category ref="useWaterRef" :tabId="tabId" :energyType="energyType" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="4" tab="供水量"> <a-tab-pane key="4" tab="供水量">
<category ref="provideWaterRef" /> <category ref="provideWaterRef" :tabId="tabId" :energyType="energyType" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="5" tab="碳排"> <a-tab-pane key="5" tab="碳排">
<category ref="carbonEmissionsRef" /> <category ref="carbonEmissionsRef" :tabId="tabId" :energyType="energyType" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="6" tab="供热量"> <a-tab-pane key="6" tab="供热量">
<category ref="provideHotRef" /> <category ref="provideHotRef" :tabId="tabId" :energyType="energyType" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</template> </template>
@ -40,6 +40,7 @@
const provideHotRef = ref<InstanceType<typeof category> | null>(null); const provideHotRef = ref<InstanceType<typeof category> | null>(null);
// tab // tab
const tabId = ref(1); const tabId = ref(1);
const energyType = ref();
const handleTabChange = (key) => { const handleTabChange = (key) => {
console.log('Tab changed:', key); console.log('Tab changed:', key);
// //
@ -50,30 +51,50 @@
} }
}); });
} else if (key === '2') { } else if (key === '2') {
tabId.value = 1;
energyType.value = 'ELECTRICITY_USAGE'
nextTick(() => { nextTick(() => {
if (electricRef.value) { if (electricRef.value) {
tabId.value = 1; electricRef.value.electricTotal = true
electricRef.value.getYearData(); // electricRef.value.changeToYear(); //
electricRef.value.getBallData();
electricRef.value.getYearPillarData();
} }
}); });
} else if (key === '3') { } else if (key === '3') {
if (useWaterRef.value) { tabId.value = 2;
useWaterRef.value.getYearData(); energyType.value = 'WATER_USAGE'
} nextTick(() => {
if (useWaterRef.value) {
useWaterRef.value.electricTotal = true
useWaterRef.value.changeToYear(); //
}
});
} else if (key === '4') { } else if (key === '4') {
if (provideWaterRef.value) { tabId.value = 3;
provideWaterRef.value.getYearData(); energyType.value = 'gongshuiliang'
} nextTick(() => {
if (provideWaterRef.value) {
provideWaterRef.value.electricTotal = true
provideWaterRef.value.changeToYear(); //
}
});
} else if (key === '5') { } else if (key === '5') {
if (carbonEmissionsRef.value) { tabId.value = 4;
carbonEmissionsRef.value.getYearData(); energyType.value = 'CARBON_EMISSIONS'
} nextTick(() => {
if (carbonEmissionsRef.value) {
carbonEmissionsRef.value.electricTotal = true
carbonEmissionsRef.value.changeToYear(); //
}
});
} else if (key === '6') { } else if (key === '6') {
if (provideHotRef.value) { tabId.value = 5;
provideHotRef.value.getYearData(); energyType.value = 'HEAT_SUPPLY'
} nextTick(() => {
if (provideHotRef.value) {
provideHotRef.value.electricTotal = true
provideHotRef.value.changeToYear(); //
}
});
} }
}; };
</script> </script>

1
hx-ai-intelligent/src/view/equipmentManage/group/index.vue

@ -120,6 +120,7 @@
modalFormRef.value?.toggle(); modalFormRef.value?.toggle();
}; };
const moveNode = (data, type: opType) => { const moveNode = (data, type: opType) => {
debugger
const flag = type === 'up'; const flag = type === 'up';
http.post(group.move, { ...data, isUp: flag }).then(() => { http.post(group.move, { ...data, isUp: flag }).then(() => {
treeRef.value?.treeReload(); treeRef.value?.treeReload();

Loading…
Cancel
Save