监控看板功能优化、优化并修改bug

1、监控看板功能优化
2、修改列表展示条数
3、优化并修改bug
This commit is contained in:
康冉冉
2025-11-19 18:52:05 +08:00
parent f8864457e1
commit 550bcc4685
14 changed files with 341 additions and 187 deletions
+43
View File
@@ -191,9 +191,27 @@
show: true,
},
},
// 配置高亮状态下的样式
emphasis: dataXY && dataXY.highlight ? {
itemStyle: {
borderWidth: 2, // 边框加粗
shadowBlur: 5, // 添加阴影光晕
},
label: {
show: false, // 高亮时显示标签
}
} : {},
series: series
};
lineDataListIntance.setOption(option);
if (dataXY && dataXY.highlight) {
// 然后高亮当前点击的数据点
lineDataListIntance.dispatchAction({
type: 'highlight', // 高亮类型
seriesIndex: 0, // 系列索引,从点击事件参数中获取
dataIndex: 0 // 数据索引,从点击事件参数中获取
});
}
if (dataXY && dataXY.unitSelList && dataXY.unitSelList.length > 0) {
// 初始化图表后,调用方法定位下拉框
this.positionYAxisSelector(lineDataListIntance);
@@ -207,6 +225,31 @@
lineDataListIntance.off('click');
lineDataListIntance.on("click", function(params) {
that.$emit("chartClickModel", {params: params});
if (dataXY && dataXY.highlight) {
// 首先取消之前可能存在的高亮状态
lineDataListIntance.dispatchAction({
type: 'downplay' // 取消所有数据点的高亮
});
// 然后高亮当前点击的数据点
setTimeout(() => {
lineDataListIntance.dispatchAction({
type: 'highlight', // 高亮类型
seriesIndex: params.seriesIndex, // 系列索引,从点击事件参数中获取
dataIndex: params.dataIndex // 数据索引,从点击事件参数中获取
});
},1000);
}
});
// 2. 关键:拦截默认的鼠标移出事件,不做任何操作(即不取消高亮)
lineDataListIntance.on('mouseover', (params) => {
// 这个函数体为空,或者只包含一些不涉及downplay的逻辑
// 这样就阻止了鼠标移出时高亮自动消失
});
// 2. 关键:拦截默认的鼠标移出事件,不做任何操作(即不取消高亮)
lineDataListIntance.on('mouseout', (params) => {
// 这个函数体为空,或者只包含一些不涉及downplay的逻辑
// 这样就阻止了鼠标移出时高亮自动消失
});
},
positionYAxisSelector(chartInstance) {