Merge branch 'feature/my' of http://1.95.137.212:57001/APP/FlutterApp into feature/my
This commit is contained in:
@@ -1416,7 +1416,13 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
|
||||
/// 开始作业
|
||||
void _startWork() async {
|
||||
debugPrint('🔵 _startWork 方法被调用了!');
|
||||
|
||||
debugPrint('📊 startWorkList 类型:${startWorkList.runtimeType}');
|
||||
debugPrint('📊 startWorkList 长度:${startWorkList.length}');
|
||||
debugPrint('📊 startWorkList 内容:$startWorkList');
|
||||
if (startWorkList.isEmpty) {
|
||||
debugPrint('🚀 作业列表为空');
|
||||
ToastUtils.showInfo(context, '作业列表为空,请重新选择路径');
|
||||
return;
|
||||
}
|
||||
@@ -1436,7 +1442,17 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
//}).toList();
|
||||
|
||||
// 步骤2:将 List 转换为 Queue(队列)
|
||||
final Queue<work_area_model.DeviceAddPathPointModel> pathQueue = Queue.from(startWorkList);
|
||||
debugPrint('⚙️ 开始类型转换...');
|
||||
final List<work_area_model.DeviceAddPathPointModel> typedList = startWorkList
|
||||
.whereType<Map<String, dynamic>>()
|
||||
.map((item) {
|
||||
return work_area_model.DeviceAddPathPointModel(
|
||||
latitude: (item['lat'] as num).toDouble(),
|
||||
longitude: (item['lon'] as num).toDouble(),
|
||||
);
|
||||
}).toList();
|
||||
debugPrint('✅ 类型转换成功,长度:${typedList.length}');
|
||||
final Queue<work_area_model.DeviceAddPathPointModel> pathQueue = Queue.from(typedList);
|
||||
|
||||
debugPrint('🚀 开始作业:${_selectedPlot?.plotName ?? "未命名"},路径点数量:${pathQueue.length}');
|
||||
debugPrint('第一个点 WGS84: ${pathQueue.first.latitude}, ${pathQueue.first.longitude}');
|
||||
@@ -1603,7 +1619,7 @@ class _MapPageEnterpriseState extends State<MapPageEnterprise> {
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
child: ElevatedButton(
|
||||
onPressed: state.isLoading || gcjPathPoints.isEmpty
|
||||
onPressed: state.isLoading || startWorkList.isEmpty
|
||||
? null
|
||||
: () {
|
||||
// 开始作业逻辑
|
||||
|
||||
Reference in New Issue
Block a user