提交1 bmad搭建与项目启动 - ok
This commit is contained in:
81
src/types/auth.ts
Normal file
81
src/types/auth.ts
Normal file
@@ -0,0 +1,81 @@
|
||||
export interface Enterprise {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string;
|
||||
type: string;
|
||||
status: 'active' | 'inactive';
|
||||
address?: string;
|
||||
contact?: string;
|
||||
phone?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface User {
|
||||
id: string;
|
||||
username: string;
|
||||
phone: string;
|
||||
email?: string;
|
||||
realName: string;
|
||||
role: string;
|
||||
permissions: string[];
|
||||
avatar?: string;
|
||||
department?: string;
|
||||
enterpriseId: string;
|
||||
enterpriseName: string;
|
||||
createdAt: string;
|
||||
lastLoginTime?: string;
|
||||
lastLoginIp?: string;
|
||||
lastLoginDevice?: string;
|
||||
}
|
||||
|
||||
export interface LoginForm {
|
||||
username?: string;
|
||||
password?: string;
|
||||
phone?: string;
|
||||
code?: string;
|
||||
captcha: string;
|
||||
loginType: 'password' | 'phone';
|
||||
}
|
||||
|
||||
export interface RegisterForm {
|
||||
username: string;
|
||||
password: string;
|
||||
confirmPassword: string;
|
||||
phone: string;
|
||||
code: string;
|
||||
realName: string;
|
||||
email?: string;
|
||||
enterpriseId: string;
|
||||
captcha: string;
|
||||
}
|
||||
|
||||
export interface AuthState {
|
||||
isAuthenticated: boolean;
|
||||
user: User | null;
|
||||
token: string | null;
|
||||
refreshToken: string | null;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
success: boolean;
|
||||
message: string;
|
||||
data?: {
|
||||
user: User;
|
||||
token: string;
|
||||
refreshToken: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface LoginRecord {
|
||||
id: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
loginTime: string;
|
||||
loginIp: string;
|
||||
loginDevice: string;
|
||||
browser: string;
|
||||
os: string;
|
||||
loginType: 'password' | 'phone';
|
||||
status: 'success' | 'failed';
|
||||
failReason?: string;
|
||||
}
|
||||
145
src/types/driver.ts
Normal file
145
src/types/driver.ts
Normal file
@@ -0,0 +1,145 @@
|
||||
// 驾驶员档案数据类型定义
|
||||
|
||||
export interface DriverRecord {
|
||||
id: string;
|
||||
|
||||
// 基本信息
|
||||
name: string;
|
||||
gender: '男' | '女';
|
||||
birthDate: string;
|
||||
phone: string;
|
||||
email?: string;
|
||||
address?: string;
|
||||
idCard: string; // 身份证号
|
||||
photo?: string; // 照片URL
|
||||
|
||||
// 驾驶证信息
|
||||
driverLicense: {
|
||||
licenseNumber: string;
|
||||
licenseType: string; // C1, B2, A等
|
||||
issueDate: string;
|
||||
expiryDate: string;
|
||||
frontPhoto?: string; // 驾驶证正页
|
||||
backPhoto?: string; // 驾驶证副页
|
||||
};
|
||||
|
||||
// 从业资格证
|
||||
qualification?: {
|
||||
certificateNumber: string;
|
||||
issueDate: string;
|
||||
expiryDate: string;
|
||||
certificatePhoto?: string;
|
||||
};
|
||||
|
||||
// 培训记录
|
||||
trainingRecords: TrainingRecord[];
|
||||
|
||||
// 违规记录
|
||||
violationRecords: ViolationRecord[];
|
||||
|
||||
// 工作信息
|
||||
status: DriverStatus;
|
||||
department?: string;
|
||||
entryDate: string; // 入职日期
|
||||
|
||||
// 系统信息
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy: string;
|
||||
updatedBy: string;
|
||||
}
|
||||
|
||||
export type DriverStatus = '在岗' | '休假' | '离职';
|
||||
|
||||
export interface TrainingRecord {
|
||||
id: string;
|
||||
driverId: string;
|
||||
trainingName: string;
|
||||
trainingType: string;
|
||||
trainingDate: string;
|
||||
duration: number; // 培训时长(小时)
|
||||
instructor?: string;
|
||||
score?: number;
|
||||
certificate?: string; // 证书URL
|
||||
remarks?: string;
|
||||
knowledgeBaseIds?: string[]; // 关联的培训知识库
|
||||
}
|
||||
|
||||
export interface ViolationRecord {
|
||||
id: string;
|
||||
driverId: string;
|
||||
violationType: string;
|
||||
violationDate: string;
|
||||
description: string;
|
||||
penaltyPoints?: number;
|
||||
fine?: number;
|
||||
handler?: string;
|
||||
status: '待处理' | '处理中' | '已处理';
|
||||
remarks?: string;
|
||||
}
|
||||
|
||||
// 驾驶员任务
|
||||
export interface DriverTask {
|
||||
id: string;
|
||||
taskNumber: string; // 任务编号
|
||||
|
||||
// 任务基本信息
|
||||
machineryId: string; // 农机ID
|
||||
machineryName?: string;
|
||||
driverId: string; // 驾驶员ID
|
||||
driverName?: string;
|
||||
fieldId?: string; // 地块ID
|
||||
fieldName?: string;
|
||||
|
||||
// 任务详情
|
||||
operationType: string; // 作业类型:耕地、播种、收获等
|
||||
description?: string;
|
||||
|
||||
// 时间要求
|
||||
plannedStartTime: string;
|
||||
plannedEndTime: string;
|
||||
actualStartTime?: string;
|
||||
actualEndTime?: string;
|
||||
|
||||
// 任务状态
|
||||
status: TaskStatus;
|
||||
|
||||
// 问题反馈
|
||||
issues: TaskIssue[];
|
||||
|
||||
// 工时统计
|
||||
workHours?: number; // 实际工时(小时)
|
||||
|
||||
// 其他
|
||||
priority: 'low' | 'medium' | 'high';
|
||||
assignedBy: string; // 分配人
|
||||
assignedAt: string; // 分配时间
|
||||
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type TaskStatus = '待接收' | '已接收' | '进行中' | '已完成' | '已中断' | '已取消';
|
||||
|
||||
export interface TaskIssue {
|
||||
id: string;
|
||||
taskId: string;
|
||||
reportedAt: string;
|
||||
reportedBy: string;
|
||||
issueType: string;
|
||||
description: string;
|
||||
photos?: string[]; // 问题照片
|
||||
status: '待处理' | '处理中' | '已解决';
|
||||
solution?: string;
|
||||
solvedAt?: string;
|
||||
}
|
||||
|
||||
// 证件到期提醒配置
|
||||
export interface CertificateReminder {
|
||||
driverId: string;
|
||||
driverName: string;
|
||||
certificateType: '驾驶证' | '从业资格证';
|
||||
expiryDate: string;
|
||||
daysUntilExpiry: number;
|
||||
reminded: boolean;
|
||||
}
|
||||
241
src/types/equipment.ts
Normal file
241
src/types/equipment.ts
Normal file
@@ -0,0 +1,241 @@
|
||||
// 农机负载设备数据类型定义
|
||||
|
||||
export interface MountedDevice {
|
||||
id: string;
|
||||
machineryId: string; // 所属农机ID
|
||||
deviceTypeId: string; // 设备类型ID
|
||||
|
||||
// 设备信息
|
||||
deviceName: string;
|
||||
serialNumber: string; // 设备序列号
|
||||
|
||||
// 挂载信息
|
||||
mountedAt: string; // 挂载时间
|
||||
unmountedAt?: string; // 拆卸时间
|
||||
status: 'mounted' | 'unmounted';
|
||||
|
||||
// 设备参数配置
|
||||
parameters: Record<string, any>;
|
||||
|
||||
// 备注
|
||||
remarks?: string;
|
||||
|
||||
// 操作记录
|
||||
operator: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface DeviceType {
|
||||
id: string;
|
||||
name: string;
|
||||
category: DeviceCategory;
|
||||
|
||||
// 元数据
|
||||
manufacturer?: string; // 品牌
|
||||
model?: string; // 型号
|
||||
communicationProtocol?: string; // 通信协议:MQTT, HTTP, RS485等
|
||||
dataFormat?: string; // 数据格式:JSON, XML, Binary等
|
||||
|
||||
// 参数定义
|
||||
parameterDefinitions: ParameterDefinition[];
|
||||
|
||||
// 其他
|
||||
description?: string;
|
||||
icon?: string;
|
||||
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type DeviceCategory =
|
||||
| '摄像头'
|
||||
| '北斗终端'
|
||||
| 'GPS终端'
|
||||
| '转速传感器'
|
||||
| '油耗传感器'
|
||||
| '温度传感器'
|
||||
| '湿度传感器'
|
||||
| '深度传感器'
|
||||
| '流量传感器'
|
||||
| '其他';
|
||||
|
||||
export interface ParameterDefinition {
|
||||
key: string;
|
||||
label: string;
|
||||
type: 'string' | 'number' | 'boolean' | 'select';
|
||||
required?: boolean;
|
||||
defaultValue?: any;
|
||||
options?: { label: string; value: any }[];
|
||||
unit?: string;
|
||||
min?: number;
|
||||
max?: number;
|
||||
description?: string;
|
||||
}
|
||||
|
||||
// 设备监控数据
|
||||
export interface DeviceMonitoringData {
|
||||
deviceId: string;
|
||||
machineryId: string;
|
||||
timestamp: string;
|
||||
data: Record<string, any>;
|
||||
}
|
||||
|
||||
// 实时位置数据
|
||||
export interface LocationData {
|
||||
machineryId: string;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
altitude?: number;
|
||||
speed?: number; // km/h
|
||||
heading?: number; // 方位角,0-360度
|
||||
accuracy?: number; // 定位精度,米
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
// 工作状态
|
||||
export interface MachineryWorkState {
|
||||
machineryId: string;
|
||||
state: WorkState;
|
||||
|
||||
// 工况数据
|
||||
ignition: boolean; // 点火状态
|
||||
speed: number; // 行驶速度 km/h
|
||||
ptoStatus: boolean; // PTO(动力输出)状态
|
||||
engineRpm?: number; // 发动机转速
|
||||
fuelLevel?: number; // 油量百分比
|
||||
|
||||
// 作业数据
|
||||
workingArea?: number; // 作业面积(亩)
|
||||
workingRate?: number; // 作业速率(亩/小时)
|
||||
|
||||
timestamp: string;
|
||||
}
|
||||
|
||||
export type WorkState = '熄火' | '行驶中' | '作业中' | '故障' | '待机';
|
||||
|
||||
// 作业轨迹
|
||||
export interface WorkTrack {
|
||||
id: string;
|
||||
machineryId: string;
|
||||
taskId?: string;
|
||||
startTime: string;
|
||||
endTime?: string;
|
||||
points: LocationData[];
|
||||
totalDistance?: number; // 总距离,公里
|
||||
totalArea?: number; // 总作业面积,亩
|
||||
averageSpeed?: number; // 平均速度 km/h
|
||||
}
|
||||
|
||||
// 故障诊断
|
||||
export interface FaultDiagnosis {
|
||||
id: string;
|
||||
machineryId: string;
|
||||
machineryName?: string;
|
||||
|
||||
// 故障信息
|
||||
faultCode: string;
|
||||
faultName: string;
|
||||
faultLevel: 'info' | 'warning' | 'error' | 'critical';
|
||||
description: string;
|
||||
|
||||
// 诊断结果
|
||||
diagnosis?: string;
|
||||
predictedCause?: string;
|
||||
solution?: string;
|
||||
knowledgeBaseIds?: string[]; // 关联的知识库
|
||||
|
||||
// 时间
|
||||
detectedAt: string;
|
||||
resolvedAt?: string;
|
||||
|
||||
// 状态
|
||||
status: '待处理' | '处理中' | '已解决' | '已忽略';
|
||||
|
||||
// 处理信息
|
||||
handler?: string;
|
||||
handleNotes?: string;
|
||||
}
|
||||
|
||||
// 健康评估
|
||||
export interface HealthAssessment {
|
||||
machineryId: string;
|
||||
machineryName?: string;
|
||||
|
||||
// 评估结果
|
||||
score: number; // 0-100
|
||||
level: '优秀' | '良好' | '注意' | '警告';
|
||||
|
||||
// 评估指标
|
||||
metrics: {
|
||||
runningHours: number; // 运行小时数
|
||||
faultCount: number; // 故障次数
|
||||
maintenanceScore: number; // 维保得分
|
||||
workloadScore: number; // 作业负荷得分
|
||||
};
|
||||
|
||||
// 趋势分析
|
||||
trend: 'improving' | 'stable' | 'declining';
|
||||
|
||||
// 建议
|
||||
recommendations: string[];
|
||||
|
||||
assessedAt: string;
|
||||
assessedBy: string;
|
||||
}
|
||||
|
||||
// 地理坐标点
|
||||
export interface GeoPoint {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
}
|
||||
|
||||
// 电子围栏
|
||||
export interface GeoFence {
|
||||
id: string;
|
||||
name: string;
|
||||
type: 'circle' | 'polygon';
|
||||
|
||||
// 圆形围栏
|
||||
center?: GeoPoint;
|
||||
radius?: number; // 米
|
||||
|
||||
// 多边形围栏
|
||||
points?: GeoPoint[];
|
||||
|
||||
// 关联农机
|
||||
machineryIds: string[];
|
||||
|
||||
// 规则
|
||||
alertOnExit: boolean; // 离开围栏时报警
|
||||
alertOnEnter: boolean; // 进入围栏时报警
|
||||
|
||||
// 工时核算
|
||||
countWorkHours: boolean; // 是否计算围栏内工时
|
||||
|
||||
// 状态
|
||||
enabled: boolean;
|
||||
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy: string;
|
||||
updatedBy?: string;
|
||||
}
|
||||
|
||||
// 围栏报警记录
|
||||
export interface GeoFenceAlert {
|
||||
id: string;
|
||||
fenceId: string;
|
||||
fenceName: string;
|
||||
machineryId: string;
|
||||
machineryName?: string;
|
||||
|
||||
alertType: 'enter' | 'exit';
|
||||
location: GeoPoint;
|
||||
alertedAt: string;
|
||||
|
||||
// 处理状态
|
||||
acknowledged: boolean;
|
||||
acknowledgedBy?: string;
|
||||
acknowledgedAt?: string;
|
||||
}
|
||||
217
src/types/field.ts
Normal file
217
src/types/field.ts
Normal file
@@ -0,0 +1,217 @@
|
||||
// 地块信息管理系统类型定义
|
||||
|
||||
// 地块基本信息
|
||||
export interface Field {
|
||||
id: string;
|
||||
code: string; // 地块编号
|
||||
name: string; // 地块名称
|
||||
area: number; // 面积(亩)
|
||||
perimeter: number; // 周长(米)
|
||||
|
||||
// 位置信息
|
||||
location: string; // 所在位置
|
||||
coordinates: GeoCoordinate[]; // 边界坐标点
|
||||
centerPoint: {
|
||||
lat: number;
|
||||
lng: number;
|
||||
};
|
||||
|
||||
// 土地属性
|
||||
soilType: SoilType; // 土壤类型
|
||||
landUseType: LandUseType; // 土地利用类型
|
||||
plantingMode: PlantingMode; // 种植模式
|
||||
irrigationType: IrrigationType; // 灌溉方式
|
||||
|
||||
// 权属信息
|
||||
owner: string; // 权属人
|
||||
ownerPhone?: string; // 联系电话
|
||||
contractStartDate?: string; // 承包开始日期
|
||||
contractEndDate?: string; // 承包结束日期
|
||||
contractPeriod?: number; // 承包期限(年)
|
||||
certificateNumber?: string; // 确权证号
|
||||
|
||||
// 标签和分类
|
||||
tags: string[]; // 标签
|
||||
category?: string; // 分类
|
||||
|
||||
// 附件
|
||||
photos: string[]; // 照片
|
||||
documents: FieldDocument[]; // 文档(合同扫描件等)
|
||||
|
||||
// 状态
|
||||
status: 'active' | 'inactive' | 'pending'; // 使用状态
|
||||
|
||||
// 元数据
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy: string;
|
||||
currentVersion: number; // 当前版本号
|
||||
|
||||
// 额外属性
|
||||
elevation?: number; // 海拔(米)
|
||||
slope?: number; // 坡度(度)
|
||||
aspect?: string; // 坡向
|
||||
waterSource?: string; // 水源情况
|
||||
remarks?: string; // 备注
|
||||
}
|
||||
|
||||
// 地理坐标
|
||||
export interface GeoCoordinate {
|
||||
lat: number;
|
||||
lng: number;
|
||||
}
|
||||
|
||||
// 土壤类型
|
||||
export type SoilType =
|
||||
| 'sandy' // 沙土
|
||||
| 'loamy' // 壤土
|
||||
| 'clay' // 粘土
|
||||
| 'silt' // 淤泥土
|
||||
| 'peat' // 泥炭土
|
||||
| 'saline' // 盐碱土
|
||||
| 'other'; // 其他
|
||||
|
||||
// 土地利用类型
|
||||
export type LandUseType =
|
||||
| 'farmland' // 耕地
|
||||
| 'garden' // 园地
|
||||
| 'forestland' // 林地
|
||||
| 'grassland' // 草地
|
||||
| 'other'; // 其他
|
||||
|
||||
// 种植模式
|
||||
export type PlantingMode =
|
||||
| 'open-field' // 露地
|
||||
| 'greenhouse' // 大棚
|
||||
| 'orchard' // 果园
|
||||
| 'paddy' // 水田
|
||||
| 'dryland'; // 旱地
|
||||
|
||||
// 灌溉方式
|
||||
export type IrrigationType =
|
||||
| 'drip' // 滴灌
|
||||
| 'sprinkler' // 喷灌
|
||||
| 'flood' // 漫灌
|
||||
| 'micro-sprinkler' // 微喷
|
||||
| 'none'; // 无灌溉
|
||||
|
||||
// 地块文档
|
||||
export interface FieldDocument {
|
||||
id: string;
|
||||
name: string;
|
||||
type: 'contract' | 'certificate' | 'permit' | 'other'; // 文档类型
|
||||
url: string;
|
||||
size: number; // 文件大小(字节)
|
||||
uploadedAt: string;
|
||||
uploadedBy: string;
|
||||
}
|
||||
|
||||
// 地块版本历史
|
||||
export interface FieldVersion {
|
||||
id: string;
|
||||
fieldId: string;
|
||||
version: number;
|
||||
changeType: 'create' | 'update-boundary' | 'update-attributes' | 'merge' | 'split';
|
||||
changes: FieldVersionChange[];
|
||||
coordinates?: GeoCoordinate[]; // 历史边界
|
||||
attributes?: Partial<Field>; // 历史属性
|
||||
changedBy: string;
|
||||
changedAt: string;
|
||||
remarks?: string;
|
||||
}
|
||||
|
||||
// 版本变更详情
|
||||
export interface FieldVersionChange {
|
||||
field: string; // 字段名
|
||||
oldValue: any;
|
||||
newValue: any;
|
||||
}
|
||||
|
||||
// 地块标签
|
||||
export interface FieldTag {
|
||||
id: string;
|
||||
name: string;
|
||||
color: string;
|
||||
category?: string; // 标签分类
|
||||
description?: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
// 地块分类
|
||||
export interface FieldCategory {
|
||||
id: string;
|
||||
name: string;
|
||||
parentId?: string;
|
||||
children?: FieldCategory[];
|
||||
icon?: string;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
// 地图图层类型
|
||||
export type MapLayerType =
|
||||
| 'satellite' // 卫星影像
|
||||
| 'street' // 电子地图
|
||||
| 'terrain' // 地形图
|
||||
| 'hybrid'; // 混合
|
||||
|
||||
// 绘制工具类型
|
||||
export type DrawToolType =
|
||||
| 'none' // 无
|
||||
| 'point' // 点
|
||||
| 'line' // 线
|
||||
| 'polygon' // 多边形
|
||||
| 'rectangle' // 矩形
|
||||
| 'circle'; // 圆形
|
||||
|
||||
// 编辑模式
|
||||
export type EditMode =
|
||||
| 'view' // 查看
|
||||
| 'draw' // 绘制
|
||||
| 'edit' // 编辑
|
||||
| 'split' // 分割
|
||||
| 'merge'; // 合并
|
||||
|
||||
// GIS文件格式
|
||||
export type GISFileFormat = 'kml' | 'shp' | 'geojson' | 'gpx';
|
||||
|
||||
// 空间查询类型
|
||||
export type SpatialQueryType =
|
||||
| 'point-in-polygon' // 点在面内
|
||||
| 'polygon-intersect' // 面相交
|
||||
| 'polygon-adjacent' // 面相邻
|
||||
| 'buffer'; // 缓冲区
|
||||
|
||||
// 遥感影像数据
|
||||
export interface SatelliteImage {
|
||||
id: string;
|
||||
fieldId: string;
|
||||
date: string; // 影像日期
|
||||
source: string; // 数据源(如Landsat, Sentinel等)
|
||||
cloudCover: number; // 云量百分比
|
||||
resolution: number; // 分辨率(米)
|
||||
url: string; // 影像URL
|
||||
thumbnail?: string; // 缩略图
|
||||
ndvi?: number; // 归一化植被指数
|
||||
evi?: number; // 增强型植被指数
|
||||
}
|
||||
|
||||
// 地块统计查询条件
|
||||
export interface FieldQueryCondition {
|
||||
soilType?: SoilType[];
|
||||
plantingMode?: PlantingMode[];
|
||||
minArea?: number;
|
||||
maxArea?: number;
|
||||
tags?: string[];
|
||||
owner?: string;
|
||||
status?: Field['status'][];
|
||||
}
|
||||
|
||||
// 地块统计结果
|
||||
export interface FieldStatistics {
|
||||
totalCount: number;
|
||||
totalArea: number;
|
||||
averageArea: number;
|
||||
bySoilType: Record<SoilType, number>;
|
||||
byPlantingMode: Record<PlantingMode, number>;
|
||||
byStatus: Record<Field['status'], number>;
|
||||
}
|
||||
89
src/types/machinery.ts
Normal file
89
src/types/machinery.ts
Normal file
@@ -0,0 +1,89 @@
|
||||
// 农机档案数据类型定义
|
||||
|
||||
export interface MachineryRecord {
|
||||
id: string;
|
||||
// 基本信息
|
||||
name: string;
|
||||
model: string;
|
||||
category: MachineryCategory;
|
||||
usage: MachineryUsage;
|
||||
manufacturer: string;
|
||||
manufactureDate: string;
|
||||
purchaseDate: string;
|
||||
|
||||
// 技术参数
|
||||
engineNumber: string;
|
||||
chassisNumber: string;
|
||||
power: string; // 功率
|
||||
weight: string; // 重量
|
||||
workingWidth: string; // 工作幅宽
|
||||
|
||||
// 购机信息
|
||||
purchasePrice: number;
|
||||
supplier: string;
|
||||
invoiceNumber: string;
|
||||
invoiceUrl?: string; // 发票文件URL
|
||||
|
||||
// 保险信息
|
||||
insuranceCompany?: string;
|
||||
insurancePolicyNumber?: string;
|
||||
insuranceStartDate?: string;
|
||||
insuranceEndDate?: string;
|
||||
insuranceAmount?: number;
|
||||
|
||||
// 使用信息
|
||||
status: MachineryStatus;
|
||||
currentLocation?: string;
|
||||
operator?: string;
|
||||
department?: string;
|
||||
|
||||
// 其他信息
|
||||
remarks?: string;
|
||||
tags: string[];
|
||||
qrCode: string; // 二维码内容
|
||||
|
||||
// 系统信息
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy: string;
|
||||
updatedBy: string;
|
||||
}
|
||||
|
||||
export type MachineryCategory =
|
||||
| '耕地机械'
|
||||
| '播种机械'
|
||||
| '收获机械'
|
||||
| '植保机械'
|
||||
| '灌溉机械'
|
||||
| '运输机械'
|
||||
| '其他';
|
||||
|
||||
export type MachineryUsage = '旱地' | '水田' | '通用' | '其他';
|
||||
|
||||
export type MachineryStatus = '运行中' | '空闲中' | '待维护' | '已报废';
|
||||
|
||||
export interface MachineryChangeHistory {
|
||||
id: string;
|
||||
machineryId: string;
|
||||
fieldName: string;
|
||||
fieldLabel: string;
|
||||
oldValue: any;
|
||||
newValue: any;
|
||||
operator: string;
|
||||
operatedAt: string;
|
||||
}
|
||||
|
||||
export interface MachineryTag {
|
||||
id: string;
|
||||
name: string;
|
||||
color: string;
|
||||
createdAt: string;
|
||||
}
|
||||
|
||||
export interface MachineryFilter {
|
||||
category?: MachineryCategory;
|
||||
usage?: MachineryUsage;
|
||||
status?: MachineryStatus;
|
||||
tags?: string[];
|
||||
searchKeyword?: string;
|
||||
}
|
||||
41
src/types/message.ts
Normal file
41
src/types/message.ts
Normal file
@@ -0,0 +1,41 @@
|
||||
// 消息中心类型定义
|
||||
|
||||
// 消息类型
|
||||
export type MessageType = 'sms' | 'email' | 'internal' | 'push';
|
||||
|
||||
// 消息状态
|
||||
export type MessageStatus = 'pending' | 'sent' | 'failed' | 'read';
|
||||
|
||||
// 消息模板
|
||||
export interface MessageTemplate {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
type: MessageType;
|
||||
subject?: string;
|
||||
content: string;
|
||||
variables: string[]; // 变量列表,如 ['username', 'code', 'time']
|
||||
isActive: boolean;
|
||||
description?: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy?: string;
|
||||
}
|
||||
|
||||
// 消息日志
|
||||
export interface MessageLog {
|
||||
id: string;
|
||||
templateId?: string;
|
||||
templateName?: string;
|
||||
type: MessageType;
|
||||
recipient: string; // 接收人(手机号/邮箱/用户ID)
|
||||
recipientName?: string;
|
||||
subject?: string;
|
||||
content: string;
|
||||
status: MessageStatus;
|
||||
sentTime: string;
|
||||
readTime?: string;
|
||||
failReason?: string;
|
||||
retryCount: number;
|
||||
variables?: Record<string, any>;
|
||||
}
|
||||
112
src/types/monitor.ts
Normal file
112
src/types/monitor.ts
Normal file
@@ -0,0 +1,112 @@
|
||||
// 系统监控类型定义
|
||||
|
||||
// 登录日志
|
||||
export interface LoginLog {
|
||||
id: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
loginTime: string;
|
||||
ipAddress: string;
|
||||
device: string;
|
||||
browser?: string;
|
||||
os?: string;
|
||||
location?: string;
|
||||
status: 'success' | 'failed';
|
||||
failReason?: string;
|
||||
sessionId?: string;
|
||||
}
|
||||
|
||||
// 操作日志
|
||||
export interface OperationLog {
|
||||
id: string;
|
||||
userId: string;
|
||||
username: string;
|
||||
operationTime: string;
|
||||
module: string;
|
||||
action: string;
|
||||
description: string;
|
||||
ipAddress: string;
|
||||
requestUrl?: string;
|
||||
requestMethod?: string;
|
||||
requestParams?: string;
|
||||
responseData?: string;
|
||||
duration?: number; // 毫秒
|
||||
status: 'success' | 'failed';
|
||||
errorMessage?: string;
|
||||
}
|
||||
|
||||
export type OperationModule =
|
||||
| 'user'
|
||||
| 'role'
|
||||
| 'permission'
|
||||
| 'machinery'
|
||||
| 'driver'
|
||||
| 'task'
|
||||
| 'system'
|
||||
| 'other';
|
||||
|
||||
export type OperationAction =
|
||||
| 'create'
|
||||
| 'update'
|
||||
| 'delete'
|
||||
| 'view'
|
||||
| 'export'
|
||||
| 'import'
|
||||
| 'login'
|
||||
| 'logout';
|
||||
|
||||
// 性能监控
|
||||
export interface SystemPerformance {
|
||||
timestamp: string;
|
||||
cpu: {
|
||||
usage: number; // 百分比
|
||||
cores: number;
|
||||
};
|
||||
memory: {
|
||||
total: number; // MB
|
||||
used: number; // MB
|
||||
free: number; // MB
|
||||
usage: number; // 百分比
|
||||
};
|
||||
disk: {
|
||||
total: number; // GB
|
||||
used: number; // GB
|
||||
free: number; // GB
|
||||
usage: number; // 百分比
|
||||
};
|
||||
jvm?: {
|
||||
heapUsed: number; // MB
|
||||
heapMax: number; // MB
|
||||
heapUsage: number; // 百分比
|
||||
nonHeapUsed: number; // MB
|
||||
threadCount: number;
|
||||
gcCount: number;
|
||||
gcTime: number; // 毫秒
|
||||
};
|
||||
tomcat?: {
|
||||
threadCount: number;
|
||||
maxThreads: number;
|
||||
connectionCount: number;
|
||||
requestCount: number;
|
||||
errorCount: number;
|
||||
};
|
||||
}
|
||||
|
||||
// 网络日志
|
||||
export interface NetworkLog {
|
||||
id: string;
|
||||
timestamp: string;
|
||||
method: string;
|
||||
url: string;
|
||||
requestHeaders?: Record<string, string>;
|
||||
requestParams?: string;
|
||||
requestBody?: string;
|
||||
responseStatus: number;
|
||||
responseTime: number; // 毫秒
|
||||
responseBody?: string;
|
||||
responseSize?: number; // bytes
|
||||
clientIp?: string;
|
||||
userAgent?: string;
|
||||
userId?: string;
|
||||
username?: string;
|
||||
}
|
||||
489
src/types/navigation.ts
Normal file
489
src/types/navigation.ts
Normal file
@@ -0,0 +1,489 @@
|
||||
// 导航系统类型定义
|
||||
|
||||
export interface MenuItem {
|
||||
id: string;
|
||||
label: string;
|
||||
icon?: string;
|
||||
path?: string;
|
||||
children?: MenuItem[];
|
||||
}
|
||||
|
||||
export interface SubSystem {
|
||||
id: string;
|
||||
label: string;
|
||||
icon: string;
|
||||
menus: MenuItem[];
|
||||
}
|
||||
|
||||
// 智能农机管理系统菜单
|
||||
export const machineryMenus: MenuItem[] = [
|
||||
{
|
||||
id: 'machinery-archive',
|
||||
label: '农机档案',
|
||||
children: [
|
||||
{ id: 'machinery-entry', label: '农机档案录入与维护', path: '/machinery/archive/entry' },
|
||||
{ id: 'machinery-classification', label: '农机分类与标签管理', path: '/machinery/archive/classification' },
|
||||
{ id: 'machinery-qrcode', label: '农机二维码管理', path: '/machinery/archive/qrcode' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'driver-archive',
|
||||
label: '驾驶员档案',
|
||||
children: [
|
||||
{ id: 'driver-info', label: '驾驶员信息管理', path: '/machinery/driver/info' },
|
||||
{ id: 'driver-task', label: '驾驶员任务管理', path: '/machinery/driver/task' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'load-management',
|
||||
label: '农机负载管理',
|
||||
children: [
|
||||
{ id: 'load-device', label: '负载管理', path: '/machinery/load/device' },
|
||||
{ id: 'load-type', label: '负载类型', path: '/machinery/load/type' },
|
||||
{ id: 'load-parameter', label: '负载参数', path: '/machinery/load/parameter' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'monitoring',
|
||||
label: '设备实时监控与定位',
|
||||
children: [
|
||||
{ id: 'realtime-location', label: '实时位置追踪', path: '/machinery/monitoring/location' },
|
||||
{ id: 'work-status', label: '工作状态监控', path: '/machinery/monitoring/status' },
|
||||
{ id: 'operation-data', label: '作业数据监控', path: '/machinery/monitoring/operation' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'fault-diagnosis',
|
||||
label: '远程诊断与故障预警',
|
||||
children: [
|
||||
{ id: 'fault-warning', label: '故障诊断与预警', path: '/machinery/fault/warning' },
|
||||
{ id: 'health-assessment', label: '健康评估', path: '/machinery/fault/health' },
|
||||
{ id: 'parameter-monitor', label: '运行参数监测', path: '/machinery/fault/parameter' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'precision-operation',
|
||||
label: '精准作业管理与支持',
|
||||
children: [
|
||||
{ id: 'operation-record', label: '作业数据记录', path: '/machinery/operation/record' },
|
||||
{ id: 'route-planning', label: '作业路线规划', path: '/machinery/operation/route' },
|
||||
{ id: 'plan-dispatch', label: '作业方案下发', path: '/machinery/operation/dispatch' },
|
||||
{ id: 'cockpit', label: '农机驾驶舱', path: '/machinery/operation/cockpit' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'data-analysis',
|
||||
label: '数据管理与分析报告',
|
||||
children: [
|
||||
{ id: 'operation-analysis', label: '作业数据分析', path: '/machinery/data/analysis' },
|
||||
{ id: 'history-comparison', label: '历史数据查询与对比', path: '/machinery/data/comparison' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'scheduling',
|
||||
label: '农机管理与调度',
|
||||
children: [
|
||||
{ id: 'task-assignment', label: '任务分配', path: '/machinery/scheduling/assignment' },
|
||||
{ id: 'realtime-dispatch', label: '实时调度监控', path: '/machinery/scheduling/dispatch' },
|
||||
{ id: 'track-playback', label: '农机作业轨迹回放', path: '/machinery/scheduling/playback' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'security',
|
||||
label: '安全与安防',
|
||||
children: [
|
||||
{ id: 'geo-fence', label: '电子围栏', path: '/machinery/security/fence' },
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
// 其他子系统的菜单可以类似定义
|
||||
export const fieldMenus: MenuItem[] = [
|
||||
{
|
||||
id: 'field-archive',
|
||||
label: '地块档案管理',
|
||||
children: [
|
||||
{ id: 'field-entry-maintenance', label: '地块信息录入与维护', path: '/field/archive/entry' },
|
||||
{ id: 'field-classification-tags', label: '地块分类与标签管理', path: '/field/archive/classification' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'field-map',
|
||||
label: '地块数字化与地图管理',
|
||||
children: [
|
||||
{ id: 'field-gis-map', label: 'GIS地图管理', path: '/field/map/gis' },
|
||||
{ id: 'field-draw-edit', label: '数字化绘制与编辑', path: '/field/map/draw' },
|
||||
{ id: 'field-spatial-query', label: '空间数据管理', path: '/field/map/spatial-query' },
|
||||
{ id: 'field-satellite', label: '地块影像', path: '/field/map/satellite' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'field-analysis',
|
||||
label: '空间分析与决策支持',
|
||||
children: [
|
||||
{ id: 'soil-data', label: '土壤基础数据', path: '/field/analysis/soil-data' },
|
||||
{ id: 'layer-sampling', label: '分层采样分析', path: '/field/analysis/layer-sampling' },
|
||||
{ id: 'soil-quality', label: '土壤质量评价', path: '/field/analysis/soil-quality' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'field-monitoring',
|
||||
label: '地块环境监测',
|
||||
children: [
|
||||
{ id: 'weather-monitoring', label: '气象监测', path: '/field/monitoring/weather' },
|
||||
{ id: 'environment-monitoring', label: '环境监测', path: '/field/monitoring/environment' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'field-suitability',
|
||||
label: '地块适宜性评价',
|
||||
children: [
|
||||
{ id: 'comprehensive-evaluation', label: '多因子综合评价', path: '/field/suitability/comprehensive' },
|
||||
{ id: 'batch-analysis', label: '自动化空间分析', path: '/field/suitability/batch' },
|
||||
{ id: 'crop-recommendation', label: '作物适配推荐', path: '/field/suitability/crop' },
|
||||
{ id: 'weight-config', label: '权重配置', path: '/field/suitability/weight' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'field-comparison',
|
||||
label: '地块对比分析',
|
||||
children: [
|
||||
{ id: 'multi-indicator', label: '多维度指标看板', path: '/field/comparison/indicator' },
|
||||
{ id: 'chart-analysis', label: '可视化图表分析', path: '/field/comparison/chart' },
|
||||
{ id: 'report-generation', label: '对比报告生成', path: '/field/comparison/report' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'field-risk',
|
||||
label: '地块风险预警',
|
||||
children: [
|
||||
{ id: 'risk-monitoring', label: '实时风险监测', path: '/field/risk/monitoring' },
|
||||
{ id: 'warning-push', label: '预警推送管理', path: '/field/risk/push' },
|
||||
{ id: 'disposal-tracking', label: '预警处置跟踪', path: '/field/risk/disposal' },
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
export const operationMenus: MenuItem[] = [
|
||||
{
|
||||
id: 'operation-planning',
|
||||
label: '农事计划',
|
||||
children: [
|
||||
{ id: 'plan-creation', label: '计划制定', path: '/operation/planning/creation' },
|
||||
{ id: 'resource-allocation', label: '资源分配规划', path: '/operation/planning/allocation' },
|
||||
{ id: 'progress-tracking', label: '计划进度跟踪', path: '/operation/planning/progress' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operation-task',
|
||||
label: '农事任务',
|
||||
children: [
|
||||
{ id: 'task-management', label: '任务管理', path: '/operation/task/management' },
|
||||
{ id: 'task-assignment', label: '任务分配与派发', path: '/operation/task/assignment' },
|
||||
{ id: 'task-monitoring', label: '任务状态监控', path: '/operation/task/monitoring' },
|
||||
{ id: 'task-statistics', label: '历史与统计', path: '/operation/task/statistics' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operation-execution',
|
||||
label: '农事执行',
|
||||
children: [
|
||||
{ id: 'operation-type', label: '农事类型', path: '/operation/execution/type' },
|
||||
{ id: 'operation-record', label: '操作录入', path: '/operation/execution/record' },
|
||||
{ id: 'operation-log', label: '日志多维查询', path: '/operation/execution/log' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operation-calendar',
|
||||
label: '农事日历',
|
||||
children: [
|
||||
{ id: 'calendar-view', label: '可视化视图', path: '/operation/calendar/view' },
|
||||
{ id: 'calendar-gantt', label: '甘特图', path: '/operation/calendar/gantt' },
|
||||
{ id: 'calendar-progress', label: '进度状态可视化', path: '/operation/calendar/progress' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operation-archive',
|
||||
label: '农事档案',
|
||||
children: [
|
||||
{ id: 'archive-aggregation', label: '档案归集与生成', path: '/operation/archive/aggregation' },
|
||||
{ id: 'archive-view', label: '全维度数据视图', path: '/operation/archive/view' },
|
||||
{ id: 'archive-trace', label: '追踪与溯源', path: '/operation/archive/trace' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operation-knowledge',
|
||||
label: '农事知识库',
|
||||
children: [
|
||||
{ id: 'knowledge-management', label: '多模态知识内容管理', path: '/operation/knowledge/management' },
|
||||
{ id: 'knowledge-category', label: '分类与标签', path: '/operation/knowledge/category' },
|
||||
{ id: 'knowledge-search', label: '智能检索', path: '/operation/knowledge/search' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operation-performance',
|
||||
label: '绩效管理',
|
||||
children: [
|
||||
{ id: 'performance-staff', label: '人员管理', path: '/operation/performance/staff' },
|
||||
{ id: 'performance-hours', label: '工时记录', path: '/operation/performance/hours' },
|
||||
{ id: 'performance-statistics', label: '绩效统计', path: '/operation/performance/statistics' },
|
||||
{ id: 'performance-schedule', label: '排班管理', path: '/operation/performance/schedule' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'operation-issue',
|
||||
label: '农事问题协同',
|
||||
children: [
|
||||
{ id: 'issue-report', label: '问题一键上报', path: '/operation/issue/report' },
|
||||
{ id: 'issue-assign', label: '问题处理与分派', path: '/operation/issue/assign' },
|
||||
{ id: 'issue-collaborate', label: '在线协同', path: '/operation/issue/collaborate' },
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
export const assetMenus: MenuItem[] = [
|
||||
{
|
||||
id: 'asset-basic',
|
||||
label: '基础信息管理',
|
||||
children: [
|
||||
{ id: 'asset-materials', label: '农资档案管理', path: '/asset/basic/materials' },
|
||||
{ id: 'asset-tools', label: '农具档案管理', path: '/asset/basic/tools' },
|
||||
{ id: 'asset-suppliers', label: '供应商管理', path: '/asset/basic/suppliers' },
|
||||
{ id: 'asset-customers', label: '客户管理', path: '/asset/basic/customers' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'asset-purchase',
|
||||
label: '采购管理',
|
||||
children: [
|
||||
{ id: 'purchase-plan', label: '采购计划', path: '/asset/purchase/plan' },
|
||||
{ id: 'purchase-order', label: '采购订单', path: '/asset/purchase/order' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'asset-inventory',
|
||||
label: '库存管理',
|
||||
children: [
|
||||
{ id: 'inventory-in', label: '入库管理', path: '/asset/inventory/in' },
|
||||
{ id: 'inventory-out', label: '出库管理', path: '/asset/inventory/out' },
|
||||
{ id: 'inventory-check', label: '盘点管理', path: '/asset/inventory/check' },
|
||||
{ id: 'inventory-warning', label: '库存预警', path: '/asset/inventory/warning' },
|
||||
{ id: 'inventory-detail', label: '库存明细', path: '/asset/inventory/detail' },
|
||||
{ id: 'inventory-location', label: '库位管理', path: '/asset/inventory/location' },
|
||||
{ id: 'inventory-suggest', label: '采购建议', path: '/asset/inventory/suggest' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'asset-requisition',
|
||||
label: '物资领用',
|
||||
children: [
|
||||
{ id: 'requisition-apply', label: '领用申请', path: '/asset/requisition/apply' },
|
||||
{ id: 'requisition-approval', label: '领用审批', path: '/asset/requisition/approval' },
|
||||
{ id: 'requisition-checkout', label: '出库与核销', path: '/asset/requisition/checkout' },
|
||||
{ id: 'requisition-record', label: '领用记录与溯源', path: '/asset/requisition/record' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'asset-return',
|
||||
label: '物资归还',
|
||||
children: [
|
||||
{ id: 'return-register', label: '归还登记', path: '/asset/return/register' },
|
||||
{ id: 'return-process', label: '归还处理', path: '/asset/return/process' },
|
||||
{ id: 'return-settlement', label: '领用记录关联核销', path: '/asset/return/settlement' },
|
||||
{ id: 'return-history', label: '归还历史与资产台账', path: '/asset/return/history' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'asset-equipment',
|
||||
label: '农资农具管理',
|
||||
children: [
|
||||
{ id: 'equipment-archive', label: '物资档案', path: '/asset/equipment/archive' },
|
||||
{ id: 'equipment-dispatch', label: '使用调度与状态', path: '/asset/equipment/dispatch' },
|
||||
{ id: 'equipment-maintenance', label: '维修保养', path: '/asset/equipment/maintenance' },
|
||||
{ id: 'equipment-depreciation', label: '折旧计算', path: '/asset/equipment/depreciation' },
|
||||
{ id: 'equipment-disposal', label: '报废处理', path: '/asset/equipment/disposal' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'asset-report',
|
||||
label: '可视化报表',
|
||||
children: [
|
||||
{ id: 'report-overview', label: '全局概览核心指标', path: '/asset/report/overview' },
|
||||
{ id: 'report-inventory', label: '库存动态可视化', path: '/asset/report/inventory' },
|
||||
{ id: 'report-consumption', label: '领用消耗分析', path: '/asset/report/consumption' },
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
export const aiMenus: MenuItem[] = [
|
||||
{
|
||||
id: 'ai-data-center',
|
||||
label: '全域数据感知中心',
|
||||
children: [
|
||||
{ id: 'data-external', label: '多源数据接入', path: '/ai/data-center/external' },
|
||||
{ id: 'data-iot', label: '物联设备数据接入', path: '/ai/data-center/iot' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'ai-model-integration',
|
||||
label: '模型接入集成',
|
||||
children: [
|
||||
{ id: 'model-service-access', label: '模型服务接入', path: '/ai/model-integration/access' },
|
||||
{ id: 'model-service-management', label: '模型服务管理', path: '/ai/model-integration/management' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'ai-model-application',
|
||||
label: '模型应用中心',
|
||||
children: [
|
||||
{ id: 'app-generation', label: '应用生成', path: '/ai/model-application/generation' },
|
||||
{ id: 'app-scheduling', label: '调度管理', path: '/ai/model-application/scheduling' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'ai-decision-generation',
|
||||
label: '智能决策生成',
|
||||
children: [
|
||||
{ id: 'decision-fusion', label: '业务融合', path: '/ai/decision/fusion' },
|
||||
{ id: 'decision-simulation', label: '决策模拟', path: '/ai/decision/simulation' },
|
||||
{ id: 'decision-log', label: '决策日志', path: '/ai/decision/log' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'ai-decision-support',
|
||||
label: '智能决策支持',
|
||||
children: [
|
||||
{ id: 'decision-dashboard', label: '决策看板', path: '/ai/support/dashboard' },
|
||||
{ id: 'decision-detail', label: '决策详情', path: '/ai/support/detail' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'ai-decision-application',
|
||||
label: '决策应用',
|
||||
children: [
|
||||
{ id: 'device-control', label: '设备控制集成', path: '/ai/application/device-control' },
|
||||
{ id: 'external-system', label: '外部系统联动', path: '/ai/application/external-system' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'ai-knowledge-base',
|
||||
label: 'AI知识库',
|
||||
children: [
|
||||
{ id: 'knowledge-generation', label: 'AI知识自动生成与应用', path: '/ai/knowledge/generation' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'ai-monitoring-center',
|
||||
label: '监控中心',
|
||||
children: [
|
||||
{ id: 'model-monitoring', label: '模型监控', path: '/ai/monitoring/model' },
|
||||
{ id: 'audit-log', label: '全链路审计日志', path: '/ai/monitoring/audit' },
|
||||
{ id: 'alert-management', label: '告警管理', path: '/ai/monitoring/alert' },
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
export const irrigationMenus: MenuItem[] = [
|
||||
{
|
||||
id: 'water-fertilizer-management',
|
||||
label: '水肥机管理',
|
||||
children: [
|
||||
{ id: 'wf-device', label: '水肥机设备', path: '/irrigation/wf-management/device' },
|
||||
{ id: 'wf-component', label: '水肥机部件配置', path: '/irrigation/wf-management/component' },
|
||||
{ id: 'wf-parameter', label: '水肥机参数配置', path: '/irrigation/wf-management/parameter' },
|
||||
{ id: 'wf-mapping', label: '水肥设备映射', path: '/irrigation/wf-management/mapping' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'smart-irrigation',
|
||||
label: '智能灌溉',
|
||||
children: [
|
||||
{ id: 'auto-irrigation', label: '智能灌溉', path: '/irrigation/smart/auto' },
|
||||
{ id: 'manual-irrigation', label: '人工灌溉', path: '/irrigation/smart/manual' },
|
||||
{ id: 'realtime-monitor', label: '水肥机实时监测数据', path: '/irrigation/smart/realtime' },
|
||||
{ id: 'history-monitor', label: '水肥机历史监测数据', path: '/irrigation/smart/history' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'fertilizer-formula',
|
||||
label: '施肥配方管理',
|
||||
children: [
|
||||
{ id: 'water-control', label: '加水控制', path: '/irrigation/fertilizer/water-control' },
|
||||
{ id: 'level-setting', label: '液位设定', path: '/irrigation/fertilizer/level-setting' },
|
||||
{ id: 'stirring-control', label: '搅拌控制', path: '/irrigation/fertilizer/stirring-control' },
|
||||
{ id: 'history-data', label: '历史监测数据', path: '/irrigation/fertilizer/history-data' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'water-fertilizer-control',
|
||||
label: '水肥控制',
|
||||
children: [
|
||||
{ id: 'fertilizer-params', label: '施肥参数设置', path: '/irrigation/wf-control/params' },
|
||||
{ id: 'tank-realtime', label: '肥料桶实时监测数据', path: '/irrigation/wf-control/tank-realtime' },
|
||||
{ id: 'valve-control', label: '阀门控制', path: '/irrigation/wf-control/valve-control' },
|
||||
{ id: 'valve-realtime', label: '电动阀实时监测数据', path: '/irrigation/wf-control/valve-realtime' },
|
||||
{ id: 'fertilizer-history', label: '施肥与配比历史数据', path: '/irrigation/wf-control/fertilizer-history' },
|
||||
{ id: 'valve-history', label: '电动阀历史监测数据', path: '/irrigation/wf-control/valve-history' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'monitoring-alert',
|
||||
label: '实时监测与预警',
|
||||
children: [
|
||||
{ id: 'alert-logic', label: '预警逻辑管理', path: '/irrigation/monitoring/alert-logic' },
|
||||
{ id: 'threshold-alert', label: '阈值预警与告警', path: '/irrigation/monitoring/threshold-alert' },
|
||||
{ id: 'notification-push', label: '多通道告警推送', path: '/irrigation/monitoring/notification-push' },
|
||||
]
|
||||
},
|
||||
];
|
||||
|
||||
export const configMenus: MenuItem[] = [
|
||||
{
|
||||
id: 'tenant-management',
|
||||
label: '租户管理',
|
||||
children: [
|
||||
{ id: 'enterprise-audit', label: '企业审核', path: '/config/tenant/enterprise-audit' },
|
||||
{ id: 'audit-history', label: '审核历史', path: '/config/tenant/audit-history' },
|
||||
{ id: 'enterprise-info', label: '企业信息', path: '/config/tenant/enterprise-info' },
|
||||
{ id: 'platform-user-management', label: '用户管理', path: '/config/tenant/user-management' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'user-management',
|
||||
label: '用户管理',
|
||||
children: [
|
||||
{ id: 'employee-management', label: '员工管理', path: '/config/user/employee' },
|
||||
{ id: 'role-management', label: '角色管理', path: '/config/user/role' },
|
||||
{ id: 'menu-management', label: '菜单管理', path: '/config/user/menu' },
|
||||
{ id: 'permission-config', label: '权限配置管理', path: '/config/user/permission' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'system-params',
|
||||
label: '系统参数',
|
||||
children: [
|
||||
{ id: 'system-settings', label: '系统设置', path: '/config/system/settings' },
|
||||
{ id: 'category-dictionary', label: '分类字典', path: '/config/system/category' },
|
||||
{ id: 'data-dictionary', label: '数据字典', path: '/config/system/dictionary' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'system-monitor',
|
||||
label: '系统监控',
|
||||
children: [
|
||||
{ id: 'login-log', label: '登录日志', path: '/config/monitor/login-log' },
|
||||
{ id: 'operation-log', label: '操作日志', path: '/config/monitor/operation-log' },
|
||||
{ id: 'performance-monitor', label: '性能监控', path: '/config/monitor/performance' },
|
||||
{ id: 'network-log', label: '网络日志', path: '/config/monitor/network-log' },
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'message-center',
|
||||
label: '消息中心',
|
||||
children: [
|
||||
{ id: 'message-send', label: '消息发送', path: '/config/message/send' },
|
||||
{ id: 'message-template', label: '消息模版', path: '/config/message/template' },
|
||||
{ id: 'message-log', label: '消息日志', path: '/config/message/log' },
|
||||
]
|
||||
},
|
||||
];
|
||||
62
src/types/profile.ts
Normal file
62
src/types/profile.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
// 个人中心类型定义
|
||||
|
||||
// 用户个人信息
|
||||
export interface UserProfile {
|
||||
id: string;
|
||||
username: string;
|
||||
name: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
avatar?: string;
|
||||
gender?: 'male' | 'female';
|
||||
birthday?: string;
|
||||
department?: string;
|
||||
position?: string;
|
||||
enterpriseId?: string;
|
||||
enterpriseName?: string;
|
||||
roleIds: string[];
|
||||
roleNames: string[];
|
||||
bio?: string;
|
||||
address?: string;
|
||||
createdAt: string;
|
||||
lastLoginTime?: string;
|
||||
lastLoginIp?: string;
|
||||
}
|
||||
|
||||
// 密码修改
|
||||
export interface PasswordChange {
|
||||
oldPassword: string;
|
||||
newPassword: string;
|
||||
confirmPassword: string;
|
||||
}
|
||||
|
||||
// 注册信息
|
||||
export interface RegisterForm {
|
||||
username: string;
|
||||
password: string;
|
||||
confirmPassword: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
email?: string;
|
||||
verificationCode: string;
|
||||
agreementAccepted: boolean;
|
||||
}
|
||||
|
||||
// 登录信息
|
||||
export interface LoginForm {
|
||||
username?: string;
|
||||
phone?: string;
|
||||
password?: string;
|
||||
verificationCode?: string;
|
||||
captcha: string;
|
||||
rememberMe: boolean;
|
||||
loginType: 'password' | 'sms';
|
||||
}
|
||||
|
||||
// 登录响应
|
||||
export interface LoginResponse {
|
||||
token: string;
|
||||
refreshToken: string;
|
||||
user: UserProfile;
|
||||
expiresIn: number; // 秒
|
||||
}
|
||||
77
src/types/system-params.ts
Normal file
77
src/types/system-params.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
// 系统参数类型定义
|
||||
|
||||
// 系统设置
|
||||
export interface SystemSettings {
|
||||
platformName: string;
|
||||
platformLogo?: string;
|
||||
systemAnnouncement?: string;
|
||||
contactEmail?: string;
|
||||
contactPhone?: string;
|
||||
address?: string;
|
||||
companyName?: string;
|
||||
icp?: string;
|
||||
copyright?: string;
|
||||
enableRegistration: boolean;
|
||||
enableGuestAccess: boolean;
|
||||
sessionTimeout: number; // 分钟
|
||||
maxLoginAttempts: number;
|
||||
passwordPolicy: {
|
||||
minLength: number;
|
||||
requireUppercase: boolean;
|
||||
requireLowercase: boolean;
|
||||
requireNumbers: boolean;
|
||||
requireSpecialChars: boolean;
|
||||
};
|
||||
dateFormat: string;
|
||||
timezone: string;
|
||||
language: string;
|
||||
}
|
||||
|
||||
// 分类字典(树形结构)
|
||||
export interface CategoryDictionary {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
type: string; // 分类类型:industry, equipment, crop等
|
||||
parentId?: string;
|
||||
level: number;
|
||||
sortOrder: number;
|
||||
description?: string;
|
||||
isActive: boolean;
|
||||
children?: CategoryDictionary[];
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type CategoryType = 'industry' | 'equipment' | 'crop' | 'operation' | 'other';
|
||||
|
||||
// 数据字典(键值对)
|
||||
export interface DataDictionary {
|
||||
id: string;
|
||||
code: string;
|
||||
name: string;
|
||||
category: string; // 字典分类
|
||||
value: string;
|
||||
label: string;
|
||||
sortOrder: number;
|
||||
description?: string;
|
||||
isSystem: boolean; // 是否系统内置
|
||||
isActive: boolean;
|
||||
extendData?: Record<string, any>;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type DictionaryCategory =
|
||||
| 'gender'
|
||||
| 'status'
|
||||
| 'unit'
|
||||
| 'weather'
|
||||
| 'soil_type'
|
||||
| 'irrigation_method'
|
||||
| 'fertilizer_type'
|
||||
| 'pesticide_type'
|
||||
| 'task_status'
|
||||
| 'task_priority'
|
||||
| 'approval_status'
|
||||
| 'other';
|
||||
77
src/types/task.ts
Normal file
77
src/types/task.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
// 任务分配相关数据类型定义
|
||||
|
||||
export interface Task {
|
||||
id: string;
|
||||
name: string;
|
||||
description?: string;
|
||||
|
||||
// 任务类型和优先级
|
||||
taskType: TaskType;
|
||||
priority: TaskPriority;
|
||||
|
||||
// 地块信息
|
||||
fieldId?: string;
|
||||
fieldName?: string;
|
||||
fieldArea?: number; // 亩
|
||||
|
||||
// 分配信息
|
||||
machineryId: string | null;
|
||||
machineryName?: string;
|
||||
driverId: string | null;
|
||||
driverName?: string;
|
||||
|
||||
// 时间信息
|
||||
startTime: string;
|
||||
endTime: string;
|
||||
estimatedDuration?: number; // 小时
|
||||
|
||||
// 作业要求
|
||||
requirements?: {
|
||||
workingDepth?: number; // 作业深度(cm)
|
||||
workingSpeed?: number; // 作业速度(km/h)
|
||||
seedingRate?: number; // 播种量(kg/亩)
|
||||
fertilizingRate?: number; // 施肥量(kg/亩)
|
||||
quality?: string; // 质量要求
|
||||
};
|
||||
|
||||
// 状态
|
||||
status: TaskStatus;
|
||||
|
||||
// 备注
|
||||
remarks?: string;
|
||||
|
||||
// 创建和更新信息
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
createdBy: string;
|
||||
updatedBy?: string;
|
||||
}
|
||||
|
||||
export type TaskType =
|
||||
| '耕地'
|
||||
| '播种'
|
||||
| '施肥'
|
||||
| '灌溉'
|
||||
| '喷药'
|
||||
| '收获'
|
||||
| '运输'
|
||||
| '其他';
|
||||
|
||||
export type TaskPriority = 'low' | 'medium' | 'high' | 'urgent';
|
||||
|
||||
export type TaskStatus =
|
||||
| '待分配'
|
||||
| '已分配'
|
||||
| '进行中'
|
||||
| '已完成'
|
||||
| '已取消';
|
||||
|
||||
// 地块信息
|
||||
export interface Field {
|
||||
id: string;
|
||||
name: string;
|
||||
area: number; // 亩
|
||||
location?: string;
|
||||
cropType?: string;
|
||||
status: 'idle' | 'working' | 'harvested';
|
||||
}
|
||||
163
src/types/user-management.ts
Normal file
163
src/types/user-management.ts
Normal file
@@ -0,0 +1,163 @@
|
||||
// 统一用户管理系统类型定义
|
||||
|
||||
// 企业信息
|
||||
export interface Enterprise {
|
||||
id: string;
|
||||
// 企业基本信息
|
||||
name: string;
|
||||
type: string; // 企业类型
|
||||
province: string;
|
||||
city: string;
|
||||
district?: string;
|
||||
|
||||
// 其他信息
|
||||
companySize?: string; // 公司规模
|
||||
registeredCapital?: string; // 注册资本
|
||||
establishmentDate?: string; // 成立时间
|
||||
invoiceType?: string; // 发票类型
|
||||
socialCreditCode: string; // 社会信用代码
|
||||
businessScope?: string; // 经营范围
|
||||
businessLicense?: string; // 营业执照(图片URL)
|
||||
|
||||
// 开户信息
|
||||
bankAccount?: string; // 银行账号
|
||||
bankName?: string; // 开户行
|
||||
bankFullName?: string; // 开户行全称
|
||||
bankAddress?: string; // 开户行地址
|
||||
bankLicense?: string; // 开户许可证(图片URL)
|
||||
|
||||
// 法人信息
|
||||
legalPerson?: string; // 法人名称
|
||||
idCardFront?: string; // 身份证正面(图片URL)
|
||||
idCardBack?: string; // 身份证反面(图片URL)
|
||||
|
||||
// 联系信息
|
||||
registrant: string;
|
||||
contactPhone: string;
|
||||
address: string;
|
||||
|
||||
// 系统信息
|
||||
status: EnterpriseStatus;
|
||||
auditStatus: AuditStatus;
|
||||
auditReason?: string;
|
||||
auditTime?: string;
|
||||
auditor?: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type EnterpriseStatus = 'active' | 'inactive' | 'suspended';
|
||||
export type AuditStatus = 'pending' | 'approved' | 'rejected';
|
||||
|
||||
// 审核记录
|
||||
export interface AuditRecord {
|
||||
id: string;
|
||||
enterpriseId: string;
|
||||
enterpriseName: string;
|
||||
auditType: 'register' | 'update';
|
||||
submitTime: string;
|
||||
auditTime?: string;
|
||||
auditor?: string;
|
||||
result: AuditStatus;
|
||||
reason?: string;
|
||||
remarks?: string;
|
||||
}
|
||||
|
||||
// 员工信息
|
||||
export interface Employee {
|
||||
id: string;
|
||||
enterpriseId: string;
|
||||
enterpriseName: string;
|
||||
username: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
email?: string;
|
||||
department?: string;
|
||||
position?: string;
|
||||
roleIds: string[];
|
||||
roles?: string[];
|
||||
status: UserStatus;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastLoginTime?: string;
|
||||
}
|
||||
|
||||
// 用户信息
|
||||
export interface User {
|
||||
id: string;
|
||||
username: string;
|
||||
name: string;
|
||||
phone: string;
|
||||
email?: string;
|
||||
enterpriseId?: string;
|
||||
enterpriseName?: string;
|
||||
roleIds: string[];
|
||||
roles?: string[];
|
||||
userType: UserType;
|
||||
status: UserStatus;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
lastLoginTime?: string;
|
||||
}
|
||||
|
||||
export type UserType = 'super_admin' | 'enterprise_admin' | 'employee';
|
||||
export type UserStatus = 'active' | 'inactive' | 'frozen';
|
||||
|
||||
// 角色信息
|
||||
export interface Role {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string;
|
||||
description?: string;
|
||||
type: RoleType;
|
||||
menuIds: string[];
|
||||
permissionIds: string[];
|
||||
defaultHomePage?: string;
|
||||
status: 'active' | 'inactive';
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type RoleType = 'system' | 'custom';
|
||||
|
||||
// 菜单信息
|
||||
export interface Menu {
|
||||
id: string;
|
||||
parentId?: string;
|
||||
name: string;
|
||||
code: string;
|
||||
path?: string;
|
||||
icon?: string;
|
||||
component?: string;
|
||||
sort: number;
|
||||
type: MenuType;
|
||||
visible: boolean;
|
||||
status: 'active' | 'inactive';
|
||||
children?: Menu[];
|
||||
}
|
||||
|
||||
export type MenuType = 'directory' | 'menu' | 'button';
|
||||
|
||||
// 权限信息
|
||||
export interface Permission {
|
||||
id: string;
|
||||
name: string;
|
||||
code: string;
|
||||
type: PermissionType;
|
||||
description?: string;
|
||||
menuId?: string; // 关联菜单ID
|
||||
menuPath?: string; // 菜单完整路径,如:智能农机管理系统 > 农机档案 > 农机录入
|
||||
status: 'active' | 'inactive';
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export type PermissionType =
|
||||
| 'view'
|
||||
| 'add'
|
||||
| 'edit'
|
||||
| 'delete'
|
||||
| 'export'
|
||||
| 'import'
|
||||
| 'approve'
|
||||
| 'control';
|
||||
Reference in New Issue
Block a user