next.js搭建路由01

This commit is contained in:
2025-10-20 16:19:41 +08:00
parent 727ec66189
commit 5c783c73e1
333 changed files with 7568 additions and 7091 deletions

6
crop-x/next-env.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference path="./.next/types/routes.d.ts" />
// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

814
crop-x/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -5,6 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"next:dev": "next dev --turbopack",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"lint:fix": "eslint . --ext ts,tsx --fix",
@@ -51,11 +52,12 @@
"embla-carousel-react": "^8.6.0",
"input-otp": "^1.4.2",
"lucide-react": "^0.487.0",
"next": "^15.5.6",
"next-themes": "^0.4.6",
"qrcode": "*",
"react": "^18.3.1",
"react": "^19.2.0",
"react-day-picker": "^8.10.1",
"react-dom": "^18.3.1",
"react-dom": "^19.2.0",
"react-hook-form": "^7.55.0",
"react-resizable-panels": "^2.1.7",
"recharts": "^2.15.2",
@@ -84,6 +86,6 @@
"prettier": "^3.3.3",
"tailwindcss": "^4.1.14",
"typescript": "^5.6.2",
"vite": "6.3.5"
"vite": "^6.4.0"
}
}

View File

@@ -1,12 +0,0 @@
import React from 'react'
import { useTheme } from '@/hooks/useTheme'
import Main from '@/components/layouts/Main.tsx'
function App() {
return (
<div>
<Main></Main>
</div>
)
}
export default App

View File

@@ -0,0 +1,15 @@
import { ReactNode } from 'react'
export default function AuthLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gradient-to-br from-green-50 via-blue-50 to-purple-50 flex items-center justify-center">
<div className="w-full max-w-md">
{children}
</div>
</div>
)
}

View File

@@ -0,0 +1,84 @@
import { Metadata } from 'next'
import Link from 'next/link'
export const metadata: Metadata = {
title: '登录 - Crop-X 智慧农业管理系统',
description: '用户登录页面',
}
export default function LoginPage() {
return (
<div className="bg-white rounded-lg shadow-xl p-8">
<div className="text-center mb-8">
<div className="text-4xl mb-4">🌱</div>
<h1 className="text-2xl font-bold text-gray-800 mb-2">
Crop-X
</h1>
<p className="text-gray-600">
</p>
</div>
<form className="space-y-6">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
placeholder="请输入用户名"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
placeholder="请输入密码"
/>
</div>
<div className="flex items-center justify-between">
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded"
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<a href="#" className="text-sm text-green-600 hover:text-green-500">
</a>
</div>
<button
type="submit"
className="w-full py-2 px-4 bg-green-600 hover:bg-green-700 rounded-md text-white font-medium transition-colors"
>
</button>
</form>
<div className="mt-6 text-center">
<p className="text-sm text-gray-600">
{' '}
<Link href="/register" className="text-green-600 hover:text-green-500 font-medium">
</Link>
</p>
</div>
<div className="mt-8 pt-6 border-t border-gray-200">
<p className="text-xs text-gray-500 text-center">
© 2024 Crop-X. All rights reserved.
</p>
</div>
</div>
)
}

View File

@@ -0,0 +1,121 @@
import { Metadata } from 'next'
import Link from 'next/link'
export const metadata: Metadata = {
title: '注册 - Crop-X 智慧农业管理系统',
description: '用户注册页面',
}
export default function RegisterPage() {
return (
<div className="bg-white rounded-lg shadow-xl p-8">
<div className="text-center mb-8">
<div className="text-4xl mb-4">🌱</div>
<h1 className="text-2xl font-bold text-gray-800 mb-2">
Crop-X
</h1>
<p className="text-gray-600">
</p>
</div>
<form className="space-y-6">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
placeholder="请输入姓名"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="email"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
placeholder="请输入邮箱"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
placeholder="请输入用户名"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
placeholder="请输入密码"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500 focus:border-transparent"
placeholder="请再次输入密码"
/>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded"
/>
<label className="ml-2 block text-sm text-gray-700">
{' '}
<a href="#" className="text-green-600 hover:text-green-500">
</a>{' '}
{' '}
<a href="#" className="text-green-600 hover:text-green-500">
</a>
</label>
</div>
<button
type="submit"
className="w-full py-2 px-4 bg-green-600 hover:bg-green-700 rounded-md text-white font-medium transition-colors"
>
</button>
</form>
<div className="mt-6 text-center">
<p className="text-sm text-gray-600">
{' '}
<Link href="/login" className="text-green-600 hover:text-green-500 font-medium">
</Link>
</p>
</div>
<div className="mt-8 pt-6 border-t border-gray-200">
<p className="text-xs text-gray-500 text-center">
© 2024 Crop-X. All rights reserved.
</p>
</div>
</div>
)
}

View File

@@ -0,0 +1,15 @@
"use client"
import '@/styles/globals.css'
export default function RootLayout({
}: {
children: React.ReactNode
}) {
return (
<html lang="zh-CN">
<body >
</body>
</html>
)
}

View File

