|
@@ -0,0 +1,2062 @@
|
|
|
|
|
+#!/usr/bin/env python3
|
|
|
|
|
+# -*- coding: utf-8 -*-
|
|
|
|
|
+"""
|
|
|
|
|
+Stage6/7/8整合可视化工具
|
|
|
|
|
+在Stage6评估结果基础上,为完全匹配帖子增加Stage7解构和Stage8相似度展示
|
|
|
|
|
+"""
|
|
|
|
|
+
|
|
|
|
|
+import json
|
|
|
|
|
+import os
|
|
|
|
|
+from datetime import datetime
|
|
|
|
|
+from typing import List, Dict, Any
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def load_data(json_path: str) -> List[Dict[str, Any]]:
|
|
|
|
|
+ """加载JSON数据"""
|
|
|
|
|
+ with open(json_path, 'r', encoding='utf-8') as f:
|
|
|
|
|
+ return json.load(f)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def load_stage7_data(json_path: str) -> Dict[str, Any]:
|
|
|
|
|
+ """加载Stage7解构数据"""
|
|
|
|
|
+ with open(json_path, 'r', encoding='utf-8') as f:
|
|
|
|
|
+ data = json.load(f)
|
|
|
|
|
+
|
|
|
|
|
+ # 创建note_id到解构数据的映射
|
|
|
|
|
+ mapping = {}
|
|
|
|
|
+ for result in data.get('results', []):
|
|
|
|
|
+ note_id = result.get('note_id')
|
|
|
|
|
+ if note_id:
|
|
|
|
|
+ mapping[note_id] = result
|
|
|
|
|
+
|
|
|
|
|
+ return mapping
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def load_stage8_data(json_path: str) -> Dict[str, Any]:
|
|
|
|
|
+ """加载Stage8相似度数据"""
|
|
|
|
|
+ with open(json_path, 'r', encoding='utf-8') as f:
|
|
|
|
|
+ data = json.load(f)
|
|
|
|
|
+
|
|
|
|
|
+ # 创建note_id到相似度数据的映射
|
|
|
|
|
+ mapping = {}
|
|
|
|
|
+ for result in data.get('results', []):
|
|
|
|
|
+ note_id = result.get('note_id')
|
|
|
|
|
+ if note_id:
|
|
|
|
|
+ mapping[note_id] = result
|
|
|
|
|
+
|
|
|
|
|
+ return mapping
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def calculate_statistics(data: List[Dict[str, Any]]) -> Dict[str, Any]:
|
|
|
|
|
+ """计算统计数据(包括评估结果)"""
|
|
|
|
|
+ total_features = len(data)
|
|
|
|
|
+ total_search_words = 0
|
|
|
|
|
+ searched_count = 0
|
|
|
|
|
+ not_searched_count = 0
|
|
|
|
|
+ total_notes = 0
|
|
|
|
|
+ video_count = 0
|
|
|
|
|
+ normal_count = 0
|
|
|
|
|
+
|
|
|
|
|
+ # 评估统计
|
|
|
|
|
+ total_evaluated_notes = 0
|
|
|
|
|
+ total_filtered = 0
|
|
|
|
|
+ match_complete = 0
|
|
|
|
|
+ match_similar = 0
|
|
|
|
|
+ match_weak = 0
|
|
|
|
|
+ match_none = 0
|
|
|
|
|
+
|
|
|
|
|
+ for feature in data:
|
|
|
|
|
+ grouped_results = feature.get('组合评估结果_分组', [])
|
|
|
|
|
+
|
|
|
|
|
+ for group in grouped_results:
|
|
|
|
|
+ search_items = group.get('top10_searches', [])
|
|
|
|
|
+ total_search_words += len(search_items)
|
|
|
|
|
+
|
|
|
|
|
+ for search_item in search_items:
|
|
|
|
|
+ search_result = search_item.get('search_result', {})
|
|
|
|
|
+
|
|
|
|
|
+ if search_result:
|
|
|
|
|
+ searched_count += 1
|
|
|
|
|
+ notes = search_result.get('data', {}).get('data', [])
|
|
|
|
|
+ total_notes += len(notes)
|
|
|
|
|
+
|
|
|
|
|
+ for note in notes:
|
|
|
|
|
+ note_type = note.get('note_card', {}).get('type', '')
|
|
|
|
|
+ if note_type == 'video':
|
|
|
|
|
+ video_count += 1
|
|
|
|
|
+ else:
|
|
|
|
|
+ normal_count += 1
|
|
|
|
|
+
|
|
|
|
|
+ evaluation = search_item.get('evaluation_with_filter')
|
|
|
|
|
+ if evaluation:
|
|
|
|
|
+ total_evaluated_notes += evaluation.get('total_notes', 0)
|
|
|
|
|
+ total_filtered += evaluation.get('filtered_count', 0)
|
|
|
|
|
+
|
|
|
|
|
+ stats = evaluation.get('statistics', {})
|
|
|
|
|
+ match_complete += stats.get('完全匹配(8-10)', 0)
|
|
|
|
|
+ match_similar += stats.get('相似匹配(6-7)', 0)
|
|
|
|
|
+ match_weak += stats.get('弱相似(5-6)', 0)
|
|
|
|
|
+ match_none += stats.get('无匹配(≤4)', 0)
|
|
|
|
|
+ else:
|
|
|
|
|
+ not_searched_count += 1
|
|
|
|
|
+
|
|
|
|
|
+ total_remaining = total_evaluated_notes - total_filtered if total_evaluated_notes > 0 else 0
|
|
|
|
|
+
|
|
|
|
|
+ return {
|
|
|
|
|
+ 'total_features': total_features,
|
|
|
|
|
+ 'total_search_words': total_search_words,
|
|
|
|
|
+ 'searched_count': searched_count,
|
|
|
|
|
+ 'not_searched_count': not_searched_count,
|
|
|
|
|
+ 'searched_percentage': round(searched_count / total_search_words * 100, 1) if total_search_words > 0 else 0,
|
|
|
|
|
+ 'total_notes': total_notes,
|
|
|
|
|
+ 'video_count': video_count,
|
|
|
|
|
+ 'normal_count': normal_count,
|
|
|
|
|
+ 'video_percentage': round(video_count / total_notes * 100, 1) if total_notes > 0 else 0,
|
|
|
|
|
+ 'normal_percentage': round(normal_count / total_notes * 100, 1) if total_notes > 0 else 0,
|
|
|
|
|
+ 'total_evaluated': total_evaluated_notes,
|
|
|
|
|
+ 'total_filtered': total_filtered,
|
|
|
|
|
+ 'total_remaining': total_remaining,
|
|
|
|
|
+ 'filter_rate': round(total_filtered / total_evaluated_notes * 100, 1) if total_evaluated_notes > 0 else 0,
|
|
|
|
|
+ 'match_complete': match_complete,
|
|
|
|
|
+ 'match_similar': match_similar,
|
|
|
|
|
+ 'match_weak': match_weak,
|
|
|
|
|
+ 'match_none': match_none,
|
|
|
|
|
+ 'complete_rate': round(match_complete / total_remaining * 100, 1) if total_remaining > 0 else 0,
|
|
|
|
|
+ 'similar_rate': round(match_similar / total_remaining * 100, 1) if total_remaining > 0 else 0,
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def generate_html(data: List[Dict[str, Any]], stats: Dict[str, Any],
|
|
|
|
|
+ stage7_mapping: Dict[str, Any], stage8_mapping: Dict[str, Any],
|
|
|
|
|
+ output_path: str):
|
|
|
|
|
+ """生成HTML可视化页面"""
|
|
|
|
|
+
|
|
|
|
|
+ # 准备数据JSON
|
|
|
|
|
+ data_json = json.dumps(data, ensure_ascii=False, indent=2)
|
|
|
|
|
+ stage7_json = json.dumps(stage7_mapping, ensure_ascii=False, indent=2)
|
|
|
|
|
+ stage8_json = json.dumps(stage8_mapping, ensure_ascii=False, indent=2)
|
|
|
|
|
+
|
|
|
|
|
+ html_content = f'''<!DOCTYPE html>
|
|
|
|
|
+<html lang="zh-CN">
|
|
|
|
|
+<head>
|
|
|
|
|
+ <meta charset="UTF-8">
|
|
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
+ <title>Stage6/7/8 整合可视化</title>
|
|
|
|
|
+ <style>
|
|
|
|
|
+ * {{
|
|
|
|
|
+ margin: 0;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ body {{
|
|
|
|
|
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
|
|
|
+ background: #f5f7fa;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ overflow-x: hidden;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 顶部统计面板 */
|
|
|
|
|
+ .stats-panel {{
|
|
|
|
|
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+ box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stats-container {{
|
|
|
|
|
+ max-width: 1400px;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stats-row {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-around;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ gap: 15px;
|
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stats-row:last-child {{
|
|
|
|
|
+ margin-bottom: 0;
|
|
|
|
|
+ padding-top: 15px;
|
|
|
|
|
+ border-top: 1px solid rgba(255,255,255,0.2);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-item {{
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-value {{
|
|
|
|
|
+ font-size: 28px;
|
|
|
|
|
+ font-weight: bold;
|
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-label {{
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ opacity: 0.9;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-item.small .stat-value {{
|
|
|
|
|
+ font-size: 22px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 过滤控制面板 */
|
|
|
|
|
+ .filter-panel {{
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ max-width: 1400px;
|
|
|
|
|
+ margin: 20px auto;
|
|
|
|
|
+ padding: 15px 20px;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 20px;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-label {{
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #374151;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-buttons {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn {{
|
|
|
|
|
+ padding: 6px 12px;
|
|
|
|
|
+ border: 2px solid #e5e7eb;
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn:hover {{
|
|
|
|
|
+ border-color: #667eea;
|
|
|
|
|
+ background: #f9fafb;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn.active {{
|
|
|
|
|
+ border-color: #667eea;
|
|
|
|
|
+ background: #667eea;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn.complete {{
|
|
|
|
|
+ border-color: #10b981;
|
|
|
|
|
+ }}
|
|
|
|
|
+ .filter-btn.complete.active {{
|
|
|
|
|
+ background: #10b981;
|
|
|
|
|
+ border-color: #10b981;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn.similar {{
|
|
|
|
|
+ border-color: #f59e0b;
|
|
|
|
|
+ }}
|
|
|
|
|
+ .filter-btn.similar.active {{
|
|
|
|
|
+ background: #f59e0b;
|
|
|
|
|
+ border-color: #f59e0b;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn.weak {{
|
|
|
|
|
+ border-color: #f97316;
|
|
|
|
|
+ }}
|
|
|
|
|
+ .filter-btn.weak.active {{
|
|
|
|
|
+ background: #f97316;
|
|
|
|
|
+ border-color: #f97316;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn.none {{
|
|
|
|
|
+ border-color: #ef4444;
|
|
|
|
|
+ }}
|
|
|
|
|
+ .filter-btn.none.active {{
|
|
|
|
|
+ background: #ef4444;
|
|
|
|
|
+ border-color: #ef4444;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .filter-btn.filtered {{
|
|
|
|
|
+ border-color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+ .filter-btn.filtered.active {{
|
|
|
|
|
+ background: #6b7280;
|
|
|
|
|
+ border-color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 主容器 */
|
|
|
|
|
+ .main-container {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ max-width: 1400px;
|
|
|
|
|
+ margin: 0 auto 20px;
|
|
|
|
|
+ gap: 20px;
|
|
|
|
|
+ padding: 0 20px;
|
|
|
|
|
+ height: calc(100vh - 260px);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 左侧导航 */
|
|
|
|
|
+ .left-sidebar {{
|
|
|
|
|
+ width: 30%;
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ position: sticky;
|
|
|
|
|
+ top: 20px;
|
|
|
|
|
+ height: fit-content;
|
|
|
|
|
+ max-height: calc(100vh - 280px);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-group {{
|
|
|
|
|
+ border-bottom: 1px solid #e5e7eb;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-header {{
|
|
|
|
|
+ padding: 15px 20px;
|
|
|
|
|
+ background: #f9fafb;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ user-select: none;
|
|
|
|
|
+ transition: background 0.2s;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-header:hover {{
|
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-header.active {{
|
|
|
|
|
+ background: #667eea;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-title {{
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ margin-bottom: 5px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-meta {{
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-header.active .feature-meta {{
|
|
|
|
|
+ color: rgba(255,255,255,0.8);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-words-list {{
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ padding: 0;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-words-list.expanded {{
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-group {{
|
|
|
|
|
+ border-bottom: 1px solid #f3f4f6;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-header {{
|
|
|
|
|
+ padding: 12px 20px 12px 30px;
|
|
|
|
|
+ background: #fafbfc;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ user-select: none;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ border-left: 3px solid transparent;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-header:hover {{
|
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
|
+ border-left-color: #a78bfa;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-header.active {{
|
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
|
+ border-left-color: #7c3aed;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-title {{
|
|
|
|
|
+ font-size: 15px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #7c3aed;
|
|
|
|
|
+ margin-bottom: 4px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-meta {{
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-desc {{
|
|
|
|
|
+ padding: 8px 20px 8px 30px;
|
|
|
|
|
+ background: #fefce8;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #854d0e;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ border-left: 3px solid #fbbf24;
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .base-word-desc.expanded {{
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-words-sublist {{
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-words-sublist.expanded {{
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-word-item {{
|
|
|
|
|
+ padding: 12px 20px 12px 50px;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ border-left: 3px solid transparent;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-word-item:hover {{
|
|
|
|
|
+ background: #f9fafb;
|
|
|
|
|
+ border-left-color: #667eea;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-word-item.active {{
|
|
|
|
|
+ background: #ede9fe;
|
|
|
|
|
+ border-left-color: #7c3aed;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-word-text {{
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #374151;
|
|
|
|
|
+ margin-bottom: 4px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-word-score {{
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ padding: 2px 8px;
|
|
|
|
|
+ border-radius: 12px;
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ margin-left: 8px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .score-high {{
|
|
|
|
|
+ background: #d1fae5;
|
|
|
|
|
+ color: #065f46;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .score-medium {{
|
|
|
|
|
+ background: #fef3c7;
|
|
|
|
|
+ color: #92400e;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .score-low {{
|
|
|
|
|
+ background: #fee2e2;
|
|
|
|
|
+ color: #991b1b;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-badge {{
|
|
|
|
|
+ display: inline-block;
|
|
|
|
|
+ padding: 2px 6px;
|
|
|
|
|
+ border-radius: 10px;
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ margin-left: 6px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-complete {{
|
|
|
|
|
+ background: #d1fae5;
|
|
|
|
|
+ color: #065f46;
|
|
|
|
|
+ border: 1px solid #10b981;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-similar {{
|
|
|
|
|
+ background: #fef3c7;
|
|
|
|
|
+ color: #92400e;
|
|
|
|
|
+ border: 1px solid #f59e0b;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-weak {{
|
|
|
|
|
+ background: #fed7aa;
|
|
|
|
|
+ color: #9a3412;
|
|
|
|
|
+ border: 1px solid #f97316;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-none {{
|
|
|
|
|
+ background: #fee2e2;
|
|
|
|
|
+ color: #991b1b;
|
|
|
|
|
+ border: 1px solid #ef4444;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-filtered {{
|
|
|
|
|
+ background: #e5e7eb;
|
|
|
|
|
+ color: #4b5563;
|
|
|
|
|
+ border: 1px solid #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .search-word-eval {{
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ margin-top: 4px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 右侧结果区 */
|
|
|
|
|
+ .right-content {{
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ padding-bottom: 40px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .result-block {{
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
|
|
|
+ margin-bottom: 30px;
|
|
|
|
|
+ padding: 20px;
|
|
|
|
|
+ scroll-margin-top: 20px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .result-header {{
|
|
|
|
|
+ margin-bottom: 20px;
|
|
|
|
|
+ padding-bottom: 15px;
|
|
|
|
|
+ border-bottom: 2px solid #e5e7eb;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .result-title {{
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #111827;
|
|
|
|
|
+ margin-bottom: 10px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .result-stats {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-badge {{
|
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
|
+ padding: 4px 10px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-badge.eval {{
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-badge.eval.complete {{
|
|
|
|
|
+ background: #d1fae5;
|
|
|
|
|
+ color: #065f46;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-badge.eval.similar {{
|
|
|
|
|
+ background: #fef3c7;
|
|
|
|
|
+ color: #92400e;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-badge.eval.weak {{
|
|
|
|
|
+ background: #fed7aa;
|
|
|
|
|
+ color: #9a3412;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-badge.eval.none {{
|
|
|
|
|
+ background: #fee2e2;
|
|
|
|
|
+ color: #991b1b;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .stat-badge.eval.filtered {{
|
|
|
|
|
+ background: #e5e7eb;
|
|
|
|
|
+ color: #4b5563;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .notes-grid {{
|
|
|
|
|
+ display: grid;
|
|
|
|
|
+ grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
|
|
|
+ gap: 20px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .empty-state {{
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ padding: 60px 40px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .empty-icon {{
|
|
|
|
|
+ font-size: 48px;
|
|
|
|
|
+ margin-bottom: 16px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .empty-title {{
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #374151;
|
|
|
|
|
+ margin-bottom: 8px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .empty-desc {{
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ line-height: 1.6;
|
|
|
|
|
+ color: #9ca3af;
|
|
|
|
|
+ max-width: 400px;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card {{
|
|
|
|
|
+ border: 3px solid #e5e7eb;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card:hover {{
|
|
|
|
|
+ transform: translateY(-4px);
|
|
|
|
|
+ box-shadow: 0 10px 25px rgba(0,0,0,0.15);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card.eval-complete {{
|
|
|
|
|
+ border-color: #10b981;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card.eval-similar {{
|
|
|
|
|
+ border-color: #f59e0b;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card.eval-weak {{
|
|
|
|
|
+ border-color: #f97316;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card.eval-none {{
|
|
|
|
|
+ border-color: #ef4444;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card.eval-filtered {{
|
|
|
|
|
+ border-color: #6b7280;
|
|
|
|
|
+ opacity: 0.6;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 图片轮播 */
|
|
|
|
|
+ .image-carousel {{
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 280px;
|
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .carousel-images {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ transition: transform 0.3s ease;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .carousel-image {{
|
|
|
|
|
+ min-width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ object-fit: cover;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .carousel-btn {{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 50%;
|
|
|
|
|
+ transform: translateY(-50%);
|
|
|
|
|
+ background: rgba(0,0,0,0.5);
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ width: 32px;
|
|
|
|
|
+ height: 32px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ transition: background 0.2s;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .carousel-btn:hover {{
|
|
|
|
|
+ background: rgba(0,0,0,0.7);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .carousel-btn.prev {{
|
|
|
|
|
+ left: 8px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .carousel-btn.next {{
|
|
|
|
|
+ right: 8px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-card:hover .carousel-btn {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .carousel-indicators {{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ bottom: 10px;
|
|
|
|
|
+ left: 50%;
|
|
|
|
|
+ transform: translateX(-50%);
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ gap: 6px;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dot {{
|
|
|
|
|
+ width: 8px;
|
|
|
|
|
+ height: 8px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ background: rgba(255,255,255,0.5);
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dot.active {{
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ width: 24px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .image-counter {{
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ top: 10px;
|
|
|
|
|
+ right: 10px;
|
|
|
|
|
+ background: rgba(0,0,0,0.6);
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ padding: 4px 8px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ z-index: 10;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-info {{
|
|
|
|
|
+ padding: 12px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-title {{
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ color: #111827;
|
|
|
|
|
+ margin-bottom: 8px;
|
|
|
|
|
+ display: -webkit-box;
|
|
|
|
|
+ -webkit-line-clamp: 2;
|
|
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ line-height: 1.4;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-meta {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ margin-bottom: 8px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-type {{
|
|
|
|
|
+ padding: 3px 8px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ font-weight: 500;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .type-video {{
|
|
|
|
|
+ background: #dbeafe;
|
|
|
|
|
+ color: #1e40af;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .type-normal {{
|
|
|
|
|
+ background: #d1fae5;
|
|
|
|
|
+ color: #065f46;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-author {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 6px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .author-avatar {{
|
|
|
|
|
+ width: 24px;
|
|
|
|
|
+ height: 24px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-eval {{
|
|
|
|
|
+ padding: 8px 12px;
|
|
|
|
|
+ background: #f9fafb;
|
|
|
|
|
+ border-top: 1px solid #e5e7eb;
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-eval-header {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ user-select: none;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-eval-score {{
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-eval-toggle {{
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ font-size: 10px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-eval-details {{
|
|
|
|
|
+ margin-top: 8px;
|
|
|
|
|
+ padding-top: 8px;
|
|
|
|
|
+ border-top: 1px solid #e5e7eb;
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .note-eval-details.expanded {{
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-detail-label {{
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #374151;
|
|
|
|
|
+ margin-top: 6px;
|
|
|
|
|
+ margin-bottom: 2px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-detail-label:first-child {{
|
|
|
|
|
+ margin-top: 0;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .eval-detail-text {{
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* ========== 新增: 解构面板样式 ========== */
|
|
|
|
|
+
|
|
|
|
|
+ .deconstruction-toggle-btn {{
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ padding: 10px;
|
|
|
|
|
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ border-top: 1px solid #e5e7eb;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ transition: all 0.3s;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ gap: 6px;
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .deconstruction-toggle-btn:hover {{
|
|
|
|
|
+ background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
|
|
|
|
|
+ transform: scale(1.02);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 浮层遮罩 */
|
|
|
|
|
+ .modal-overlay {{
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ position: fixed;
|
|
|
|
|
+ top: 0;
|
|
|
|
|
+ left: 0;
|
|
|
|
|
+ right: 0;
|
|
|
|
|
+ bottom: 0;
|
|
|
|
|
+ background: rgba(0, 0, 0, 0.7);
|
|
|
|
|
+ z-index: 9998;
|
|
|
|
|
+ animation: fadeIn 0.3s ease;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .modal-overlay.active {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 浮层窗口 */
|
|
|
|
|
+ .modal-window {{
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ border-radius: 12px;
|
|
|
|
|
+ width: 90%;
|
|
|
|
|
+ max-width: 1200px;
|
|
|
|
|
+ max-height: 90vh;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
|
|
|
|
|
+ animation: slideUp 0.3s ease;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-direction: column;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ @keyframes fadeIn {{
|
|
|
|
|
+ from {{ opacity: 0; }}
|
|
|
|
|
+ to {{ opacity: 1; }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ @keyframes slideUp {{
|
|
|
|
|
+ from {{
|
|
|
|
|
+ opacity: 0;
|
|
|
|
|
+ transform: translateY(50px);
|
|
|
|
|
+ }}
|
|
|
|
|
+ to {{
|
|
|
|
|
+ opacity: 1;
|
|
|
|
|
+ transform: translateY(0);
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 浮层头部 */
|
|
|
|
|
+ .modal-header {{
|
|
|
|
|
+ padding: 20px 25px;
|
|
|
|
|
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .modal-title {{
|
|
|
|
|
+ font-size: 18px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .modal-note-title {{
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ opacity: 0.9;
|
|
|
|
|
+ margin-top: 5px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .modal-close-btn {{
|
|
|
|
|
+ background: rgba(255, 255, 255, 0.2);
|
|
|
|
|
+ border: none;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ width: 36px;
|
|
|
|
|
+ height: 36px;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .modal-close-btn:hover {{
|
|
|
|
|
+ background: rgba(255, 255, 255, 0.3);
|
|
|
|
|
+ transform: scale(1.1);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 浮层内容区 */
|
|
|
|
|
+ .modal-body {{
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ overflow-y: auto;
|
|
|
|
|
+ padding: 25px;
|
|
|
|
|
+ background: #fafbfc;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .deconstruction-content {{
|
|
|
|
|
+ max-width: 1000px;
|
|
|
|
|
+ margin: 0 auto;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .deconstruction-header {{
|
|
|
|
|
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ padding: 12px 15px;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ margin-bottom: 15px;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .original-feature {{
|
|
|
|
|
+ font-size: 16px;
|
|
|
|
|
+ margin-top: 4px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-card {{
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ border: 2px solid #e5e7eb;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ margin-bottom: 12px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-header {{
|
|
|
|
|
+ padding: 10px 15px;
|
|
|
|
|
+ background: #667eea;
|
|
|
|
|
+ color: white;
|
|
|
|
|
+ cursor: pointer;
|
|
|
|
|
+ user-select: none;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-header:hover {{
|
|
|
|
|
+ background: #5568d3;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-title {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-count {{
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ opacity: 0.9;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-toggle {{
|
|
|
|
|
+ font-size: 12px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-body {{
|
|
|
|
|
+ max-height: 0;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ transition: max-height 0.3s ease-in-out;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .dimension-body.expanded {{
|
|
|
|
|
+ max-height: 1000px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-list {{
|
|
|
|
|
+ padding: 10px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-item {{
|
|
|
|
|
+ padding: 10px;
|
|
|
|
|
+ margin-bottom: 8px;
|
|
|
|
|
+ background: #f9fafb;
|
|
|
|
|
+ border-left: 3px solid #e5e7eb;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ transition: all 0.2s;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-item:hover {{
|
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
|
+ border-left-color: #667eea;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-item.top-score {{
|
|
|
|
|
+ background: #fff9e6;
|
|
|
|
|
+ border-left: 3px solid #FFD700;
|
|
|
|
|
+ box-shadow: 0 2px 8px rgba(255, 215, 0, 0.2);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-item.top-score .feature-name {{
|
|
|
|
|
+ color: #b8860b;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-name {{
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ font-weight: 600;
|
|
|
|
|
+ color: #111827;
|
|
|
|
|
+ margin-bottom: 6px;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 6px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .top-badge {{
|
|
|
|
|
+ background: #FFD700;
|
|
|
|
|
+ color: #000;
|
|
|
|
|
+ padding: 2px 6px;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-meta-row {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 8px;
|
|
|
|
|
+ margin-bottom: 6px;
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-dimension-detail {{
|
|
|
|
|
+ background: #e5e7eb;
|
|
|
|
|
+ padding: 2px 6px;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-weight {{
|
|
|
|
|
+ background: #dbeafe;
|
|
|
|
|
+ padding: 2px 6px;
|
|
|
|
|
+ border-radius: 3px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-row {{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ gap: 10px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-score {{
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ font-weight: 700;
|
|
|
|
|
+ min-width: 50px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-score.high {{
|
|
|
|
|
+ color: #10b981;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-score.medium {{
|
|
|
|
|
+ color: #f59e0b;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-score.low {{
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-bar-container {{
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ height: 8px;
|
|
|
|
|
+ background: #e5e7eb;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-bar {{
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ transition: width 0.3s ease;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-bar.high {{
|
|
|
|
|
+ background: linear-gradient(90deg, #10b981 0%, #059669 100%);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-bar.medium {{
|
|
|
|
|
+ background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-bar.low {{
|
|
|
|
|
+ background: linear-gradient(90deg, #9ca3af 0%, #6b7280 100%);
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .similarity-explanation {{
|
|
|
|
|
+ margin-top: 8px;
|
|
|
|
|
+ padding: 8px;
|
|
|
|
|
+ background: white;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ font-size: 11px;
|
|
|
|
|
+ color: #6b7280;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ display: none;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .feature-item:hover .similarity-explanation {{
|
|
|
|
|
+ display: block;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ /* 滚动条样式 */
|
|
|
|
|
+ ::-webkit-scrollbar {{
|
|
|
|
|
+ width: 8px;
|
|
|
|
|
+ height: 8px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ ::-webkit-scrollbar-track {{
|
|
|
|
|
+ background: #f1f1f1;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ ::-webkit-scrollbar-thumb {{
|
|
|
|
|
+ background: #888;
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ ::-webkit-scrollbar-thumb:hover {{
|
|
|
|
|
+ background: #555;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ .hidden {{
|
|
|
|
|
+ display: none !important;
|
|
|
|
|
+ }}
|
|
|
|
|
+ </style>
|
|
|
|
|
+</head>
|
|
|
|
|
+<body>
|
|
|
|
|
+ <!-- 统计面板 -->
|
|
|
|
|
+ <div class="stats-panel">
|
|
|
|
|
+ <div class="stats-container">
|
|
|
|
|
+ <div class="stats-row">
|
|
|
|
|
+ <div class="stat-item">
|
|
|
|
|
+ <div class="stat-value">📊 {stats['total_features']}</div>
|
|
|
|
|
+ <div class="stat-label">原始特征数</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item">
|
|
|
|
|
+ <div class="stat-value">🔍 {stats['total_search_words']}</div>
|
|
|
|
|
+ <div class="stat-label">搜索词总数</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item">
|
|
|
|
|
+ <div class="stat-value">✅ {stats['searched_count']}</div>
|
|
|
|
|
+ <div class="stat-label">已搜索 ({stats['searched_percentage']}%)</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item">
|
|
|
|
|
+ <div class="stat-value">⏸️ {stats['not_searched_count']}</div>
|
|
|
|
|
+ <div class="stat-label">未搜索</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item">
|
|
|
|
|
+ <div class="stat-value">📝 {stats['total_notes']}</div>
|
|
|
|
|
+ <div class="stat-label">帖子总数</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item">
|
|
|
|
|
+ <div class="stat-value">🎬 {stats['video_count']}</div>
|
|
|
|
|
+ <div class="stat-label">视频 ({stats['video_percentage']}%)</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item">
|
|
|
|
|
+ <div class="stat-value">📷 {stats['normal_count']}</div>
|
|
|
|
|
+ <div class="stat-label">图文 ({stats['normal_percentage']}%)</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stats-row">
|
|
|
|
|
+ <div class="stat-item small">
|
|
|
|
|
+ <div class="stat-value">⚡ {stats['total_evaluated']}</div>
|
|
|
|
|
+ <div class="stat-label">已评估</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item small">
|
|
|
|
|
+ <div class="stat-value">⚫ {stats['total_filtered']}</div>
|
|
|
|
|
+ <div class="stat-label">已过滤 ({stats['filter_rate']}%)</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item small">
|
|
|
|
|
+ <div class="stat-value">🟢 {stats['match_complete']}</div>
|
|
|
|
|
+ <div class="stat-label">完全匹配 ({stats['complete_rate']}%)</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item small">
|
|
|
|
|
+ <div class="stat-value">🟡 {stats['match_similar']}</div>
|
|
|
|
|
+ <div class="stat-label">相似匹配 ({stats['similar_rate']}%)</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item small">
|
|
|
|
|
+ <div class="stat-value">🟠 {stats['match_weak']}</div>
|
|
|
|
|
+ <div class="stat-label">弱相似</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="stat-item small">
|
|
|
|
|
+ <div class="stat-value">🔴 {stats['match_none']}</div>
|
|
|
|
|
+ <div class="stat-label">无匹配</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 过滤控制面板 -->
|
|
|
|
|
+ <div class="filter-panel">
|
|
|
|
|
+ <span class="filter-label">🔍 筛选显示:</span>
|
|
|
|
|
+ <div class="filter-buttons">
|
|
|
|
|
+ <button class="filter-btn active" onclick="filterNotes('all')">全部</button>
|
|
|
|
|
+ <button class="filter-btn complete" onclick="filterNotes('complete')">🟢 完全匹配</button>
|
|
|
|
|
+ <button class="filter-btn similar" onclick="filterNotes('similar')">🟡 相似匹配</button>
|
|
|
|
|
+ <button class="filter-btn weak" onclick="filterNotes('weak')">🟠 弱相似</button>
|
|
|
|
|
+ <button class="filter-btn none" onclick="filterNotes('none')">🔴 无匹配</button>
|
|
|
|
|
+ <button class="filter-btn filtered" onclick="filterNotes('filtered')">⚫ 已过滤</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 主容器 -->
|
|
|
|
|
+ <div class="main-container">
|
|
|
|
|
+ <!-- 左侧导航 -->
|
|
|
|
|
+ <div class="left-sidebar" id="leftSidebar"></div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 右侧结果区 -->
|
|
|
|
|
+ <div class="right-content" id="rightContent"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 解构结果模态窗口 -->
|
|
|
|
|
+ <div class="modal-overlay" id="deconstructionModal">
|
|
|
|
|
+ <div class="modal-window">
|
|
|
|
|
+ <div class="modal-header">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <div class="modal-title">🎯 解构特征相似度分析</div>
|
|
|
|
|
+ <div class="modal-note-title" id="modalNoteTitle"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <button class="modal-close-btn" onclick="closeModal()">×</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="modal-body">
|
|
|
|
|
+ <div class="deconstruction-content" id="modalContent"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <script>
|
|
|
|
|
+ // 数据
|
|
|
|
|
+ const data = {data_json};
|
|
|
|
|
+ const stage7Data = {stage7_json};
|
|
|
|
|
+ const stage8Data = {stage8_json};
|
|
|
|
|
+ let currentFilter = 'all';
|
|
|
|
|
+
|
|
|
|
|
+ // 创建评估映射
|
|
|
|
|
+ const noteEvaluations = {{}};
|
|
|
|
|
+ data.forEach((feature, fIdx) => {{
|
|
|
|
|
+ const groups = feature['组合评估结果_分组'] || [];
|
|
|
|
|
+ groups.forEach((group, gIdx) => {{
|
|
|
|
|
+ const searches = group['top10_searches'] || [];
|
|
|
|
|
+ searches.forEach((search, sIdx) => {{
|
|
|
|
|
+ const evaluation = search['evaluation_with_filter'];
|
|
|
|
|
+ if (evaluation && evaluation.notes_evaluation) {{
|
|
|
|
|
+ evaluation.notes_evaluation.forEach(noteEval => {{
|
|
|
|
|
+ const key = `${{fIdx}}-${{gIdx}}-${{sIdx}}-${{noteEval.note_index}}`;
|
|
|
|
|
+ noteEvaluations[key] = noteEval;
|
|
|
|
|
+ }});
|
|
|
|
|
+ }}
|
|
|
|
|
+ }});
|
|
|
|
|
+ }});
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ // 获取评估类别
|
|
|
|
|
+ function getEvalCategory(noteEval) {{
|
|
|
|
|
+ if (!noteEval || noteEval['Query相关性'] !== '相关') {{
|
|
|
|
|
+ return 'filtered';
|
|
|
|
|
+ }}
|
|
|
|
|
+ const score = noteEval['综合得分'];
|
|
|
|
|
+ if (score >= 8) return 'complete';
|
|
|
|
|
+ if (score >= 6) return 'similar';
|
|
|
|
|
+ if (score >= 5) return 'weak';
|
|
|
|
|
+ return 'none';
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 渲染左侧导航
|
|
|
|
|
+ function renderLeftSidebar() {{
|
|
|
|
|
+ const sidebar = document.getElementById('leftSidebar');
|
|
|
|
|
+ let html = '';
|
|
|
|
|
+
|
|
|
|
|
+ data.forEach((feature, featureIdx) => {{
|
|
|
|
|
+ const groups = feature['组合评估结果_分组'] || [];
|
|
|
|
|
+ let totalSearches = 0;
|
|
|
|
|
+ groups.forEach(group => {{
|
|
|
|
|
+ totalSearches += (group['top10_searches'] || []).length;
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="feature-group">
|
|
|
|
|
+ <div class="feature-header" onclick="toggleFeature(${{featureIdx}})" id="feature-header-${{featureIdx}}">
|
|
|
|
|
+ <div class="feature-title">${{feature['原始特征名称']}}</div>
|
|
|
|
|
+ <div class="feature-meta">
|
|
|
|
|
+ ${{feature['来源层级']}} · 权重: ${{feature['权重'].toFixed(2)}} · ${{totalSearches}}个搜索词
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="search-words-list" id="search-words-${{featureIdx}}">
|
|
|
|
|
+ `;
|
|
|
|
|
+
|
|
|
|
|
+ groups.forEach((group, groupIdx) => {{
|
|
|
|
|
+ const baseWord = group['base_word'] || '';
|
|
|
|
|
+ const baseSimilarity = group['base_word_similarity'] || 0;
|
|
|
|
|
+ const searches = group['top10_searches'] || [];
|
|
|
|
|
+
|
|
|
|
|
+ const relatedWords = feature['高相似度候选_按base_word']?.[baseWord] || [];
|
|
|
|
|
+ const relatedWordNames = relatedWords.map(w => w['人设特征名称']).slice(0, 10).join('、');
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="base-word-group">
|
|
|
|
|
+ <div class="base-word-header" onclick="toggleBaseWord(${{featureIdx}}, ${{groupIdx}})"
|
|
|
|
|
+ id="base-word-header-${{featureIdx}}-${{groupIdx}}">
|
|
|
|
|
+ <div class="base-word-title">🎯 ${{baseWord}}</div>
|
|
|
|
|
+ <div class="base-word-meta">相似度: ${{baseSimilarity.toFixed(2)}} · ${{searches.length}}个搜索词</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="base-word-desc" id="base-word-desc-${{featureIdx}}-${{groupIdx}}">
|
|
|
|
|
+ ${{relatedWordNames || '无相关词汇'}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="search-words-sublist" id="search-words-sublist-${{featureIdx}}-${{groupIdx}}">
|
|
|
|
|
+ `;
|
|
|
|
|
+
|
|
|
|
|
+ searches.forEach((sw, swIdx) => {{
|
|
|
|
|
+ const score = sw.score || 0;
|
|
|
|
|
+ const blockId = `block-${{featureIdx}}-${{groupIdx}}-${{swIdx}}`;
|
|
|
|
|
+ const sourceWord = sw.source_word || '';
|
|
|
|
|
+
|
|
|
|
|
+ const evaluation = sw['evaluation_with_filter'];
|
|
|
|
|
+ let evalBadges = '';
|
|
|
|
|
+ if (evaluation) {{
|
|
|
|
|
+ const stats = evaluation.statistics || {{}};
|
|
|
|
|
+ const complete = stats['完全匹配(8-10)'] || 0;
|
|
|
|
|
+ const similar = stats['相似匹配(6-7)'] || 0;
|
|
|
|
|
+ const weak = stats['弱相似(5-6)'] || 0;
|
|
|
|
|
+ const none = stats['无匹配(≤4)'] || 0;
|
|
|
|
|
+ const filtered = evaluation.filtered_count || 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (complete > 0) evalBadges += `<span class="eval-badge eval-complete">🟢${{complete}}</span>`;
|
|
|
|
|
+ if (similar > 0) evalBadges += `<span class="eval-badge eval-similar">🟡${{similar}}</span>`;
|
|
|
|
|
+ if (weak > 0) evalBadges += `<span class="eval-badge eval-weak">🟠${{weak}}</span>`;
|
|
|
|
|
+ if (none > 0) evalBadges += `<span class="eval-badge eval-none">🔴${{none}}</span>`;
|
|
|
|
|
+ if (filtered > 0) evalBadges += `<span class="eval-badge eval-filtered">⚫${{filtered}}</span>`;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="search-word-item" onclick="scrollToBlock('${{blockId}}')"
|
|
|
|
|
+ id="sw-${{featureIdx}}-${{groupIdx}}-${{swIdx}}"
|
|
|
|
|
+ data-block-id="${{blockId}}">
|
|
|
|
|
+ <div class="search-word-text">
|
|
|
|
|
+ 🔍 ${{sw.search_word}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="search-word-meta" style="font-size:11px;color:#9ca3af;margin-top:2px">
|
|
|
|
|
+ 来源: ${{sourceWord}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="search-word-eval">${{evalBadges}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ sidebar.innerHTML = html;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 渲染右侧结果区
|
|
|
|
|
+ function renderRightContent() {{
|
|
|
|
|
+ const content = document.getElementById('rightContent');
|
|
|
|
|
+ let html = '';
|
|
|
|
|
+
|
|
|
|
|
+ data.forEach((feature, featureIdx) => {{
|
|
|
|
|
+ const groups = feature['组合评估结果_分组'] || [];
|
|
|
|
|
+
|
|
|
|
|
+ groups.forEach((group, groupIdx) => {{
|
|
|
|
|
+ const searches = group['top10_searches'] || [];
|
|
|
|
|
+
|
|
|
|
|
+ searches.forEach((sw, swIdx) => {{
|
|
|
|
|
+ const blockId = `block-${{featureIdx}}-${{groupIdx}}-${{swIdx}}`;
|
|
|
|
|
+ const hasSearchResult = sw.search_result != null;
|
|
|
|
|
+ const searchResult = sw.search_result || {{}};
|
|
|
|
|
+ const notes = searchResult.data?.data || [];
|
|
|
|
|
+
|
|
|
|
|
+ const videoCount = notes.filter(n => n.note_card?.type === 'video').length;
|
|
|
|
|
+ const normalCount = notes.length - videoCount;
|
|
|
|
|
+
|
|
|
|
|
+ const evaluation = sw['evaluation_with_filter'];
|
|
|
|
|
+ let evalStats = '';
|
|
|
|
|
+ if (evaluation) {{
|
|
|
|
|
+ const stats = evaluation.statistics || {{}};
|
|
|
|
|
+ const complete = stats['完全匹配(8-10)'] || 0;
|
|
|
|
|
+ const similar = stats['相似匹配(6-7)'] || 0;
|
|
|
|
|
+ const weak = stats['弱相似(5-6)'] || 0;
|
|
|
|
|
+ const none = stats['无匹配(≤4)'] || 0;
|
|
|
|
|
+ const filtered = evaluation.filtered_count || 0;
|
|
|
|
|
+
|
|
|
|
|
+ if (complete > 0) evalStats += `<span class="stat-badge eval complete">🟢 完全:${{complete}}</span>`;
|
|
|
|
|
+ if (similar > 0) evalStats += `<span class="stat-badge eval similar">🟡 相似:${{similar}}</span>`;
|
|
|
|
|
+ if (weak > 0) evalStats += `<span class="stat-badge eval weak">🟠 弱:${{weak}}</span>`;
|
|
|
|
|
+ if (none > 0) evalStats += `<span class="stat-badge eval none">🔴 无:${{none}}</span>`;
|
|
|
|
|
+ if (filtered > 0) evalStats += `<span class="stat-badge eval filtered">⚫ 过滤:${{filtered}}</span>`;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="result-block" id="${{blockId}}">
|
|
|
|
|
+ <div class="result-header">
|
|
|
|
|
+ <div class="result-title">${{sw.search_word}}</div>
|
|
|
|
|
+ <div class="result-stats">
|
|
|
|
|
+ `;
|
|
|
|
|
+
|
|
|
|
|
+ if (!hasSearchResult) {{
|
|
|
|
|
+ html += `<span class="stat-badge" style="background:#fef3c7;color:#92400e;font-weight:600">⏸️ 未执行搜索</span>`;
|
|
|
|
|
+ }} else if (notes.length === 0) {{
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <span class="stat-badge">📝 0 条帖子</span>
|
|
|
|
|
+ <span class="stat-badge" style="background:#fee2e2;color:#991b1b;font-weight:600">❌ 未找到匹配</span>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }} else {{
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <span class="stat-badge">📝 ${{notes.length}} 条帖子</span>
|
|
|
|
|
+ <span class="stat-badge">🎬 ${{videoCount}} 视频</span>
|
|
|
|
|
+ <span class="stat-badge">📷 ${{normalCount}} 图文</span>
|
|
|
|
|
+ ${{evalStats}}
|
|
|
|
|
+ `;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ html += `</div></div>`;
|
|
|
|
|
+
|
|
|
|
|
+ if (!hasSearchResult) {{
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="empty-state">
|
|
|
|
|
+ <div class="empty-icon">⏸️</div>
|
|
|
|
|
+ <div class="empty-title">该搜索词未执行搜索</div>
|
|
|
|
|
+ <div class="empty-desc">由于搜索次数限制,该搜索词未被执行</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }} else if (notes.length === 0) {{
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="empty-state">
|
|
|
|
|
+ <div class="empty-icon">❌</div>
|
|
|
|
|
+ <div class="empty-title">搜索完成,但未找到匹配的帖子</div>
|
|
|
|
|
+ <div class="empty-desc">该搜索词已执行,但小红书返回了 0 条结果</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }} else {{
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="notes-grid">
|
|
|
|
|
+ ${{notes.map((note, noteIdx) => renderNoteCard(note, featureIdx, groupIdx, swIdx, noteIdx)).join('')}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ html += `</div>`;
|
|
|
|
|
+ }});
|
|
|
|
|
+ }});
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ content.innerHTML = html;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 渲染单个帖子卡片
|
|
|
|
|
+ function renderNoteCard(note, featureIdx, groupIdx, swIdx, noteIdx) {{
|
|
|
|
|
+ const card = note.note_card || {{}};
|
|
|
|
|
+ const images = card.image_list || [];
|
|
|
|
|
+ const title = card.display_title || '无标题';
|
|
|
|
|
+ const noteType = card.type || 'normal';
|
|
|
|
|
+ const noteId = note.id || '';
|
|
|
|
|
+ const user = card.user || {{}};
|
|
|
|
|
+ const userName = user.nick_name || '未知用户';
|
|
|
|
|
+ const userAvatar = user.avatar || '';
|
|
|
|
|
+
|
|
|
|
|
+ const carouselId = `carousel-${{featureIdx}}-${{groupIdx}}-${{swIdx}}-${{noteIdx}}`;
|
|
|
|
|
+
|
|
|
|
|
+ const evalKey = `${{featureIdx}}-${{groupIdx}}-${{swIdx}}-${{noteIdx}}`;
|
|
|
|
|
+ const noteEval = noteEvaluations[evalKey];
|
|
|
|
|
+ const evalCategory = getEvalCategory(noteEval);
|
|
|
|
|
+ const evalClass = `eval-${{evalCategory}}`;
|
|
|
|
|
+
|
|
|
|
|
+ let evalSection = '';
|
|
|
|
|
+ if (noteEval) {{
|
|
|
|
|
+ const score = noteEval['综合得分'];
|
|
|
|
|
+ const scoreEmoji = score >= 8 ? '🟢' : score >= 6 ? '🟡' : score >= 5 ? '🟠' : '🔴';
|
|
|
|
|
+ const scoreText = score >= 8 ? '完全匹配' : score >= 6 ? '相似匹配' : score >= 5 ? '弱相似' : '无匹配';
|
|
|
|
|
+ const reasoning = noteEval['评分说明'] || '无';
|
|
|
|
|
+ const matchingPoints = (noteEval['关键匹配点'] || []).join('、') || '无';
|
|
|
|
|
+
|
|
|
|
|
+ evalSection = `
|
|
|
|
|
+ <div class="note-eval">
|
|
|
|
|
+ <div class="note-eval-header" onclick="event.stopPropagation(); toggleEvalDetails('${{carouselId}}')">
|
|
|
|
|
+ <span class="note-eval-score">${{scoreEmoji}} ${{scoreText}} (${{score}}分)</span>
|
|
|
|
|
+ <span class="note-eval-toggle" id="${{carouselId}}-toggle">▼ 详情</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="note-eval-details" id="${{carouselId}}-details">
|
|
|
|
|
+ <div class="eval-detail-label">评估理由:</div>
|
|
|
|
|
+ <div class="eval-detail-text">${{reasoning}}</div>
|
|
|
|
|
+ <div class="eval-detail-label">匹配要点:</div>
|
|
|
|
|
+ <div class="eval-detail-text">${{matchingPoints}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }} else if (evalCategory === 'filtered') {{
|
|
|
|
|
+ evalSection = `
|
|
|
|
|
+ <div class="note-eval">
|
|
|
|
|
+ <div class="note-eval-score">⚫ 已过滤(与搜索无关)</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 检查是否有解构数据(仅完全匹配)
|
|
|
|
|
+ const hasDeconstruction = evalCategory === 'complete' && (stage7Data[noteId] || stage8Data[noteId]);
|
|
|
|
|
+ let deconstructionSection = '';
|
|
|
|
|
+
|
|
|
|
|
+ if (hasDeconstruction) {{
|
|
|
|
|
+ deconstructionSection = `
|
|
|
|
|
+ <button class="deconstruction-toggle-btn" data-note-id="${{noteId}}" data-note-title="${{title.replace(/"/g, '"')}}">
|
|
|
|
|
+ <span>📊</span>
|
|
|
|
|
+ <span>查看解构结果</span>
|
|
|
|
|
+ </button>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ return `
|
|
|
|
|
+ <div class="note-card ${{evalClass}}" data-eval-category="${{evalCategory}}" onclick="openNote('${{noteId}}')">
|
|
|
|
|
+ <div class="image-carousel" id="${{carouselId}}">
|
|
|
|
|
+ <div class="carousel-images">
|
|
|
|
|
+ ${{images.map(img => `<img class="carousel-image" src="${{img}}" alt="帖子图片" loading="lazy">`).join('')}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ ${{images.length > 1 ? `
|
|
|
|
|
+ <button class="carousel-btn prev" onclick="event.stopPropagation(); changeImage('${{carouselId}}', -1)">←</button>
|
|
|
|
|
+ <button class="carousel-btn next" onclick="event.stopPropagation(); changeImage('${{carouselId}}', 1)">→</button>
|
|
|
|
|
+ <div class="carousel-indicators">
|
|
|
|
|
+ ${{images.map((_, i) => `<span class="dot ${{i === 0 ? 'active' : ''}}" onclick="event.stopPropagation(); goToImage('${{carouselId}}', ${{i}})"></span>`).join('')}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span class="image-counter">1/${{images.length}}</span>
|
|
|
|
|
+ ` : ''}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="note-info">
|
|
|
|
|
+ <div class="note-title">${{title}}</div>
|
|
|
|
|
+ <div class="note-meta">
|
|
|
|
|
+ <span class="note-type type-${{noteType}}">
|
|
|
|
|
+ ${{noteType === 'video' ? '🎬 视频' : '📷 图文'}}
|
|
|
|
|
+ </span>
|
|
|
|
|
+ <div class="note-author">
|
|
|
|
|
+ ${{userAvatar ? `<img class="author-avatar" src="${{userAvatar}}" alt="${{userName}}">` : ''}}
|
|
|
|
|
+ <span>${{userName}}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ ${{evalSection}}
|
|
|
|
|
+ ${{deconstructionSection}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 打开解构模态窗口
|
|
|
|
|
+ function openDeconstructionModal(noteId, noteTitle) {{
|
|
|
|
|
+ console.log('🔧 [调试] openDeconstructionModal被调用, noteId:', noteId);
|
|
|
|
|
+
|
|
|
|
|
+ const modal = document.getElementById('deconstructionModal');
|
|
|
|
|
+ const modalContent = document.getElementById('modalContent');
|
|
|
|
|
+ const modalNoteTitle = document.getElementById('modalNoteTitle');
|
|
|
|
|
+
|
|
|
|
|
+ if (!modal || !modalContent || !modalNoteTitle) {{
|
|
|
|
|
+ console.error('❌ [错误] 无法找到模态窗口元素');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 设置标题
|
|
|
|
|
+ modalNoteTitle.textContent = noteTitle || '解构分析';
|
|
|
|
|
+
|
|
|
|
|
+ // 检查是否有数据
|
|
|
|
|
+ const hasStage8Data = !!stage8Data[noteId];
|
|
|
|
|
+ console.log('📊 [调试] Stage8数据存在:', hasStage8Data);
|
|
|
|
|
+
|
|
|
|
|
+ if (!hasStage8Data) {{
|
|
|
|
|
+ console.warn('⚠️ [警告] 未找到Stage8数据, noteId:', noteId);
|
|
|
|
|
+ console.log('📋 [调试] 可用的noteId列表:', Object.keys(stage8Data));
|
|
|
|
|
+ modalContent.innerHTML = '<div style="padding: 30px; text-align: center; color: #6b7280;">暂无解构数据</div>';
|
|
|
|
|
+ }} else {{
|
|
|
|
|
+ try {{
|
|
|
|
|
+ modalContent.innerHTML = renderDeconstructionContent(noteId);
|
|
|
|
|
+ console.log('✅ [调试] 解构内容渲染成功');
|
|
|
|
|
+ }} catch (error) {{
|
|
|
|
|
+ console.error('❌ [错误] 渲染解构内容失败:', error);
|
|
|
|
|
+ modalContent.innerHTML = `<div style="padding: 30px; text-align: center; color: red;">渲染错误: ${{error.message}}</div>`;
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 显示模态窗口
|
|
|
|
|
+ modal.classList.add('active');
|
|
|
|
|
+ document.body.style.overflow = 'hidden'; // 禁止背景滚动
|
|
|
|
|
+ console.log('✅ [调试] 模态窗口已显示');
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 关闭模态窗口
|
|
|
|
|
+ function closeModal() {{
|
|
|
|
|
+ console.log('🔧 [调试] closeModal被调用');
|
|
|
|
|
+ const modal = document.getElementById('deconstructionModal');
|
|
|
|
|
+ if (modal) {{
|
|
|
|
|
+ modal.classList.remove('active');
|
|
|
|
|
+ document.body.style.overflow = ''; // 恢复滚动
|
|
|
|
|
+ console.log('✅ [调试] 模态窗口已关闭');
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // ESC键关闭模态窗口
|
|
|
|
|
+ document.addEventListener('keydown', function(e) {{
|
|
|
|
|
+ if (e.key === 'Escape') {{
|
|
|
|
|
+ const modal = document.getElementById('deconstructionModal');
|
|
|
|
|
+ if (modal && modal.classList.contains('active')) {{
|
|
|
|
|
+ closeModal();
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ // 点击遮罩层关闭模态窗口
|
|
|
|
|
+ document.addEventListener('click', function(e) {{
|
|
|
|
|
+ const modal = document.getElementById('deconstructionModal');
|
|
|
|
|
+ if (e.target === modal) {{
|
|
|
|
|
+ closeModal();
|
|
|
|
|
+ }}
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ // 渲染解构内容
|
|
|
|
|
+ function renderDeconstructionContent(noteId) {{
|
|
|
|
|
+ const stage8Info = stage8Data[noteId];
|
|
|
|
|
+ if (!stage8Info) {{
|
|
|
|
|
+ return '<div style="padding: 15px; text-align: center; color: #6b7280;">暂无解构数据</div>';
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ const originalFeature = stage8Info.original_feature || '未知特征';
|
|
|
|
|
+ const features = stage8Info.deconstructed_features || [];
|
|
|
|
|
+
|
|
|
|
|
+ // 按维度分组
|
|
|
|
|
+ const dimensionGroups = {{}};
|
|
|
|
|
+ features.forEach(feat => {{
|
|
|
|
|
+ const dim = feat.dimension || '未分类';
|
|
|
|
|
+ if (!dimensionGroups[dim]) {{
|
|
|
|
|
+ dimensionGroups[dim] = [];
|
|
|
|
|
+ }}
|
|
|
|
|
+ dimensionGroups[dim].push(feat);
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ // 为每个维度找出最高分
|
|
|
|
|
+ Object.keys(dimensionGroups).forEach(dim => {{
|
|
|
|
|
+ const feats = dimensionGroups[dim];
|
|
|
|
|
+ if (feats.length > 0) {{
|
|
|
|
|
+ const maxScore = Math.max(...feats.map(f => f.similarity_score || 0));
|
|
|
|
|
+ feats.forEach(f => {{
|
|
|
|
|
+ f.isTopInDimension = (f.similarity_score === maxScore);
|
|
|
|
|
+ }});
|
|
|
|
|
+ }}
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ let html = `
|
|
|
|
|
+ <div class="deconstruction-header">
|
|
|
|
|
+ <div>🎯 解构特征相似度分析</div>
|
|
|
|
|
+ <div class="original-feature">目标特征: "${{originalFeature}}"</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+
|
|
|
|
|
+ // 按维度排序: 灵感点 -> 目的点 -> 关键点
|
|
|
|
|
+ const dimensionOrder = ['灵感点-全新内容', '灵感点-共性差异', '灵感点-共性内容', '目的点', '关键点'];
|
|
|
|
|
+ const sortedDimensions = Object.keys(dimensionGroups).sort((a, b) => {{
|
|
|
|
|
+ const aIndex = dimensionOrder.findIndex(d => a.startsWith(d));
|
|
|
|
|
+ const bIndex = dimensionOrder.findIndex(d => b.startsWith(d));
|
|
|
|
|
+ if (aIndex === -1 && bIndex === -1) return a.localeCompare(b);
|
|
|
|
|
+ if (aIndex === -1) return 1;
|
|
|
|
|
+ if (bIndex === -1) return -1;
|
|
|
|
|
+ return aIndex - bIndex;
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ sortedDimensions.forEach((dimension, dimIdx) => {{
|
|
|
|
|
+ const feats = dimensionGroups[dimension];
|
|
|
|
|
+ const dimId = `dim-${{noteId}}-${{dimIdx}}`;
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="dimension-card">
|
|
|
|
|
+ <div class="dimension-header" onclick="event.stopPropagation(); toggleDimension('${{dimId}}')">
|
|
|
|
|
+ <div class="dimension-title">
|
|
|
|
|
+ <span>${{getDimensionIcon(dimension)}} ${{dimension}}</span>
|
|
|
|
|
+ <span class="dimension-count">(${{feats.length}}个特征)</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span class="dimension-toggle" id="${{dimId}}-toggle">▼</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="dimension-body expanded" id="${{dimId}}">
|
|
|
|
|
+ <div class="feature-list">
|
|
|
|
|
+ `;
|
|
|
|
|
+
|
|
|
|
|
+ // 按分数降序排列
|
|
|
|
|
+ feats.sort((a, b) => (b.similarity_score || 0) - (a.similarity_score || 0));
|
|
|
|
|
+
|
|
|
|
|
+ feats.forEach(feat => {{
|
|
|
|
|
+ const score = feat.similarity_score || 0;
|
|
|
|
|
+ const scoreClass = score >= 0.7 ? 'high' : score >= 0.5 ? 'medium' : 'low';
|
|
|
|
|
+ const barWidth = Math.min(score * 100, 100);
|
|
|
|
|
+ const isTop = feat.isTopInDimension;
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ <div class="feature-item ${{isTop ? 'top-score' : ''}}">
|
|
|
|
|
+ <div class="feature-name">
|
|
|
|
|
+ ${{isTop ? '<span class="top-badge">🏆 最高分</span>' : ''}}
|
|
|
|
|
+ ${{feat.feature_name || '未命名特征'}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="feature-meta-row">
|
|
|
|
|
+ <span class="feature-dimension-detail">${{feat.dimension_detail || '无分类'}}</span>
|
|
|
|
|
+ <span class="feature-weight">权重: ${{(feat.weight || 0).toFixed(1)}}</span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="similarity-row">
|
|
|
|
|
+ <span class="similarity-score ${{scoreClass}}">${{score.toFixed(3)}}</span>
|
|
|
|
|
+ <div class="similarity-bar-container">
|
|
|
|
|
+ <div class="similarity-bar ${{scoreClass}}" style="width: ${{barWidth}}%"></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="similarity-explanation">
|
|
|
|
|
+ ${{feat.similarity_explanation || '无说明'}}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ html += `
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ return html;
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 获取维度图标
|
|
|
|
|
+ function getDimensionIcon(dimension) {{
|
|
|
|
|
+ if (dimension.includes('灵感点')) return '💡';
|
|
|
|
|
+ if (dimension.includes('目的点')) return '🎯';
|
|
|
|
|
+ if (dimension.includes('关键点')) return '🔑';
|
|
|
|
|
+ return '📋';
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 切换维度卡片
|
|
|
|
|
+ function toggleDimension(dimId) {{
|
|
|
|
|
+ const body = document.getElementById(dimId);
|
|
|
|
|
+ const toggle = document.getElementById(`${{dimId}}-toggle`);
|
|
|
|
|
+
|
|
|
|
|
+ if (body.classList.contains('expanded')) {{
|
|
|
|
|
+ body.classList.remove('expanded');
|
|
|
|
|
+ toggle.textContent = '▶';
|
|
|
|
|
+ }} else {{
|
|
|
|
|
+ body.classList.add('expanded');
|
|
|
|
|
+ toggle.textContent = '▼';
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 图片轮播逻辑
|
|
|
|
|
+ const carouselStates = {{}};
|
|
|
|
|
+
|
|
|
|
|
+ function changeImage(carouselId, direction) {{
|
|
|
|
|
+ if (!carouselStates[carouselId]) {{
|
|
|
|
|
+ carouselStates[carouselId] = {{ currentIndex: 0 }};
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ const carousel = document.getElementById(carouselId);
|
|
|
|
|
+ const imagesContainer = carousel.querySelector('.carousel-images');
|
|
|
|
|
+ const images = carousel.querySelectorAll('.carousel-image');
|
|
|
|
|
+ const dots = carousel.querySelectorAll('.dot');
|
|
|
|
|
+ const counter = carousel.querySelector('.image-counter');
|
|
|
|
|
+
|
|
|
|
|
+ let newIndex = carouselStates[carouselId].currentIndex + direction;
|
|
|
|
|
+ if (newIndex < 0) newIndex = images.length - 1;
|
|
|
|
|
+ if (newIndex >= images.length) newIndex = 0;
|
|
|
|
|
+
|
|
|
|
|
+ carouselStates[carouselId].currentIndex = newIndex;
|
|
|
|
|
+ imagesContainer.style.transform = `translateX(-${{newIndex * 100}}%)`;
|
|
|
|
|
+
|
|
|
|
|
+ dots.forEach((dot, i) => {{
|
|
|
|
|
+ dot.classList.toggle('active', i === newIndex);
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ if (counter) {{
|
|
|
|
|
+ counter.textContent = `${{newIndex + 1}}/${{images.length}}`;
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ function goToImage(carouselId, index) {{
|
|
|
|
|
+ if (!carouselStates[carouselId]) {{
|
|
|
|
|
+ carouselStates[carouselId] = {{ currentIndex: 0 }};
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ const carousel = document.getElementById(carouselId);
|
|
|
|
|
+ const imagesContainer = carousel.querySelector('.carousel-images');
|
|
|
|
|
+ const dots = carousel.querySelectorAll('.dot');
|
|
|
|
|
+ const counter = carousel.querySelector('.image-counter');
|
|
|
|
|
+
|
|
|
|
|
+ carouselStates[carouselId].currentIndex = index;
|
|
|
|
|
+ imagesContainer.style.transform = `translateX(-${{index * 100}}%)`;
|
|
|
|
|
+
|
|
|
|
|
+ dots.forEach((dot, i) => {{
|
|
|
|
|
+ dot.classList.toggle('active', i === index);
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ if (counter) {{
|
|
|
|
|
+ counter.textContent = `${{index + 1}}/${{dots.length}}`;
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ function toggleFeature(featureIdx) {{
|
|
|
|
|
+ const searchWordsList = document.getElementById(`search-words-${{featureIdx}}`);
|
|
|
|
|
+ const featureHeader = document.getElementById(`feature-header-${{featureIdx}}`);
|
|
|
|
|
+
|
|
|
|
|
+ searchWordsList.classList.toggle('expanded');
|
|
|
|
|
+ featureHeader.classList.toggle('active');
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ function toggleBaseWord(featureIdx, groupIdx) {{
|
|
|
|
|
+ const baseWordHeader = document.getElementById(`base-word-header-${{featureIdx}}-${{groupIdx}}`);
|
|
|
|
|
+ const baseWordDesc = document.getElementById(`base-word-desc-${{featureIdx}}-${{groupIdx}}`);
|
|
|
|
|
+ const searchWordsSublist = document.getElementById(`search-words-sublist-${{featureIdx}}-${{groupIdx}}`);
|
|
|
|
|
+
|
|
|
|
|
+ baseWordHeader.classList.toggle('active');
|
|
|
|
|
+ baseWordDesc.classList.toggle('expanded');
|
|
|
|
|
+ searchWordsSublist.classList.toggle('expanded');
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ function scrollToBlock(blockId) {{
|
|
|
|
|
+ const block = document.getElementById(blockId);
|
|
|
|
|
+ if (block) {{
|
|
|
|
|
+ block.scrollIntoView({{ behavior: 'smooth', block: 'start' }});
|
|
|
|
|
+
|
|
|
|
|
+ document.querySelectorAll('.search-word-item').forEach(item => {{
|
|
|
|
|
+ item.classList.remove('active');
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ document.querySelectorAll(`[data-block-id="${{blockId}}"]`).forEach(item => {{
|
|
|
|
|
+ item.classList.add('active');
|
|
|
|
|
+ }});
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ function toggleEvalDetails(carouselId) {{
|
|
|
|
|
+ const details = document.getElementById(`${{carouselId}}-details`);
|
|
|
|
|
+ const toggle = document.getElementById(`${{carouselId}}-toggle`);
|
|
|
|
|
+
|
|
|
|
|
+ if (details && toggle) {{
|
|
|
|
|
+ details.classList.toggle('expanded');
|
|
|
|
|
+ toggle.textContent = details.classList.contains('expanded') ? '▲ 收起' : '▼ 详情';
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ function filterNotes(category) {{
|
|
|
|
|
+ currentFilter = category;
|
|
|
|
|
+
|
|
|
|
|
+ document.querySelectorAll('.filter-btn').forEach(btn => {{
|
|
|
|
|
+ btn.classList.remove('active');
|
|
|
|
|
+ }});
|
|
|
|
|
+ event.target.classList.add('active');
|
|
|
|
|
+
|
|
|
|
|
+ document.querySelectorAll('.note-card').forEach(card => {{
|
|
|
|
|
+ const evalCategory = card.getAttribute('data-eval-category');
|
|
|
|
|
+ if (category === 'all' || evalCategory === category) {{
|
|
|
|
|
+ card.classList.remove('hidden');
|
|
|
|
|
+ }} else {{
|
|
|
|
|
+ card.classList.add('hidden');
|
|
|
|
|
+ }}
|
|
|
|
|
+ }});
|
|
|
|
|
+
|
|
|
|
|
+ document.querySelectorAll('.result-block').forEach(block => {{
|
|
|
|
|
+ const visibleCards = block.querySelectorAll('.note-card:not(.hidden)');
|
|
|
|
|
+ if (visibleCards.length === 0) {{
|
|
|
|
|
+ block.classList.add('hidden');
|
|
|
|
|
+ }} else {{
|
|
|
|
|
+ block.classList.remove('hidden');
|
|
|
|
|
+ }}
|
|
|
|
|
+ }});
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ function openNote(noteId) {{
|
|
|
|
|
+ if (noteId) {{
|
|
|
|
|
+ window.open(`https://www.xiaohongshu.com/explore/${{noteId}}`, '_blank');
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ // 页面加载时输出调试信息
|
|
|
|
|
+ console.log('='.repeat(60));
|
|
|
|
|
+ console.log('🚀 [系统] 页面脚本加载完成');
|
|
|
|
|
+ console.log('📊 [数据] Stage6特征数:', data.length);
|
|
|
|
|
+ console.log('📊 [数据] Stage7解构数:', Object.keys(stage7Data).length);
|
|
|
|
|
+ console.log('📊 [数据] Stage8相似度数:', Object.keys(stage8Data).length);
|
|
|
|
|
+ console.log('📋 [数据] Stage8可用noteId:', Object.keys(stage8Data));
|
|
|
|
|
+ console.log('='.repeat(60));
|
|
|
|
|
+
|
|
|
|
|
+ // 初始化
|
|
|
|
|
+ document.addEventListener('DOMContentLoaded', () => {{
|
|
|
|
|
+ console.log('✅ [系统] DOM加载完成,开始初始化...');
|
|
|
|
|
+
|
|
|
|
|
+ try {{
|
|
|
|
|
+ renderLeftSidebar();
|
|
|
|
|
+ console.log('✅ [系统] 左侧导航渲染完成');
|
|
|
|
|
+
|
|
|
|
|
+ renderRightContent();
|
|
|
|
|
+ console.log('✅ [系统] 右侧内容渲染完成');
|
|
|
|
|
+
|
|
|
|
|
+ if (data.length > 0) {{
|
|
|
|
|
+ toggleFeature(0);
|
|
|
|
|
+
|
|
|
|
|
+ const firstGroups = data[0]['组合评估结果_分组'];
|
|
|
|
|
+ if (firstGroups && firstGroups.length > 0) {{
|
|
|
|
|
+ toggleBaseWord(0, 0);
|
|
|
|
|
+ }}
|
|
|
|
|
+ }}
|
|
|
|
|
+
|
|
|
|
|
+ console.log('✅ [系统] 页面初始化完成');
|
|
|
|
|
+
|
|
|
|
|
+ // 为所有解构按钮添加事件监听器
|
|
|
|
|
+ setTimeout(() => {{
|
|
|
|
|
+ const buttons = document.querySelectorAll('.deconstruction-toggle-btn');
|
|
|
|
|
+ console.log('🔍 [系统] 找到解构按钮数量:', buttons.length);
|
|
|
|
|
+
|
|
|
|
|
+ buttons.forEach((btn, index) => {{
|
|
|
|
|
+ const noteId = btn.getAttribute('data-note-id');
|
|
|
|
|
+ const noteTitle = btn.getAttribute('data-note-title');
|
|
|
|
|
+ console.log(` 按钮[${{index}}] noteId:`, noteId, ', title:', noteTitle);
|
|
|
|
|
+
|
|
|
|
|
+ // 添加事件监听器打开模态窗口
|
|
|
|
|
+ btn.addEventListener('click', function(e) {{
|
|
|
|
|
+ console.log('🖱️ [事件] 按钮点击, noteId:', noteId);
|
|
|
|
|
+ e.stopPropagation();
|
|
|
|
|
+ e.preventDefault();
|
|
|
|
|
+ openDeconstructionModal(noteId, noteTitle);
|
|
|
|
|
+ }});
|
|
|
|
|
+ }});
|
|
|
|
|
+ }}, 500);
|
|
|
|
|
+
|
|
|
|
|
+ }} catch (error) {{
|
|
|
|
|
+ console.error('❌ [错误] 初始化失败:', error);
|
|
|
|
|
+ }}
|
|
|
|
|
+ }});
|
|
|
|
|
+ </script>
|
|
|
|
|
+</body>
|
|
|
|
|
+</html>
|
|
|
|
|
+'''
|
|
|
|
|
+
|
|
|
|
|
+ with open(output_path, 'w', encoding='utf-8') as f:
|
|
|
|
|
+ f.write(html_content)
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+def main():
|
|
|
|
|
+ """主函数"""
|
|
|
|
|
+ script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
+
|
|
|
|
|
+ # 加载数据
|
|
|
|
|
+ stage6_path = os.path.join(script_dir, 'output_v2', 'stage6_with_evaluations.json')
|
|
|
|
|
+ stage7_path = os.path.join(script_dir, 'output_v2', 'stage7_with_deconstruction.json')
|
|
|
|
|
+ stage8_path = os.path.join(script_dir, 'output_v2', 'stage8_similarity_scores.json')
|
|
|
|
|
+
|
|
|
|
|
+ output_dir = os.path.join(script_dir, 'visualization')
|
|
|
|
|
+ os.makedirs(output_dir, exist_ok=True)
|
|
|
|
|
+
|
|
|
|
|
+ timestamp = datetime.now().strftime('%Y%m%d_%H%M%S')
|
|
|
|
|
+ output_path = os.path.join(output_dir, f'stage6_with_stage78_{timestamp}.html')
|
|
|
|
|
+
|
|
|
|
|
+ print(f"📖 加载Stage6数据: {stage6_path}")
|
|
|
|
|
+ data = load_data(stage6_path)
|
|
|
|
|
+ print(f"✓ 加载了 {len(data)} 个原始特征")
|
|
|
|
|
+
|
|
|
|
|
+ print(f"📖 加载Stage7数据: {stage7_path}")
|
|
|
|
|
+ stage7_mapping = load_stage7_data(stage7_path)
|
|
|
|
|
+ print(f"✓ 加载了 {len(stage7_mapping)} 个解构结果")
|
|
|
|
|
+
|
|
|
|
|
+ print(f"📖 加载Stage8数据: {stage8_path}")
|
|
|
|
|
+ stage8_mapping = load_stage8_data(stage8_path)
|
|
|
|
|
+ print(f"✓ 加载了 {len(stage8_mapping)} 个相似度评分")
|
|
|
|
|
+
|
|
|
|
|
+ print("📊 计算统计数据...")
|
|
|
|
|
+ stats = calculate_statistics(data)
|
|
|
|
|
+ print(f"✓ 统计完成:")
|
|
|
|
|
+ print(f" - 原始特征: {stats['total_features']}")
|
|
|
|
|
+ print(f" - 搜索词总数: {stats['total_search_words']}")
|
|
|
|
|
+ print(f" - 帖子总数: {stats['total_notes']}")
|
|
|
|
|
+ print(f" - 完全匹配: {stats['match_complete']} ({stats['complete_rate']}%)")
|
|
|
|
|
+
|
|
|
|
|
+ print(f"\n🎨 生成可视化页面...")
|
|
|
|
|
+ generate_html(data, stats, stage7_mapping, stage8_mapping, output_path)
|
|
|
|
|
+ print(f"✓ 生成完成: {output_path}")
|
|
|
|
|
+
|
|
|
|
|
+ print(f"\n🌐 在浏览器中打开查看:")
|
|
|
|
|
+ print(f" file://{output_path}")
|
|
|
|
|
+
|
|
|
|
|
+ return output_path
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+if __name__ == '__main__':
|
|
|
|
|
+ main()
|