This commit is contained in:
2026-08-01 21:08:18 +08:00
parent e1e1a3d608
commit 8d535d579d
8 changed files with 1174 additions and 471 deletions
+242
View File
@@ -0,0 +1,242 @@
```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>聊天记录</title>
<style>
* {
box-sizing: border-box;
}
body {
font-family: "Microsoft YaHei", Arial, sans-serif;
background: #f1f2f6;
margin: 0;
padding: 20px;
color: #2c2c33;
}
.container {
max-width: 1300px;
margin: 0 auto;
text-align: center;
}
h1 {
margin: 0 0 8px 0;
color: #222222;
font-size: 32px;
font-weight: 800;
text-align: center;
}
.meta {
margin-bottom: 24px;
color: #7a7f99;
font-size: 16px;
text-align: center;
}
table {
width: 100%;
margin-top: 10px;
overflow: hidden;
border-collapse: collapse;
table-layout: fixed;
border-radius: 12px;
background: #ffffff;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
text-align: left;
}
thead {
color: #ffffff;
background: #d93939;
font-size: 18px;
}
th,
td {
padding: 14px 12px;
border-bottom: 1px solid #eeeeee;
font-size: 16px;
vertical-align: middle;
}
th {
font-weight: 700;
text-align: center;
}
tbody tr:last-child td {
border-bottom: none;
}
tbody tr:hover {
background: #fff2f2;
}
/* 角色列 */
.role-col {
width: 16%;
color: #333333;
font-weight: 700;
text-align: center;
word-break: break-word;
}
/* 频道列 */
.channel-col {
width: 10%;
text-align: center;
}
/* 消息列 */
.message-col {
width: 56%;
color: #333333;
font-weight: 600;
line-height: 1.65;
word-break: break-word;
overflow-wrap: anywhere;
}
/* 时间列 */
.time-col {
width: 18%;
color: #757b8f;
text-align: center;
white-space: nowrap;
}
/* 频道标签 */
.channel-tag {
display: inline-block;
min-width: 58px;
padding: 5px 10px;
border-radius: 6px;
font-size: 14px;
font-weight: 700;
text-align: center;
}
.channel-world {
color: #d93939;
border: 1px solid #f3bcbc;
background: #fff0f0;
}
.channel-school {
color: #7d43b7;
border: 1px solid #d8c0ef;
background: #f6effd;
}
.channel-team {
color: #197d5b;
border: 1px solid #b8e4d5;
background: #edf9f5;
}
.channel-map {
color: #1e6bd6;
border: 1px solid #bdd3f5;
background: #eef5ff;
}
.channel-other {
color: #666666;
border: 1px solid #d8d8d8;
background: #f4f4f4;
}
.empty-row td {
padding: 50px 20px;
color: #8a8fa3;
font-size: 17px;
text-align: center;
}
</style>
</head>
<body>
<div class="container">
<h1>聊天记录</h1>
<div class="meta">
共查询到 {{ total | default(0, true) }} 条聊天记录
</div>
<table>
<thead>
<tr>
<th class="role-col">角色</th>
<th class="channel-col">频道</th>
<th class="message-col">消息</th>
<th class="time-col">时间</th>
</tr>
</thead>
<tbody>
{% if list %}
{% for m in list %}
<tr>
<td class="role-col">
{{ m["roleName"] | default("未知角色", true) }}
</td>
<td class="channel-col">
{% if m["channel"] == "世界" %}
<span class="channel-tag channel-world">
{{ m["channel"] }}
</span>
{% elif m["channel"] == "门派" %}
<span class="channel-tag channel-school">
{{ m["channel"] }}
</span>
{% elif m["channel"] == "团队" %}
<span class="channel-tag channel-team">
{{ m["channel"] }}
</span>
{% elif m["channel"] == "地图" %}
<span class="channel-tag channel-map">
{{ m["channel"] }}
</span>
{% else %}
<span class="channel-tag channel-other">
{{ m["channel"] | default("未知", true) }}
</span>
{% endif %}
</td>
<td class="message-col">
{{ m["message"] | default("暂无消息内容", true) }}
</td>
<td class="time-col">
{{ m["time"] | default("-", true) }}
</td>
</tr>
{% endfor %}
{% else %}
<tr class="empty-row">
<td colspan="4">
暂未查询到聊天记录
</td>
</tr>
{% endif %}
</tbody>
</table>
</div>
</body>
</html>
```