|
|
@@ -482,31 +482,70 @@ function NoteNode({ id, data, sourcePosition, targetPosition }) {
|
|
|
</div>
|
|
|
)}
|
|
|
|
|
|
- {/* 标签 */}
|
|
|
- <div style={{ display: 'flex', gap: '6px', marginBottom: '8px', flexWrap: 'wrap' }}>
|
|
|
- <span style={{
|
|
|
- display: 'inline-block',
|
|
|
- padding: '2px 8px',
|
|
|
- borderRadius: '12px',
|
|
|
- background: '#fff1f2',
|
|
|
- color: '#be123c',
|
|
|
- fontSize: '10px',
|
|
|
- fontWeight: '500',
|
|
|
- }}>
|
|
|
- {data.matchLevel}
|
|
|
- </span>
|
|
|
- <span style={{
|
|
|
- display: 'inline-block',
|
|
|
- padding: '2px 8px',
|
|
|
- borderRadius: '12px',
|
|
|
- background: '#fff7ed',
|
|
|
- color: '#c2410c',
|
|
|
- fontSize: '10px',
|
|
|
- fontWeight: '500',
|
|
|
+ {/* 互动数据 */}
|
|
|
+ {data.interact_info && (
|
|
|
+ <div style={{
|
|
|
+ display: 'flex',
|
|
|
+ gap: '8px',
|
|
|
+ marginBottom: '8px',
|
|
|
+ flexWrap: 'wrap',
|
|
|
+ fontSize: '11px',
|
|
|
+ color: '#9f1239',
|
|
|
}}>
|
|
|
- Score: {data.score}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
+ {data.interact_info.liked_count > 0 && (
|
|
|
+ <span style={{ display: 'flex', alignItems: 'center', gap: '2px' }}>
|
|
|
+ ❤️ {data.interact_info.liked_count}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ {data.interact_info.collected_count > 0 && (
|
|
|
+ <span style={{ display: 'flex', alignItems: 'center', gap: '2px' }}>
|
|
|
+ ⭐ {data.interact_info.collected_count}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ {data.interact_info.comment_count > 0 && (
|
|
|
+ <span style={{ display: 'flex', alignItems: 'center', gap: '2px' }}>
|
|
|
+ 💬 {data.interact_info.comment_count}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ {data.interact_info.shared_count > 0 && (
|
|
|
+ <span style={{ display: 'flex', alignItems: 'center', gap: '2px' }}>
|
|
|
+ 🔗 {data.interact_info.shared_count}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* 标签 */}
|
|
|
+ {(data.matchLevel || data.score) && (
|
|
|
+ <div style={{ display: 'flex', gap: '6px', marginBottom: '8px', flexWrap: 'wrap' }}>
|
|
|
+ {data.matchLevel && (
|
|
|
+ <span style={{
|
|
|
+ display: 'inline-block',
|
|
|
+ padding: '2px 8px',
|
|
|
+ borderRadius: '12px',
|
|
|
+ background: '#fff1f2',
|
|
|
+ color: '#be123c',
|
|
|
+ fontSize: '10px',
|
|
|
+ fontWeight: '500',
|
|
|
+ }}>
|
|
|
+ {data.matchLevel}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ {data.score && (
|
|
|
+ <span style={{
|
|
|
+ display: 'inline-block',
|
|
|
+ padding: '2px 8px',
|
|
|
+ borderRadius: '12px',
|
|
|
+ background: '#fff7ed',
|
|
|
+ color: '#c2410c',
|
|
|
+ fontSize: '10px',
|
|
|
+ fontWeight: '500',
|
|
|
+ }}>
|
|
|
+ Score: {data.score}
|
|
|
+ </span>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
|
|
|
{/* 描述 */}
|
|
|
{expanded && data.description && (
|
|
|
@@ -855,21 +894,22 @@ function transformData(data) {
|
|
|
canvasIdToNodeData[canvasId] = true;
|
|
|
|
|
|
// 根据节点类型创建不同的数据结构
|
|
|
- if (nodeType === 'note') {
|
|
|
+ if (nodeType === 'note' || nodeType === 'post') {
|
|
|
nodes.push({
|
|
|
id: canvasId,
|
|
|
originalId: originalId,
|
|
|
type: 'note',
|
|
|
data: {
|
|
|
- title: node.title || '帖子',
|
|
|
+ title: node.query || node.title || '帖子',
|
|
|
matchLevel: node.match_level,
|
|
|
score: node.relevance_score ? node.relevance_score.toFixed(2) : '0.00',
|
|
|
- description: node.desc || '',
|
|
|
+ description: node.body_text || node.desc || '',
|
|
|
isSelected: node.is_selected !== undefined ? node.is_selected : true,
|
|
|
imageList: node.image_list || [],
|
|
|
noteUrl: node.note_url || '',
|
|
|
evaluationReason: node.evaluation_reason || '',
|
|
|
- nodeType: 'note',
|
|
|
+ interact_info: node.interact_info || {},
|
|
|
+ nodeType: nodeType,
|
|
|
},
|
|
|
position: { x: 0, y: 0 },
|
|
|
});
|