2025-11-20紧急优化内容
This commit is contained in:
@ -14,7 +14,6 @@
|
||||
<script>
|
||||
import * as echarts from "echarts";
|
||||
import resize from "@/mixins/ems/resize";
|
||||
import { formatDate } from "@/filters/ems";
|
||||
import { pcsMaxTemp } from "@/api/ems/dzjk";
|
||||
|
||||
export default {
|
||||
@ -37,8 +36,6 @@ export default {
|
||||
methods: {
|
||||
init(siteId,timeRange) {
|
||||
this.chart.showLoading();
|
||||
const x = [];
|
||||
const data = [];
|
||||
const [startTime='', endTime=''] = timeRange;
|
||||
pcsMaxTemp(siteId,startTime,endTime)
|
||||
.then((response) => {
|
||||
@ -61,7 +58,12 @@ export default {
|
||||
areaStyle: {
|
||||
// color:'#FFBD00'
|
||||
},
|
||||
data: (element.maxTempVoList || []).map((i) => i.temp),
|
||||
data: (element.maxTempVoList || []).map((i) => {
|
||||
return {
|
||||
value: i.temp,
|
||||
year: i.dateDay
|
||||
}
|
||||
}),
|
||||
});
|
||||
});
|
||||
this.chart.setOption({
|
||||
@ -78,11 +80,24 @@ export default {
|
||||
containLabel: true,
|
||||
},
|
||||
tooltip: {
|
||||
show:true,
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
formatter :(params)=>{
|
||||
if(params.length <= 0) return
|
||||
let result = (params[0].data.year || '')+ params[0].name + '<div>'
|
||||
params.forEach(item=>{
|
||||
const {color,seriesName,value} = item
|
||||
result += `<div style="position: relative;padding-left:20px;line-height: 20px;">
|
||||
<div style="position: absolute;top:50%;left:0;width:12px;height:12px;border-radius:100%;background: ${color};transform: translateY(-50%)"></div>
|
||||
<span>${seriesName}</span><span style="margin-left:20px;font-weight: 700">${value}</span></div>`
|
||||
})
|
||||
result+='</div>'
|
||||
return result
|
||||
}
|
||||
},
|
||||
textStyle: {
|
||||
color: "#333333",
|
||||
|
||||
Reference in New Issue
Block a user