next.js搭建路由01
This commit is contained in:
6
crop-x/next-env.d.ts
vendored
Normal file
6
crop-x/next-env.d.ts
vendored
Normal 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
814
crop-x/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
15
crop-x/src/app/(auth)/layout.tsx
Normal file
15
crop-x/src/app/(auth)/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
84
crop-x/src/app/(auth)/login/page.tsx
Normal file
84
crop-x/src/app/(auth)/login/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
121
crop-x/src/app/(auth)/register/page.tsx
Normal file
121
crop-x/src/app/(auth)/register/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<div className="">
|
||||
资产标签
|
||||
</div>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/agricultural-asset/layout.tsx
Normal file
22
crop-x/src/app/agricultural-asset/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
147
crop-x/src/app/agricultural-asset/page.tsx
Normal file
147
crop-x/src/app/agricultural-asset/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
71
crop-x/src/app/agricultural-machinery/archive/page.tsx
Normal file
71
crop-x/src/app/agricultural-machinery/archive/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
35
crop-x/src/app/agricultural-machinery/error.tsx
Normal file
35
crop-x/src/app/agricultural-machinery/error.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/agricultural-machinery/layout.tsx
Normal file
22
crop-x/src/app/agricultural-machinery/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
10
crop-x/src/app/agricultural-machinery/loading.tsx
Normal file
10
crop-x/src/app/agricultural-machinery/loading.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
93
crop-x/src/app/agricultural-machinery/page.tsx
Normal file
93
crop-x/src/app/agricultural-machinery/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/ai-crop-model/layout.tsx
Normal file
22
crop-x/src/app/ai-crop-model/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
159
crop-x/src/app/ai-crop-model/page.tsx
Normal file
159
crop-x/src/app/ai-crop-model/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
133
crop-x/src/app/central-config/layout.tsx
Normal file
133
crop-x/src/app/central-config/layout.tsx
Normal 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>
|
||||
}
|
||||
22
crop-x/src/app/central-config/message-center/layout.tsx
Normal file
22
crop-x/src/app/central-config/message-center/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
111
crop-x/src/app/central-config/message-center/page.tsx
Normal file
111
crop-x/src/app/central-config/message-center/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
123
crop-x/src/app/central-config/page.tsx
Normal file
123
crop-x/src/app/central-config/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/central-config/system-monitoring/layout.tsx
Normal file
22
crop-x/src/app/central-config/system-monitoring/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
103
crop-x/src/app/central-config/system-monitoring/page.tsx
Normal file
103
crop-x/src/app/central-config/system-monitoring/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/central-config/system-parameters/layout.tsx
Normal file
22
crop-x/src/app/central-config/system-parameters/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
103
crop-x/src/app/central-config/system-parameters/page.tsx
Normal file
103
crop-x/src/app/central-config/system-parameters/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/central-config/tenant-management/layout.tsx
Normal file
22
crop-x/src/app/central-config/tenant-management/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
163
crop-x/src/app/central-config/tenant-management/page.tsx
Normal file
163
crop-x/src/app/central-config/tenant-management/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/central-config/user-management/layout.tsx
Normal file
22
crop-x/src/app/central-config/user-management/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
178
crop-x/src/app/central-config/user-management/page.tsx
Normal file
178
crop-x/src/app/central-config/user-management/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -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
34
crop-x/src/app/error.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/farming-operation/layout.tsx
Normal file
22
crop-x/src/app/farming-operation/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
159
crop-x/src/app/farming-operation/page.tsx
Normal file
159
crop-x/src/app/farming-operation/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/land-information/layout.tsx
Normal file
22
crop-x/src/app/land-information/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
147
crop-x/src/app/land-information/page.tsx
Normal file
147
crop-x/src/app/land-information/page.tsx
Normal 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
18
crop-x/src/app/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
10
crop-x/src/app/loading.tsx
Normal file
10
crop-x/src/app/loading.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
21
crop-x/src/app/not-found.tsx
Normal file
21
crop-x/src/app/not-found.tsx
Normal 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
8
crop-x/src/app/page.tsx
Normal file
@@ -0,0 +1,8 @@
|
||||
|
||||
export default function HomePage() {
|
||||
return (
|
||||
<div className="">
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/water-fertilizer-control/layout.tsx
Normal file
22
crop-x/src/app/water-fertilizer-control/layout.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
123
crop-x/src/app/water-fertilizer-control/page.tsx
Normal file
123
crop-x/src/app/water-fertilizer-control/page.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
))}
|
||||
|
||||
@@ -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} ;
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>,
|
||||
)
|
||||
@@ -1 +0,0 @@
|
||||
/* 404页面样式 */
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 服务器错误页面样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const ServerError = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现服务器错误页面逻辑
|
||||
console.log('服务器错误页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>服务器错误</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* AI模型入口样式 */
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 模型训练样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const ModelTraining = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现模型训练逻辑
|
||||
console.log('模型训练页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>模型训练</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 预测分析样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const PredictionAnalysis = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现预测分析逻辑
|
||||
console.log('预测分析页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>预测分析</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 推荐系统样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const RecommendationSystem = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现推荐系统逻辑
|
||||
console.log('推荐系统页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>推荐系统</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 资产折旧样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const AssetDepreciation = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现资产折旧逻辑
|
||||
console.log('资产折旧页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>资产折旧</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 资产管理入口样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const AssetEntry = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现资产管理入口逻辑
|
||||
console.log('资产管理入口页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>资产管理入口</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 库存管理样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const InventoryManagement = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现库存管理逻辑
|
||||
console.log('库存管理页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>库存管理</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 维护记录样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const MaintenanceRecords = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现维护记录逻辑
|
||||
console.log('维护记录页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>维护记录</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 登录页面样式 */
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 中心配置入口样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const CentralConfigEntry = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现中心配置入口逻辑
|
||||
console.log('中心配置入口页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>中心配置入口</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 消息中心样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const MessageCenter = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现消息中心逻辑
|
||||
console.log('消息中心页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>消息中心</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 系统监控样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const SystemMonitoring = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现系统监控逻辑
|
||||
console.log('系统监控页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>系统监控</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 系统参数样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const SystemParameters = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现系统参数逻辑
|
||||
console.log('系统参数页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>系统参数</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 租户管理样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const TenantManagement = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现租户管理逻辑
|
||||
console.log('租户管理页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>租户管理</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 用户管理样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const UserManagement = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现用户管理逻辑
|
||||
console.log('用户管理页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>用户管理</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 仪表板页面样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const Dashboard = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现仪表板逻辑
|
||||
console.log('仪表板页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>系统仪表板</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 灌溉控制入口样式 */
|
||||
@@ -1,14 +0,0 @@
|
||||
import { useEffect } from 'react'
|
||||
|
||||
export const IrrigationEntry = () => {
|
||||
useEffect(() => {
|
||||
// TODO: 实现灌溉控制入口逻辑
|
||||
console.log('灌溉控制入口页面')
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1>灌溉控制入口</h1>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
/* 监控系统样式 */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user