This commit is contained in:
2026-05-08 15:16:04 +08:00
parent 042b626ccb
commit 507fb9789a
71 changed files with 14944 additions and 0 deletions
+148
View File
@@ -0,0 +1,148 @@
{% extends "base.html" %}
{% block content %}
<section class="catalog-header panel catalog-header-tight catalog-page-header">
<div class="catalog-header-copy">
<p class="eyebrow">Communication</p>
<h1>通信部件目录</h1>
<p class="hero-text">支持分页、筛选、排序和快速编辑。</p>
</div>
<div class="catalog-header-side">
<div class="catalog-metrics">
<div class="summary-card compact">
<span class="summary-label">总记录</span>
<strong>{{ total_catalog_count }}</strong>
</div>
<div class="summary-card compact">
<span class="summary-label">当前结果</span>
<strong>{{ total_count }}</strong>
</div>
<div class="summary-card compact">
<span class="summary-label">当前页</span>
<strong>{{ page }} / {{ total_pages }}</strong>
</div>
</div>
</div>
</section>
<section class="panel catalog-actions-panel top-gap">
<div>
<p class="eyebrow">Actions</p>
<h2>新增内容</h2>
</div>
<a class="primary-button" href="{{ url_for('web.communication_new') }}">新增通信部件</a>
</section>
<section class="panel panel-wide top-gap">
<form class="search-form filter-row" method="get">
<input type="search" name="q" value="{{ search_term }}" placeholder="Part / Display / Source / Type">
<select name="source">
<option value="">全部来源</option>
{% for option in source_options %}
<option value="{{ option }}" {% if option == source_filter %}selected{% endif %}>{{ option }}</option>
{% endfor %}
</select>
<select name="antenna_type">
<option value="">全部类型</option>
{% for option in type_options %}
<option value="{{ option }}" {% if option == antenna_type_filter %}selected{% endif %}>{{ option }}</option>
{% endfor %}
</select>
<select name="sort">
{% for option in sort_options %}
<option value="{{ option.value }}" {% if option.value == sort_option %}selected{% endif %}>{{ option.label }}</option>
{% endfor %}
</select>
<button class="primary-button" type="submit">应用</button>
<a class="secondary-button" href="{{ url_for('web.communication_list') }}">重置</a>
</form>
{% if rows %}
<div class="table-shell top-gap">
<table class="data-table compact-table">
<thead>
<tr>
<th>Part</th>
<th>Display</th>
<th>Type</th>
<th>Range (km)</th>
<th>Mass (t)</th>
<th>Idle (W)</th>
<th>Source</th>
<th>Flags</th>
<th>Action</th>
</tr>
</thead>
<tbody>
{% for row in rows %}
<tr>
<td><strong>{{ row.part_name }}</strong></td>
<td>{{ row.display_name or '-' }}</td>
<td>{{ row.antenna_type or '-' }}</td>
<td>{{ row.range_km if row.range_km is not none else '-' }}</td>
<td>{{ row.mass_t if row.mass_t is not none else '-' }}</td>
<td>{{ row.idle_power_watt if row.idle_power_watt is not none else '-' }}</td>
<td>{{ row.source or '-' }}</td>
<td>
{% if row.is_active %}Active{% else %}-{% endif %}
{% if row.is_deployable %} / Deployable{% endif %}
{% if row.is_feeder %} / Feeder{% endif %}
</td>
<td>
<div class="table-actions">
<a class="table-link" href="{{ url_for('web.communication_edit', part_id=row.id) }}">编辑</a>
<form
method="post"
action="{{ url_for('web.communication_delete', part_id=row.id) }}"
class="inline-form"
onsubmit="return confirm('确认删除 {{ row.part_name }} ?')"
>
<button class="danger-link" type="submit">删除</button>
</form>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% if total_pages > 1 %}
<nav class="pagination-bar" aria-label="Communication pagination">
{% if has_prev %}
<a class="pagination-link" href="{{ prev_url }}">上一页</a>
{% else %}
<span class="pagination-link disabled">上一页</span>
{% endif %}
<div class="pagination-pages">
{% for item in page_links %}
{% if item.ellipsis %}
<span class="pagination-ellipsis">...</span>
{% elif item.current %}
<span class="pagination-link current">{{ item.number }}</span>
{% else %}
<a class="pagination-link" href="{{ item.url }}">{{ item.number }}</a>
{% endif %}
{% endfor %}
</div>
{% if has_next %}
<a class="pagination-link" href="{{ next_url }}">下一页</a>
{% else %}
<span class="pagination-link disabled">下一页</span>
{% endif %}
</nav>
{% endif %}
{% else %}
<section class="empty-state compact-empty">
<h2>没有命中结果</h2>
<p>调整筛选条件或重置后重试。</p>
</section>
{% endif %}
</section>
{% endblock %}