刘立冬 пре 3 недеља
родитељ
комит
aba801a92f

+ 5 - 1
visualization/sug_v6_1_2_121/convert_v8_to_graph_v3.js

@@ -682,6 +682,8 @@ function convertV8ToGraphV2(runContext, searchResults) {
         // 创建查询节点
         nextRoundItems.forEach((item, index) => {
           const itemId = `next_round_${item.text}_r${roundNum}_${index}`;
+          const isSugItem = item.type === 'sug';
+
           nodes[itemId] = {
             type: 'next_round_item',
             query: '[Q] ' + item.text,
@@ -691,7 +693,9 @@ function convertV8ToGraphV2(runContext, searchResults) {
             iteration: roundNum,
             is_selected: true,
             type_label: item.type_label || '',
-            item_type: item.type
+            item_type: item.type,
+            is_suggestion: isSugItem,
+            suggestion_label: isSugItem ? '[suggestion]' : ''
           };
 
           edges.push({

+ 31 - 0
visualization/sug_v6_1_2_121/index.js

@@ -346,6 +346,19 @@ function QueryNode({ id, data, sourcePosition, targetPosition }) {
                   {data.typeLabel || data.type_label}
                 </span>
               )}
+            {data.is_suggestion && data.suggestion_label && (
+              <span style={{
+                display: 'inline-block',
+                padding: '1px 6px',
+                borderRadius: '10px',
+                background: '#ede9fe',
+                color: '#6d28d9',
+                fontSize: '10px',
+                fontWeight: '600',
+              }}>
+                {data.suggestion_label}
+              </span>
+            )}
             </div>
 
             {data.parent && (
@@ -969,6 +982,21 @@ function TreeNode({ node, level, children, isCollapsed, onToggle, isSelected, on
               </span>
             )}
 
+            {node.data.is_suggestion && node.data.suggestion_label && (
+              <span style={{
+                fontSize: '12px',
+                color: '#fff',
+                background: '#8b5cf6',
+                padding: '2px 5px',
+                borderRadius: '3px',
+                flexShrink: 0,
+                fontWeight: '600',
+              }}
+              >
+                {node.data.suggestion_label}
+              </span>
+            )}
+
             {/* 类型标签 - 显示在右侧靠近分数,蓝色背景 */}
             {node.data.type_label && (
               <span style={{
@@ -1245,6 +1273,9 @@ function transformData(data) {
             source_scores: node.source_scores || [], // 扁平来源得分
             is_above_sources: node.is_above_sources || false, // 组合是否高于来源得分
             max_source_score: node.max_source_score !== undefined ? node.max_source_score : null, // 来源最高分
+            item_type: node.item_type || '', // 构建下一轮节点来源类型
+            is_suggestion: node.is_suggestion || false,
+            suggestion_label: node.suggestion_label || '',
           },
           position: { x: 0, y: 0 },
         });