提交1 bmad搭建与项目启动 - ok

This commit is contained in:
2025-10-17 17:24:56 +08:00
commit ec58562661
686 changed files with 149750 additions and 0 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1 @@
/* 调度系统样式 */

View File

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

View File

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

View File

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

View File

@@ -0,0 +1 @@
/* 对比分析样式 */

View File

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

View File

@@ -0,0 +1 @@
/* 地块档案管理样式 */

View File

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

View File

@@ -0,0 +1 @@
/* 地块分类样式 */

View File

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

View File

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

View File

@@ -0,0 +1 @@
/* 地图管理样式 */

View File

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

View File

@@ -0,0 +1 @@
/* 风险预警样式 */

View File

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

View File

@@ -0,0 +1 @@
/* 空间分析样式 */

View File

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

View File

@@ -0,0 +1 @@
/* 适宜性评价样式 */

View File

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

View File

@@ -0,0 +1 @@
/* CategoryForm 样式文件 */

View File

@@ -0,0 +1,7 @@
import React from 'react';
import './index.css';
export function CategoryForm() {
console.log('CategoryForm component rendered');
return <div className="CategoryForm"><h4>CategoryForm</h4></div>;
}

View File

@@ -0,0 +1,3 @@
export interface CategoryFormProps {
// Props will be defined later
}

View File

@@ -0,0 +1 @@
/* CategoryTree 样式文件 */

View File

@@ -0,0 +1,7 @@
import React from 'react';
import './index.css';
export function CategoryTree() {
console.log('CategoryTree component rendered');
return <div className="CategoryTree"><h4>CategoryTree</h4></div>;
}

View File

@@ -0,0 +1,3 @@
export interface CategoryTreeProps {
// Props will be defined later
}

View File

@@ -0,0 +1 @@
/* TagForm 样式文件 */

View File

@@ -0,0 +1,7 @@
import React from 'react';
import './index.css';
export function TagForm() {
console.log('TagForm component rendered');
return <div className="TagForm"><h4>TagForm</h4></div>;
}

View File

@@ -0,0 +1,3 @@
export interface TagFormProps {
// Props will be defined later
}

View File

@@ -0,0 +1 @@
/* TagManager 样式文件 */

View File

@@ -0,0 +1,7 @@
import React from 'react';
import './index.css';
export function TagManager() {
console.log('TagManager component rendered');
return <div className="TagManager"><h4>TagManager</h4></div>;
}

View File

@@ -0,0 +1,3 @@
export interface TagManagerProps {
// Props will be defined later
}

View File

@@ -0,0 +1 @@
/* TagSelector 样式文件 */

View File

@@ -0,0 +1,7 @@
import React from 'react';
import './index.css';
export function TagSelector() {
console.log('TagSelector component rendered');
return <div className="TagSelector"><h4>TagSelector</h4></div>;
}

View File

@@ -0,0 +1,3 @@
export interface TagSelectorProps {
// Props will be defined later
}

View File

@@ -0,0 +1,6 @@
export const CATEGORY_COLORS = [
"#1890ff",
"#52c41a",
"#fa8c16",
"#722ed1"
];

View File

@@ -0,0 +1,21 @@
import { useState, useCallback } from "react";
import { Category, Tag } from "../index.types";
export function useClassification() {
const [selectedCategory, setSelectedCategory] = useState<Category | null>(null);
const [selectedTags, setSelectedTags] = useState<Tag[]>([]);
const handleCategorySelect = useCallback((category: Category) => {
setSelectedCategory(category);
}, []);
const handleTagToggle = useCallback((tag: Tag) => {
setSelectedTags(prev =>
prev.find(t => t.id === tag.id)
? prev.filter(t => t.id \!== tag.id)
: [...prev, tag]
);
}, []);
return { selectedCategory, selectedTags, handleCategorySelect, handleTagToggle };
}

View File

@@ -0,0 +1,14 @@
import { useCallback } from "react";
import { Category, Tag } from "../index.types";
export function usePageActions(refreshData: () => void) {
const handleCreateCategory = useCallback((category: Partial<Category>) => {
console.log("Create category:", category);
}, []);
const handleCreateTag = useCallback((tag: Partial<Tag>) => {
console.log("Create tag:", tag);
}, []);
return { handleCreateCategory, handleCreateTag };
}

View File