@@ -0,0 +1,8 @@
export default function HomePage() {
return (
<div className="">
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function AgriculturalAssetLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
📦
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,147 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '农业资产管理 - Crop-X 智慧农业管理系统',
description: '农业资产管理系统主页面',
}
export default function AgriculturalAssetPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/agricultural-asset/basic-information"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
📋
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-asset/procurement-management"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
🛒
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-asset/inventory-management"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
📦
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-asset/material-requisition"
className="block p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors"
>
<h3 className="font-semibold text-orange-900 mb-2">
📤
</h3>
<p className="text-orange-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-asset/material-return"
className="block p-4 bg-teal-50 rounded-lg hover:bg-teal-100 transition-colors"
>
<h3 className="font-semibold text-teal-900 mb-2">
📥
</h3>
<p className="text-teal-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-asset/agricultural-supplies"
className="block p-4 bg-indigo-50 rounded-lg hover:bg-indigo-100 transition-colors"
>
<h3 className="font-semibold text-indigo-900 mb-2">
🚜
</h3>
<p className="text-indigo-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-asset/visualization-reports"
className="block p-4 bg-pink-50 rounded-lg hover:bg-pink-100 transition-colors"
>
<h3 className="font-semibold text-pink-900 mb-2">
📊
</h3>
<p className="text-pink-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">1,245 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-orange-600 font-semibold">12 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">8 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,94 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '农机档案录入与维护 - Crop-X 智慧农业管理系统',
description: '农机设备信息管理',
}
export default function MachineryEntryPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📋
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
</h3>
<form className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
placeholder="请输入农机编号"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="date"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
/>
</div>
<button
type="submit"
className="w-full px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors"
>
</button>
</form>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
</h3>
<div className="space-y-3">
{[
{ id: 'NJ001', type: '拖拉机', status: '运行中', date: '2023-01-15' },
{ id: 'NJ002', type: '收割机', status: '空闲中', date: '2023-03-20' },
{ id: 'NJ003', type: '播种机', status: '维护中', date: '2023-02-10' },
].map((machine) => (
<div key={machine.id} className="bg-white rounded-lg p-4 shadow-sm">
<div className="flex justify-between items-start">
<div>
<h4 className="font-semibold text-gray-800">{machine.id}</h4>
<p className="text-sm text-gray-600">{machine.type}</p>
<p className="text-xs text-gray-500">: {machine.date}</p>
</div>
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
machine.status === '运行中' ? 'bg-green-100 text-green-800' :
machine.status === '空闲中' ? 'bg-gray-100 text-gray-800' :
'bg-yellow-100 text-yellow-800'
}`}>
{machine.status}
</span>
</div>
</div>
))}
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,71 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '农机档案管理 - Crop-X 智慧农业管理系统',
description: '农机设备档案信息管理',
}
export default function MachineryArchivePage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📋
</h2>
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
<div className="bg-green-50 rounded-lg p-6 hover:bg-green-100 transition-colors cursor-pointer">
<h3 className="font-semibold text-green-900 mb-2">
📝
</h3>
<p className="text-green-700 text-sm">
</p>
</div>
<div className="bg-blue-50 rounded-lg p-6 hover:bg-blue-100 transition-colors cursor-pointer">
<h3 className="font-semibold text-blue-900 mb-2">
🏷
</h3>
<p className="text-blue-700 text-sm">
</p>
</div>
<div className="bg-purple-50 rounded-lg p-6 hover:bg-purple-100 transition-colors cursor-pointer">
<h3 className="font-semibold text-purple-900 mb-2">
📱
</h3>
<p className="text-purple-700 text-sm">
</p>
</div>
</div>
<div className="mt-6 bg-gray-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-green-600 mb-2">156</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-blue-600 mb-2">12</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-purple-600 mb-2">89</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-orange-600 mb-2">95%</div>
<div className="text-sm text-gray-600"></div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,35 @@
'use client'
import { useEffect } from 'react'
export default function AgriculturalMachineryError({
error,
reset,
}: {
error: Error & { digest?: string }
reset: () => void
}) {
useEffect(() => {
console.error('农机管理系统错误:', error)
}, [error])
return (
<div className="min-h-screen bg-gray-50 flex items-center justify-center">
<div className="text-center">
<div className="text-6xl mb-4">🚙</div>
<h2 className="text-2xl font-bold text-red-800 mb-4">
</h2>
<p className="text-red-600 mb-6">
{error.message || '未知系统错误'}
</p>
<button
onClick={reset}
className="px-6 py-3 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors"
>
</button>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function AgriculturalMachineryLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
🚙
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,10 @@
export default function AgriculturalMachineryLoading() {
return (
<div className="min-h-screen bg-gray-50 flex items-center justify-center">
<div className="text-center">
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-green-600 mx-auto mb-4"></div>
<p className="text-gray-600">...</p>
</div>
</div>
)
}

View File

@@ -0,0 +1,93 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '实时位置追踪 - Crop-X 智慧农业管理系统',
description: '农机设备定位监控',
}
export default function RealTimeLocationTrackingPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📍
</h2>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
<div className="lg:col-span-2">
<div className="bg-gray-100 rounded-lg h-96 flex items-center justify-center">
<div className="text-center">
<div className="text-6xl mb-4">🗺</div>
<h3 className="text-lg font-semibold text-gray-700 mb-2">
</h3>
<p className="text-gray-600">
</p>
</div>
</div>
</div>
<div className="space-y-4">
<div className="bg-green-50 rounded-lg p-4">
<h3 className="font-semibold text-green-900 mb-3">
线
</h3>
<div className="space-y-2">
{[
{ id: 'NJ001', name: '拖拉机-001', location: '东区农田', status: '工作中' },
{ id: 'NJ002', name: '收割机-002', location: '西区农田', status: '工作中' },
{ id: 'NJ003', name: '播种机-003', location: '南区农田', status: '空闲' },
].map((machine) => (
<div key={machine.id} className="bg-white rounded-lg p-3 shadow-sm">
<div className="flex items-center justify-between">
<div>
<h4 className="font-medium text-gray-800">{machine.name}</h4>
<p className="text-sm text-gray-600">{machine.location}</p>
</div>
<div className={`w-2 h-2 rounded-full ${
machine.status === '工作中' ? 'bg-green-500' : 'bg-gray-400'
}`} />
</div>
</div>
))}
</div>
</div>
<div className="bg-blue-50 rounded-lg p-4">
<h3 className="font-semibold text-blue-900 mb-3">
</h3>
<div className="space-y-2">
<div className="flex justify-between">
<span className="text-gray-600"></span>
<span className="font-semibold">12 </span>
</div>
<div className="flex justify-between">
<span className="text-gray-600">线</span>
<span className="font-semibold text-green-600">10 </span>
</div>
<div className="flex justify-between">
<span className="text-gray-600">线</span>
<span className="font-semibold text-gray-600">2 </span>
</div>
</div>
</div>
</div>
</div>
<div className="mt-6 grid grid-cols-1 md:grid-cols-3 gap-4">
<button className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
🔄
</button>
<button className="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
📍
</button>
<button className="px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors">
📊
</button>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,93 @@
import Link from 'next/link'
export default function AgriculturalMachineryPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/agricultural-machinery/archive/machinery-entry"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
📋
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-machinery/monitoring/real-time-location-tracking"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
📍
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/agricultural-machinery/scheduling/task-assignment"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
📅
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">12 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-gray-600 font-semibold">8 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-yellow-600 font-semibold">3 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,150 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '任务分配 - Crop-X 智慧农业管理系统',
description: '农机作业任务分配',
}
export default function TaskAssignmentPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📅
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
</h3>
<form className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="请输入任务名称"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>-001</option>
<option>-002</option>
<option>-003</option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>-01</option>
<option>西-02</option>
<option>-03</option>
</select>
</div>
<div className="grid grid-cols-2 gap-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="datetime-local"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="datetime-local"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
</div>
</div>
<button
type="submit"
className="w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
>
</button>
</form>
</div>
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
</h3>
<div className="space-y-3">
{[
{ id: 'T001', name: '东区收割作业', priority: '高', deadline: '2024-10-25' },
{ id: 'T002', name: '南区犁地作业', priority: '中', deadline: '2024-10-26' },
{ id: 'T003', name: '北区播种作业', priority: '低', deadline: '2024-10-27' },
].map((task) => (
<div key={task.id} className="bg-white rounded-lg p-4 shadow-sm">
<div className="flex justify-between items-start">
<div>
<h4 className="font-semibold text-gray-800">{task.name}</h4>
<p className="text-sm text-gray-600">: {task.id}</p>
<p className="text-sm text-gray-600">: {task.deadline}</p>
</div>
<div className="text-right">
<span className={`inline-block px-2 py-1 text-xs font-medium rounded-full mb-2 ${
task.priority === '高' ? 'bg-red-100 text-red-800' :
task.priority === '中' ? 'bg-yellow-100 text-yellow-800' :
'bg-green-100 text-green-800'
}`}>
{task.priority}
</span>
<br />
<button className="text-blue-600 hover:text-blue-800 text-sm">
</button>
</div>
</div>
</div>
))}
</div>
</div>
</div>
<div className="mt-6 bg-yellow-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-yellow-900 mb-4">
</h3>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-blue-600 mb-2">8</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-green-600 mb-2">15</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-purple-600 mb-2">23</div>
<div className="text-sm text-gray-600"></div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function AiCropModelLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
🤖 AI作物模型精准决策系统
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,159 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: 'AI作物模型 - Crop-X 智慧农业管理系统',
description: 'AI作物模型精准决策系统主页面',
}
export default function AiCropModelPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
AI作物模型精准决策系统
</h2>
<p className="text-gray-600 mb-6">
AI知识库管理
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/ai-crop-model/data-perception-center"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
📊
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/ai-crop-model/model-integration-center"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
🔗
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/ai-crop-model/model-application-center"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
🎯
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
<Link
href="/ai-crop-model/intelligent-decision-generation"
className="block p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors"
>
<h3 className="font-semibold text-orange-900 mb-2">
🧠
</h3>
<p className="text-orange-700 text-sm">
</p>
</Link>
<Link
href="/ai-crop-model/intelligent-decision-support"
className="block p-4 bg-teal-50 rounded-lg hover:bg-teal-100 transition-colors"
>
<h3 className="font-semibold text-teal-900 mb-2">
💡
</h3>
<p className="text-teal-700 text-sm">
</p>
</Link>
<Link
href="/ai-crop-model/decision-application"
className="block p-4 bg-indigo-50 rounded-lg hover:bg-indigo-100 transition-colors"
>
<h3 className="font-semibold text-indigo-900 mb-2">
</h3>
<p className="text-indigo-700 text-sm">
</p>
</Link>
<Link
href="/ai-crop-model/ai-knowledge-base"
className="block p-4 bg-pink-50 rounded-lg hover:bg-pink-100 transition-colors"
>
<h3 className="font-semibold text-pink-900 mb-2">
📚 AI知识库
</h3>
<p className="text-pink-700 text-sm">
</p>
</Link>
<Link
href="/ai-crop-model/monitoring-center"
className="block p-4 bg-red-50 rounded-lg hover:bg-red-100 transition-colors"
>
<h3 className="font-semibold text-red-900 mb-2">
📈
</h3>
<p className="text-red-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊 AI模型状态
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">24 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">156 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">94.5%</span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,133 @@
"use client"
import { ReactNode } from 'react'
import SideBar from '@/components/layouts/SideBar/SideBar'
// 中心配置路由数据
const centralConfigData = {
versions: ["1.0.0", "2.0.0"],
navMain: [
{
title: "租户管理",
url: "/central-config/tenant-management",
icon: "🏢",
items: [
{
title: "租户创建管理",
url: "/central-config/tenant-management/tenant-creation",
isActive: false
},
{
title: "租户配置管理",
url: "/central-config/tenant-management/tenant-configuration",
isActive: false
},
{
title: "租户授权管理",
url: "/central-config/tenant-management/tenant-authorization",
isActive: false
}
]
},
{
title: "用户管理",
url: "/central-config/user-management",
icon: "👥",
items: [
{
title: "用户账号管理",
url: "/central-config/user-management/user-account-management",
isActive: false
},
{
title: "角色权限管理",
url: "/central-config/user-management/role-permission-management",
isActive: false
},
{
title: "用户行为跟踪",
url: "/central-config/user-management/user-behavior-tracking",
isActive: false
}
]
},
{
title: "系统参数",
url: "/central-config/system-parameters",
icon: "🔧",
items: [
{
title: "基础配置管理",
url: "/central-config/system-parameters/basic-configuration",
isActive: false
},
{
title: "业务规则设置",
url: "/central-config/system-parameters/business-rule-settings",
isActive: false
},
{
title: "接口配置管理",
url: "/central-config/system-parameters/interface-configuration",
isActive: false
}
]
},
{
title: "系统监控",
url: "/central-config/system-monitoring",
icon: "📈",
items: [
{
title: "性能监控管理",
url: "/central-config/system-monitoring/performance-monitoring",
isActive: false
},
{
title: "日志管理",
url: "/central-config/system-monitoring/log-management",
isActive: false
},
{
title: "异常处理管理",
url: "/central-config/system-monitoring/exception-handling",
isActive: false
}
]
},
{
title: "消息中心",
url: "/central-config/message-center",
icon: "📨",
items: [
{
title: "消息推送管理",
url: "/central-config/message-center/message-push-management",
isActive: false
},
{
title: "消息发送",
url: "/central-config/message-center/message-send",
isActive: false
},
{
title: "通知设置管理",
url: "/central-config/message-center/notification-settings",
isActive: false
},
{
title: "反馈管理",
url: "/central-config/message-center/feedback-management",
isActive: false
}
]
}
]
}
export default function CentralConfigLayout({
children,
}: {
children: ReactNode
}) {
return <SideBar data={centralConfigData}>{children}</SideBar>
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function MessageCenterLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
📨
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,146 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '消息发送 - Crop-X 智慧农业管理系统',
description: '消息推送管理页面',
}
export default function MessageSendPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📤
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
</h3>
<form className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="请输入消息标题"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<textarea
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
rows={4}
placeholder="请输入消息内容"
></textarea>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<div className="space-y-2">
<label className="flex items-center">
<input type="checkbox" className="mr-2" defaultChecked />
</label>
<label className="flex items-center">
<input type="checkbox" className="mr-2" />
</label>
<label className="flex items-center">
<input type="checkbox" className="mr-2" />
</label>
</div>
</div>
<button
type="submit"
className="w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors"
>
</button>
</form>
</div>
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
</h3>
<div className="space-y-3">
{[
{ id: 'MSG001', title: '系统维护通知', recipients: '全体用户', time: '2024-10-20 14:30', status: '已发送' },
{ id: 'MSG002', title: '农机任务分配', recipients: '农机操作员', time: '2024-10-20 12:15', status: '已发送' },
{ id: 'MSG003', title: '天气预警', recipients: '农场管理员', time: '2024-10-20 09:45', status: '已发送' },
{ id: 'MSG004', title: '数据备份提醒', recipients: '系统管理员', time: '2024-10-19 23:00', status: '已发送' },
].map((message) => (
<div key={message.id} className="bg-white rounded-lg p-4 shadow-sm">
<div className="flex justify-between items-start">
<div>
<h4 className="font-semibold text-gray-800">{message.title}</h4>
<p className="text-sm text-gray-600">: {message.recipients}</p>
<p className="text-xs text-gray-500">{message.time}</p>
</div>
<span className="inline-block px-2 py-1 text-xs font-medium bg-green-100 text-green-800 rounded-full">
{message.status}
</span>
</div>
</div>
))}
</div>
</div>
</div>
<div className="mt-6 bg-yellow-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-yellow-900 mb-4">
📊
</h3>
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-blue-600 mb-2">156</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-green-600 mb-2">98.5%</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-purple-600 mb-2">1,234</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-orange-600 mb-2">8</div>
<div className="text-sm text-gray-600"></div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,111 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '消息中心 - Crop-X 智慧农业管理系统',
description: '消息推送管理页面',
}
export default function MessageCenterPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/central-config/message-center/message-push-management"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
📤
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/central-config/message-center/message-send"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
📨
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/central-config/message-center/notification-settings"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
<Link
href="/central-config/message-center/feedback-management"
className="block p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors"
>
<h3 className="font-semibold text-orange-900 mb-2">
💬
</h3>
<p className="text-orange-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">156 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-orange-600 font-semibold">23 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">8 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,123 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '中心配置管理 - Crop-X 智慧农业管理系统',
description: '中心配置管理系统主页面',
}
export default function CentralConfigPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/central-config/tenant-management"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
🏢
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/central-config/user-management"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
👥
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/central-config/system-parameters"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
🔧
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
<Link
href="/central-config/system-monitoring"
className="block p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors"
>
<h3 className="font-semibold text-orange-900 mb-2">
📈
</h3>
<p className="text-orange-700 text-sm">
</p>
</Link>
<Link
href="/central-config/message-center"
className="block p-4 bg-teal-50 rounded-lg hover:bg-teal-100 transition-colors"
>
<h3 className="font-semibold text-teal-900 mb-2">
📨
</h3>
<p className="text-teal-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">12 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">248 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">99.8%</span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,185 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '异常处理 - Crop-X 智慧农业管理系统',
description: '系统异常处理管理页面',
}
export default function ExceptionHandlingPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="bg-red-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-red-900 mb-4">
</h3>
<div className="space-y-3">
{[
{
id: 'ERR001',
type: '数据库连接异常',
severity: '高',
time: '2024-10-20 15:30:25',
status: 'active',
description: 'MySQL连接池耗尽无法获取新连接'
},
{
id: 'ERR002',
type: 'API超时异常',
severity: '中',
time: '2024-10-20 15:28:15',
status: 'active',
description: '第三方天气API调用超时'
},
{
id: 'ERR003',
type: '内存溢出警告',
severity: '中',
time: '2024-10-20 15:25:42',
status: 'resolved',
description: 'JVM内存使用率超过85%阈值'
},
].map((error) => (
<div key={error.id} className="bg-white rounded-lg p-4 shadow-sm border-l-4 border-red-500">
<div className="flex justify-between items-start mb-2">
<div>
<h4 className="font-semibold text-gray-800">{error.type}</h4>
<p className="text-sm text-gray-600">{error.description}</p>
<p className="text-xs text-gray-500 mt-1">{error.time}</p>
</div>
<div className="flex flex-col items-end space-y-1">
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
error.severity === '高' ? 'bg-red-100 text-red-800' : 'bg-yellow-100 text-yellow-800'
}`}>
{error.severity}
</span>
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
error.status === 'active' ? 'bg-orange-100 text-orange-800' : 'bg-green-100 text-green-800'
}`}>
{error.status === 'active' ? '活跃' : '已解决'}
</span>
</div>
</div>
<div className="flex space-x-2 mt-3">
<button className="px-3 py-1 bg-blue-600 text-white text-xs rounded hover:bg-blue-700">
</button>
<button className="px-3 py-1 bg-green-600 text-white text-xs rounded hover:bg-green-700">
</button>
<button className="px-3 py-1 bg-purple-600 text-white text-xs rounded hover:bg-purple-700">
</button>
</div>
</div>
))}
</div>
</div>
<div className="bg-yellow-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-yellow-900 mb-4">
</h3>
<div className="space-y-4">
<div className="bg-white rounded-lg p-4">
<h4 className="font-medium text-gray-800 mb-3"></h4>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-red-600">23 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">18 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-orange-600">5 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">15</span>
</div>
</div>
</div>
<div className="bg-white rounded-lg p-4">
<h4 className="font-medium text-gray-800 mb-3"></h4>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-purple-600">8 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">6 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">5 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-orange-600">4 </span>
</div>
</div>
</div>
</div>
</div>
</div>
<div className="mt-6 bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
🔧
</h3>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<h4 className="font-medium text-gray-800 mb-3"></h4>
<div className="space-y-2">
<div className="flex justify-between items-center p-2 bg-white rounded">
<span className="text-sm text-gray-700"></span>
<span className="text-sm text-green-600"></span>
</div>
<div className="flex justify-between items-center p-2 bg-white rounded">
<span className="text-sm text-gray-700"></span>
<span className="text-sm text-green-600"></span>
</div>
<div className="flex justify-between items-center p-2 bg-white rounded">
<span className="text-sm text-gray-700"></span>
<span className="text-sm text-gray-600"></span>
</div>
<div className="flex justify-between items-center p-2 bg-white rounded">
<span className="text-sm text-gray-700"></span>
<span className="text-sm text-green-600"></span>
</div>
</div>
</div>
<div>
<h4 className="font-medium text-gray-800 mb-3"></h4>
<div className="grid grid-cols-2 gap-2">
<button className="px-3 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm">
</button>
<button className="px-3 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors text-sm">
</button>
<button className="px-3 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors text-sm">
</button>
<button className="px-3 py-2 bg-orange-600 text-white rounded-md hover:bg-orange-700 transition-colors text-sm">
</button>
</div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function SystemMonitoringLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
📈
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,160 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '日志管理 - Crop-X 智慧农业管理系统',
description: '系统日志管理页面',
}
export default function LogManagementPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📋
</h2>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
<div className="lg:col-span-2">
<div className="bg-gray-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
</h3>
<div className="mb-4 flex space-x-4">
<select className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option>ERROR</option>
<option>WARN</option>
<option>INFO</option>
<option>DEBUG</option>
</select>
<input
type="text"
placeholder="搜索日志内容..."
className="flex-1 px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<button className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
</div>
<div className="bg-white rounded-lg p-4 max-h-96 overflow-y-auto">
<div className="space-y-3">
{[
{ time: '2024-10-20 15:30:25', level: 'INFO', module: '用户管理', message: '用户登录成功: admin', status: 'normal' },
{ time: '2024-10-20 15:28:15', level: 'WARN', module: '农机管理', message: '农机NJ001离线超时', status: 'warning' },
{ time: '2024-10-20 15:25:42', level: 'ERROR', module: '数据同步', message: 'API调用失败: timeout', status: 'error' },
{ time: '2024-10-20 15:22:18', level: 'INFO', module: '任务调度', message: '定时任务执行完成', status: 'normal' },
{ time: '2024-10-20 15:20:05', level: 'INFO', module: '系统监控', message: '系统性能指标正常', status: 'normal' },
].map((log, index) => (
<div key={index} className="border-l-4 border-gray-300 pl-4 py-2 hover:bg-gray-50">
<div className="flex justify-between items-start">
<div className="flex-1">
<div className="flex items-center space-x-2 mb-1">
<span className={`text-xs font-medium px-2 py-1 rounded ${
log.level === 'ERROR' ? 'bg-red-100 text-red-800' :
log.level === 'WARN' ? 'bg-yellow-100 text-yellow-800' :
log.level === 'INFO' ? 'bg-blue-100 text-blue-800' :
'bg-gray-100 text-gray-800'
}`}>
{log.level}
</span>
<span className="text-sm text-gray-500">{log.time}</span>
<span className="text-sm text-gray-600">[{log.module}]</span>
</div>
<p className="text-sm text-gray-700">{log.message}</p>
</div>
</div>
</div>
))}
</div>
</div>
<div className="mt-4 flex justify-between items-center">
<div className="text-sm text-gray-600">
1-5 1,245
</div>
<div className="flex space-x-2">
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
</button>
<button className="px-3 py-1 bg-blue-600 text-white rounded-md">
1
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
2
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
</button>
</div>
</div>
</div>
</div>
<div className="space-y-4">
<div className="bg-green-50 rounded-lg p-4">
<h4 className="font-semibold text-green-900 mb-3"></h4>
<div className="space-y-2">
<div className="flex justify-between">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">1,245</span>
</div>
<div className="flex justify-between">
<span className="text-gray-600"></span>
<span className="font-semibold text-red-600">12</span>
</div>
<div className="flex justify-between">
<span className="text-gray-600"></span>
<span className="font-semibold text-yellow-600">45</span>
</div>
<div className="flex justify-between">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">1,188</span>
</div>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-4">
<h4 className="font-semibold text-blue-900 mb-3"></h4>
<div className="space-y-2">
<button className="w-full px-3 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors text-sm">
</button>
<button className="w-full px-3 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors text-sm">
</button>
<button className="w-full px-3 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors text-sm">
</button>
</div>
</div>
<div className="bg-purple-50 rounded-lg p-4">
<h4 className="font-semibold text-purple-900 mb-3"></h4>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-sm text-gray-600"></span>
<select className="text-xs px-2 py-1 border border-gray-300 rounded">
<option>INFO</option>
<option>DEBUG</option>
<option>WARN</option>
<option>ERROR</option>
</select>
</div>
<div className="flex justify-between items-center">
<span className="text-sm text-gray-600"></span>
<span className="text-sm font-semibold">30</span>
</div>
<div className="flex justify-between items-center">
<span className="text-sm text-gray-600"></span>
<span className="text-sm text-green-600"></span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,103 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '系统监控 - Crop-X 智慧农业管理系统',
description: '系统监控管理页面',
}
export default function SystemMonitoringPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/central-config/system-monitoring/performance-monitoring"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
📊
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/central-config/system-monitoring/log-management"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
📋
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/central-config/system-monitoring/exception-handling"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">15 8</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600">CPU使用率</span>
<span className="text-blue-600 font-semibold">45.2%</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600">使</span>
<span className="text-purple-600 font-semibold">68.7%</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-orange-600 font-semibold">3 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,119 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '性能监控 - Crop-X 智慧农业管理系统',
description: '系统性能监控管理页面',
}
export default function PerformanceMonitoringPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📊
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<div className="flex justify-between items-center mb-2">
<span className="text-gray-700">CPU 使</span>
<span className="font-semibold text-green-600">45.2%</span>
</div>
<div className="w-full bg-gray-200 rounded-full h-2">
<div className="bg-green-600 h-2 rounded-full" style={{ width: '45.2%' }}></div>
</div>
</div>
<div>
<div className="flex justify-between items-center mb-2">
<span className="text-gray-700">使</span>
<span className="font-semibold text-blue-600">68.7%</span>
</div>
<div className="w-full bg-gray-200 rounded-full h-2">
<div className="bg-blue-600 h-2 rounded-full" style={{ width: '68.7%' }}></div>
</div>
</div>
<div>
<div className="flex justify-between items-center mb-2">
<span className="text-gray-700">使</span>
<span className="font-semibold text-purple-600">32.1%</span>
</div>
<div className="w-full bg-gray-200 rounded-full h-2">
<div className="bg-purple-600 h-2 rounded-full" style={{ width: '32.1%' }}></div>
</div>
</div>
<div>
<div className="flex justify-between items-center mb-2">
<span className="text-gray-700"></span>
<span className="font-semibold text-orange-600">28.5%</span>
</div>
<div className="w-full bg-gray-200 rounded-full h-2">
<div className="bg-orange-600 h-2 rounded-full" style={{ width: '28.5%' }}></div>
</div>
</div>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
</h3>
<div className="bg-white rounded-lg p-4 h-64 flex items-center justify-center">
<div className="text-center">
<div className="text-4xl mb-2">📈</div>
<p className="text-gray-600">
</p>
<p className="text-sm text-gray-500">
()
</p>
</div>
</div>
</div>
</div>
<div className="mt-6 grid grid-cols-1 md:grid-cols-3 gap-4">
<div className="bg-white rounded-lg p-4 border-l-4 border-green-500">
<h4 className="font-semibold text-gray-800 mb-2"></h4>
<div className="text-2xl font-bold text-green-600 mb-1">125ms</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 border-l-4 border-blue-500">
<h4 className="font-semibold text-gray-800 mb-2"></h4>
<div className="text-2xl font-bold text-blue-600 mb-1">1,245</div>
<div className="text-sm text-gray-600">/</div>
</div>
<div className="bg-white rounded-lg p-4 border-l-4 border-purple-500">
<h4 className="font-semibold text-gray-800 mb-2"></h4>
<div className="text-2xl font-bold text-purple-600 mb-1">99.9%</div>
<div className="text-sm text-gray-600"></div>
</div>
</div>
<div className="mt-6 bg-yellow-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-yellow-900 mb-4">
</h3>
<div className="space-y-2">
<div className="flex items-center">
<div className="w-2 h-2 bg-yellow-500 rounded-full mr-3"></div>
<span className="text-gray-700">使</span>
</div>
<div className="flex items-center">
<div className="w-2 h-2 bg-green-500 rounded-full mr-3"></div>
<span className="text-gray-700">CPU使用率正常</span>
</div>
<div className="flex items-center">
<div className="w-2 h-2 bg-blue-500 rounded-full mr-3"></div>
<span className="text-gray-700"></span>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,223 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '基础配置 - Crop-X 智慧农业管理系统',
description: '基础配置管理页面',
}
export default function BasicConfigurationPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="space-y-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
defaultValue="Crop-X 智慧农业管理系统"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
defaultValue="v2.1.0"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
<option>Asia/Shanghai (UTC+8)</option>
<option>Asia/Beijing (UTC+8)</option>
<option>UTC (UTC+0)</option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
<option></option>
<option>English</option>
</select>
</div>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
()
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="30"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="8"
/>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
HTTPS访问
</label>
</div>
</div>
</div>
</div>
<div className="space-y-6">
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
defaultValue="20"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
()
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
defaultValue="24"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
(MB)
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
defaultValue="10"
/>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
Gzip压缩
</label>
</div>
</div>
</div>
<div className="bg-orange-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-orange-900 mb-4">
</h3>
<div className="space-y-4">
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300 rounded"
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="email"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500"
defaultValue="admin@crop-x.com"
/>
</div>
</div>
</div>
</div>
</div>
<div className="mt-6 flex justify-end space-x-4">
<button className="px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors">
</button>
<button className="px-6 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,243 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '业务规则设置 - Crop-X 智慧农业管理系统',
description: '业务规则设置管理页面',
}
export default function BusinessRuleSettingsPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📋
</h2>
<div className="space-y-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
🚙
</h3>
<div className="space-y-4">
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800">线</h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3">线</p>
<div className="flex items-center space-x-4">
<input
type="number"
className="w-20 px-2 py-1 border border-gray-300 rounded"
defaultValue="8"
/>
<span className="text-sm text-gray-600">/</span>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<input
type="number"
className="w-20 px-2 py-1 border border-gray-300 rounded"
defaultValue="30"
/>
<span className="text-sm text-gray-600"></span>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<select className="px-3 py-1 border border-gray-300 rounded">
<option></option>
<option></option>
<option></option>
</select>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
🌾
</h3>
<div className="space-y-4">
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<input
type="number"
className="w-24 px-2 py-1 border border-gray-300 rounded"
defaultValue="1000"
/>
<span className="text-sm text-gray-600"></span>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<select className="px-3 py-1 border border-gray-300 rounded">
<option>A/B/C三级</option>
<option>//</option>
<option>//</option>
</select>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
</div>
</div>
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
📋
</h3>
<div className="space-y-4">
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<select className="px-3 py-1 border border-gray-300 rounded">
<option></option>
<option></option>
<option></option>
</select>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<input
type="number"
className="w-20 px-2 py-1 border border-gray-300 rounded"
defaultValue="2"
/>
<span className="text-sm text-gray-600"></span>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-orange-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<input
type="number"
className="w-20 px-2 py-1 border border-gray-300 rounded"
defaultValue="85"
/>
<span className="text-sm text-gray-600">% 线</span>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
</div>
</div>
<div className="bg-orange-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-orange-900 mb-4">
📊
</h3>
<div className="space-y-4">
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<select className="px-3 py-1 border border-gray-300 rounded">
<option></option>
<option></option>
<option></option>
</select>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
<div className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-2">
<h4 className="font-medium text-gray-800"></h4>
<span className="text-sm text-green-600"></span>
</div>
<p className="text-sm text-gray-600 mb-3"></p>
<div className="flex items-center space-x-4">
<input
type="number"
className="w-20 px-2 py-1 border border-gray-300 rounded"
defaultValue="90"
/>
<span className="text-sm text-gray-600"></span>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
</div>
</div>
</div>
</div>
<div className="mt-6 flex justify-end space-x-4">
<button className="px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
<button className="px-6 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,299 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '接口配置 - Crop-X 智慧农业管理系统',
description: '接口配置管理页面',
}
export default function InterfaceConfigurationPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
🔌
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="space-y-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
🌤
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
API提供商
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
<option></option>
<option></option>
<option>OpenWeatherMap</option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
API密钥
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
defaultValue="••••••••••••••••"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<div className="flex items-center space-x-2">
<input
type="number"
className="w-20 px-2 py-1 border border-gray-300 rounded"
defaultValue="1000"
/>
<span className="text-sm text-gray-600">/</span>
</div>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<button className="w-full px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
📱
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
Access Key ID
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="••••••••••••••••"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
Access Key Secret
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="••••••••••••••••"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="Crop-X农业"
/>
</div>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
</div>
</div>
</div>
<div className="space-y-6">
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
📧
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
SMTP服务器
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
defaultValue="smtp.crop-x.com"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
defaultValue="587"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="email"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
defaultValue="noreply@crop-x.com"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500"
defaultValue="••••••••••••••••"
/>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
SSL/TLS加密
</label>
</div>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
<div className="bg-orange-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-orange-900 mb-4">
🗺
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500">
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
API Key
</label>
<input
type="password"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500"
defaultValue="••••••••••••••••"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<div className="flex space-x-2">
<input
type="text"
className="flex-1 px-2 py-1 border border-gray-300 rounded"
placeholder="经度"
defaultValue="116.397428"
/>
<input
type="text"
className="flex-1 px-2 py-1 border border-gray-300 rounded"
placeholder="纬度"
defaultValue="39.90923"
/>
</div>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500">
<option>10 - </option>
<option>12 - </option>
<option>14 - </option>
<option>16 - </option>
</select>
</div>
<button className="w-full px-4 py-2 bg-orange-600 text-white rounded-md hover:bg-orange-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
<div className="mt-6 bg-gray-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
<div className="bg-white rounded-lg p-4 border-l-4 border-green-500">
<h4 className="font-medium text-gray-800 mb-2"></h4>
<div className="flex items-center justify-between">
<span className="text-sm text-green-600"></span>
<span className="text-xs text-gray-500">响应: 125ms</span>
</div>
</div>
<div className="bg-white rounded-lg p-4 border-l-4 border-green-500">
<h4 className="font-medium text-gray-800 mb-2"></h4>
<div className="flex items-center justify-between">
<span className="text-sm text-green-600"></span>
<span className="text-xs text-gray-500">响应: 89ms</span>
</div>
</div>
<div className="bg-white rounded-lg p-4 border-l-4 border-yellow-500">
<h4 className="font-medium text-gray-800 mb-2"></h4>
<div className="flex items-center justify-between">
<span className="text-sm text-yellow-600"></span>
<span className="text-xs text-gray-500">响应: 456ms</span>
</div>
</div>
<div className="bg-white rounded-lg p-4 border-l-4 border-green-500">
<h4 className="font-medium text-gray-800 mb-2"></h4>
<div className="flex items-center justify-between">
<span className="text-sm text-green-600"></span>
<span className="text-xs text-gray-500">响应: 67ms</span>
</div>
</div>
</div>
</div>
<div className="mt-6 flex justify-end space-x-4">
<button className="px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors">
</button>
<button className="px-6 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
<button className="px-6 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function SystemParametersLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
🔧
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,103 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '系统参数 - Crop-X 智慧农业管理系统',
description: '系统参数管理页面',
}
export default function SystemParametersPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/central-config/system-parameters/basic-configuration"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/central-config/system-parameters/business-rule-settings"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
📋
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/central-config/system-parameters/interface-configuration"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
🔌
</h3>
<p className="text-purple-700 text-sm">
API接口和第三方服务配置
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">45 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">23 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">12 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-orange-600 font-semibold">3 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function TenantManagementLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
🏢
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,163 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '租户管理 - Crop-X 智慧农业管理系统',
description: '租户管理页面',
}
export default function TenantManagementPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/central-config/tenant-management/tenant-creation"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/central-config/tenant-management/tenant-configuration"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/central-config/tenant-management/tenant-authorization"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
🔐
</h3>
<p className="text-purple-700 text-sm">
访
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">12 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">10 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-orange-600 font-semibold">2 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">1,248 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📋
</h3>
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200">
<thead className="bg-gray-50">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
ID
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{[
{ id: 'T001', name: '绿色农业合作社', status: 'active', time: '2024-10-20 10:30' },
{ id: 'T002', name: '丰收农场', status: 'active', time: '2024-10-19 14:15' },
{ id: 'T003', name: '智慧农业科技', status: 'pending', time: '2024-10-18 09:45' },
{ id: 'T004', name: '现代农业示范园', status: 'active', time: '2024-10-17 16:20' },
].map((tenant) => (
<tr key={tenant.id}>
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
{tenant.id}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{tenant.name}
</td>
<td className="px-6 py-4 whitespace-nowrap">
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
tenant.status === 'active' ? 'bg-green-100 text-green-800' : 'bg-yellow-100 text-yellow-800'
}`}>
{tenant.status === 'active' ? '活跃' : '待审核'}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{tenant.time}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium">
<button className="text-blue-600 hover:text-blue-900 mr-3"></button>
<button className="text-red-600 hover:text-red-900"></button>
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,243 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '租户授权 - Crop-X 智慧农业管理系统',
description: '租户授权管理页面',
}
export default function TenantAuthorizationPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
🔐
</h2>
<div className="mb-6">
<div className="flex items-center space-x-4">
<select className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option>T001 - 绿</option>
<option>T002 - </option>
<option>T003 - </option>
<option>T004 - </option>
</select>
<button className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
</div>
</div>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
<div className="lg:col-span-2">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
📋
</h3>
<div className="space-y-4">
{[
{ module: '智能农机管理', code: 'machinery', enabled: true, features: ['档案管理', '实时监控', '任务调度', '数据分析'] },
{ module: '地块信息管理', code: 'land', enabled: true, features: ['地块档案', '地图管理', '空间分析', '环境监测'] },
{ module: '农事操作管理', code: 'farming', enabled: true, features: ['农事计划', '任务管理', '操作执行', '知识库'] },
{ module: '农业资产管理', code: 'asset', enabled: false, features: ['基础信息', '采购管理', '库存管理', '物资领用'] },
{ module: 'AI作物模型', code: 'ai-model', enabled: false, features: ['数据感知', '模型应用', '智能决策', '监控中心'] },
{ module: '水肥控制', code: 'irrigation', enabled: true, features: ['水肥机管理', '智能灌溉', '施肥配方', '实时监测'] },
{ module: '中心配置', code: 'config', enabled: false, features: ['租户管理', '用户管理', '系统参数', '消息中心'] },
].map((item, index) => (
<div key={index} className="bg-white rounded-lg p-4">
<div className="flex justify-between items-center mb-3">
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded mr-3"
defaultChecked={item.enabled}
/>
<h4 className="font-medium text-gray-800">{item.module}</h4>
<span className="ml-2 text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded">
{item.code}
</span>
</div>
<button className="text-blue-600 hover:text-blue-800 text-sm">
</button>
</div>
<div className="grid grid-cols-2 md:grid-cols-4 gap-2">
{item.features.map((feature, featureIndex) => (
<label key={featureIndex} className="flex items-center text-sm">
<input
type="checkbox"
className="h-3 w-3 text-green-600 focus:ring-green-500 border-gray-300 rounded mr-2"
defaultChecked={item.enabled}
/>
<span className={item.enabled ? 'text-gray-700' : 'text-gray-400'}>
{feature}
</span>
</label>
))}
</div>
</div>
))}
</div>
</div>
</div>
<div className="space-y-6">
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
🔑 API访问权限
</h3>
<div className="space-y-4">
<div className="flex items-center justify-between">
<span className="text-gray-700">API访问</span>
<span className="text-sm text-green-600"></span>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
API Key
</label>
<div className="flex space-x-2">
<input
type="password"
className="flex-1 px-3 py-2 border border-gray-300 rounded-md bg-gray-50"
value="••••••••••••••••••••••••••••••••"
readOnly
/>
<button className="px-3 py-1 bg-blue-600 text-white text-sm rounded hover:bg-blue-700">
</button>
</div>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
访
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option>1000/</option>
<option>5000/</option>
<option>10000/</option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
IP白名单
</label>
<textarea
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
rows={3}
placeholder="输入允许访问的IP地址每行一个"
></textarea>
</div>
</div>
</div>
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">4 / 7</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">18 / 28</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600">API权限</span>
<span className="font-semibold text-purple-600"></span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-sm text-gray-500">2024-10-20 15:30</span>
</div>
</div>
</div>
<div className="bg-orange-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-orange-900 mb-4">
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
<div className="mt-6 bg-yellow-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-yellow-900 mb-4">
📋
</h3>
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200">
<thead className="bg-yellow-100">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{[
{ time: '2024-10-20 15:30', type: '模块授权', content: '启用智能农机管理模块', operator: 'admin' },
{ time: '2024-10-20 14:15', type: '权限调整', content: '关闭农业资产管理模块', operator: 'admin' },
{ time: '2024-10-20 10:45', type: 'API配置', content: '重置API密钥', operator: 'admin' },
{ time: '2024-10-19 16:20', type: '权限调整', content: '启用水肥控制模块', operator: 'admin' },
].map((record, index) => (
<tr key={index}>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{record.time}
</td>
<td className="px-6 py-4 whitespace-nowrap">
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
record.type === '模块授权' ? 'bg-green-100 text-green-800' :
record.type === '权限调整' ? 'bg-blue-100 text-blue-800' :
'bg-purple-100 text-purple-800'
}`}>
{record.type}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{record.content}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{record.operator}
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
<div className="mt-6 flex justify-end space-x-4">
<button className="px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors">
</button>
<button className="px-6 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,287 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '租户配置 - Crop-X 智慧农业管理系统',
description: '租户配置管理页面',
}
export default function TenantConfigurationPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
</h2>
<div className="mb-6">
<div className="flex items-center space-x-4">
<select className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option>T001 - 绿</option>
<option>T002 - </option>
<option>T003 - </option>
<option>T004 - </option>
</select>
<button className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
</div>
</div>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="space-y-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
defaultValue="绿色农业合作社"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
Logo
</label>
<div className="flex items-center space-x-4">
<div className="w-16 h-16 bg-gray-200 rounded-lg flex items-center justify-center">
<span className="text-gray-500">Logo</span>
</div>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
Logo
</button>
<button className="px-3 py-1 border border-gray-300 text-sm rounded hover:bg-gray-50">
</button>
</div>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
defaultValue="张三"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="tel"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
defaultValue="13800138000"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
<option></option>
<option></option>
<option></option>
</select>
</div>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="100"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
(GB)
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="50"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
()
</label>
<input
type="number"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
defaultValue="365"
/>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
API访问
</label>
</div>
</div>
</div>
</div>
<div className="space-y-6">
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
<option></option>
<option>绿</option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
<option></option>
<option>English</option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
<option>Asia/Shanghai (UTC+8)</option>
<option>Asia/Beijing (UTC+8)</option>
<option>UTC (UTC+0)</option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
<option>YYYY-MM-DD</option>
<option>YYYY/MM/DD</option>
<option>DD/MM/YYYY</option>
<option>MM/DD/YYYY</option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
<option>1,234.56</option>
<option>1.234,56</option>
<option>1234.56</option>
</select>
</div>
</div>
</div>
<div className="bg-orange-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-orange-900 mb-4">
</h3>
<div className="space-y-4">
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300 rounded"
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="email"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500"
defaultValue="admin@green-agri.com"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="tel"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500"
defaultValue="13800138000"
/>
</div>
</div>
</div>
</div>
</div>
<div className="mt-6 flex justify-end space-x-4">
<button className="px-6 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors">
</button>
<button className="px-6 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,221 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '租户创建 - Crop-X 智慧农业管理系统',
description: '租户创建管理页面',
}
export default function TenantCreationPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
</h3>
<form className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
<span className="text-red-500">*</span>
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
placeholder="请输入租户名称"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
<span className="text-red-500">*</span>
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
placeholder="请输入租户代码(英文)"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
<span className="text-red-500">*</span>
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
placeholder="请输入联系人姓名"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
<span className="text-red-500">*</span>
</label>
<input
type="tel"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
placeholder="请输入联系电话"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
<span className="text-red-500">*</span>
</label>
<input
type="email"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
placeholder="请输入电子邮箱"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
<span className="text-red-500">*</span>
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500">
<option></option>
<option></option>
<option></option>
<option>广</option>
<option></option>
<option></option>
<option></option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<textarea
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
rows={3}
placeholder="请输入详细地址"
></textarea>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<textarea
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-green-500"
rows={3}
placeholder="请输入备注说明"
></textarea>
</div>
<div className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-green-600 focus:ring-green-500 border-gray-300 rounded"
defaultChecked
/>
<label className="ml-2 block text-sm text-gray-700">
</label>
</div>
<div className="flex space-x-4">
<button
type="submit"
className="flex-1 px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors"
>
</button>
<button
type="button"
className="flex-1 px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
>
</button>
</div>
</form>
</div>
<div className="space-y-6">
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
📋
</h3>
<div className="space-y-3 text-sm text-gray-700">
<div className="flex items-start">
<div className="w-2 h-2 bg-blue-500 rounded-full mt-1.5 mr-3"></div>
<p>2-50</p>
</div>
<div className="flex items-start">
<div className="w-2 h-2 bg-blue-500 rounded-full mt-1.5 mr-3"></div>
<p>3-20</p>
</div>
<div className="flex items-start">
<div className="w-2 h-2 bg-blue-500 rounded-full mt-1.5 mr-3"></div>
<p></p>
</div>
<div className="flex items-start">
<div className="w-2 h-2 bg-blue-500 rounded-full mt-1.5 mr-3"></div>
<p></p>
</div>
<div className="flex items-start">
<div className="w-2 h-2 bg-blue-500 rounded-full mt-1.5 mr-3"></div>
<p></p>
</div>
</div>
</div>
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors">
📥
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
📄
</button>
<button className="w-full px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
📊
</button>
</div>
</div>
<div className="bg-yellow-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-yellow-900 mb-4">
📈
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">3 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-orange-600">2 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">1 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-purple-600">100%</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function UserManagementLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
👥
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,178 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '用户管理 - Crop-X 智慧农业管理系统',
description: '用户管理页面',
}
export default function UserManagementPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/central-config/user-management/user-account-management"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
👤
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/central-config/user-management/role-permission-management"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
🔐
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/central-config/user-management/user-behavior-tracking"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
📊
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">248 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">186 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">12 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-orange-600 font-semibold">5 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📋
</h3>
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200">
<thead className="bg-gray-50">
<tr>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
<th className="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{[
{ username: 'admin', name: '系统管理员', role: '超级管理员', tenant: '系统', lastLogin: '2024-10-20 15:30', status: 'active' },
{ username: 'zhangsan', name: '张三', role: '农场管理员', tenant: '绿色农业合作社', lastLogin: '2024-10-20 14:15', status: 'active' },
{ username: 'lisi', name: '李四', role: '农机操作员', tenant: '丰收农场', lastLogin: '2024-10-20 12:45', status: 'active' },
{ username: 'wangwu', name: '王五', role: '技术员', tenant: '智慧农业科技', lastLogin: '2024-10-19 16:20', status: 'inactive' },
{ username: 'zhaoliu', name: '赵六', role: '观察员', tenant: '现代农业示范园', lastLogin: '2024-10-18 09:30', status: 'pending' },
].map((user, index) => (
<tr key={index}>
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">
{user.username}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{user.name}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{user.role}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{user.tenant}
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
{user.lastLogin}
</td>
<td className="px-6 py-4 whitespace-nowrap">
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
user.status === 'active' ? 'bg-green-100 text-green-800' :
user.status === 'inactive' ? 'bg-gray-100 text-gray-800' :
'bg-yellow-100 text-yellow-800'
}`}>
{user.status === 'active' ? '活跃' : user.status === 'inactive' ? '未激活' : '待审核'}
</span>
</td>
<td className="px-6 py-4 whitespace-nowrap text-sm font-medium">
<button className="text-blue-600 hover:text-blue-900 mr-3"></button>
<button className="text-red-600 hover:text-red-900"></button>
</td>
</tr>
))}
</tbody>
</table>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,245 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '角色权限管理 - Crop-X 智慧农业管理系统',
description: '角色权限管理页面',
}
export default function RolePermissionManagementPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
🔐
</h2>
<div className="grid grid-cols-1 lg:grid-cols-2 gap-6">
<div className="space-y-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
🎭
</h3>
<div className="space-y-4">
<div className="flex justify-between items-center mb-4">
<h4 className="font-medium text-gray-800"></h4>
<button className="px-3 py-1 bg-green-600 text-white text-sm rounded hover:bg-green-700">
</button>
</div>
{[
{ name: '超级管理员', code: 'super_admin', users: 3, description: '拥有系统所有权限' },
{ name: '农场管理员', code: 'farm_admin', users: 45, description: '管理农场整体运营' },
{ name: '农机操作员', code: 'machine_operator', users: 89, description: '操作和维护农机设备' },
{ name: '技术员', code: 'technician', users: 67, description: '负责技术支持和分析' },
{ name: '观察员', code: 'observer', users: 44, description: '只读权限,查看数据' },
].map((role, index) => (
<div key={index} className="bg-white rounded-lg p-4">
<div className="flex justify-between items-start mb-2">
<div>
<h5 className="font-medium text-gray-800">{role.name}</h5>
<p className="text-sm text-gray-600">{role.description}</p>
<p className="text-xs text-gray-500 mt-1">: {role.code}</p>
</div>
<div className="flex items-center space-x-2">
<span className="px-2 py-1 text-xs bg-blue-100 text-blue-800 rounded-full">
{role.users}
</span>
<button className="text-blue-600 hover:text-blue-800 text-sm">
</button>
<button className="text-red-600 hover:text-red-800 text-sm">
</button>
</div>
</div>
</div>
))}
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="请输入角色名称"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<input
type="text"
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
placeholder="请输入角色代码(英文)"
/>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<textarea
className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
rows={3}
placeholder="请输入角色描述"
></textarea>
</div>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
</div>
</div>
</div>
<div className="space-y-6">
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
🔑
</h3>
<div className="mb-4">
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-purple-500">
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</div>
<div className="space-y-3">
{[
{
module: '智能农机管理',
permissions: ['查看', '创建', '编辑', '删除', '导出']
},
{
module: '地块信息管理',
permissions: ['查看', '创建', '编辑', '删除', '导出']
},
{
module: '农事操作管理',
permissions: ['查看', '创建', '编辑', '删除', '导出']
},
{
module: '农业资产管理',
permissions: ['查看', '创建', '编辑', '删除', '导出']
},
{
module: 'AI作物模型',
permissions: ['查看', '创建', '编辑', '删除', '导出']
},
{
module: '水肥控制',
permissions: ['查看', '创建', '编辑', '删除', '导出']
},
{
module: '系统配置',
permissions: ['查看', '创建', '编辑', '删除', '导出']
},
].map((module, index) => (
<div key={index} className="bg-white rounded-lg p-3">
<div className="flex items-center justify-between mb-2">
<h4 className="font-medium text-gray-800">{module.module}</h4>
<label className="flex items-center text-sm">
<input
type="checkbox"
className="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded mr-2"
/>
</label>
</div>
<div className="flex flex-wrap gap-2">
{module.permissions.map((permission, permIndex) => (
<label key={permIndex} className="flex items-center">
<input
type="checkbox"
className="h-3 w-3 text-purple-600 focus:ring-purple-500 border-gray-300 rounded mr-1"
/>
<span className="text-xs text-gray-700">{permission}</span>
</label>
))}
</div>
</div>
))}
</div>
<button className="w-full mt-4 px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors">
</button>
</div>
<div className="bg-orange-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-orange-900 mb-4">
👥
</h3>
<div className="space-y-4">
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<select className="w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-orange-500">
<option></option>
<option> - </option>
<option> - </option>
<option> - </option>
<option> - </option>
</select>
</div>
<div>
<label className="block text-sm font-medium text-gray-700 mb-2">
</label>
<div className="space-y-2">
{['超级管理员', '农场管理员', '农机操作员', '技术员', '观察员'].map((role, index) => (
<label key={index} className="flex items-center">
<input
type="checkbox"
className="h-4 w-4 text-orange-600 focus:ring-orange-500 border-gray-300 rounded mr-2"
/>
<span className="text-sm text-gray-700">{role}</span>
</label>
))}
</div>
</div>
<button className="w-full px-4 py-2 bg-orange-600 text-white rounded-md hover:bg-orange-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
<div className="mt-6 bg-gray-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊 使
</h3>
<div className="grid grid-cols-1 md:grid-cols-4 gap-4">
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-green-600 mb-2">5</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-blue-600 mb-2">35</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-purple-600 mb-2">18</div>
<div className="text-sm text-gray-600"></div>
</div>
<div className="bg-white rounded-lg p-4 text-center">
<div className="text-2xl font-bold text-orange-600 mb-2">42</div>
<div className="text-sm text-gray-600"></div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,283 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '用户账号管理 - Crop-X 智慧农业管理系统',
description: '用户账号管理页面',
}
export default function UserAccountManagementPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
👤
</h2>
<div className="mb-6 flex justify-between items-center">
<div className="flex items-center space-x-4">
<input
type="text"
placeholder="搜索用户名、姓名或邮箱..."
className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 w-80"
/>
<select className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
<select className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
<button className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
</div>
<button className="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
<div className="lg:col-span-2">
<div className="bg-gray-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
</h3>
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200">
<thead className="bg-gray-100">
<tr>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
<input type="checkbox" className="h-4 w-4 text-gray-600 focus:ring-gray-500 border-gray-300 rounded" />
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{[
{
username: 'admin',
name: '系统管理员',
email: 'admin@crop-x.com',
avatar: '👨‍💼',
role: '超级管理员',
tenant: '系统',
status: 'active',
createTime: '2024-01-01'
},
{
username: 'zhangsan',
name: '张三',
email: 'zhangsan@green-agri.com',
avatar: '👨‍🌾',
role: '农场管理员',
tenant: '绿色农业合作社',
status: 'active',
createTime: '2024-03-15'
},
{
username: 'lisi',
name: '李四',
email: 'lisi@harvest.com',
avatar: '👩‍🌾',
role: '农机操作员',
tenant: '丰收农场',
status: 'active',
createTime: '2024-05-20'
},
{
username: 'wangwu',
name: '王五',
email: 'wangwu@smart-agri.com',
avatar: '👨‍🔧',
role: '技术员',
tenant: '智慧农业科技',
status: 'inactive',
createTime: '2024-07-10'
},
{
username: 'zhaoliu',
name: '赵六',
email: 'zhaoliu@modern-agri.com',
avatar: '👩‍🔬',
role: '观察员',
tenant: '现代农业示范园',
status: 'pending',
createTime: '2024-09-05'
},
].map((user, index) => (
<tr key={index} className="hover:bg-gray-50">
<td className="px-4 py-3 whitespace-nowrap">
<input type="checkbox" className="h-4 w-4 text-gray-600 focus:ring-gray-500 border-gray-300 rounded" />
</td>
<td className="px-4 py-3 whitespace-nowrap">
<div className="flex items-center">
<div className="text-2xl mr-3">{user.avatar}</div>
<div>
<div className="text-sm font-medium text-gray-900">{user.name}</div>
<div className="text-sm text-gray-500">@{user.username}</div>
<div className="text-xs text-gray-400">{user.email}</div>
</div>
</div>
</td>
<td className="px-4 py-3 whitespace-nowrap">
<span className="px-2 py-1 text-xs font-medium bg-blue-100 text-blue-800 rounded-full">
{user.role}
</span>
</td>
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
{user.tenant}
</td>
<td className="px-4 py-3 whitespace-nowrap">
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
user.status === 'active' ? 'bg-green-100 text-green-800' :
user.status === 'inactive' ? 'bg-gray-100 text-gray-800' :
'bg-yellow-100 text-yellow-800'
}`}>
{user.status === 'active' ? '活跃' : user.status === 'inactive' ? '未激活' : '待审核'}
</span>
</td>
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
{user.createTime}
</td>
<td className="px-4 py-3 whitespace-nowrap text-sm font-medium">
<button className="text-blue-600 hover:text-blue-900 mr-2"></button>
<button className="text-green-600 hover:text-green-900 mr-2"></button>
<button className="text-red-600 hover:text-red-900"></button>
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mt-4 flex justify-between items-center">
<div className="text-sm text-gray-600">
1-5 248
</div>
<div className="flex space-x-2">
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
</button>
<button className="px-3 py-1 bg-blue-600 text-white rounded-md">
1
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
2
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
3
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
...
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
</button>
</div>
</div>
</div>
</div>
<div className="space-y-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
📊
</h3>
<div className="space-y-3">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">248</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">186</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-orange-600">5</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-red-600">12</span>
</div>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
🎭
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-purple-600">3</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">45</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">89</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-orange-600">67</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-gray-600">44</span>
</div>
</div>
</div>
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded-md hover:bg-purple-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-orange-600 text-white rounded-md hover:bg-orange-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,337 @@
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '用户行为跟踪 - Crop-X 智慧农业管理系统',
description: '用户行为跟踪管理页面',
}
export default function UserBehaviorTrackingPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-2xl font-bold text-gray-800 mb-6">
📊
</h2>
<div className="mb-6 flex items-center space-x-4">
<input
type="text"
placeholder="搜索用户..."
className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<select className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500">
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
<input
type="date"
className="px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500"
/>
<button className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
</button>
<button className="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
<div className="grid grid-cols-1 lg:grid-cols-4 gap-6">
<div className="lg:col-span-3">
<div className="bg-gray-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📋
</h3>
<div className="overflow-x-auto">
<table className="min-w-full divide-y divide-gray-200">
<thead className="bg-gray-100">
<tr>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
IP地址
</th>
<th className="px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider">
</th>
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{[
{
time: '2024-10-20 15:30:25',
user: '张三',
type: '登录',
module: '系统认证',
description: '用户登录系统',
ip: '192.168.1.100',
status: 'success'
},
{
time: '2024-10-20 15:28:15',
user: '李四',
type: '查看页面',
module: '智能农机管理',
description: '查看农机列表页面',
ip: '192.168.1.101',
status: 'success'
},
{
time: '2024-10-20 15:25:42',
user: '王五',
type: '创建数据',
module: '地块信息管理',
description: '创建新的地块信息',
ip: '192.168.1.102',
status: 'success'
},
{
time: '2024-10-20 15:22:18',
user: '赵六',
type: '编辑数据',
module: '农事操作管理',
description: '编辑农事任务信息',
ip: '192.168.1.103',
status: 'success'
},
{
time: '2024-10-20 15:20:05',
user: '张三',
type: '导出数据',
module: '系统配置',
description: '导出用户列表',
ip: '192.168.1.100',
status: 'success'
},
{
time: '2024-10-20 15:18:30',
user: '李四',
type: '删除数据',
module: '农业资产管理',
description: '删除资产记录',
ip: '192.168.1.101',
status: 'warning'
},
{
time: '2024-10-20 15:15:45',
user: '王五',
type: '登录',
module: '系统认证',
description: '用户登录失败',
ip: '192.168.1.102',
status: 'error'
},
].map((record, index) => (
<tr key={index} className="hover:bg-gray-50">
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
{record.time}
</td>
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-900">
{record.user}
</td>
<td className="px-4 py-3 whitespace-nowrap">
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
record.type === '登录' ? 'bg-green-100 text-green-800' :
record.type === '查看页面' ? 'bg-blue-100 text-blue-800' :
record.type === '创建数据' ? 'bg-purple-100 text-purple-800' :
record.type === '编辑数据' ? 'bg-orange-100 text-orange-800' :
record.type === '导出数据' ? 'bg-teal-100 text-teal-800' :
'bg-red-100 text-red-800'
}`}>
{record.type}
</span>
</td>
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
{record.module}
</td>
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
{record.description}
</td>
<td className="px-4 py-3 whitespace-nowrap text-sm text-gray-500">
{record.ip}
</td>
<td className="px-4 py-3 whitespace-nowrap">
<span className={`px-2 py-1 text-xs font-medium rounded-full ${
record.status === 'success' ? 'bg-green-100 text-green-800' :
record.status === 'warning' ? 'bg-yellow-100 text-yellow-800' :
'bg-red-100 text-red-800'
}`}>
{record.status === 'success' ? '成功' : record.status === 'warning' ? '警告' : '失败'}
</span>
</td>
</tr>
))}
</tbody>
</table>
</div>
<div className="mt-4 flex justify-between items-center">
<div className="text-sm text-gray-600">
1-7 1,456
</div>
<div className="flex space-x-2">
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
</button>
<button className="px-3 py-1 bg-blue-600 text-white rounded-md">
1
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
2
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
3
</button>
<button className="px-3 py-1 border border-gray-300 rounded-md hover:bg-gray-50">
</button>
</div>
</div>
</div>
</div>
<div className="space-y-6">
<div className="bg-green-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-green-900 mb-4">
📈
</h3>
<div className="space-y-3">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">1,456</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">1,423</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-red-600">25</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-purple-600">186</span>
</div>
</div>
</div>
<div className="bg-blue-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-blue-900 mb-4">
🎯
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">342 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">298 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-purple-600">256 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-orange-600">189 </span>
</div>
</div>
</div>
<div className="bg-purple-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-purple-900 mb-4">
👥 TOP5
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-purple-600">89 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-blue-600">76 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-green-600">65 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-orange-600">54 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="font-semibold text-red-600">43 </span>
</div>
</div>
</div>
<div className="bg-orange-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-orange-900 mb-4">
</h3>
<div className="space-y-3">
<div className="bg-white rounded-lg p-3 border-l-4 border-red-500">
<div className="flex justify-between items-center mb-1">
<span className="text-sm font-medium text-gray-800"></span>
<span className="text-xs text-red-600"></span>
</div>
<p className="text-xs text-gray-600">用户: test@example.com - 5</p>
</div>
<div className="bg-white rounded-lg p-3 border-l-4 border-yellow-500">
<div className="flex justify-between items-center mb-1">
<span className="text-sm font-medium text-gray-800"></span>
<span className="text-xs text-yellow-600"></span>
</div>
<p className="text-xs text-gray-600">用户: 李四 - 3</p>
</div>
<div className="bg-white rounded-lg p-3 border-l-4 border-blue-500">
<div className="flex justify-between items-center mb-1">
<span className="text-sm font-medium text-gray-800"></span>
<span className="text-xs text-blue-600"></span>
</div>
<p className="text-xs text-gray-600">用户: 王五 - 10</p>
</div>
</div>
</div>
</div>
</div>
<div className="mt-6 bg-yellow-50 rounded-lg p-6">
<h3 className="text-lg font-semibold text-yellow-900 mb-4">
🔍
</h3>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<button className="px-4 py-2 bg-yellow-600 text-white rounded-md hover:bg-yellow-700 transition-colors">
</button>
<button className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition-colors">
使
</button>
<button className="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

