同步:iot 模块同步至 yudao/master 最新
- 新增 Modbus 支持:config/point API + 3 个表单/列表组件
- apps/web-antd/src/api/iot/device/modbus/{config,point}/index.ts
- apps/web-antd/src/views/iot/device/device/detail/modules/modbus-*.vue
- 设备详情页与子设备列表按 upstream 更新对齐
- 产品/数据类型、物模型常量更新
- packages/constants/dict-enum: 新增 IOT_MODBUS_MODE / IOT_MODBUS_FRAME_FORMAT,
IOT_CODEC_TYPE 重命名为 IOT_SERIALIZE_TYPE(本地无引用)
对比 yudao/master 范围:
git diff 36aa19537..yudao/master -- 'apps/web-antd/src/{views,api}/iot'
类型检查:对 iot 模块净引入 4/净修复 4,均为 upstream 本身的历史问题。
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
30
apps/web-antd/src/api/iot/device/modbus/config/index.ts
Normal file
30
apps/web-antd/src/api/iot/device/modbus/config/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
export namespace IotDeviceModbusConfigApi {
|
||||
/** Modbus 连接配置 VO */
|
||||
export interface ModbusConfig {
|
||||
id?: number; // 主键
|
||||
deviceId: number; // 设备编号
|
||||
ip: string; // Modbus 服务器 IP 地址
|
||||
port: number; // Modbus 服务器端口
|
||||
slaveId: number; // 从站地址
|
||||
timeout: number; // 连接超时时间,单位:毫秒
|
||||
retryInterval: number; // 重试间隔,单位:毫秒
|
||||
mode: number; // 模式
|
||||
frameFormat: number; // 帧格式
|
||||
status: number; // 状态
|
||||
}
|
||||
}
|
||||
|
||||
/** 获取设备的 Modbus 连接配置 */
|
||||
export function getModbusConfig(deviceId: number) {
|
||||
return requestClient.get<IotDeviceModbusConfigApi.ModbusConfig>(
|
||||
'/iot/device-modbus-config/get',
|
||||
{ params: { deviceId } },
|
||||
);
|
||||
}
|
||||
|
||||
/** 保存 Modbus 连接配置 */
|
||||
export function saveModbusConfig(data: IotDeviceModbusConfigApi.ModbusConfig) {
|
||||
return requestClient.post('/iot/device-modbus-config/save', data);
|
||||
}
|
||||
Reference in New Issue
Block a user