zhaohy 2 months ago
parent
commit
f4d7076a08
  1. 21
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonAssets/carbonAssetsDetail/index.vue
  2. 14
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonEmissionFactorLibrary/index.vue
  3. 12
      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. 13
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonInventoryCheck/index.vue
  7. 5
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/all/index.vue
  8. 7
      hx-ai-intelligent/src/view/carbonEmissionManage/carbonPlanning/category/categoryDeatil.vue
  9. 6
      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;

14
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: '取消',

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

@ -7,10 +7,14 @@
: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 }">
@ -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();
});
}

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

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

@ -52,6 +52,7 @@
</div>
</div>
</div>
<a-spin :spinning="spinning">
<div class="contant">
<div class="chartsPart">
<template v-for="(item, index) in data" :key="index">
@ -70,6 +71,7 @@
</a-table>
</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);
});
};

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

@ -8,6 +8,7 @@
<a-button type="primary" @click="changeParentData">返回</a-button>
</div>
</div>
<a-spin :spinning="spinning">
<div class="contant">
<a-card class="chartsPart" v-if="showPart">
<div class="chart" ref="chartRef"></div>
@ -124,6 +125,7 @@
</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 = {

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

@ -38,6 +38,7 @@
</div>
</div>
</div>
<a-spin :spinning="spinning">
<div class="contant">
<div class="chartsPart">
<div class="ballChart" ref="ballChartRef"></div>
@ -62,6 +63,7 @@
</a-table>
</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