feat(notice): 投递明细/失败重发/只读场景总览

This commit is contained in:
augushong
2026-10-12 12:41:03 +00:00
parent ca16cd56de
commit cc1459383f
5 changed files with 247 additions and 6 deletions

View File

@@ -79,6 +79,62 @@
</div>
</div>
<div class="detail-field-item detail-field-full">
<div class="detail-field-label">投递明细</div>
<div class="detail-field-value">
{notempty name="target_rows"}
<table class="layui-table" style="margin:0;">
<thead>
<tr>
<th>明细ID</th>
<th>接收人</th>
<th>渠道</th>
<th>状态</th>
<th>重试次数</th>
<th>错误信息</th>
<th>发送时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{volist name="target_rows" id="tvo"}
<tr>
<td>{$tvo.id}</td>
<td>{$tvo.admin_nickname}</td>
<td>{$tvo.channel_name}</td>
<td><span class="{$tvo.status_class}">{$tvo.status_name}</span></td>
<td>{$tvo.retry_count}</td>
<td>
{notempty name="tvo.error_message"}
{$tvo.error_message|htmlspecialchars}
{else/}
-
{/notempty}
</td>
<td>
{if condition="$tvo.send_time gt 0"}
{$tvo.send_time|date="Y-m-d H:i:s"}
{else/}
-
{/if}
</td>
<td>
{if condition="$tvo.status eq 3"}
<button type="button" class="layui-btn layui-btn-warm layui-btn-xs notice-resend-btn" data-target-id="{$tvo.id}">重发</button>
{else/}
-
{/if}
</td>
</tr>
{/volist}
</tbody>
</table>
{else/}
<span class="layui-text-em">暂无投递明细</span>
{/notempty}
</div>
</div>
</div>
</div>
<!-- 右侧基础信息 -->

View File

@@ -1,3 +1,21 @@
$(function(){
ua.listen();
// 无 resend 权限时隐藏行内重发按钮(与框架按钮保守隐藏口径一致)
if (ua.auth('resend') === false) {
$('.notice-resend-btn').remove();
}
// 失败投递行内重发:POST target_id,服务端原子重置 status=3 行后刷新明细
$(document).on('click', '.notice-resend-btn', function () {
var btn = $(this);
ua.request.post({
url: ua.url('system.notice/resend'),
data: {target_id: btn.data('target-id')},
}, function (res) {
ua.msg.success(res.msg || '已重发', function () {
location.reload();
});
});
});
})

View File

@@ -0,0 +1,43 @@
<div class="layuimini-container detail-container">
<div class="layuimini-main">
<div class="layui-card detail-card">
<div class="layui-card-header detail-header">
<h2 class="detail-title">通知场景总览</h2>
</div>
<div class="layui-card-body detail-content">
<table class="layui-table">
<thead>
<tr>
<th>场景</th>
<th>投递渠道</th>
<th>订阅要求</th>
<th>订阅统计</th>
</tr>
</thead>
<tbody>
{volist name="rows" id="vo"}
<tr>
<td>
{$vo.title}
<div style="color:#999;font-size:12px;">{$vo.scene}</div>
</td>
<td>{$vo.channel_names}</td>
<td>
{if condition="$vo.locked eq 1"}
<span class="layui-badge">必选</span>
{else/}
<span class="layui-badge layui-bg-blue">自愿</span>
{/if}
</td>
<td>{$vo.subscribed} / {$vo.total_admins} 位管理员</td>
</tr>
{/volist}
</tbody>
</table>
<div style="color:#999;font-size:12px;margin-top:8px;">
订阅统计口径:该场景订阅状态为启用(status=1)的去重管理员数 / 全体启用管理员数。场景由代码注册,本页仅展示。
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,3 @@
$(function(){
ua.listen();
})