diff --git a/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart b/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart index 06f9e88a..66767303 100644 --- a/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart +++ b/frontend/mobile-app/lib/features/profile/presentation/widgets/team_tree_widget.dart @@ -113,30 +113,7 @@ class _TeamTreeWidgetState extends State { Widget _buildTreeLevel(List nodes, int level) { if (nodes.isEmpty) return const SizedBox.shrink(); - // 使用容器实际宽度计算最大节点数(减去 padding) - final availableWidth = _containerWidth - 16; // 减去左右 padding (8*2) - final maxVisibleNodes = ((availableWidth + nodeHorizontalSpacing) / (nodeWidth + nodeHorizontalSpacing)).floor().clamp(1, 100); - - // 分离需要显示的节点和隐藏的节点 - List visibleNodes; - List hiddenNodes; - - if (nodes.length <= maxVisibleNodes) { - visibleNodes = nodes; - hiddenNodes = []; - } else { - // 显示前几个和最后一个,中间显示省略号 - final showCount = maxVisibleNodes - 1; // 留一个位置给省略号 - final frontCount = (showCount / 2).ceil(); - final backCount = showCount - frontCount; - - visibleNodes = [ - ...nodes.sublist(0, frontCount), - ...nodes.sublist(nodes.length - backCount), - ]; - hiddenNodes = nodes.sublist(frontCount, nodes.length - backCount); - } - + // 显示所有节点,允许左右滚动 return Column( children: [ // 当前层的节点 @@ -144,14 +121,9 @@ class _TeamTreeWidgetState extends State { mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, children: [ - for (int i = 0; i < visibleNodes.length; i++) ...[ - if (i == (maxVisibleNodes - 1) ~/ 2 && hiddenNodes.isNotEmpty) ...[ - // 在中间位置插入省略号节点 - _buildEllipsisNode(hiddenNodes), - SizedBox(width: nodeHorizontalSpacing), - ], - _buildNodeWithChildren(visibleNodes[i]), - if (i < visibleNodes.length - 1) SizedBox(width: nodeHorizontalSpacing), + for (int i = 0; i < nodes.length; i++) ...[ + _buildNodeWithChildren(nodes[i]), + if (i < nodes.length - 1) SizedBox(width: nodeHorizontalSpacing), ], ], ),