feat: v1.4.0 - 典型方案采纳、推荐方案列表、审计字段、导航优化
- 添加典型方案采纳功能 (POST /api/plans/<id>/adopt) - 添加推荐方案列表 (GET /api/students/<id>/recommended-plans) - PracticePlan 新增 created_by/updated_by/updated_at 审计字段 - 方案编辑/详情页导航优化 (bfcache 处理、pageshow 事件) - 方案列表支持删除功能 - 学员列表'暂无方案/问题'样式统一 - 更新文档:问题文件已废弃(迁移到数据库) - 更新部署脚本和验证清单
This commit is contained in:
@@ -189,6 +189,30 @@
|
||||
let allProblems = [];
|
||||
let currentEditId = null;
|
||||
let currentDeleteId = null;
|
||||
const PROBLEM_FILTER_KEY = 'problem_filters';
|
||||
|
||||
function saveProblemFilterState() {
|
||||
const state = {
|
||||
search: document.getElementById('searchInput').value,
|
||||
filterCategory: document.getElementById('filterCategory').value,
|
||||
groupBy: document.getElementById('groupByCategory').value
|
||||
};
|
||||
sessionStorage.setItem(PROBLEM_FILTER_KEY, JSON.stringify(state));
|
||||
}
|
||||
|
||||
function restoreProblemFilterState() {
|
||||
const saved = sessionStorage.getItem(PROBLEM_FILTER_KEY);
|
||||
if (!saved) return;
|
||||
try {
|
||||
const state = JSON.parse(saved);
|
||||
if (state.search) document.getElementById('searchInput').value = state.search;
|
||||
if (state.filterCategory) document.getElementById('filterCategory').value = state.filterCategory;
|
||||
if (state.groupBy) document.getElementById('groupByCategory').value = state.groupBy;
|
||||
saveProblemFilterState();
|
||||
} catch (e) {
|
||||
console.error('恢复问题筛选状态失败', e);
|
||||
}
|
||||
}
|
||||
|
||||
window.pageInit = function() {
|
||||
loadProblems();
|
||||
@@ -199,10 +223,13 @@ window.pageInit = function() {
|
||||
async function loadProblems() {
|
||||
const response = await fetch('/api/problems');
|
||||
allProblems = await response.json();
|
||||
restoreProblemFilterState();
|
||||
applyProblemFilters();
|
||||
}
|
||||
|
||||
function applyProblemFilters() {
|
||||
saveProblemFilterState();
|
||||
|
||||
const search = document.getElementById('searchInput').value.toLowerCase();
|
||||
const filterCategory = document.getElementById('filterCategory').value;
|
||||
const groupBy = document.getElementById('groupByCategory').value;
|
||||
|
||||
Reference in New Issue
Block a user