2.PCS最高温度修复bug展示多PCS设备的数据 3.PCS的状态根据状态枚举映射配置的内容显示 4.BMS的总览,增加工作状态、与PCS通讯、与EMS通讯的配置,及关联展示 5.增加批量导入单体电池点位的功能 6.修复计算点可能会出现id与code在一个池子内的问题,再次计算后数据正常 7.计算点增加小数位限制的功能,实时计算与7天历史接口都已经按照配置的小数位进行限制 8.统计报表中的功率曲线改为了按照分钟显示 9.功率曲线出现断点的问题是因为数据计算太密集了导致的,增加了前端连线不断的显示 10.PCS和电池堆的曲线与配置增加了关联设备显示 11.点位映射中的电池温度,增加了多设备 12.收益报表增加升序排列,合并当月所有合计 13.增加业务报表备注功能,可以根据业务设计开发,目前电表报表与收益报表均有备注列可以修改
143 lines
3.5 KiB
Vue
143 lines
3.5 KiB
Vue
<template>
|
|
<el-card
|
|
shadow="always"
|
|
class="common-card-container common-card-container-body-no-padding"
|
|
>
|
|
<div slot="header">
|
|
<span class="card-title">电池平均温度</span>
|
|
</div>
|
|
<div ref="chartRef" style="height: 360px" />
|
|
</el-card>
|
|
</template>
|
|
|
|
<style scoped lang="scss"></style>
|
|
<script>
|
|
import * as echarts from "echarts";
|
|
import resize from "@/mixins/ems/resize";
|
|
import { getPointConfigCurve } from "@/api/ems/site";
|
|
|
|
export default {
|
|
mixins: [resize],
|
|
props: {
|
|
displayData: {
|
|
type: Array,
|
|
default: () => []
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
chart: null,
|
|
};
|
|
},
|
|
mounted() {
|
|
this.chart = echarts.init(this.$refs.chartRef);
|
|
},
|
|
beforeDestroy() {
|
|
if (!this.chart) {
|
|
return;
|
|
}
|
|
this.chart.dispose();
|
|
this.chart = null;
|
|
},
|
|
methods: {
|
|
init(siteId,timeRange) {
|
|
const [startTime='', endTime=''] = timeRange;
|
|
const query = {
|
|
siteId,
|
|
rangeType: "custom",
|
|
startTime: this.normalizeDateTime(startTime, false),
|
|
endTime: this.normalizeDateTime(endTime, true)
|
|
};
|
|
const rows = (this.displayData || []).filter(
|
|
(item) =>
|
|
item &&
|
|
item.fieldCode === "SBJK_SSYX__curveBatteryAveTemp" &&
|
|
item.useFixedDisplay !== 1 &&
|
|
item.dataPoint
|
|
);
|
|
const tasks = rows.map((row) => {
|
|
const pointId = String(row.dataPoint || "").trim();
|
|
if(!pointId) return Promise.resolve(null);
|
|
return getPointConfigCurve({
|
|
...query,
|
|
pointId
|
|
}).then((response) => {
|
|
const list = response?.data || [];
|
|
return {
|
|
name: (row.deviceName || "") + (row.fieldName || row.fieldCode || pointId),
|
|
data: list
|
|
.map((item) => [this.parseToTimestamp(item.dataTime), Number(item.pointValue)])
|
|
.filter((item) => item[0] && !Number.isNaN(item[1]))
|
|
};
|
|
}).catch(() => null);
|
|
});
|
|
Promise.all(tasks).then((series) => {
|
|
this.setOption((series || []).filter(Boolean));
|
|
});
|
|
},
|
|
normalizeDateTime(value, endOfDay) {
|
|
const raw = String(value || "").trim();
|
|
if (!raw) return "";
|
|
if (raw.includes(" ")) return raw;
|
|
return `${raw} ${endOfDay ? "23:59:59" : "00:00:00"}`;
|
|
},
|
|
parseToTimestamp(value) {
|
|
if (!value) return null;
|
|
const t = new Date(value).getTime();
|
|
return Number.isNaN(t) ? null : t;
|
|
},
|
|
setOption(seriesData = []) {
|
|
this.chart && this.chart.setOption({
|
|
legend: {
|
|
left: "center",
|
|
top: "5",
|
|
itemWidth: 10,
|
|
itemHeight: 5,
|
|
textStyle: {
|
|
fontSize: 9,
|
|
},
|
|
},
|
|
grid: {
|
|
containLabel: true,
|
|
},
|
|
tooltip: {
|
|
show:true,
|
|
trigger: "axis",
|
|
axisPointer: {
|
|
type: "cross",
|
|
}
|
|
},
|
|
textStyle: {
|
|
color: "#333333",
|
|
},
|
|
xAxis: { type: "time" },
|
|
yAxis: {
|
|
type: "value",
|
|
},
|
|
dataZoom: [
|
|
{
|
|
type: "inside",
|
|
start: 0,
|
|
end: 100,
|
|
},
|
|
{
|
|
start: 0,
|
|
end: 100,
|
|
},
|
|
],
|
|
series: seriesData.map(item => ({
|
|
type: "line",
|
|
name: item.name,
|
|
showSymbol: false,
|
|
smooth: true,
|
|
areaStyle: {
|
|
opacity: 0.35
|
|
},
|
|
data: item.data
|
|
})),
|
|
},true);
|
|
},
|
|
},
|
|
};
|
|
</script>
|