Compare commits

...

2 Commits

Author SHA1 Message Date
facf39e778 fix: 修复回收站显示问题
- 修改提示文字:回收站数据可随时恢复,无30天限制
- 清空分页组件:避免显示错误的分页
2026-04-19 17:09:58 +08:00
51cecf1f4e fix: 修复回收站点击事件被侧边栏通用处理器捕获的问题
- 只为有 data-filter 属性的链接添加过滤事件处理器
- 回收站链接使用 onclick 内联事件,不会被通用处理器干扰
- 从回收站返回时正确重置 trashView 状态
2026-04-19 17:07:48 +08:00

View File

@@ -1362,9 +1362,15 @@ document.addEventListener('DOMContentLoaded', async () => {
});
// 侧边栏过滤
document.querySelectorAll('.sidebar a').forEach(a => {
document.querySelectorAll('.sidebar a[data-filter]').forEach(a => {
a.addEventListener('click', (e) => {
e.preventDefault();
// 如果在回收站视图,先退出
if (trashView) {
trashView = false;
}
document.querySelectorAll('.sidebar a').forEach(x => x.classList.remove('active'));
a.classList.add('active');
@@ -2334,13 +2340,17 @@ async function loadTrash() {
function renderTrash(items, total) {
const container = document.getElementById('itemList');
const paginationContainer = document.getElementById('pagination');
// 清空分页
paginationContainer.innerHTML = '';
// 显示回收站标题和操作按钮
let header = `
<div class="d-flex justify-content-between align-items-center mb-3">
<div>
<h5><i class="bi bi-trash"></i> 回收站 (${total} 条数据)</h5>
<small class="text-muted">删除的数据可在30天内恢复</small>
<small class="text-muted">回收站数据可随时恢复或彻底删除</small>
</div>
<div>
<button class="btn btn-outline-secondary" onclick="hideTrash()">