@@ -0,0 +1,26 @@
import { useState, useEffect, useCallback } from "react";
import { Category, Tag } from "../index.types";
export function usePageData() {
const [categories, setCategories] = useState<Category[]>([]);
const [tags, setTags] = useState<Tag[]>([]);
const [loading, setLoading] = useState(false);
const [error, setError] = useState<string | null>(null);
const fetchData = useCallback(async () => {
setLoading(true);
try {
// 模拟API调用
setCategories([]);
setTags([]);
} catch (err) {
setError("Failed to fetch data");
} finally {
setLoading(false);
}
}, []);
useEffect(() => { fetchData(); }, [fetchData]);
return { categories, tags, loading, error, refreshData: fetchData };
}

View File

@@ -0,0 +1 @@
/* MachineryClassification 样式文件 */

View File

@@ -0,0 +1,6 @@
import React from "react";
export function MachineryClassification() {
console.log("MachineryClassification component rendered");
return <div className="machinery-classification"><h1></h1></div>;
}

View File

@@ -0,0 +1,13 @@
export interface Category {
id: string;
name: string;
parentId?: string;
description?: string;
}
export interface Tag {
id: string;
name: string;
color?: string;
category?: string;
}

View File

@@ -0,0 +1,23 @@
import { Category } from "../index.types";
export function validateCategoryName(name: string): string | null {
if (\!name || name.trim() === "") {
return "分类名称不能为空";
}
if (name.length > 50) {
return "分类名称不能超过50个字符";
}
return null;
}
export function formatCategoryPath(category: Category, allCategories: Category[]): string {
const path: string[] = [];
let current = category;
while (current) {
path.unshift(current.name);
current = allCategories.find(c => c.id === current.parentId);
}
return path.join(" / ");
}

View File

@@ -0,0 +1,22 @@
import { Category, Tag } from "../index.types";
export function buildCategoryTree(categories: Category[]): Category[] {
const categoryMap = new Map();
const roots: Category[] = [];
categories.forEach(category => {
categoryMap.set(category.id, { ...category, children: [] });
});
categories.forEach(category => {
const node = categoryMap.get(category.id);
if (category.parentId) {
const parent = categoryMap.get(category.parentId);
if (parent) parent.children.push(node);
} else {
roots.push(node);
}
});
return roots;
}

View File

