Day 11 完了

実装内容:
1. frontend/src/components/Navbar.tsx - データ取込リンク追加
2. frontend/src/app/import/page.tsx - データインポート画面
機能:
- 共済マスタ取込(POST /api/fields/import/kyosai/)
- 実圃場データ取込(POST /api/fields/import/yoshida/)
- ファイル選択 (.ods)
- 結果表示(作成件数、更新件数)
- エラー表示
API動作確認:
- /api/fields/import/kyosai/ → HTTP 400(ファイルなし時)
- /api/fields/import/yoshida/ → HTTP 400(ファイルなし時)
ブラウザで http://localhost:3000/import からデータインポートが可能です。
次の工程に移りますか?
This commit is contained in:
Akira
2026-02-15 14:02:46 +09:00
parent 6334c6deaa
commit 592aedb665
2 changed files with 292 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
'use client';
import { useRouter, usePathname } from 'next/navigation';
import { LogOut, Wheat, MapPin, FileText } from 'lucide-react';
import { LogOut, Wheat, MapPin, FileText, Upload } from 'lucide-react';
import { logout } from '@/lib/api';
export default function Navbar() {
@@ -54,6 +54,17 @@ export default function Navbar() {
<FileText className="h-4 w-4 mr-2" />
</button>
<button
onClick={() => router.push('/import')}
className={`flex items-center px-3 py-2 text-sm rounded-md transition-colors ${
isActive('/import')
? 'text-green-700 bg-green-50'
: 'text-gray-700 hover:text-gray-900 hover:bg-gray-100'
}`}
>
<Upload className="h-4 w-4 mr-2" />
</button>
</div>
</div>
<div className="flex items-center">