作付け計画画面 (/allocation):

年度をlocalStorageに保存・復元(ブラウザを閉じても維持、明示的に変えるまで固定)
過去年度を表示中は琥珀色のバナー「{year}年度のデータを参照中(過去年度)」+ 「今年度に戻る」ボタン
テーブル枠も過去年度では薄いセピア調に変化
デフォルトは今年度(2026)
帳票出力画面 (/reports):

デフォルトを 2025 固定 → new Date().getFullYear() に変更
セレクタも動的5年分に変更
ダッシュボード (/dashboard):

既に今年度デフォルト(変更不要)
記憶:

CLAUDE.md「重要な設計判断」に年度管理方針を追記済み
MEMORY.md に Phase 2 のグローバル作業年度導入方針を記録済み
This commit is contained in:
Akira
2026-02-20 16:52:38 +09:00
parent 6eb19f75b7
commit 9169018392
3 changed files with 44 additions and 11 deletions

View File

@@ -26,7 +26,7 @@ const previewPdf = async (url: string) => {
};
export default function ReportsPage() {
const [year, setYear] = useState<number>(2025);
const [year, setYear] = useState<number>(new Date().getFullYear());
const [busy, setBusy] = useState<string | null>(null);
const handleAction = async (action: 'download' | 'preview', type: 'kyosai' | 'chusankan') => {
@@ -67,9 +67,9 @@ export default function ReportsPage() {
onChange={(e) => setYear(parseInt(e.target.value))}
className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 w-full max-w-xs"
>
<option value={2025}>2025</option>
<option value={2026}>2026</option>
<option value={2027}>2027</option>
{Array.from({ length: 5 }, (_, i) => new Date().getFullYear() - 2 + i).map((y) => (
<option key={y} value={y}>{y}</option>
))}
</select>
</div>