@@ -0,0 +1,7 @@
/* MachineryDetails 样式文件 */
.machinery-details {
padding: 16px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

View File

@@ -0,0 +1,20 @@
import React from 'react';
import { MachineryRecord } from '../../index.types';
import './index.css';
interface MachineryDetailsProps {
machinery: MachineryRecord;
onClose?: () => void;
onEdit?: (machinery: MachineryRecord) => void;
}
export function MachineryDetails({ machinery, onClose, onEdit }: MachineryDetailsProps) {
console.log('MachineryDetails component rendered', { machineryId: machinery.id });
return (
<div className="machinery-details">
<h3></h3>
{/* 详情内容将在后续实现 */}
</div>
);
}

View File

@@ -0,0 +1,7 @@
import { MachineryRecord } from "../../index.types";
export interface MachineryDetailsProps {
machinery: MachineryRecord;
onClose?: () => void;
onEdit?: (machinery: MachineryRecord) => void;
}

View File

@@ -0,0 +1,8 @@
/* MachineryFilter 样式文件 */
.machinery-filter {
padding: 16px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 16px;
}

View File

@@ -0,0 +1,19 @@
import React from 'react';
import { MachineryFilters } from '../../index.types';
import './index.css';
interface MachineryFilterProps {
filters: MachineryFilters;
onFilterChange: (filters: MachineryFilters) => void;
}
export function MachineryFilter({ filters, onFilterChange }: MachineryFilterProps) {
console.log('MachineryFilter component rendered', { filters });
return (
<div className="machinery-filter">
<h3></h3>
{/* 筛选内容将在后续实现 */}
</div>
);
}

View File

@@ -0,0 +1,8 @@
import { MachineryFilters } from '../../index.types';
export interface MachineryFilterProps {
filters: MachineryFilters;
onFilterChange: (filters: MachineryFilters) => void;
onReset?: () => void;
loading?: boolean;
}

View File

@@ -0,0 +1,7 @@
/* MachineryForm 样式文件 */
.machinery-form {
padding: 16px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

View File

@@ -0,0 +1,20 @@
import React from 'react';
import { MachineryRecord } from '../../index.types';
import './index.css';
interface MachineryFormProps {
machinery?: Partial<MachineryRecord>;
onSubmit?: (data: Partial<MachineryRecord>) => void;
onCancel?: () => void;
}
export function MachineryForm({ machinery, onSubmit, onCancel }: MachineryFormProps) {
console.log('MachineryForm component rendered', { machinery });
return (
<div className="machinery-form">
<h2></h2>
{/* 表单内容将在后续实现 */}
</div>
);
}

View File

@@ -0,0 +1,19 @@
import { MachineryRecord } from '../../index.types';
export interface MachineryFormProps {
machinery?: Partial<MachineryRecord>;
mode?: 'create' | 'edit' | 'view';
onSubmit?: (data: Partial<MachineryRecord>) => void;
onCancel?: () => void;
loading?: boolean;
}
export interface FormFieldProps {
label: string;
name: keyof MachineryRecord;
value: any;
onChange: (value: any) => void;
error?: string;
disabled?: boolean;
required?: boolean;
}

View File

@@ -0,0 +1,7 @@
/* MachineryList 样式文件 */
.machinery-list {
padding: 16px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

View File

@@ -0,0 +1,34 @@
import React from 'react';
import { MachineryRecord, PaginationState } from '../../index.types';
import './index.css';
interface MachineryListProps {
machinery: MachineryRecord[];
loading?: boolean;
error?: string | null;
pagination?: PaginationState;
onPageChange?: (page: number) => void;
onEdit?: (machinery: MachineryRecord) => void;
onDelete?: (id: string) => void;
onBatchDelete?: (ids: string[]) => void;
}
export function MachineryList({
machinery,
loading,
error,
pagination,
onPageChange,
onEdit,
onDelete,
onBatchDelete
}: MachineryListProps) {
console.log('MachineryList component rendered', { machineryCount: machinery.length });
return (
<div className="machinery-list">
<h3></h3>
{/* 列表内容将在后续实现 */}
</div>
);
}

View File

@@ -0,0 +1,23 @@
import { MachineryRecord, PaginationState } from '../../index.types';
export interface MachineryListProps {
machinery: MachineryRecord[];
loading?: boolean;
error?: string | null;
pagination?: PaginationState;
onPageChange?: (page: number) => void;
onEdit?: (machinery: MachineryRecord) => void;
onDelete?: (id: string) => void;
onBatchDelete?: (ids: string[]) => void;
onExport?: () => void;
selectable?: boolean;
showActions?: boolean;
}
export interface MachineryListItemProps {
machinery: MachineryRecord;
onEdit?: (machinery: MachineryRecord) => void;
onDelete?: (id: string) => void;
selected?: boolean;
onSelect?: (id: string, selected: boolean) => void;
}

View File

@@ -0,0 +1,7 @@
/* MachineryTable 样式文件 */
.machinery-table {
padding: 16px;
background: white;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

View File

@@ -0,0 +1,21 @@
import React from 'react';
import { MachineryRecord } from '../../index.types';
import './index.css';
interface MachineryTableProps {
machinery: MachineryRecord[];
loading?: boolean;
onEdit?: (machinery: MachineryRecord) => void;
onDelete?: (id: string) => void;
}
export function MachineryTable({ machinery, loading, onEdit, onDelete }: MachineryTableProps) {
console.log('MachineryTable component rendered', { machineryCount: machinery.length });
return (
<div className="machinery-table">
<h3></h3>
{/* 表格内容将在后续实现 */}
</div>
);
}

View File

@@ -0,0 +1,10 @@
import { MachineryRecord } from '../../index.types';
export interface MachineryTableProps {
machinery: MachineryRecord[];
loading?: boolean;
onEdit?: (machinery: MachineryRecord) => void;
onDelete?: (id: string) => void;
selectable?: boolean;
onSelectionChange?: (selectedIds: string[]) => void;
}

View File

@@ -0,0 +1 @@
/* Pagination 样式文件 */

View File

@@ -0,0 +1,14 @@
import React from "react";
import "./index.css";
interface PaginationProps {
current: number;
total: number;
pageSize: number;
onChange?: (page: number) => void;
}
export function Pagination({ current, total, pageSize, onChange }: PaginationProps) {
console.log("Pagination component rendered");
return <div className="pagination"><h4></h4></div>;
}

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