From f74074d737d41f29c0ad04583f59520daa76d019 Mon Sep 17 00:00:00 2001 From: Fine Date: Mon, 10 Mar 2025 15:29:47 +0800 Subject: [PATCH] update --- .../related/trace/components/D3Graph/Index.vue | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/views/dashboard/related/trace/components/D3Graph/Index.vue b/src/views/dashboard/related/trace/components/D3Graph/Index.vue index 420c925f..59f1bfcb 100644 --- a/src/views/dashboard/related/trace/components/D3Graph/Index.vue +++ b/src/views/dashboard/related/trace/components/D3Graph/Index.vue @@ -238,25 +238,26 @@ limitations under the License. --> fixSpansSize.value = fixSpans.length; for (const id of Object.keys(segmentGroup)) { const currentSegment = segmentGroup[id].sort((a: Span, b: Span) => b.parentSpanId - a.parentSpanId); - for (const s of currentSegment) { - const index = currentSegment.findIndex((i: Span) => i.spanId === s.parentSpanId); + for (const span of currentSegment) { + const index = currentSegment.findIndex((i: Span) => i.spanId === span.parentSpanId); if (index > -1) { if ( (currentSegment[index].isBroken && currentSegment[index].parentSpanId === -1) || !currentSegment[index].isBroken ) { - currentSegment[index].children.push(s); + currentSegment[index].children.push(span); currentSegment[index].children.sort((a: Span, b: Span) => a.spanId - b.spanId); } } - if (s.isBroken) { + if (span.isBroken) { const children = props.data.filter((span: Span) => span.refs.find( - (d) => d.traceId === s.traceId && d.parentSegmentId === s.segmentId && d.parentSpanId === s.spanId, + (d) => + d.traceId === span.traceId && d.parentSegmentId === span.segmentId && d.parentSpanId === span.spanId, ), ); if (children.length) { - s.children.push(...children); + span.children.push(...children); } } }