{# app/templates/search_results.html (新文件) #} {% extends "base.html" %} {% block content %}

搜索结果

关键词: {{ query }}

系统功能

{% set features = [ {'name': '仪表盘', 'url': url_for('main.dashboard'), 'keywords': ['dashboard', 'home', '主页', '仪表盘']}, {'name': '个人数据', 'url': url_for('main.dashboard'), 'keywords': ['data', 'my data', '数据']}, {'name': '系统通知', 'url': url_for('main.notifications'), 'keywords': ['notification', 'notice', '通知', '公告']} ] %} {% if current_user.is_admin() %} {% set _ = features.extend([ {'name': '管理面板', 'url': url_for('admin.dashboard'), 'keywords': ['admin', 'manage', '管理']}, {'name': '用户管理', 'url': url_for('admin.manage_users'), 'keywords': ['user', 'account', '用户', '账号']}, {'name': '数据上传', 'url': url_for('admin.upload_data'), 'keywords': ['upload', '上传', 'import']}, {'name': '原始文件管理', 'url': url_for('admin.manage_raw_files'), 'keywords': ['raw', 'file', '原始', '文件']}, {'name': '数据整合', 'url': url_for('admin.integration_manager'), 'keywords': ['integration', 'process', '整合', '处理']}, {'name': 'AI推理', 'url': url_for('admin.inference_manager'), 'keywords': ['ai', 'inference', 'model', '推理', '诊断']} ]) %} {% endif %} {% set found_features = [] %} {% for feature in features %} {% for kw in feature.keywords %} {% if kw in query.lower() or query.lower() in kw %} {% if feature not in found_features %} {% set _ = found_features.append(feature) %} {% endif %} {% endif %} {% endfor %} {% endfor %} {% for feature in found_features %}
{{ feature.name }} 跳转到 {{ feature.name }} 页面
{% else %}
未找到匹配的系统功能入口
{% endfor %}

数据条目

{% if data_entries %}
{% for entry in data_entries %}
{{ entry.title }}

{{ entry.content | truncate(100) }}

{{ entry.timestamp.strftime('%Y-%m-%d') }} {% if current_user.is_admin() and entry.is_expired() %} 已过期 {% endif %}
{% endfor %}
{% else %}
没有找到相关的数据条目。
{% endif %}

通知公告

{% if notifications %}
{% for notification in notifications %}
{{ notification.title }}
{{ notification.timestamp.strftime('%Y-%m-%d') }}

{{ notification.content | truncate(150) }}

{% if current_user.is_admin() and not notification.is_published %} 草稿 {% endif %}
{% endfor %}
{% else %}
没有找到相关的通知。
{% endif %}
{% if current_user.is_admin() %}

原始数据文件夹

{% if raw_files %}
{% for folder in raw_files %}
{{ folder.folder_name }}
{{ folder.status }}
{% endfor %}
{% else %}
没有找到相关的原始数据文件夹。
{% endif %}
{% endif %}
{% endblock %}