A-1(ダッシュボード画面)の実装が完了しました。

実装内容:

バックエンド: summary APIに total_fields, assigned_fields, unassigned_fields を追加
フロントエンド: /dashboard に新画面を作成
概要サマリー: 全圃場数 / 作付け済み / 未割当(警告アイコン付き)
作物別集計テーブル(筆数・面積・合計行)
クイックアクセス: 4つのボタン(作付け計画・圃場管理・帳票出力・データ取込)
年度セレクタで切替可能
Navbar: 「ホーム」ボタン追加、KeinaSystemロゴクリックでダッシュボードへ
ルート (/): /allocation → /dashboard にリダイレクト先変更
http://localhost:3000/dashboard で確認できます。

残りタスク: A-7(検索・フィルタ)のみです
This commit is contained in:
Akira
2026-02-19 13:07:16 +09:00
parent cce119b1a8
commit 4afe37968b
8 changed files with 206 additions and 15 deletions

View File

@@ -1,7 +1,7 @@
'use client';
import { useRouter, usePathname } from 'next/navigation';
import { LogOut, Wheat, MapPin, FileText, Upload } from 'lucide-react';
import { LogOut, Wheat, MapPin, FileText, Upload, LayoutDashboard } from 'lucide-react';
import { logout } from '@/lib/api';
export default function Navbar() {
@@ -19,8 +19,21 @@ export default function Navbar() {
<div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div className="flex justify-between h-16">
<div className="flex items-center space-x-8">
<h1 className="text-xl font-bold text-green-700">KeinaSystem</h1>
<button onClick={() => router.push('/dashboard')} className="text-xl font-bold text-green-700 hover:text-green-800 transition-colors">
KeinaSystem
</button>
<div className="flex items-center space-x-4">
<button
onClick={() => router.push('/dashboard')}
className={`flex items-center px-3 py-2 text-sm rounded-md transition-colors ${
isActive('/dashboard')
? 'text-green-700 bg-green-50'
: 'text-gray-700 hover:text-gray-900 hover:bg-gray-100'
}`}
>
<LayoutDashboard className="h-4 w-4 mr-2" />
</button>
<button
onClick={() => router.push('/allocation')}
className={`flex items-center px-3 py-2 text-sm rounded-md transition-colors ${