水肥一体化控制系统 - 水肥机管理 两个子模块已成功升级为只读模式!
localStorage 读取 smart_agriculture_ai_device_typesparameterDefinitions 读取const loadDeviceTypes = () => {
const data = localStorage.getItem('smart_agriculture_ai_device_types');
if (data) {
const types: DeviceType[] = JSON.parse(data);
setDeviceTypes(types);
// 将设备类型转换为部件数据
const mockComponents: WFComponent[] = [];
types.forEach((type, index) => {
// 为每个设备类型创建2个部件示例
for (let i = 1; i <= 2; i++) {
mockComponents.push({
id: `comp-${type.id}-${i}`,
componentNo: `COMP-2024-${String(mockComponents.length + 1).padStart(3, '0')}`,
componentName: `${i}号${type.name}`,
type: type.name,
manufacturer: type.manufacturer || '未知厂商',
model: type.model || 'Standard',
// ... 其他字段
});
}
});
setComponents(mockComponents);
}
};
const loadDeviceParameters = () => {
const data = localStorage.getItem('smart_agriculture_ai_device_types');
if (data) {
const types: DeviceType[] = JSON.parse(data);
setDeviceTypes(types);
// 将所有设备类型的参数定义转换为水肥机参数
const allParameters: WFParameter[] = [];
types.forEach((type) => {
if (type.parameterDefinitions && type.parameterDefinitions.length > 0) {
type.parameterDefinitions.forEach((param) => {
allParameters.push({
id: `${type.id}-${param.key}`,
parameterKey: param.key,
parameterName: param.label,
deviceType: type.name,
deviceTypeId: type.id,
type: param.type,
unit: param.unit || '-',
minValue: param.min,
maxValue: param.max,
defaultValue: param.defaultValue,
required: param.required || false,
description: param.description || '从AI数据中心自动同步',
options: param.options,
});
});
}
});
setParameters(allParameters);
}
};
只读模式:本页面数据来自AI系统的设备类型/参数管理,
仅供查询查看。
如需添加或修改,请前往:
AI作物模型精准决策系统 → 全域数据感知中心 →
设备类型/参数管理
┌─────────────────────────────────────────────────┐
│ 水肥机部件配置 │
│ [搜索] [筛选] [新增部件] │
│ ┌──────────────────────────────────────────┐ │
│ │ 部件列表 │ │
│ │ [查看] [编辑] [删除] │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ 水肥机部件配置 [刷新数据] │
│ 数据来源:AI系统 - 设备类型管理(只读模式) │
│ ┌─────────────────────────────────────────┐ │
│ │ 🔵 只读模式提示 │ │
│ │ 数据来自AI系统,如需修改请前往AI系统 │ │
│ └─────────────────────────────────────────┘ │
│ [统计卡片:总数 在线 异常 离线] │
│ [搜索] [状态筛选] [类型筛选] │
│ ┌──────────────────────────────────────────┐ │
│ │ 部件列表 │ │
│ │ [查看] │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ 水肥机参数配置 │
│ [搜索] [筛选] [新增参数] │
│ ┌──────────────────────────────────────────┐ │
│ │ 参数列表 │ │
│ │ [查看] [编辑] [删除] │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────┐
│ 水肥机参数配置 [刷新数据] │
│ 数据来源:AI系统 - 设备参数管理(只读模式) │
│ ┌─────────────────────────────────────────┐ │
│ │ 🔵 只读模式提示 │ │
│ │ 数据来自AI系统,如需修改请前往AI系统 │ │
│ └─────────────────────────────────────────┘ │
│ [统计卡片:总数 必填 数值 设备类型] │
│ [搜索] [设备类型筛选] [参数类型筛选] │
│ ┌──────────────────────────────────────────┐ │
│ │ 参数列表 │ │
│ │ [查看] │ │
│ └──────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
localStorage 的 smart_agriculture_ai_device_types
smart_agriculture_ai_device_types 读取数据
| 功能 | 修改前 | 修改后 |
|---|---|---|
| 新增功能 | ✅ 可新增 | ❌ 已移除 |
| 编辑功能 | ✅ 可编辑 | ❌ 已移除 |
| 删除功能 | ✅ 可删除 | ❌ 已移除 |
| 查询功能 | ✅ 可查询 | ✅ 保留 |
| 查看详情 | ✅ 可查看 | ✅ 保留 |
| 数据来源 | 本地独立数据 | AI系统统一数据 |
| 数据同步 | 无 | 刷新数据按钮 |
| 只读提示 | 无 | 明确提示信息 |
| 统计卡片 | 无 | 新增统计卡片 |
| 文件 | 变更内容 |
|---|---|
| WaterFertilizerComponent.tsx |
|
| WaterFertilizerParameter.tsx |
|
Ctrl + Shift + R 或 Ctrl + F5Cmd + Shift + R步骤1:准备AI系统数据
步骤2:清除浏览器缓存并刷新
步骤3:测试水肥机部件配置
步骤4:测试水肥机参数配置