34
crop-x/src/app/error.tsx Normal file
View File

@@ -0,0 +1,34 @@
'use client'
import { useEffect } from 'react'
export default function Error({
error,
reset,
}: {
error: Error & { digest?: string }
reset: () => void
}) {
useEffect(() => {
console.error(error)
}, [error])
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-red-50 via-orange-50 to-yellow-50">
<div className="text-center">
<h2 className="text-2xl font-bold text-red-800 mb-4">
</h2>
<p className="text-red-600 mb-6">
{error.message || '未知错误'}
</p>
<button
onClick={reset}
className="px-4 py-2 bg-red-600 text-white rounded-md hover:bg-red-700 transition-colors"
>
</button>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function FarmingOperationLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
📋
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,159 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '农事操作管理 - Crop-X 智慧农业管理系统',
description: '农事操作管理系统主页面',
}
export default function FarmingOperationPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/farming-operation/farm-planning"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
📅
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/farming-operation/task-management"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/farming-operation/operation-execution"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
🚜
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
<Link
href="/farming-operation/farming-calendar"
className="block p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors"
>
<h3 className="font-semibold text-orange-900 mb-2">
📆
</h3>
<p className="text-orange-700 text-sm">
</p>
</Link>
<Link
href="/farming-operation/operation-archive"
className="block p-4 bg-teal-50 rounded-lg hover:bg-teal-100 transition-colors"
>
<h3 className="font-semibold text-teal-900 mb-2">
📁
</h3>
<p className="text-teal-700 text-sm">
</p>
</Link>
<Link
href="/farming-operation/knowledge-base"
className="block p-4 bg-indigo-50 rounded-lg hover:bg-indigo-100 transition-colors"
>
<h3 className="font-semibold text-indigo-900 mb-2">
📚
</h3>
<p className="text-indigo-700 text-sm">
</p>
</Link>
<Link
href="/farming-operation/performance-management"
className="block p-4 bg-pink-50 rounded-lg hover:bg-pink-100 transition-colors"
>
<h3 className="font-semibold text-pink-900 mb-2">
📊
</h3>
<p className="text-pink-700 text-sm">
</p>
</Link>
<Link
href="/farming-operation/issue-collaboration"
className="block p-4 bg-red-50 rounded-lg hover:bg-red-100 transition-colors"
>
<h3 className="font-semibold text-red-900 mb-2">
🤝
</h3>
<p className="text-red-700 text-sm">
线
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">86 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">23 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">156 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function LandInformationLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
🌾
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,147 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '地块信息管理 - Crop-X 智慧农业管理系统',
description: '地块信息管理系统主页面',
}
export default function LandInformationPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/land-information/field-management"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
🗺
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/land-information/map-management"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
🗺
</h3>
<p className="text-blue-700 text-sm">
GIS数据和数字化地图管理
</p>
</Link>
<Link
href="/land-information/spatial-analysis"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
📊
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
<Link
href="/land-information/environmental-monitoring"
className="block p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors"
>
<h3 className="font-semibold text-orange-900 mb-2">
🌡
</h3>
<p className="text-orange-700 text-sm">
</p>
</Link>
<Link
href="/land-information/suitability-evaluation"
className="block p-4 bg-teal-50 rounded-lg hover:bg-teal-100 transition-colors"
>
<h3 className="font-semibold text-teal-900 mb-2">
</h3>
<p className="text-teal-700 text-sm">
</p>
</Link>
<Link
href="/land-information/comparative-analysis"
className="block p-4 bg-indigo-50 rounded-lg hover:bg-indigo-100 transition-colors"
>
<h3 className="font-semibold text-indigo-900 mb-2">
📈
</h3>
<p className="text-indigo-700 text-sm">
</p>
</Link>
<Link
href="/land-information/risk-warning"
className="block p-4 bg-red-50 rounded-lg hover:bg-red-100 transition-colors"
>
<h3 className="font-semibold text-red-900 mb-2">
</h3>
<p className="text-red-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-green-600 font-semibold">48 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">35 </span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">28 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

