|
|
@@ -25,12 +25,14 @@ if (inputData.rounds && inputData.o) {
|
|
|
// v6.1.2.8 格式,需要转换
|
|
|
console.log('✨ 检测到 v6.1.2.8 格式,正在转换为图结构...');
|
|
|
|
|
|
- // 尝试读取 search_results.json
|
|
|
+ // 尝试读取 search_results.json(兼容旧版本)
|
|
|
let searchResults = null;
|
|
|
const searchResultsPath = path.join(path.dirname(inputFile), 'search_results.json');
|
|
|
if (fs.existsSync(searchResultsPath)) {
|
|
|
- console.log('📄 读取搜索结果数据...');
|
|
|
+ console.log('📄 读取外部搜索结果数据(兼容模式)...');
|
|
|
searchResults = JSON.parse(fs.readFileSync(searchResultsPath, 'utf-8'));
|
|
|
+ } else {
|
|
|
+ console.log('✅ 使用 run_context.json 中的内嵌搜索结果');
|
|
|
}
|
|
|
|
|
|
// 使用新的转换函数(按 Round > 步骤 > 数据 组织)
|
|
|
@@ -316,6 +318,19 @@ function QueryNode({ id, data, sourcePosition, targetPosition }) {
|
|
|
<strong>Parent:</strong> {data.parent}
|
|
|
</div>
|
|
|
)}
|
|
|
+ {data.selectedWord && (
|
|
|
+ <div style={{
|
|
|
+ marginTop: '6px',
|
|
|
+ paddingTop: '6px',
|
|
|
+ borderTop: '1px solid #f3f4f6',
|
|
|
+ fontSize: '10px',
|
|
|
+ color: '#6b7280',
|
|
|
+ lineHeight: '1.5',
|
|
|
+ }}>
|
|
|
+ <strong style={{ color: '#4b5563' }}>选择词:</strong>
|
|
|
+ <span style={{ marginLeft: '4px', color: '#3b82f6', fontWeight: '500' }}>{data.selectedWord}</span>
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
{data.evaluationReason && (
|
|
|
<div style={{
|
|
|
marginTop: '6px',
|
|
|
@@ -907,7 +922,7 @@ function transformData(data) {
|
|
|
isSelected: node.is_selected !== undefined ? node.is_selected : true,
|
|
|
imageList: node.image_list || [],
|
|
|
noteUrl: node.note_url || '',
|
|
|
- evaluationReason: node.evaluation_reason || '',
|
|
|
+ evaluationReason: node.evaluationReason || node.evaluation_reason || '',
|
|
|
interact_info: node.interact_info || {},
|
|
|
nodeType: nodeType,
|
|
|
},
|
|
|
@@ -928,10 +943,11 @@ function transformData(data) {
|
|
|
strategy: node.strategy || '',
|
|
|
parent: node.parent_query || '',
|
|
|
isSelected: node.is_selected !== undefined ? node.is_selected : true,
|
|
|
- evaluationReason: node.evaluation_reason || '',
|
|
|
+ evaluationReason: node.evaluationReason || node.evaluation_reason || '',
|
|
|
nodeType: nodeType, // 传递实际节点类型用于样式
|
|
|
searchCount: node.search_count, // search 节点特有
|
|
|
totalPosts: node.total_posts, // search 节点特有
|
|
|
+ selectedWord: node.selected_word || '', // 加词节点特有 - 显示选择的词
|
|
|
},
|
|
|
position: { x: 0, y: 0 },
|
|
|
});
|