对接连续任务列表接口和连续任务下发,便捷操作中暂停任务的对接,底部导航tab项的设置根据用户角色显示和设置
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
/// routeIds 的顺序就是机器人执行顺序,不排序、不转换为设备数据库主键。
|
||||
class ConsecutiveTaskRequest {
|
||||
ConsecutiveTaskRequest({
|
||||
required this.deviceId,
|
||||
required List<int> routeIds,
|
||||
required this.orgId,
|
||||
required this.siteId,
|
||||
}) : routeIds = List.unmodifiable(routeIds);
|
||||
|
||||
final String deviceId;
|
||||
final List<int> routeIds;
|
||||
final int orgId;
|
||||
final int siteId;
|
||||
|
||||
String? get validationError {
|
||||
if (deviceId.trim().isEmpty || int.tryParse(deviceId.trim()) != null) {
|
||||
return '请选择有效的机器人设备编码';
|
||||
}
|
||||
if (siteId <= 0 || orgId <= 0) return '场站或组织信息无效,请重新选择场站';
|
||||
if (routeIds.isEmpty) return '请至少选择一条区域内的路线';
|
||||
if (routeIds.any((id) => id <= 0)) return '路线信息无效,请重新选择';
|
||||
if (routeIds.toSet().length != routeIds.length) return '执行路线不能重复';
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user