18
crop-x/src/app/layout.tsx Normal file
View File

@@ -0,0 +1,18 @@
import {Navbar} from "../components/layouts/Navbar"
import '@/styles/globals.css'
export default function DashboardLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en">
<body>
<Navbar></Navbar>
{/* 布局 UI */}
{/* 将 children 放在您希望渲染页面或嵌套布局的位置 */}
<main>{children}</main>
</body>
</html>
)
}

View File

@@ -0,0 +1,10 @@
export default function Loading() {
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-green-50 via-blue-50 to-cyan-50">
<div className="text-center">
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-green-600 mx-auto mb-4"></div>
<p className="text-green-700 text-lg"> Crop-X ...</p>
</div>
</div>
)
}

View File

@@ -0,0 +1,21 @@
export default function NotFound() {
return (
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-gray-50 via-blue-50 to-green-50">
<div className="text-center">
<h1 className="text-6xl font-bold text-gray-800 mb-4">404</h1>
<h2 className="text-2xl font-semibold text-gray-700 mb-4">
</h2>
<p className="text-gray-600 mb-8">
访
</p>
<a
href="/"
className="px-4 py-2 bg-green-600 text-white rounded-md hover:bg-green-700 transition-colors"
>
</a>
</div>
</div>
)
}

8
crop-x/src/app/page.tsx Normal file
View File

