feat: MC Report System - MySQL + Express + Vanilla JS SPA

This commit is contained in:
2026-07-12 01:23:19 +08:00
commit 247a4e851d
52 changed files with 5710 additions and 0 deletions

View File

@@ -0,0 +1,62 @@
const ReviewsPage = {
async render() {
return '<div class="loading"><i class="fas fa-spinner"></i><p>加载中...</p></div>';
},
async mount() {
const container = document.getElementById('page-content');
document.getElementById('page-title').textContent = '审查管理';
document.getElementById('page-actions').innerHTML = '';
try {
const reviews = await API.get('/reviews');
this.renderList(container, reviews);
} catch (err) {
container.innerHTML = `<div class="alert alert-danger">加载失败: ${err.message}</div>`;
}
},
renderList(container, reviews) {
container.innerHTML = `
${reviews.length === 0 ? `
<div class="empty-state">
<i class="fas fa-search"></i>
<p>暂无审查记录</p>
</div>
` : `
<div class="card">
<div class="table-container">
<table>
<thead>
<tr>
<th>#</th>
<th>关联投诉</th>
<th>状态</th>
<th>审查者</th>
<th>审查意见</th>
<th>创建时间</th>
<th>操作</th>
</tr>
</thead>
<tbody>
${reviews.map(r => `
<tr>
<td>${r.id}</td>
<td><a href="#" onclick="App.navigate('complaint',${r.complaint_id});return false" style="color:var(--primary)">#${r.complaint_id} ${Utils.escapeHtml(r.complaint_title)}</a></td>
<td>${Utils.statusBadge(r.status)}</td>
<td>${r.reviewer_name || '-'}</td>
<td class="text-sm text-muted" style="max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap">${r.review_notes ? Utils.escapeHtml(r.review_notes.slice(0, 50)) : '-'}</td>
<td class="date">${Utils.formatDate(r.created_at)}</td>
<td>
<button class="btn btn-sm btn-outline" onclick="App.navigate('complaint',${r.complaint_id})"><i class="fas fa-eye"></i></button>
</td>
</tr>
`).join('')}
</tbody>
</table>
</div>
</div>
`}
`;
}
};