Files
palladium-monitor/ticket-system/templates/ticket_list.html
T
AI Agent 26940c4574 feat: initial commit - lightweight ticket system with Flask+SQLite
Features:
- User authentication (login/register)
- Ticket CRUD with status/priority/category
- Rich text description with paste-to-image
- File attachment upload (images/documents)
- Multi-select CC recipients
- Role-based permission control (admin/user)
- In-app notifications
- Statistics dashboard
- Gunicorn production deployment
2026-07-02 15:31:27 +08:00

92 lines
3.4 KiB
HTML

{% extends "base.html" %}
{% block title %}工单列表{% endblock %}
{% block content %}
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;flex-wrap:wrap;gap:10px;">
<h1 style="font-size:24px;">📋 工单列表</h1>
</div>
<!-- 筛选器 -->
<div class="card filters">
<form method="get" style="display:flex;flex-wrap:wrap;gap:10px;align-items:center;">
<label>关键字</label>
<input name="q" value="{{ q_keyword }}" placeholder="标题 / 描述">
<label>状态</label>
<select name="status">
<option value="">全部</option>
{% for k, v in STATUS.items() %}
<option value="{{ k }}" {% if q_status == k %}selected{% endif %}>{{ v }}</option>
{% endfor %}
</select>
<label>优先级</label>
<select name="priority">
<option value="">全部</option>
{% for k, v in PRIORITY.items() %}
<option value="{{ k }}" {% if q_priority == k %}selected{% endif %}>{{ v }}</option>
{% endfor %}
</select>
<label>分类</label>
<select name="category">
<option value="">全部</option>
{% for k, v in CATEGORY.items() %}
<option value="{{ k }}" {% if q_category == k %}selected{% endif %}>{{ v }}</option>
{% endfor %}
</select>
<label>标签</label>
<input name="tag" value="{{ q_tag }}" placeholder="标签">
<button type="submit" class="btn btn-primary">筛选</button>
<a href="/tickets" class="btn btn-secondary">重置</a>
</form>
</div>
<!-- 列表 -->
<div class="card" style="padding:0;overflow-x:auto;margin-top:16px;">
{% if tickets %}
<table class="ticket-table">
<thead>
<tr>
<th>ID</th>
<th>标题</th>
<th>状态</th>
<th>优先级</th>
<th>分类</th>
<th>处理人</th>
<th>标签</th>
<th>更新</th>
</tr>
</thead>
<tbody>
{% for t in tickets %}
<tr>
<td><a href="/ticket/{{ t.id }}">#{{ t.id }}</a></td>
<td><a href="/ticket/{{ t.id }}">{{ t.title[:40] }}{% if t.title|length > 40 %}…{% endif %}</a></td>
<td><span class="badge badge-{{ t.status }}">{{ status_label(t.status) }}</span></td>
<td><span class="badge badge-{{ t.priority }}">{{ priority_label(t.priority) }}</span></td>
<td><span class="badge badge-{{ t.category }}">{{ category_label(t.category) }}</span></td>
<td style="color:var(--text-muted)">{{ t.assignee or '—' }}</td>
<td>
{% for tag in parse_tags(t.tags) %}
<span class="tag">{{ tag }}</span>
{% endfor %}
</td>
<td style="color:var(--text-muted);font-size:13px;">{{ t.updated_at.strftime('%m-%d %H:%M') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p style="padding:40px;text-align:center;color:var(--text-muted);">
{% if q_status or q_priority or q_category or q_tag or q_keyword %}
没有匹配的工单,<a href="/tickets">查看全部</a>
{% else %}
暂无工单,<a href="/ticket/new">创建第一个</a>
{% endif %}
</p>
{% endif %}
</div>
{% endblock %}