修复了登录页面还存在顶部导航栏的问题
This commit is contained in:
@@ -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/(app)/agricultural-asset/layout.tsx
Normal file
22
crop-x/src/app/(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/(app)/agricultural-asset/page.tsx
Normal file
147
crop-x/src/app/(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/(app)/agricultural-machinery/archive/page.tsx
Normal file
71
crop-x/src/app/(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/(app)/agricultural-machinery/error.tsx
Normal file
35
crop-x/src/app/(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/(app)/agricultural-machinery/layout.tsx
Normal file
22
crop-x/src/app/(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/(app)/agricultural-machinery/loading.tsx
Normal file
10
crop-x/src/app/(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/(app)/agricultural-machinery/page.tsx
Normal file
93
crop-x/src/app/(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/(app)/ai-crop-model/layout.tsx
Normal file
22
crop-x/src/app/(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/(app)/ai-crop-model/page.tsx
Normal file
159
crop-x/src/app/(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>
|
||||
)
|
||||
}
|
||||
143
crop-x/src/app/(app)/central-config/layout.tsx
Normal file
143
crop-x/src/app/(app)/central-config/layout.tsx
Normal file
@@ -0,0 +1,143 @@
|
||||
"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/enterprise-audit",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "审核历史",
|
||||
url: "/central-config/tenant-management/audit-history",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "企业信息",
|
||||
url: "/central-config/tenant-management/enterprise-info",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "平台用户管理",
|
||||
url: "/central-config/tenant-management/platform-user-management",
|
||||
isActive: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "用户管理",
|
||||
url: "/central-config/user-management",
|
||||
icon: "👥",
|
||||
items: [
|
||||
{
|
||||
title: "员工管理",
|
||||
url: "/central-config/user-management/employee-management",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "角色管理",
|
||||
url: "/central-config/user-management/role-management",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "菜单管理",
|
||||
url: "/central-config/user-management/menu-management",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "权限配置管理",
|
||||
url: "/central-config/user-management/permission-config",
|
||||
isActive: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "系统参数",
|
||||
url: "/central-config/system-parameters",
|
||||
icon: "🔧",
|
||||
items: [
|
||||
{
|
||||
title: "系统设置",
|
||||
url: "/central-config/system-parameters/system-settings",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "分类字典",
|
||||
url: "/central-config/system-parameters/category-dictionary",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "数据字典",
|
||||
url: "/central-config/system-parameters/data-dictionary",
|
||||
isActive: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "系统监控",
|
||||
url: "/central-config/system-monitor",
|
||||
icon: "📈",
|
||||
items: [
|
||||
{
|
||||
title: "登录日志",
|
||||
url: "/central-config/system-monitor/login-log",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "操作日志",
|
||||
url: "/central-config/system-monitor/operation-log",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "性能监控",
|
||||
url: "/central-config/system-monitor/performance-monitor",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "网络日志",
|
||||
url: "/central-config/system-monitor/network-log",
|
||||
isActive: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "消息中心",
|
||||
url: "/central-config/message-center",
|
||||
icon: "📨",
|
||||
items: [
|
||||
{
|
||||
title: "消息发送",
|
||||
url: "/central-config/message-center/message-send",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "消息模版",
|
||||
url: "/central-config/message-center/message-template",
|
||||
isActive: false
|
||||
},
|
||||
{
|
||||
title: "消息日志",
|
||||
url: "/central-config/message-center/message-log",
|
||||
isActive: false
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export default function CentralConfigLayout({
|
||||
children,
|
||||
}: {
|
||||
children: ReactNode
|
||||
}) {
|
||||
return <SideBar data={centralConfigData}>{children}</SideBar>
|
||||
}
|
||||
@@ -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,8 @@
|
||||
export default function MessageLogPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">消息日志</h1>
|
||||
<p>消息日志管理页面</p>
|
||||
</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>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function MessageTemplatePage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">消息模版</h1>
|
||||
<p>消息模版管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
111
crop-x/src/app/(app)/central-config/message-center/page.tsx
Normal file
111
crop-x/src/app/(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/(app)/central-config/page.tsx
Normal file
123
crop-x/src/app/(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,11 @@
|
||||
export default function SystemMonitorLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<div className="system-monitor-layout">
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function LoginLogPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">登录日志</h1>
|
||||
<p>登录日志管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function NetworkLogPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">网络日志</h1>
|
||||
<p>网络日志管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function OperationLogPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">操作日志</h1>
|
||||
<p>操作日志管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function SystemMonitorPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">系统监控</h1>
|
||||
<p>系统监控主页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function PerformanceMonitorPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">性能监控</h1>
|
||||
<p>性能监控管理页面</p>
|
||||
</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>
|
||||
)
|
||||
}
|
||||
@@ -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/(app)/central-config/system-monitoring/page.tsx
Normal file
103
crop-x/src/app/(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,8 @@
|
||||
export default function CategoryDictionaryPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">分类字典</h1>
|
||||
<p>分类字典管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function DataDictionaryPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">数据字典</h1>
|
||||
<p>数据字典管理页面</p>
|
||||
</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>
|
||||
)
|
||||
}
|
||||
@@ -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/(app)/central-config/system-parameters/page.tsx
Normal file
103
crop-x/src/app/(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>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function SystemSettingsPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">系统设置</h1>
|
||||
<p>系统设置管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function AuditHistoryPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">审核历史</h1>
|
||||
<p>审核历史记录管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
'use client'
|
||||
|
||||
import { Card } from '@/components/ui/card'
|
||||
import { Enterprise, AuditStatus } from '@/types/user-management'
|
||||
|
||||
interface AuditStatsCardProps {
|
||||
enterprises: Enterprise[]
|
||||
}
|
||||
|
||||
export function AuditStatsCard({ enterprises }: AuditStatsCardProps) {
|
||||
const stats = [
|
||||
{
|
||||
label: '待审核',
|
||||
value: enterprises.filter(e => e.auditStatus === 'pending').length,
|
||||
color: 'text-yellow-600',
|
||||
bg: 'bg-yellow-100',
|
||||
},
|
||||
{
|
||||
label: '已通过',
|
||||
value: enterprises.filter(e => e.auditStatus === 'approved').length,
|
||||
color: 'text-green-600',
|
||||
bg: 'bg-green-100',
|
||||
},
|
||||
{
|
||||
label: '已驳回',
|
||||
value: enterprises.filter(e => e.auditStatus === 'rejected').length,
|
||||
color: 'text-red-600',
|
||||
bg: 'bg-red-100',
|
||||
},
|
||||
{
|
||||
label: '总企业数',
|
||||
value: enterprises.length,
|
||||
color: 'text-blue-600',
|
||||
bg: 'bg-blue-100',
|
||||
},
|
||||
]
|
||||
|
||||
return (
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
{stats.map((stat, index) => (
|
||||
<Card key={index} className="p-4">
|
||||
<div className="text-sm text-muted-foreground">{stat.label}</div>
|
||||
<div className={`mt-2 ${stat.color}`}>{stat.value}</div>
|
||||
</Card>
|
||||
))}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
'use client'
|
||||
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Image as ImageIcon } from 'lucide-react'
|
||||
import { Enterprise } from '@/types/user-management'
|
||||
|
||||
interface EnterpriseBankInfoProps {
|
||||
enterprise: Enterprise
|
||||
}
|
||||
|
||||
export function EnterpriseBankInfo({ enterprise }: EnterpriseBankInfoProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div>
|
||||
<Label>银行账号</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.bankAccount ? (
|
||||
<code className="text-sm font-mono">
|
||||
{enterprise.bankAccount}
|
||||
</code>
|
||||
) : '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>开户行</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.bankName || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Label>开户行全称</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.bankFullName || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Label>开户行地址</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.bankAddress || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Label>开户许可证</Label>
|
||||
<div className="mt-2">
|
||||
{enterprise.bankLicense ? (
|
||||
<div className="border rounded-lg p-2 inline-block">
|
||||
<img
|
||||
src={enterprise.bankLicense}
|
||||
alt="开户许可证"
|
||||
className="w-64 h-auto"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 text-muted-foreground p-4 border-2 border-dashed rounded-lg">
|
||||
<ImageIcon className="w-6 h-6" />
|
||||
<span>未上传</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
'use client'
|
||||
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Enterprise } from '@/types/user-management'
|
||||
|
||||
interface EnterpriseBasicInfoProps {
|
||||
enterprise: Enterprise
|
||||
}
|
||||
|
||||
export function EnterpriseBasicInfo({ enterprise }: EnterpriseBasicInfoProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div>
|
||||
<Label>企业名称</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">{enterprise.name}</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>企业类型</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">{enterprise.type}</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>所在地区</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.province} {enterprise.city} {enterprise.district}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>详细地址</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">{enterprise.address}</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>登记人</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">{enterprise.registrant}</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>联系电话</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">{enterprise.contactPhone}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,192 @@
|
||||
'use client'
|
||||
|
||||
import { useState } from 'react'
|
||||
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogFooter } from '@/components/ui/dialog'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'
|
||||
import { ScrollArea } from '@/components/ui/scroll-area'
|
||||
import { Card } from '@/components/ui/card'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Building, FileText, CreditCard, User, CheckCircle, XCircle } from 'lucide-react'
|
||||
import { Enterprise, AuditStatus } from '@/types/user-management'
|
||||
import { EnterpriseBasicInfo } from './EnterpriseBasicInfo'
|
||||
import { EnterpriseOtherInfo } from './EnterpriseOtherInfo'
|
||||
import { EnterpriseBankInfo } from './EnterpriseBankInfo'
|
||||
import { EnterpriseLegalInfo } from './EnterpriseLegalInfo'
|
||||
|
||||
interface EnterpriseDetailDialogProps {
|
||||
open: boolean
|
||||
onOpenChange: (open: boolean) => void
|
||||
enterprise: Enterprise | null
|
||||
onApprove: (auditReason: string) => void
|
||||
onReject: (auditReason: string) => void
|
||||
}
|
||||
|
||||
export function EnterpriseDetailDialog({
|
||||
open,
|
||||
onOpenChange,
|
||||
enterprise,
|
||||
onApprove,
|
||||
onReject
|
||||
}: EnterpriseDetailDialogProps) {
|
||||
const [auditReason, setAuditReason] = useState('')
|
||||
|
||||
const getAuditStatusBadge = (status: AuditStatus) => {
|
||||
switch (status) {
|
||||
case 'pending':
|
||||
return <Badge className="bg-yellow-100 text-yellow-700">待审核</Badge>
|
||||
case 'approved':
|
||||
return <Badge className="bg-green-100 text-green-700">已通过</Badge>
|
||||
case 'rejected':
|
||||
return <Badge className="bg-red-100 text-red-700">已驳回</Badge>
|
||||
default:
|
||||
return <Badge>{status}</Badge>
|
||||
}
|
||||
}
|
||||
|
||||
const handleApprove = () => {
|
||||
onApprove(auditReason)
|
||||
setAuditReason('')
|
||||
}
|
||||
|
||||
const handleReject = () => {
|
||||
onReject(auditReason)
|
||||
setAuditReason('')
|
||||
}
|
||||
|
||||
const handleClose = () => {
|
||||
onOpenChange(false)
|
||||
setAuditReason('')
|
||||
}
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-5xl max-h-[90vh]">
|
||||
<DialogHeader>
|
||||
<div className="flex items-center justify-between pr-8">
|
||||
<DialogTitle>企业详情审核</DialogTitle>
|
||||
{enterprise && getAuditStatusBadge(enterprise.auditStatus)}
|
||||
</div>
|
||||
<DialogDescription className="sr-only">
|
||||
查看企业的详细信息和审核状态
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
{enterprise && (
|
||||
<ScrollArea className="max-h-[calc(90vh-200px)]">
|
||||
<Tabs defaultValue="basic" className="space-y-4">
|
||||
<TabsList className="grid grid-cols-4 w-full">
|
||||
<TabsTrigger value="basic">
|
||||
<Building className="w-4 h-4 mr-2" />
|
||||
基本信息
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="other">
|
||||
<FileText className="w-4 h-4 mr-2" />
|
||||
其他信息
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="bank">
|
||||
<CreditCard className="w-4 h-4 mr-2" />
|
||||
开户信息
|
||||
</TabsTrigger>
|
||||
<TabsTrigger value="legal">
|
||||
<User className="w-4 h-4 mr-2" />
|
||||
法人信息
|
||||
</TabsTrigger>
|
||||
</TabsList>
|
||||
|
||||
<TabsContent value="basic">
|
||||
<EnterpriseBasicInfo enterprise={enterprise} />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="other">
|
||||
<EnterpriseOtherInfo enterprise={enterprise} />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="bank">
|
||||
<EnterpriseBankInfo enterprise={enterprise} />
|
||||
</TabsContent>
|
||||
|
||||
<TabsContent value="legal">
|
||||
<EnterpriseLegalInfo enterprise={enterprise} />
|
||||
</TabsContent>
|
||||
</Tabs>
|
||||
|
||||
{/* 审核信息 */}
|
||||
<div className="mt-6 pt-6 border-t">
|
||||
<h4 className="mb-4 font-bold">审核信息</h4>
|
||||
<Card className="p-6 bg-gray-50 border">
|
||||
<div className="grid grid-cols-2 gap-x-8 gap-y-4">
|
||||
<div>
|
||||
<Label className="text-xs">提交时间</Label>
|
||||
<div className="mt-1.5 text-base">
|
||||
{new Date(enterprise.createdAt).toLocaleString('zh-CN')}
|
||||
</div>
|
||||
</div>
|
||||
{enterprise.auditTime && (
|
||||
<div>
|
||||
<Label className="text-xs">审核时间</Label>
|
||||
<div className="mt-1.5 text-base">
|
||||
{new Date(enterprise.auditTime).toLocaleString('zh-CN')}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{enterprise.auditor && (
|
||||
<div>
|
||||
<Label className="text-xs">审核人</Label>
|
||||
<div className="mt-1.5 text-base">
|
||||
{enterprise.auditor}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{enterprise.auditReason && (
|
||||
<div className="col-span-2 pt-4 mt-2 border-t">
|
||||
<Label className="text-xs">审核意见</Label>
|
||||
<div className="mt-1.5 text-base">
|
||||
{enterprise.auditReason}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</Card>
|
||||
|
||||
{/* 审核操作区 - 仅待审核状态显示 */}
|
||||
{enterprise.auditStatus === 'pending' && (
|
||||
<div className="mt-6">
|
||||
<Label>审核意见</Label>
|
||||
<Textarea
|
||||
value={auditReason}
|
||||
onChange={(e) => setAuditReason(e.target.value)}
|
||||
rows={3}
|
||||
placeholder="请填写审核意见(驳回时必填)..."
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</ScrollArea>
|
||||
)}
|
||||
<DialogFooter className="border-t pt-4">
|
||||
<Button variant="outline" onClick={handleClose}>
|
||||
关闭
|
||||
</Button>
|
||||
{enterprise?.auditStatus === 'pending' && (
|
||||
<>
|
||||
<Button
|
||||
variant="destructive"
|
||||
onClick={handleReject}
|
||||
>
|
||||
<XCircle className="w-4 h-4 mr-2" />
|
||||
驳回
|
||||
</Button>
|
||||
<Button onClick={handleApprove}>
|
||||
<CheckCircle className="w-4 h-4 mr-2" />
|
||||
通过
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
'use client'
|
||||
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Image as ImageIcon } from 'lucide-react'
|
||||
import { Enterprise } from '@/types/user-management'
|
||||
|
||||
interface EnterpriseLegalInfoProps {
|
||||
enterprise: Enterprise
|
||||
}
|
||||
|
||||
export function EnterpriseLegalInfo({ enterprise }: EnterpriseLegalInfoProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="grid grid-cols-1 gap-6">
|
||||
<div>
|
||||
<Label>法人名称</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.legalPerson || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>身份证正面</Label>
|
||||
<div className="mt-2">
|
||||
{enterprise.idCardFront ? (
|
||||
<div className="border rounded-lg p-2 inline-block">
|
||||
<img
|
||||
src={enterprise.idCardFront}
|
||||
alt="身份证正面"
|
||||
className="w-80 h-auto"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 text-muted-foreground p-4 border-2 border-dashed rounded-lg">
|
||||
<ImageIcon className="w-6 h-6" />
|
||||
<span>未上传</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>身份证反面</Label>
|
||||
<div className="mt-2">
|
||||
{enterprise.idCardBack ? (
|
||||
<div className="border rounded-lg p-2 inline-block">
|
||||
<img
|
||||
src={enterprise.idCardBack}
|
||||
alt="身份证反面"
|
||||
className="w-80 h-auto"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 text-muted-foreground p-4 border-2 border-dashed rounded-lg">
|
||||
<ImageIcon className="w-6 h-6" />
|
||||
<span>未上传</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
'use client'
|
||||
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Image as ImageIcon } from 'lucide-react'
|
||||
import { Enterprise } from '@/types/user-management'
|
||||
|
||||
interface EnterpriseOtherInfoProps {
|
||||
enterprise: Enterprise
|
||||
}
|
||||
|
||||
export function EnterpriseOtherInfo({ enterprise }: EnterpriseOtherInfoProps) {
|
||||
return (
|
||||
<div className="space-y-4">
|
||||
<div className="grid grid-cols-2 gap-6">
|
||||
<div>
|
||||
<Label>公司规模</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.companySize || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>注册资本</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.registeredCapital || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>成立时间</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.establishmentDate || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<Label>发票类型</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.invoiceType || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Label>社会信用代码</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
<code className="text-sm font-mono">
|
||||
{enterprise.socialCreditCode}
|
||||
</code>
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Label>经营范围</Label>
|
||||
<div className="field-value mt-1 p-2 bg-gray-50 rounded">
|
||||
{enterprise.businessScope || '-'}
|
||||
</div>
|
||||
</div>
|
||||
<div className="col-span-2">
|
||||
<Label>营业执照</Label>
|
||||
<div className="mt-2">
|
||||
{enterprise.businessLicense ? (
|
||||
<div className="border rounded-lg p-2 inline-block">
|
||||
<img
|
||||
src={enterprise.businessLicense}
|
||||
alt="营业执照"
|
||||
className="w-64 h-auto"
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex items-center gap-2 text-muted-foreground p-4 border-2 border-dashed rounded-lg">
|
||||
<ImageIcon className="w-6 h-6" />
|
||||
<span>未上传</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
'use client'
|
||||
|
||||
import { Card } from '@/components/ui/card'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
|
||||
import { Eye } from 'lucide-react'
|
||||
import { Enterprise, AuditStatus } from '@/types/user-management'
|
||||
|
||||
interface EnterpriseTableProps {
|
||||
enterprises: Enterprise[]
|
||||
onViewDetail: (enterprise: Enterprise) => void
|
||||
}
|
||||
|
||||
export function EnterpriseTable({ enterprises, onViewDetail }: EnterpriseTableProps) {
|
||||
const getAuditStatusBadge = (status: AuditStatus) => {
|
||||
switch (status) {
|
||||
case 'pending':
|
||||
return <Badge className="bg-yellow-100 text-yellow-700">待审核</Badge>
|
||||
case 'approved':
|
||||
return <Badge className="bg-green-100 text-green-700">已通过</Badge>
|
||||
case 'rejected':
|
||||
return <Badge className="bg-red-100 text-red-700">已驳回</Badge>
|
||||
default:
|
||||
return <Badge>{status}</Badge>
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead>企业名称</TableHead>
|
||||
<TableHead>企业类型</TableHead>
|
||||
<TableHead>社会信用代码</TableHead>
|
||||
<TableHead>法人</TableHead>
|
||||
<TableHead>所在地区</TableHead>
|
||||
<TableHead>审核状态</TableHead>
|
||||
<TableHead>提交时间</TableHead>
|
||||
<TableHead>操作</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
<TableBody>
|
||||
{enterprises.length === 0 ? (
|
||||
<TableRow>
|
||||
<TableCell colSpan={8} className="text-center text-muted-foreground py-8">
|
||||
暂无数据
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
) : (
|
||||
enterprises.map((enterprise) => (
|
||||
<TableRow key={enterprise.id}>
|
||||
<TableCell>{enterprise.name}</TableCell>
|
||||
<TableCell className="text-muted-foreground">{enterprise.type}</TableCell>
|
||||
<TableCell className="text-muted-foreground">
|
||||
<code className="text-xs">{enterprise.socialCreditCode}</code>
|
||||
</TableCell>
|
||||
<TableCell>{enterprise.legalPerson || '-'}</TableCell>
|
||||
<TableCell>{`${enterprise.province} ${enterprise.city}`}</TableCell>
|
||||
<TableCell>{getAuditStatusBadge(enterprise.auditStatus)}</TableCell>
|
||||
<TableCell className="text-muted-foreground">
|
||||
{new Date(enterprise.createdAt).toLocaleDateString('zh-CN')}
|
||||
</TableCell>
|
||||
<TableCell>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
onClick={() => onViewDetail(enterprise)}
|
||||
>
|
||||
<Eye className="w-4 h-4 mr-1" />
|
||||
查看
|
||||
</Button>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))
|
||||
)}
|
||||
</TableBody>
|
||||
</Table>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
'use client'
|
||||
|
||||
import { Card } from '@/components/ui/card'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
||||
import { Search } from 'lucide-react'
|
||||
|
||||
interface SearchAndFilterProps {
|
||||
searchKeyword: string
|
||||
onSearchChange: (value: string) => void
|
||||
statusFilter: string
|
||||
onStatusFilterChange: (value: string) => void
|
||||
}
|
||||
|
||||
export function SearchAndFilter({
|
||||
searchKeyword,
|
||||
onSearchChange,
|
||||
statusFilter,
|
||||
onStatusFilterChange
|
||||
}: SearchAndFilterProps) {
|
||||
return (
|
||||
<Card className="p-4">
|
||||
<div className="flex gap-4">
|
||||
<div className="flex-1">
|
||||
<div className="relative">
|
||||
<Search className="absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-muted-foreground" />
|
||||
<Input
|
||||
placeholder="搜索企业名称、信用代码、登记人..."
|
||||
value={searchKeyword}
|
||||
onChange={(e) => onSearchChange(e.target.value)}
|
||||
className="pl-10"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Select value={statusFilter} onValueChange={onStatusFilterChange}>
|
||||
<SelectTrigger className="w-40">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="all">全部状态</SelectItem>
|
||||
<SelectItem value="pending">待审核</SelectItem>
|
||||
<SelectItem value="approved">已通过</SelectItem>
|
||||
<SelectItem value="rejected">已驳回</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
</Card>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export { AuditStatsCard } from './AuditStatsCard'
|
||||
export { SearchAndFilter } from './SearchAndFilter'
|
||||
export { EnterpriseTable } from './EnterpriseTable'
|
||||
export { EnterpriseDetailDialog } from './EnterpriseDetailDialog'
|
||||
export { EnterpriseBasicInfo } from './EnterpriseBasicInfo'
|
||||
export { EnterpriseOtherInfo } from './EnterpriseOtherInfo'
|
||||
export { EnterpriseBankInfo } from './EnterpriseBankInfo'
|
||||
export { EnterpriseLegalInfo } from './EnterpriseLegalInfo'
|
||||
@@ -0,0 +1,255 @@
|
||||
'use client'
|
||||
|
||||
import { useState, useEffect } from 'react'
|
||||
import { toast } from 'sonner'
|
||||
import {
|
||||
AuditStatsCard,
|
||||
SearchAndFilter,
|
||||
EnterpriseTable,
|
||||
EnterpriseDetailDialog
|
||||
} from './components'
|
||||
import { Enterprise, AuditStatus } from '@/types/user-management'
|
||||
|
||||
export default function EnterpriseAuditPage() {
|
||||
const [enterprises, setEnterprises] = useState<Enterprise[]>([])
|
||||
const [searchKeyword, setSearchKeyword] = useState('')
|
||||
const [statusFilter, setStatusFilter] = useState<string>('all')
|
||||
const [showDetailDialog, setShowDetailDialog] = useState(false)
|
||||
const [selectedEnterprise, setSelectedEnterprise] = useState<Enterprise | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
loadEnterprises()
|
||||
}, [])
|
||||
|
||||
const loadEnterprises = () => {
|
||||
const data = localStorage.getItem('smart_agriculture_enterprises')
|
||||
if (data) {
|
||||
setEnterprises(JSON.parse(data))
|
||||
} else {
|
||||
// 初始化示例数据
|
||||
const mockEnterprises: Enterprise[] = [
|
||||
{
|
||||
id: 'ent-1',
|
||||
name: '绿野农业科技有限公司',
|
||||
type: '有限责任公司',
|
||||
province: '北京市',
|
||||
city: '海淀区',
|
||||
district: '中关村街道',
|
||||
companySize: '50-200人',
|
||||
registeredCapital: '1000万元',
|
||||
establishmentDate: '2020-03-15',
|
||||
invoiceType: '增值税专用发票',
|
||||
socialCreditCode: '91110000123456789X',
|
||||
businessScope: '农业技术开发、技术咨询、技术服务;销售机械设备、电子产品。',
|
||||
bankAccount: '1234567890123456789',
|
||||
bankName: '中国工商银行',
|
||||
bankFullName: '中国工商银行股份有限公司北京中关村支行',
|
||||
bankAddress: '北京市海淀区中关村大街1号',
|
||||
legalPerson: '张伟',
|
||||
registrant: '张经理',
|
||||
contactPhone: '13800138001',
|
||||
address: '北京市海淀区中关村大街1号科技大厦',
|
||||
status: 'active',
|
||||
auditStatus: 'pending',
|
||||
createdAt: '2024-10-10T08:00:00',
|
||||
updatedAt: '2024-10-10T08:00:00',
|
||||
},
|
||||
{
|
||||
id: 'ent-2',
|
||||
name: '丰收现代农业集团',
|
||||
type: '股份有限公司',
|
||||
province: '江苏省',
|
||||
city: '南京市',
|
||||
district: '江宁区',
|
||||
companySize: '200-500人',
|
||||
registeredCapital: '5000万元',
|
||||
establishmentDate: '2018-06-20',
|
||||
invoiceType: '增值税专用发票',
|
||||
socialCreditCode: '91320000987654321Y',
|
||||
businessScope: '现代农业种植、农产品加工与销售、农业技术推广服务。',
|
||||
bankAccount: '9876543210987654321',
|
||||
bankName: '中国农业银行',
|
||||
bankFullName: '中国农业银行股份有限公司南京江宁支行',
|
||||
bankAddress: '江苏省南京市江宁区农业大道88号',
|
||||
legalPerson: '李明',
|
||||
registrant: '李总',
|
||||
contactPhone: '13900139002',
|
||||
address: '江苏省南京市江宁区农业大道88号',
|
||||
status: 'active',
|
||||
auditStatus: 'approved',
|
||||
auditTime: '2024-10-08T14:30:00',
|
||||
auditor: '系统管理员',
|
||||
createdAt: '2024-10-05T10:00:00',
|
||||
updatedAt: '2024-10-08T14:30:00',
|
||||
},
|
||||
{
|
||||
id: 'ent-3',
|
||||
name: '金穗农机服务中心',
|
||||
type: '个人独资企业',
|
||||
province: '山东省',
|
||||
city: '济南市',
|
||||
district: '历城区',
|
||||
companySize: '1-50人',
|
||||
registeredCapital: '200万元',
|
||||
establishmentDate: '2021-09-10',
|
||||
invoiceType: '增值税普通发票',
|
||||
socialCreditCode: '91370000456789012Z',
|
||||
businessScope: '农业机械租赁、维修服务、农机作业服务。',
|
||||
bankAccount: '5555666677778888',
|
||||
bankName: '中国建设银行',
|
||||
bankFullName: '中国建设银行股份有限公司济南历城支行',
|
||||
bankAddress: '山东省济南市历城区农机路66号',
|
||||
legalPerson: '王刚',
|
||||
registrant: '王主任',
|
||||
contactPhone: '13700137003',
|
||||
address: '山东省济南市历城区农机路66号',
|
||||
status: 'inactive',
|
||||
auditStatus: 'rejected',
|
||||
auditReason: '资质材料不完整,请补充营业执照副本和法人身份证复印件',
|
||||
auditTime: '2024-10-09T16:00:00',
|
||||
auditor: '系统管理员',
|
||||
createdAt: '2024-10-06T09:00:00',
|
||||
updatedAt: '2024-10-09T16:00:00',
|
||||
},
|
||||
];
|
||||
localStorage.setItem('smart_agriculture_enterprises', JSON.stringify(mockEnterprises));
|
||||
setEnterprises(mockEnterprises);
|
||||
}
|
||||
};
|
||||
|
||||
const filteredEnterprises = enterprises.filter(ent => {
|
||||
const matchKeyword = !searchKeyword ||
|
||||
ent.name.includes(searchKeyword) ||
|
||||
ent.socialCreditCode.includes(searchKeyword) ||
|
||||
ent.registrant.includes(searchKeyword);
|
||||
|
||||
const matchStatus = statusFilter === 'all' || ent.auditStatus === statusFilter;
|
||||
|
||||
return matchKeyword && matchStatus;
|
||||
});
|
||||
|
||||
const handleViewDetail = (enterprise: Enterprise) => {
|
||||
setSelectedEnterprise(enterprise);
|
||||
setShowDetailDialog(true);
|
||||
};
|
||||
|
||||
const handleApprove = (auditReason: string) => {
|
||||
if (!selectedEnterprise) return;
|
||||
|
||||
const now = new Date().toISOString();
|
||||
const updated = enterprises.map(ent =>
|
||||
ent.id === selectedEnterprise.id
|
||||
? {
|
||||
...ent,
|
||||
auditStatus: 'approved' as AuditStatus,
|
||||
status: 'active' as const,
|
||||
auditTime: now,
|
||||
auditor: '系统管理员',
|
||||
auditReason: auditReason || undefined,
|
||||
updatedAt: now,
|
||||
}
|
||||
: ent
|
||||
);
|
||||
|
||||
// 创建审核历史记录
|
||||
const auditRecords = JSON.parse(localStorage.getItem('smart_agriculture_audit_records') || '[]');
|
||||
const newRecord = {
|
||||
id: `audit-${Date.now()}`,
|
||||
enterpriseId: selectedEnterprise.id,
|
||||
enterpriseName: selectedEnterprise.name,
|
||||
auditType: 'register',
|
||||
submitTime: selectedEnterprise.createdAt,
|
||||
auditTime: now,
|
||||
auditor: '系统管理员',
|
||||
result: 'approved',
|
||||
remarks: auditReason || '审核通过',
|
||||
};
|
||||
auditRecords.push(newRecord);
|
||||
localStorage.setItem('smart_agriculture_audit_records', JSON.stringify(auditRecords));
|
||||
|
||||
setEnterprises(updated);
|
||||
localStorage.setItem('smart_agriculture_enterprises', JSON.stringify(updated));
|
||||
setShowDetailDialog(false);
|
||||
toast.success('审核通过');
|
||||
};
|
||||
|
||||
const handleReject = (auditReason: string) => {
|
||||
if (!selectedEnterprise) return;
|
||||
if (!auditReason.trim()) {
|
||||
toast.error('请填写驳回原因');
|
||||
return;
|
||||
}
|
||||
|
||||
const now = new Date().toISOString();
|
||||
const updated = enterprises.map(ent =>
|
||||
ent.id === selectedEnterprise.id
|
||||
? {
|
||||
...ent,
|
||||
auditStatus: 'rejected' as AuditStatus,
|
||||
status: 'inactive' as const,
|
||||
auditTime: now,
|
||||
auditor: '系统管理员',
|
||||
auditReason: auditReason,
|
||||
updatedAt: now,
|
||||
}
|
||||
: ent
|
||||
);
|
||||
|
||||
// 创建审核历史记录
|
||||
const auditRecords = JSON.parse(localStorage.getItem('smart_agriculture_audit_records') || '[]');
|
||||
const newRecord = {
|
||||
id: `audit-${Date.now()}`,
|
||||
enterpriseId: selectedEnterprise.id,
|
||||
enterpriseName: selectedEnterprise.name,
|
||||
auditType: 'register',
|
||||
submitTime: selectedEnterprise.createdAt,
|
||||
auditTime: now,
|
||||
auditor: '系统管理员',
|
||||
result: 'rejected',
|
||||
reason: auditReason,
|
||||
remarks: '审核驳回',
|
||||
};
|
||||
auditRecords.push(newRecord);
|
||||
localStorage.setItem('smart_agriculture_audit_records', JSON.stringify(auditRecords));
|
||||
|
||||
setEnterprises(updated);
|
||||
localStorage.setItem('smart_agriculture_enterprises', JSON.stringify(updated));
|
||||
setShowDetailDialog(false);
|
||||
toast.success('已驳回');
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-6 p-6">
|
||||
<div>
|
||||
<h2 className="text-green-800">企业审核</h2>
|
||||
<p className="text-muted-foreground">管理企业注册与变更审核流程</p>
|
||||
</div>
|
||||
|
||||
{/* 统计卡片 */}
|
||||
<AuditStatsCard enterprises={enterprises} />
|
||||
|
||||
{/* 搜索和筛选 */}
|
||||
<SearchAndFilter
|
||||
searchKeyword={searchKeyword}
|
||||
onSearchChange={setSearchKeyword}
|
||||
statusFilter={statusFilter}
|
||||
onStatusFilterChange={setStatusFilter}
|
||||
/>
|
||||
|
||||
{/* 企业列表 */}
|
||||
<EnterpriseTable
|
||||
enterprises={filteredEnterprises}
|
||||
onViewDetail={handleViewDetail}
|
||||
/>
|
||||
|
||||
{/* 详情审核对话框 */}
|
||||
<EnterpriseDetailDialog
|
||||
open={showDetailDialog}
|
||||
onOpenChange={setShowDetailDialog}
|
||||
enterprise={selectedEnterprise}
|
||||
onApprove={handleApprove}
|
||||
onReject={handleReject}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function EnterpriseInfoPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">企业信息</h1>
|
||||
<p>企业信息管理页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -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/(app)/central-config/tenant-management/page.tsx
Normal file
163
crop-x/src/app/(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,8 @@
|
||||
export default function PlatformUserManagementPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">平台用户管理</h1>
|
||||
<p>平台用户管理功能页面</p>
|
||||
</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>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function EmployeeManagementPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">员工管理</h1>
|
||||
<p>员工管理功能页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function MenuManagementPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">菜单管理</h1>
|
||||
<p>菜单管理功能页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
178
crop-x/src/app/(app)/central-config/user-management/page.tsx
Normal file
178
crop-x/src/app/(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,8 @@
|
||||
export default function PermissionConfigPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">权限配置管理</h1>
|
||||
<p>权限配置管理功能页面</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
export default function RoleManagementPage() {
|
||||
return (
|
||||
<div className="p-6">
|
||||
<h1 className="text-2xl font-bold mb-4">角色管理</h1>
|
||||
<p>角色管理功能页面</p>
|
||||
</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>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/(app)/farming-operation/layout.tsx
Normal file
22
crop-x/src/app/(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/(app)/farming-operation/page.tsx
Normal file
159
crop-x/src/app/(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/(app)/land-information/layout.tsx
Normal file
22
crop-x/src/app/(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/(app)/land-information/page.tsx
Normal file
147
crop-x/src/app/(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>
|
||||
)
|
||||
}
|
||||
16
crop-x/src/app/(app)/layout.tsx
Normal file
16
crop-x/src/app/(app)/layout.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import {Navbar} from "@/components/layouts/Navbar"
|
||||
import '@/styles/globals.css'
|
||||
export default function DashboardLayout({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
<div>
|
||||
<Navbar></Navbar>
|
||||
{/* 布局 UI */}
|
||||
{/* 将 children 放在您希望渲染页面或嵌套布局的位置 */}
|
||||
<main>{children}</main>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
22
crop-x/src/app/(app)/water-fertilizer-control/layout.tsx
Normal file
22
crop-x/src/app/(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/(app)/water-fertilizer-control/page.tsx
Normal file
123
crop-x/src/app/(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>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user