|
@@ -66,8 +66,8 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
|
|
const [curElecUsed, setCurElecUsed] = useState(0); // 当前月实际用电量
|
|
const [curElecUsed, setCurElecUsed] = useState(0); // 当前月实际用电量
|
|
|
|
|
|
const defaultTime = {
|
|
const defaultTime = {
|
|
- s_time: `${dayjs().format('YYYY')}-${dayjs().startOf('year').format('MM')}`,
|
|
|
|
- e_time: `${dayjs().format('YYYY')}-${dayjs().endOf('year').format('MM')}`,
|
|
|
|
|
|
+ s_time: dayjs().subtract(1, 'years').format('YYYY-MM'),
|
|
|
|
+ e_time: dayjs().format('YYYY-MM'),
|
|
};
|
|
};
|
|
|
|
|
|
const defaultParams = {
|
|
const defaultParams = {
|
|
@@ -167,11 +167,11 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
|
|
),
|
|
),
|
|
].sort();
|
|
].sort();
|
|
|
|
|
|
- let year = `${dayjs(elecPerCost.xData[0]).year()}`;
|
|
|
|
- elecPerCost.xData = [];
|
|
|
|
- for (let index = 0; index < 12; index++) {
|
|
|
|
- elecPerCost.xData.push(`${year}-${dayjs().month(index).format('MM')}`);
|
|
|
|
- }
|
|
|
|
|
|
+ // let year = `${dayjs(elecPerCost.xData[0]).year()}`;
|
|
|
|
+ // elecPerCost.xData = [];
|
|
|
|
+ // for (let index = 0; index < 12; index++) {
|
|
|
|
+ // elecPerCost.xData.push(`${year}-${dayjs().month(index).format('MM')}`);
|
|
|
|
+ // }
|
|
|
|
|
|
// 确定保留的小数点
|
|
// 确定保留的小数点
|
|
const elecPerCostValue = [...planElecPerCost, ...actualElecPerCost]
|
|
const elecPerCostValue = [...planElecPerCost, ...actualElecPerCost]
|
|
@@ -216,11 +216,11 @@ export const EnergyCost = ({ open, detailClick, showTip }) => {
|
|
),
|
|
),
|
|
].sort();
|
|
].sort();
|
|
|
|
|
|
- year = `${dayjs(elecUsed.xData[0]).year()}`;
|
|
|
|
- elecUsed.xData = [];
|
|
|
|
- for (let index = 0; index < 12; index++) {
|
|
|
|
- elecUsed.xData.push(`${year}-${dayjs().month(index).format('MM')}`);
|
|
|
|
- }
|
|
|
|
|
|
+ // let year = `${dayjs(elecUsed.xData[0]).year()}`;
|
|
|
|
+ // elecUsed.xData = [];
|
|
|
|
+ // for (let index = 0; index < 12; index++) {
|
|
|
|
+ // elecUsed.xData.push(`${year}-${dayjs().month(index).format('MM')}`);
|
|
|
|
+ // }
|
|
|
|
|
|
// 确定保留的小数点
|
|
// 确定保留的小数点
|
|
const elecUsedMaxValue = [...planElecUsed, ...actualElecUsed]
|
|
const elecUsedMaxValue = [...planElecUsed, ...actualElecUsed]
|