feat(ticket): record urges in thread, show urge count in admin, mail admins

- aksrt_ticket gains urge_count / last_urge_time (schema 3.1.0)
- cooldown moves from transient to an atomic conditional UPDATE
- urge inserts a system reply rendered as a centered notice (not quotable)
- admin list badge + info card row for urge count / last time
- new ticket_urge_admin mail event via aksrt_ticket_urged

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-10-27 22:17:40 +08:00
1 parent ac3ed9c956
commit 5febdb35c8
14 files changed
+198 -25

No files matched your search

+7
View File
@@ -406,6 +406,11 @@
}
function messageHtml(msg, canQuote) {
if (msg.author_type === 'system') {
// 系统记录(如催单):居中提示,不可引用。
return '<li class="aksrt-ticket-msg is-system"><span class="aksrt-ticket-msg__system">'
+ icon('fa-bell') + escapeHtml(msg.content) + timeTag(msg.created_at) + '</span></li>';
}
var admin = msg.author_type === 'admin';
var name = msg.author_name || (admin ? '客服' : '我');
var avatar = admin ? icon('fa-headset') : escapeHtml(Array.from(name)[0] || '我');
@@ -550,6 +555,8 @@
sendUrge(ctx.ticket).then(function (result) {
ctx.urgeUntil = Date.now() + (parseInt(result.data && result.data.urge_wait, 10) || 0) * 1000;
notyf('已提醒客服优先处理,请耐心等待', 'success');
// 重新拉取详情,让时间线出现本次的「用户催单」系统记录。
return fetchDetail(shell, ctx.ticket.id, { scrollEnd: true });
}).catch(function (error) {
var wait = parseInt(error && error.data && error.data.urge_wait, 10) || 0;
if (wait) ctx.urgeUntil = Date.now() + wait * 1000;