fix: 修复系统模块TypeScript类型错误和组件功能问题

- 修复消息组件JSX.Element类型错误,改为React.ReactNode
- 完善审核历史页面类型定义和API接口调用
- 优化验证码组件,移除备用验证码逻辑避免无限循环
- 简化系统设置页面,仅保留基本设置和外观设置
- 修复用户管理页面编辑模态框数据加载和CRUD操作
- 移除废弃的作物推荐组件文件

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-12 17:28:11 +08:00
parent dcd7ddeb71
commit dfc29ce01f
21 changed files with 379 additions and 769 deletions

View File

@@ -1,30 +1,17 @@
'use client';
import { Book, Menu, Sunset, Trees, Zap } from "lucide-react";
import { Sprout, Map, Clipboard, Package, Brain, Droplets, Settings } from 'lucide-react';
import { Menu } from "lucide-react";
import { Sprout } from 'lucide-react';
import { MessageBell } from './components/MessageBell';
import { UserProfile } from './components/UserProfile';
import { ThemeToggle } from './ThemeToggle';
import { useElementHeight } from '@/hooks/useElementHeight';
import { useViewHeight } from '@/hooks/useViewHeight';
import { usePathname, useRouter } from 'next/navigation';
import { useRef, useEffect, useState } from 'react';
// 注释掉 Accordion 相关导入,因为不再需要二级菜单
// import {
// Accordion,
// AccordionContent,
// AccordionItem,
// AccordionTrigger,
// } from "@/components/ui/accordion";
import { useLayoutStore } from '@/stores/useLayoutStore';
import { Button } from "@/components/ui/button";
import {
NavigationMenu,
NavigationMenuContent,
NavigationMenuItem,
NavigationMenuLink,
NavigationMenuList,
NavigationMenuTrigger,
} from "@/components/ui/navigation-menu";
import {
Sheet,
@@ -82,19 +69,6 @@ const Navbar1 = ({ navbarData }: Navbar1Props) => {
return false;
}
// 使用自定义 Hook 计算高度
const { elementRef, updateHeight } = useElementHeight({
immediate: true, // 立即计算高度
onUpdate: (height: number) => {
// 更新 Zustand store 中的状态
const { setNavigatorHeight } = useLayoutStore.getState();
setNavigatorHeight(height);
}
});
// 监听页面高度变化
useViewHeight();
const handleMessageClick = () => {
// 处理消息点击事件,可以跳转到消息中心页面
@@ -107,7 +81,7 @@ const Navbar1 = ({ navbarData }: Navbar1Props) => {
};
return (
<section className="py-4" ref={elementRef}>
<section className="py-4">
<div className="container" style = {containerStyle}>
{/* Desktop Menu */}
<nav className="hidden justify-between lg:flex">