feat: admin用户支持删除测试数据(按条件/日期范围),含确认框+日志

This commit is contained in:
wangfq
2026-06-05 13:44:46 +08:00
parent 0ea3511b90
commit 6a3aaf3c05
4 changed files with 140 additions and 2 deletions

View File

@@ -32,6 +32,9 @@
</select>
</label>
<button id="btn-chart" class="btn-chart" onclick="toggleChart()">📈 图表</button>
{% if current_user.role == 'admin' %}
<button id="btn-delete" class="btn-delete" onclick="confirmDelete()">🗑 删除</button>
{% endif %}
</div>
<div id="chart-container" style="display:none; width:100%; height:500px; margin-bottom:16px;"></div>
@@ -73,6 +76,17 @@
font-size: 13px;
}
.btn-chart.active { background: #27ae60; color: #fff; }
.btn-delete {
margin-left: 8px;
padding: 6px 14px;
border: 1px solid #e74c3c;
background: #fff;
color: #e74c3c;
cursor: pointer;
border-radius: 4px;
font-size: 13px;
}
.btn-delete:hover { background: #e74c3c; color: #fff; }
</style>
<script src="https://cdn.jsdelivr.net/npm/echarts@5.5.0/dist/echarts.min.js"></script>
<script src="{{ url_for('static', filename='js/test_data.js') }}"></script>