修改组态展示
This commit is contained in:
@@ -221,47 +221,45 @@ const init = async () => {
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.35)',
|
||||
borderWidth: 0,
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
},
|
||||
trigger: 'axis',
|
||||
textStyle: {
|
||||
color: '#fff',
|
||||
fontStyle: 'normal',
|
||||
opacity: 0.35,
|
||||
fontSize: 14
|
||||
},
|
||||
backgroundColor: 'rgba(0,0,0,0.35)',
|
||||
borderWidth: 0,
|
||||
axisPointer: {
|
||||
type: 'cross',
|
||||
crossStyle: {
|
||||
color: '#999'
|
||||
}
|
||||
},
|
||||
|
||||
formatter: function (params: any) {
|
||||
let list = params.filter((item, index, self) => {
|
||||
return index === self.findIndex(t => t.seriesName === item.seriesName)
|
||||
})
|
||||
var res =
|
||||
'<span style="margin-right:18px;"></span>' +
|
||||
list[0].value[0] +
|
||||
list[0].name +
|
||||
'<br/>'
|
||||
for (var i = 0, l = list.length; i < l; i++) {
|
||||
list[i].unit =
|
||||
echartsData.value.options.yAxis[
|
||||
echartsData.value.options.series[list[i].seriesIndex].yAxisIndex
|
||||
]?.name
|
||||
res +=
|
||||
list[i].seriesName +
|
||||
' ' +
|
||||
`<div style="width:16px;height:16px;float:left;background:${list[i].color};border-radius:50%;margin:0 15px"></div>` +
|
||||
`<div style='float:right;padding-left:20px;'>${list[
|
||||
i
|
||||
].value[1].toFixed(2)} ${list[i].unit||''} </div><br/>`
|
||||
formatter: function (params: any) {
|
||||
let list = params.filter((item, index, self) => {
|
||||
return index === self.findIndex(t => t.seriesName === item.seriesName)
|
||||
})
|
||||
var res =
|
||||
'<span style="margin-right:18px;"></span>' +
|
||||
list[0].value[0] +
|
||||
list[0].name +
|
||||
'<br/>'
|
||||
for (var i = 0, l = list.length; i < l; i++) {
|
||||
list[i].unit =
|
||||
echartsData.value.options.yAxis[
|
||||
echartsData.value.options.series[list[i].seriesIndex].yAxisIndex
|
||||
]?.name
|
||||
res +=
|
||||
list[i].seriesName +
|
||||
' ' +
|
||||
`<div style="width:16px;height:16px;float:left;background:${list[i].color};border-radius:50%;margin:0 15px"></div>` +
|
||||
`<div style='float:right;padding-left:20px;'>${list[i].value[1]==null?'':list[i].value[1].toFixed(2)} ${list[i].unit || ''} </div><br/>`
|
||||
}
|
||||
return res
|
||||
}
|
||||
return res
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
legend: {
|
||||
//legend使用iconfont图标
|
||||
@@ -278,15 +276,17 @@ const init = async () => {
|
||||
height: 50
|
||||
},
|
||||
|
||||
xAxis:{
|
||||
xAxis: {
|
||||
type: 'time',
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}',
|
||||
}
|
||||
},},
|
||||
axisLabel: {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}',
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
// [
|
||||
// {
|
||||
// type: 'category',
|
||||
@@ -318,7 +318,7 @@ const init = async () => {
|
||||
color: '#000',
|
||||
fontSize: 14
|
||||
},
|
||||
splitNumber:5,
|
||||
splitNumber: 5,
|
||||
minInterval: 1,
|
||||
axisTick: {
|
||||
show: true
|
||||
@@ -360,7 +360,7 @@ const init = async () => {
|
||||
color: '#000',
|
||||
fontSize: 14
|
||||
},
|
||||
splitNumber:5,
|
||||
splitNumber: 5,
|
||||
minInterval: 1,
|
||||
axisTick: {
|
||||
show: true
|
||||
@@ -408,7 +408,7 @@ const init = async () => {
|
||||
} else {
|
||||
vv.yAxisIndex = 0
|
||||
}
|
||||
|
||||
|
||||
|
||||
//series数据
|
||||
echartsData.value.options.series.push({
|
||||
@@ -424,7 +424,7 @@ const init = async () => {
|
||||
data: historyDataList.value
|
||||
.map((kk: any) => {
|
||||
if (kk.statisticalName == vv.name) {
|
||||
|
||||
|
||||
return [kk.time, kk.statisticalData]
|
||||
} else {
|
||||
return ''
|
||||
@@ -677,7 +677,7 @@ watch(
|
||||
// immediate: true
|
||||
// }
|
||||
// )
|
||||
onMounted(() => {
|
||||
onMounted(() => {
|
||||
datePickerRef.value.setInterval(5)
|
||||
})
|
||||
defineExpose({ getTrendRequest })
|
||||
|
||||
Reference in New Issue
Block a user