修改bug,优化页面UI
This commit is contained in:
@@ -41,7 +41,7 @@
|
||||
<div class="quantityTitle">基准值</div>
|
||||
</div>
|
||||
<div class="model">
|
||||
<div class="quantity">
|
||||
<div class="quantity" style="align-items: center; display: flex">
|
||||
<img
|
||||
width="20px"
|
||||
height="28px"
|
||||
@@ -278,8 +278,12 @@
|
||||
.validate()
|
||||
.then(() => {
|
||||
console.log('values', formState, toRaw(formState));
|
||||
if (formState.value.ids[0] === undefined) {
|
||||
if (formState.value.ids === undefined) {
|
||||
formState.value.ids = ids.value;
|
||||
} else {
|
||||
if (formState.value.ids[0] === undefined) {
|
||||
formState.value.ids = ids.value;
|
||||
}
|
||||
}
|
||||
fetch(carbonPlanning.batchOrUpdate, formState.value).then((res) => {
|
||||
open.value = false;
|
||||
@@ -314,7 +318,11 @@
|
||||
];
|
||||
const newTableData = ref([]);
|
||||
const setBasicData = () => {
|
||||
fetch(carbonPlanning.benchmarkSetting, { orgId: orgId.value }).then((res) => {
|
||||
fetch(carbonPlanning.benchmarkSetting, {
|
||||
orgId: orgId.value,
|
||||
type: props.type,
|
||||
itemizeId: props.parentId,
|
||||
}).then((res) => {
|
||||
newTableData.value = res.data;
|
||||
});
|
||||
visible.value = true;
|
||||
|
@@ -8,6 +8,7 @@
|
||||
v-if="selectedTime"
|
||||
style="margin-left: 5%"
|
||||
v-model:value="selectYearValue"
|
||||
:disabled-date="disabledDate"
|
||||
valueFormat="YYYY"
|
||||
@change="changeYear"
|
||||
picker="year" />
|
||||
@@ -35,6 +36,9 @@
|
||||
:data-source="data"
|
||||
bordered
|
||||
:pagination="false"
|
||||
row-key="itemizeId"
|
||||
:onRow="onRow"
|
||||
:customRow="customRow"
|
||||
:scroll="{ x: 1300, y: 250 }">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
@@ -115,6 +119,10 @@
|
||||
const selectYearValue = ref<Dayjs>(dayjs(new Date().getFullYear().toString()));
|
||||
const selectMonthValue = ref<Dayjs>(dayjs().startOf('year').month(0));
|
||||
const electricTotal = ref(true);
|
||||
const disabledDate = (current: any) => {
|
||||
return current && current.year() > new Date().getFullYear();
|
||||
};
|
||||
|
||||
// 年/月切换
|
||||
const monthStyles = ref('background: #f2f2f2');
|
||||
const yearStyles = ref('background: #2778ff');
|
||||
@@ -127,7 +135,6 @@
|
||||
selectedTime.value = false;
|
||||
getMonthData();
|
||||
getBallQuery.value.yearAndMonth = 'month';
|
||||
getBallData();
|
||||
getMonthPillarData();
|
||||
};
|
||||
const changeToYear = () => {
|
||||
@@ -138,7 +145,6 @@
|
||||
selectedTime.value = true;
|
||||
getYearData();
|
||||
getBallQuery.value.yearAndMonth = 'year';
|
||||
getBallData();
|
||||
getYearPillarData();
|
||||
};
|
||||
// echarts图
|
||||
@@ -148,6 +154,7 @@
|
||||
orgId: orgId.value,
|
||||
type: props.tabId,
|
||||
year: selectYearValue.value.format('YYYY'),
|
||||
selectedMonth: selectMonthValue.value.format('YYYY-DD'),
|
||||
});
|
||||
const xAxisData = ref([]);
|
||||
const referenceValue = ref([]);
|
||||
@@ -160,6 +167,8 @@
|
||||
budget.value = res.data.budget;
|
||||
actualUsage.value = res.data.actualUsage;
|
||||
drawPillarChart();
|
||||
getBallQuery.value.selectActualUsage = res.data.selectActualUsage;
|
||||
getBallData();
|
||||
});
|
||||
};
|
||||
const getMonthPillarData = () => {
|
||||
@@ -169,6 +178,8 @@
|
||||
budget.value = res.data.budget;
|
||||
actualUsage.value = res.data.actualUsage;
|
||||
drawPillarChart();
|
||||
getBallQuery.value.selectActualUsage = res.data.selectActualUsage;
|
||||
getBallData();
|
||||
});
|
||||
};
|
||||
const drawPillarChart = () => {
|
||||
@@ -445,9 +456,11 @@
|
||||
});
|
||||
const changeYear = () => {
|
||||
yearQueryParams.value.year = selectYearValue.value;
|
||||
year.value = selectYearValue.value;
|
||||
getPillarQuery.value.year = selectYearValue.value;
|
||||
getBallQuery.value.year = selectYearValue.value;
|
||||
addTreeNode.value.year = selectYearValue.value;
|
||||
getYearData();
|
||||
getYearPillarData();
|
||||
};
|
||||
const getYearData = () => {
|
||||
fetch(carbonPlanning.searchListByYear, yearQueryParams.value).then((res) => {
|
||||
@@ -466,9 +479,10 @@
|
||||
});
|
||||
const changeMonth = () => {
|
||||
monthQueryParams.value.yearMonth = selectMonthValue.value;
|
||||
getPillarQuery.value.selectedMonth = selectMonthValue.value;
|
||||
getBallQuery.value.yearMonth = selectMonthValue.value;
|
||||
getMonthData();
|
||||
getBallData();
|
||||
getMonthPillarData();
|
||||
};
|
||||
const getMonthData = () => {
|
||||
fetch(carbonPlanning.searchListByMonth, monthQueryParams.value).then((res) => {
|
||||
@@ -489,6 +503,21 @@
|
||||
type.value = props.tabId;
|
||||
nodeName.value = record.itemizeName;
|
||||
};
|
||||
const customRow = (record) => {
|
||||
return {
|
||||
//点击 行 进行查看详情
|
||||
onClick: (event) => {
|
||||
getPillarQuery.value.itemizeId = record.itemizeId;
|
||||
getBallQuery.value.itemizeId = record.itemizeId;
|
||||
if (selectedTime.value) {
|
||||
getYearPillarData();
|
||||
} else {
|
||||
getMonthPillarData();
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
// 子页面点击返回
|
||||
const updateData = (type) => {
|
||||
electricTotal.value = type;
|
||||
|
@@ -78,7 +78,7 @@
|
||||
}
|
||||
});
|
||||
} else if (key === '5') {
|
||||
tabId.value = 4;
|
||||
tabId.value = 5;
|
||||
energyType.value = 'CARBON_EMISSIONS'
|
||||
nextTick(() => {
|
||||
if (carbonEmissionsRef.value) {
|
||||
@@ -87,7 +87,7 @@
|
||||
}
|
||||
});
|
||||
} else if (key === '6') {
|
||||
tabId.value = 5;
|
||||
tabId.value = 4;
|
||||
energyType.value = 'HEAT_SUPPLY'
|
||||
nextTick(() => {
|
||||
if (provideHotRef.value) {
|
||||
|
Reference in New Issue
Block a user