@@ -0,0 +1,8 @@
export default function HomePage() {
return (
<div className="">
</div>
)
}

View File

@@ -0,0 +1,22 @@
import { ReactNode } from 'react'
export default function WaterFertilizerControlLayout({
children,
}: {
children: ReactNode
}) {
return (
<div className="min-h-screen bg-gray-50">
<header className="bg-white shadow-sm border-b">
<div className="container mx-auto px-4 py-4">
<h1 className="text-2xl font-bold text-green-900">
💧
</h1>
</div>
</header>
<main className="container mx-auto px-4 py-8">
{children}
</main>
</div>
)
}

View File

@@ -0,0 +1,123 @@
import Link from 'next/link'
import { Metadata } from 'next'
export const metadata: Metadata = {
title: '水肥控制 - Crop-X 智慧农业管理系统',
description: '水肥一体化控制系统主页面',
}
export default function WaterFertilizerControlPage() {
return (
<div className="space-y-6">
<div className="bg-white rounded-lg shadow p-6">
<h2 className="text-xl font-semibold text-gray-800 mb-4">
</h2>
<p className="text-gray-600 mb-6">
</p>
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<Link
href="/water-fertilizer-control/irrigation-system-management"
className="block p-4 bg-green-50 rounded-lg hover:bg-green-100 transition-colors"
>
<h3 className="font-semibold text-green-900 mb-2">
🚰
</h3>
<p className="text-green-700 text-sm">
</p>
</Link>
<Link
href="/water-fertilizer-control/smart-irrigation"
className="block p-4 bg-blue-50 rounded-lg hover:bg-blue-100 transition-colors"
>
<h3 className="font-semibold text-blue-900 mb-2">
💦
</h3>
<p className="text-blue-700 text-sm">
</p>
</Link>
<Link
href="/water-fertilizer-control/fertilizer-formula-management"
className="block p-4 bg-purple-50 rounded-lg hover:bg-purple-100 transition-colors"
>
<h3 className="font-semibold text-purple-900 mb-2">
🧪
</h3>
<p className="text-purple-700 text-sm">
</p>
</Link>
<Link
href="/water-fertilizer-control/integrated-control"
className="block p-4 bg-orange-50 rounded-lg hover:bg-orange-100 transition-colors"
>
<h3 className="font-semibold text-orange-900 mb-2">
</h3>
<p className="text-orange-700 text-sm">
</p>
</Link>
<Link
href="/water-fertilizer-control/real-time-monitoring"
className="block p-4 bg-teal-50 rounded-lg hover:bg-teal-100 transition-colors"
>
<h3 className="font-semibold text-teal-900 mb-2">
📊
</h3>
<p className="text-teal-700 text-sm">
</p>
</Link>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-2 gap-6">
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
📊
</h3>
<div className="space-y-2">
<div className="flex justify-between items-center">
<span className="text-gray-600">线</span>
<span className="text-green-600 font-semibold">18 / 20</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-blue-600 font-semibold">2,450 m³</span>
</div>
<div className="flex justify-between items-center">
<span className="text-gray-600"></span>
<span className="text-purple-600 font-semibold">8 </span>
</div>
</div>
</div>
<div className="bg-white rounded-lg shadow p-6">
<h3 className="text-lg font-semibold text-gray-800 mb-4">
🔧
</h3>
<div className="space-y-2">
<button className="w-full px-4 py-2 bg-green-600 text-white rounded hover:bg-green-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700 transition-colors">
</button>
<button className="w-full px-4 py-2 bg-purple-600 text-white rounded hover:bg-purple-700 transition-colors">
</button>
</div>
</div>
</div>
</div>
)
}

