桥梁节点边闪烁问题解决

This commit is contained in:
duanhao 2025-08-08 10:06:53 +08:00
parent 4e2a986115
commit ee2cb53385
6 changed files with 130 additions and 23 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 B

After

Width:  |  Height:  |  Size: 495 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 470 B

View File

@ -6,7 +6,7 @@
<div class="group-item-title">
<img
class="group-item-title-icon"
src="@/assets/images/abnormalGroup/abnormal-group-item-title.png"
src="@/assets/images/abnormalGroup/abnormal-user-group-item-title.png"
alt=""
/>
<div class="group-item-title-type">{{ group.type }}</div>
@ -68,7 +68,7 @@ const props = defineProps({
.groupPanel-list {
width: 100%;
height: 470px;
padding: 20px 20px;
padding: 0px 20px;
overflow: auto;
&::-webkit-scrollbar {
width: 3px; /* 垂直滚动条宽度 */
@ -83,6 +83,7 @@ const props = defineProps({
}
.group-item {
width: 100%;
padding-top: 20px;
padding-bottom: 20px;
border-bottom: 0.5px solid rgba(0, 113, 188, 0.5);
.group-item-title {

View File

@ -321,8 +321,8 @@ onBeforeUnmount(() => {
position: relative;
.title-text {
position: absolute;
top: 0;
left: 0;
top: 2px;
left: 12px;
color: #8efbff;
font-family: PingFang SC;
font-weight: 400;

View File

@ -93,7 +93,7 @@ const processData = async() => {
id: bridgeNodeId,
category: 0,
symbol: bridgeNodeImg ? `image://${bridgeNodeImg}` : 'circle',
symbolSize: 100,
symbolSize: 150,
originalId: bridgeId // ID
});
addedBridgeNodes.add(bridgeId);
@ -169,11 +169,12 @@ const initChart = async() => {
chartInstance = echarts.init(chartDom);
const SERIES_INDEX = 0;
//
chartInstance.on('mouseover', function(params) {
if (!params.data) return;
const isBridgeNode = params.data.category === 0;
const isCommunityNode = params.data.category === 1;
/* const isBridgeNode = params.data.category === 0;
if (isBridgeNode) {
//
@ -181,6 +182,28 @@ const initChart = async() => {
//
activeNodeId.value = nodeId;
updateNodeImage(nodeId, true);
} */
if (params.dataType === 'node') {
//
chartInstance.dispatchAction({
type: 'focusNodeAdjacency',
seriesIndex: SERIES_INDEX,
dataIndex: params.dataIndex
});
//
const isBridgeNode = params.data.category === 0;
if (isBridgeNode) {
const nodeId = params.data.originalId;
activeNodeId.value = nodeId;
updateNodeImage(nodeId, true);
}
} else if (params.dataType === 'edge') {
//
chartInstance.dispatchAction({ type: 'unfocusNodeAdjacency', seriesIndex: SERIES_INDEX });
chartInstance.dispatchAction({ type: 'downplay', seriesIndex: SERIES_INDEX });
// tooltip formatter
}
});
@ -188,9 +211,7 @@ const initChart = async() => {
//
chartInstance.on('mouseout', function(params) {
if (!params.data) return;
const isBridgeNode = params.data.category === 0;
const isCommunityNode = params.data.category === 1;
/* const isBridgeNode = params.data.category === 0;
if (isBridgeNode) {
//
const nodeId = params.data.originalId;
@ -198,6 +219,29 @@ const initChart = async() => {
activeNodeId.value = null;
updateNodeImage(nodeId, false);
}
} */
if (params.dataType === 'node') {
//
chartInstance.dispatchAction({
type: 'unfocusNodeAdjacency',
seriesIndex: SERIES_INDEX
});
//
const isBridgeNode = params.data.category === 0;
if (isBridgeNode) {
const nodeId = params.data.originalId;
if (activeNodeId.value === nodeId) {
activeNodeId.value = null;
updateNodeImage(nodeId, false);
}
}
} else if (params.dataType === 'edge') {
//
chartInstance.dispatchAction({
type: 'unfocusNodeAdjacency',
seriesIndex: SERIES_INDEX
});
}
});
@ -390,13 +434,20 @@ const initChart = async() => {
},
animationDurationUpdate: 3500, //
animationEasingUpdate: 'quinticInOut',
emphasis: { //
focus: 'adjacency', //
blurScope: 'coordinateSystem', //
lineStyle: { // 线
width: 10 // 线(10)
}
emphasis: {
focus: 'adjacency', // blur
blurScope: 'series', //
scale: false, //
lineStyle: { opacity: 1 },
itemStyle: { opacity: 1 },
label: { opacity: 1 }
},
blur: {
// /
lineStyle: { opacity: 0.05 },
itemStyle: { opacity: 0.1 },
label: { opacity: 0 }
}
}
]
};

View File

@ -70,6 +70,52 @@ const initChart = async () => {
chart = echarts.init(detailContainer.value);
const SERIES_INDEX = 0;
// blur series.blur
chart.on('mouseover', 'series.graph', function (params) {
if (!params.data) return;
if (params.dataType === 'node') {
chart.dispatchAction({
type: 'focusNodeAdjacency',
seriesIndex: SERIES_INDEX,
dataIndex: params.dataIndex
});
//
if (params.data.category === 0) {
activeNodeId.value = params.data.originalId;
updateNodeImage(bridgeNodeImages);
}
} else if (params.dataType === 'edge') {
//
chart.dispatchAction({ type: 'unfocusNodeAdjacency', seriesIndex: SERIES_INDEX });
chart.dispatchAction({ type: 'downplay', seriesIndex: SERIES_INDEX });
}
});
chart.on('mouseout', 'series.graph', function (params) {
if (!params.data) return;
if (params.dataType === 'node') {
chart.dispatchAction({ type: 'unfocusNodeAdjacency', seriesIndex: SERIES_INDEX });
if (params.data.category === 0) {
//
if (activeNodeId.value === params.data.originalId) {
activeNodeId.value = '';
updateNodeImage(bridgeNodeImages);
}
}
} else if (params.dataType === 'edge') {
chart.dispatchAction({ type: 'unfocusNodeAdjacency', seriesIndex: SERIES_INDEX });
}
});
// ->
chart.on('click', function(params){
//
@ -159,7 +205,7 @@ const initChart = async () => {
if (isBridgeNode) {
const images = bridgeNodeImages.get(userIdStr);
symbol = images.defImg ? `image://${images.defImg}` : 'circle';
symbolSize = 60;
symbolSize = 150;
// leader
const leaderData = keyNodeStore2.allLeaderData.find(leader => String(leader.nodeId) === userIdStr);
if (leaderData) {
@ -233,6 +279,7 @@ const initChart = async () => {
borderWidth: 0,
extraCssText: "box-shadow:none;padding:0;",
formatter: function (params) {
if (params.dataType === 'edge') return '';
if (params.dataType === "node" && params.data.category === 0) {
return `<div
style="
@ -356,16 +403,24 @@ const initChart = async () => {
{ offset: 0.9, color: '#0578b0' }
]),
curveness: 0,
with: 2,
width: 2,
type: 'solid',
opacity: 1,
},
emphasis: { //
focus: 'adjacency', //
lineStyle: { // 线
width: 10 // 线(10)
}
emphasis: {
focus: 'adjacency', // blur
blurScope: 'series', //
scale: false, //
lineStyle: { opacity: 1 },
itemStyle: { opacity: 1 },
label: { opacity: 1 }
},
blur: {
// /
lineStyle: { opacity: 0.05 },
itemStyle: { opacity: 0.1 },
label: { opacity: 0 }
}
}
]
};