diff --git a/web/app.js b/web/app.js index b20f825..6b87784 100644 --- a/web/app.js +++ b/web/app.js @@ -2832,6 +2832,7 @@ let intakeProjectId = null; async function renderIntake() { + saveUI(); // 自研/定制 tab、写入模式等页内选择也要跨刷新记忆(与其他视图同套路) const host = $("#view-intake"); // 录入页整个页面都是写操作,只读角色没有可用的部分,直接给说明 if (!canW("intake")) { @@ -4045,9 +4046,11 @@ /* ------------------------------------------- 界面状态(刷新后保持) */ const UI_KEY = "unis.ui.v2"; // v2:删掉 focusFilter=later 兼容分支后升版,旧 sessionStorage 直接作废 + // 同一工具条上的筛选必须一起记忆(曾因只存 region/origin 不存 status/risk 被挑理) const UI_FIELDS = ["view", "navFolded", "gran", "weekId", "monthIdx", "categoryId", "keyword", "projOwner", "projIdleOnly", "showArchived", "focusFilter", "focusArchived", "weeklyOwner", - "customTab", "customArchived", "customRegion", "customOrigin", "customSort", "staffArchived", "staffGroup"]; + "customTab", "customArchived", "customRegion", "customOrigin", "customStatus", "customRisk", + "customSort", "staffArchived", "staffGroup", "pageSize", "intakeType", "intakeMode"]; function saveUI() { const o = {}; @@ -4062,6 +4065,10 @@ UI_FIELDS.forEach((k) => { if (k in o) state[k] = o[k]; }); if (["board", "projects", "custom", "focus", "staff", "intake", "settings", "rbac"].indexOf(state.view) < 0) state.view = "board"; if (state.gran !== "month") state.gran = "week"; + // 数字/枚举字段防呆:sessionStorage 可能被旧版本或手改污染 + if (PAGE_SIZES.indexOf(state.pageSize) < 0) state.pageSize = PAGE_SIZES[0]; + if (state.intakeType !== "custom") state.intakeType = "general"; + if (state.intakeMode !== "ai") state.intakeMode = "direct"; } function hostNoPermission() {