View File

@@ -1,5 +1,6 @@
import * as React from "react"
import { ChevronRight } from "lucide-react"
import Link from "next/link"
import { SearchForm } from "@/components/search-form"
import { VersionSwitcher } from "@/components/version-switcher"
@@ -21,9 +22,28 @@ import {
SidebarRail,
} from "@/components/ui/sidebar"
// This is sample data.
const data = {
versions: ["1.0.1", "1.1.0-alpha", "2.0.0-beta1"],
// Define the interface for menu data
interface MenuItem {
title: string
url: string
isActive?: boolean
}
interface NavMainItem {
title: string
url: string
icon?: string
items: MenuItem[]
}
interface SidebarData {
navMain: NavMainItem[]
versions?: string[]
}
// Default data - used when no external data is provided
const defaultData: SidebarData = {
versions: ["1.0.0", "2.0.0"],
navMain: [
{
title: "Getting Started",
@@ -64,34 +84,6 @@ const data = {
title: "Styling",
url: "#",
},
{
title: "Optimizing",
url: "#",
},
{
title: "Configuring",
url: "#",
},
{
title: "Testing",
url: "#",
},
{
title: "Authentication",
url: "#",
},
{
title: "Deploying",
url: "#",
},
{
title: "Upgrading",
url: "#",
},
{
title: "Examples",
url: "#",
},
],
},
{
@@ -106,76 +98,31 @@ const data = {
title: "File Conventions",
url: "#",
},
{
title: "Functions",
url: "#",
},
{
title: "next.config.js Options",
url: "#",
},
{
title: "CLI",
url: "#",
},
{
title: "Edge Runtime",
url: "#",
},
],
},
{
title: "Architecture",
url: "#",
items: [
{
title: "Accessibility",
url: "#",
},
{
title: "Fast Refresh",
url: "#",
},
{
title: "Next.js Compiler",
url: "#",
},
{
title: "Supported Browsers",
url: "#",
},
{
title: "Turbopack",
url: "#",
},
],
},
{
title: "Community",
url: "#",
items: [
{
title: "Contribution Guide",
url: "#",
},
],
},
],
}
export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
export interface AppSidebarProps extends React.ComponentProps<typeof Sidebar> {
data?: SidebarData
}
export function AppSidebar({ data, ...props }: AppSidebarProps) {
// Use external data if provided, otherwise use default data
const sidebarData = data || defaultData
return (
<Sidebar {...props}>
<SidebarHeader>
<VersionSwitcher
versions={data.versions}
defaultVersion={data.versions[0]}
versions={sidebarData.versions || defaultData.versions}
defaultVersion={sidebarData.versions?.[0] || defaultData.versions[0]}
/>
<SearchForm />
</SidebarHeader>
<SidebarContent className="gap-0">
{/* We create a collapsible SidebarGroup for each parent. */}
{data.navMain.map((item) => (
{sidebarData.navMain.map((item) => (
<Collapsible
key={item.title}
title={item.title}
@@ -188,17 +135,24 @@ export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
className="group/label text-sm text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
>
<CollapsibleTrigger>
{item.title}{" "}
<div className="flex items-center">
{item.icon && <span className="mr-2">{item.icon}</span>}
{item.title}
<ChevronRight className="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-90" />
</div>
</CollapsibleTrigger>
</SidebarGroupLabel>
<CollapsibleContent>
<SidebarGroupContent>
<SidebarMenu>
{item.items.map((item) => (
<SidebarMenuItem key={item.title}>
<SidebarMenuButton asChild isActive={item.isActive}>
<a href={item.url}>{item.title}</a>
{item.items.map((subItem) => (
<SidebarMenuItem key={subItem.title}>
<SidebarMenuButton asChild isActive={subItem.isActive}>
{subItem.url.startsWith('#') ? (
<a href={subItem.url}>{subItem.title}</a>
) : (
<Link href={subItem.url}>{subItem.title}</Link>
)}
</SidebarMenuButton>
</SidebarMenuItem>
))}

View File

@@ -23,7 +23,8 @@ import {
SheetTrigger,
} from "@/components/ui/sheet";
interface MenuItem {
// 菜单项接口定义
export interface MenuItem {
title: string;
url: string;
description?: string;
@@ -31,15 +32,16 @@ interface MenuItem {
items?: MenuItem[];
}
interface Navbar1Props {
logo?: {
// Logo接口定义
export interface LogoConfig {
url: string;
src: string;
alt: string;
title: string;
};
menu?: MenuItem[];
auth?: {
}
// 认证接口定义
export interface AuthConfig {
login: {
title: string;
url: string;
@@ -48,93 +50,86 @@ interface Navbar1Props {
title: string;
url: string;
};
};
}
const Navbar1 = ({
logo = {
url: "https://www.shadcnblocks.com",
// Navbar数据接口定义
export interface NavbarData {
logo?: LogoConfig;
menu?: MenuItem[];
auth?: AuthConfig;
}
// Navbar组件Props接口定义
export interface NavbarProps {
navbar?: NavbarData;
}
// 默认Navbar数据
const defaultNavbar: NavbarData = {
logo: {
url: "/",
src: "https://deifkwefumgah.cloudfront.net/shadcnblocks/block/logos/shadcnblockscom-icon.svg",
alt: "logo",
title: "Shadcnblocks.com",
alt: "Crop-X Logo",
title: "Crop-X 智慧农业",
},
menu = [
{ title: "Home", url: "#" },
menu: [
{
title: "Products",
url: "#",
items: [
{
title: "Blog",
description: "The latest industry news, updates, and info",
title: "智能农机管理系统",
url: "/agricultural-machinery",
description: "农机档案、实时监控、精准作业管理",
icon: <Book className="size-5 shrink-0" />,
url: "#",
},
{
title: "Company",
description: "Our mission is to innovate and empower the world",
title: "地块信息管理系统",
url: "/land-information",
description: "地块档案、地图管理、空间分析",
icon: <Trees className="size-5 shrink-0" />,
url: "#",
},
{
title: "Careers",
description: "Browse job listing and discover our workspace",
title: "农事操作管理系统",
url: "/farming-operation",
description: "农事计划、任务管理、操作执行",
icon: <Sunset className="size-5 shrink-0" />,
url: "#",
},
{
title: "Support",
description:
"Get in touch with our support team or visit our community forums",
title: "农业资产管理系统",
url: "/agricultural-asset",
description: "基础信息、采购管理、库存管理",
icon: <Zap className="size-5 shrink-0" />,
url: "#",
},
],
},
{
title: "Resources",
url: "#",
items: [
{
title: "Help Center",
description: "Get all the answers you need right here",
icon: <Zap className="size-5 shrink-0" />,
url: "#",
},
{
title: "Contact Us",
description: "We are here to help you with any questions you have",
icon: <Sunset className="size-5 shrink-0" />,
url: "#",
},
{
title: "Status",
description: "Check the current status of our services and APIs",
icon: <Trees className="size-5 shrink-0" />,
url: "#",
},
{
title: "Terms of Service",
description: "Our terms and conditions for using our services",
title: "AI作物模型精准决策系统",
url: "/ai-crop-model",
description: "数据感知、模型应用、智能决策",
icon: <Book className="size-5 shrink-0" />,
url: "#",
},
],
},
{
title: "Pricing",
url: "#",
title: "水肥一体化控制系统",
url: "/water-fertilizer-control",
description: "水肥机管理、智能灌溉、配方管理",
icon: <Trees className="size-5 shrink-0" />,
},
{
title: "Blog",
url: "#",
title: "中心配置管理系统",
url: "/central-config",
description: "租户管理、用户管理、系统监控",
icon: <Sunset className="size-5 shrink-0" />,
},
],
auth = {
login: { title: "Login", url: "#" },
signup: { title: "Sign up", url: "#" },
auth: {
login: { title: "登录", url: "/login" },
signup: { title: "注册", url: "/register" },
},
}: Navbar1Props) => {
};
// 新的Navbar组件支持外部传入navbar参数
export function Navbar({ navbar }: NavbarProps) {
// 使用外部传入的navbar数据如果没有则使用默认数据
const navbarData = navbar || defaultNavbar;
const logo = navbarData.logo || defaultNavbar.logo;
const menu = navbarData.menu || defaultNavbar.menu;
const auth = navbarData.auth || defaultNavbar.auth;
return (
<section className="py-4">
<div className="container">
@@ -224,7 +219,7 @@ const Navbar1 = ({
</div>
</section>
);
};
}
const renderMenuItem = (item: MenuItem) => {
if (item.items) {
@@ -295,5 +290,3 @@ const SubMenuLink = ({ item }: { item: MenuItem }) => {
</a>
);
};
export {Navbar1} ;

View File

@@ -1,4 +1,8 @@
import { AppSidebar } from "@/components/app-sidebar"
"use client"
import { ReactNode, useEffect, useState } from 'react'
import { usePathname } from 'next/navigation'
import { AppSidebar, AppSidebarProps, SidebarData } from "@/components/app-sidebar"
import {
Breadcrumb,
BreadcrumbItem,
@@ -13,31 +17,95 @@ import {
SidebarProvider,
SidebarTrigger,
} from "@/components/ui/sidebar"
import React from 'react'
export interface SideBarProps {
children: ReactNode
data?: AppSidebarProps['data']
}
export default function SideBar({ children, data }: SideBarProps) {
const pathname = usePathname()
const [breadcrumbItems, setBreadcrumbItems] = useState<Array<{ title: string, url?: string, isPage?: boolean }>>([])
useEffect(() => {
if (!data || !data.navMain) return
const generateBreadcrumb = () => {
const items = [{ title: "首页", url: "/" }]
// 解析当前路径
const pathSegments = pathname.split('/').filter(Boolean)
if (pathSegments.length === 0) {
// 首页
items.push({ title: "首页", isPage: true })
} else if (pathSegments[0] === 'central-config') {
// 中心配置模块
items.push({ title: "中心配置", url: "/central-config" })
if (pathSegments.length === 1) {
// 中心配置主页
items.push({ title: "中心配置", isPage: true })
} else if (pathSegments.length >= 2) {
// 查找匹配的一级菜单
const mainModule = data.navMain.find(item =>
item.url === `/central-config/${pathSegments[1]}`
)
if (mainModule) {
items.push({ title: mainModule.title, url: mainModule.url })
if (pathSegments.length === 2) {
// 一级菜单页面
items.push({ title: mainModule.title, isPage: true })
} else if (pathSegments.length >= 3) {
// 查找匹配的二级菜单
const subModule = mainModule.items.find(item =>
item.url === pathname
)
if (subModule) {
items.push({ title: subModule.title, isPage: true })
}
}
}
}
}
setBreadcrumbItems(items)
}
generateBreadcrumb()
}, [pathname, data])
export default function Page() {
return (
<SidebarProvider>
<AppSidebar />
<AppSidebar data={data} />
<SidebarInset>
<header className="flex sticky top-0 bg-background h-16 shrink-0 items-center gap-2 border-b px-4">
<SidebarTrigger className="-ml-1" />
<Separator orientation="vertical" className="mr-2 h-4" />
<Breadcrumb>
<BreadcrumbList>
{breadcrumbItems.map((item, index) => (
<React.Fragment key={index}>
{index > 0 && <BreadcrumbSeparator className="hidden md:block" />}
<BreadcrumbItem className="hidden md:block">
<BreadcrumbLink href="#">
Building Your Application
</BreadcrumbLink>
</BreadcrumbItem>
<BreadcrumbSeparator className="hidden md:block" />
<BreadcrumbItem>
<BreadcrumbPage>Data Fetching</BreadcrumbPage>
{item.isPage ? (
<BreadcrumbPage>{item.title}</BreadcrumbPage>
) : item.url ? (
<BreadcrumbLink href={item.url}>{item.title}</BreadcrumbLink>
) : (
<span>{item.title}</span>
)}
</BreadcrumbItem>
</React.Fragment>
))}
</BreadcrumbList>
</Breadcrumb>
</header>
<div className="flex flex-1 flex-col gap-4 p-4">
{children}
</div>
</SidebarInset>
</SidebarProvider>

View File

@@ -1,10 +0,0 @@
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import './styles/globals.css'
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
)

View File

@@ -1 +0,0 @@
/* 404页面样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const NotFound = () => {
useEffect(() => {
// TODO: 实现404页面逻辑
console.log('404页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 服务器错误页面样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const ServerError = () => {
useEffect(() => {
// TODO: 实现服务器错误页面逻辑
console.log('服务器错误页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* AI模型入口样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const AIModelEntry = () => {
useEffect(() => {
// TODO: 实现AI模型入口逻辑
console.log('AI模型入口页面')
}, [])
return (
<div className="p-6">
<h1>AI模型入口</h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 模型训练样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const ModelTraining = () => {
useEffect(() => {
// TODO: 实现模型训练逻辑
console.log('模型训练页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 预测分析样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const PredictionAnalysis = () => {
useEffect(() => {
// TODO: 实现预测分析逻辑
console.log('预测分析页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 推荐系统样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const RecommendationSystem = () => {
useEffect(() => {
// TODO: 实现推荐系统逻辑
console.log('推荐系统页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 资产折旧样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const AssetDepreciation = () => {
useEffect(() => {
// TODO: 实现资产折旧逻辑
console.log('资产折旧页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 资产管理入口样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const AssetEntry = () => {
useEffect(() => {
// TODO: 实现资产管理入口逻辑
console.log('资产管理入口页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 库存管理样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const InventoryManagement = () => {
useEffect(() => {
// TODO: 实现库存管理逻辑
console.log('库存管理页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 维护记录样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const MaintenanceRecords = () => {
useEffect(() => {
// TODO: 实现维护记录逻辑
console.log('维护记录页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 登录页面样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const Login = () => {
useEffect(() => {
// TODO: 实现登录逻辑
console.log('登录页面')
}, [])
return (
<div className="min-h-screen flex items-center justify-center">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 中心配置入口样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const CentralConfigEntry = () => {
useEffect(() => {
// TODO: 实现中心配置入口逻辑
console.log('中心配置入口页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 消息中心样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const MessageCenter = () => {
useEffect(() => {
// TODO: 实现消息中心逻辑
console.log('消息中心页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 系统监控样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const SystemMonitoring = () => {
useEffect(() => {
// TODO: 实现系统监控逻辑
console.log('系统监控页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 系统参数样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const SystemParameters = () => {
useEffect(() => {
// TODO: 实现系统参数逻辑
console.log('系统参数页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 租户管理样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const TenantManagement = () => {
useEffect(() => {
// TODO: 实现租户管理逻辑
console.log('租户管理页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 用户管理样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const UserManagement = () => {
useEffect(() => {
// TODO: 实现用户管理逻辑
console.log('用户管理页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 仪表板页面样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const Dashboard = () => {
useEffect(() => {
// TODO: 实现仪表板逻辑
console.log('仪表板页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 灌溉控制入口样式 */

View File

@@ -1,14 +0,0 @@
import { useEffect } from 'react'
export const IrrigationEntry = () => {
useEffect(() => {
// TODO: 实现灌溉控制入口逻辑
console.log('灌溉控制入口页面')
}, [])
return (
<div className="p-6">
<h1></h1>
</div>
)
}

View File

@@ -1 +0,0 @@
/* 监控系统样式 */

Some files were not shown because too many files have changed in this diff Show More