diff --git a/crop-x/src/app/(app)/land-information/archive/entry/page.tsx b/crop-x/src/app/(app)/land-information/archive/entry/page.tsx deleted file mode 100644 index ebbda94..0000000 --- a/crop-x/src/app/(app)/land-information/archive/entry/page.tsx +++ /dev/null @@ -1,18 +0,0 @@ -'use client'; - -import { Card } from '@/components/ui/card'; - -export default function EntryPage() { - return ( -
- -

地块录入维护

-
-

- 页面路径: /land-information/archive/entry -

-
-
-
- ); -} \ No newline at end of file diff --git a/crop-x/src/app/(app)/land-information/archive/manage/components/LandAttachments.tsx b/crop-x/src/app/(app)/land-information/archive/manage/components/LandAttachments.tsx new file mode 100644 index 0000000..3e5024f --- /dev/null +++ b/crop-x/src/app/(app)/land-information/archive/manage/components/LandAttachments.tsx @@ -0,0 +1,51 @@ +'use client'; + +import { Card } from '@/components/ui/card'; + +export function LandAttachments() { + return ( +
+
+ +
+
+
+ 📷 +
+

+ 点击上传或拖拽照片到此处 +

+

+ 支持 JPG、PNG 格式,最大 5MB +

+
+
+
+ +
+ +
+
+
+
+ 📄 +
+

+ 上传合同扫描件 +

+

+ 支持 PDF、图片格式 +

+
+
+ +
+

+ 💡 建议上传:承包合同、确权证书、地块测绘报告等相关文档 +

+
+
+
+
+ ); +} \ No newline at end of file diff --git a/crop-x/src/app/(app)/land-information/archive/manage/components/LandAttributes.tsx b/crop-x/src/app/(app)/land-information/archive/manage/components/LandAttributes.tsx new file mode 100644 index 0000000..1aad89a --- /dev/null +++ b/crop-x/src/app/(app)/land-information/archive/manage/components/LandAttributes.tsx @@ -0,0 +1,135 @@ +'use client'; + +import { useState } from 'react'; +import { Input } from '@/components/ui/input'; +import { Button } from '@/components/ui/button'; +import { Badge } from '@/components/ui/badge'; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; +import { Plus, X } from 'lucide-react'; +import { Land } from '@/app/(app)/land-information/archive/manage/page'; +import { toast } from 'sonner'; + +interface LandAttributesProps { + formData: Partial; + onChange: (data: Partial) => void; +} + +export function LandAttributes({ formData, onChange }: LandAttributesProps) { + const [tagInput, setTagInput] = useState(''); + + const handleFieldChange = (field: keyof Land, value: any) => { + onChange({ ...formData, [field]: value }); + }; + + // 添加标签 + const handleAddTag = () => { + if (tagInput.trim() && !formData.tags?.includes(tagInput.trim())) { + handleFieldChange('tags', [...(formData.tags || []), tagInput.trim()]); + setTagInput(''); + toast.success('标签已添加'); + } + }; + + // 删除标签 + const handleRemoveTag = (tag: string) => { + handleFieldChange('tags', formData.tags?.filter(t => t !== tag) || []); + }; + + // Enter键添加标签 + const handleTagKeyPress = (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + e.preventDefault(); + handleAddTag(); + } + }; + + return ( +
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ +
+ setTagInput(e.target.value)} + placeholder="输入标签" + onKeyPress={handleTagKeyPress} + className="flex-1" + /> + +
+
+ {formData.tags?.map((tag) => ( + + {tag} + handleRemoveTag(tag)} + /> + + ))} + {(!formData.tags || formData.tags.length === 0) && ( + 暂无标签,点击上方添加 + )} +
+
+
+ ); +} \ No newline at end of file diff --git a/crop-x/src/app/(app)/land-information/archive/manage/components/LandBasicInfo.tsx b/crop-x/src/app/(app)/land-information/archive/manage/components/LandBasicInfo.tsx new file mode 100644 index 0000000..afcd90f --- /dev/null +++ b/crop-x/src/app/(app)/land-information/archive/manage/components/LandBasicInfo.tsx @@ -0,0 +1,103 @@ +'use client'; + +import { Input } from '@/components/ui/input'; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; +import { Textarea } from '@/components/ui/textarea'; +import { Land } from '@/app/(app)/land-information/archive/manage/page'; + +interface LandBasicInfoProps { + formData: Partial; + onChange: (data: Partial) => void; + isEdit?: boolean; +} + +export function LandBasicInfo({ formData, onChange, isEdit = false }: LandBasicInfoProps) { + const handleFieldChange = (field: keyof Land, value: any) => { + onChange({ ...formData, [field]: value }); + }; + + return ( +
+
+
+ + handleFieldChange('code', e.target.value)} + placeholder="系统自动生成" + disabled={isEdit} + /> +
+ +
+ + handleFieldChange('name', e.target.value)} + placeholder="如:东大田1号地" + required + /> +
+ +
+ + handleFieldChange('location', e.target.value)} + placeholder="如:江苏省南京市浦口区" + required + /> +
+ +
+ + handleFieldChange('area', parseFloat(e.target.value) || 0)} + placeholder="请输入面积" + /> +
+ +
+ + handleFieldChange('perimeter', parseFloat(e.target.value) || 0)} + placeholder="请输入周长" + /> +
+ +
+ + +
+
+ +
+ +