From 7932f09a48fd75041a4f30dbf635d4c62b1bcbb1 Mon Sep 17 00:00:00 2001 From: Songzex <2402265378@qq.com> Date: Wed, 11 Mar 2026 11:10:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=82=B9=E5=87=BB=E5=BC=80?= =?UTF-8?q?=E5=A7=8B=E4=BD=9C=E4=B8=9A=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=B8=8D=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../widgets/map/testmap_pages.dart | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/lib/features/home/presentation/widgets/map/testmap_pages.dart b/lib/features/home/presentation/widgets/map/testmap_pages.dart index 4842bae9..20ed843b 100644 --- a/lib/features/home/presentation/widgets/map/testmap_pages.dart +++ b/lib/features/home/presentation/widgets/map/testmap_pages.dart @@ -1402,7 +1402,13 @@ class _MapPageEnterpriseState extends State { /// 开始作业 void _startWork() async { + debugPrint('🔵 _startWork 方法被调用了!'); + + debugPrint('📊 startWorkList 类型:${startWorkList.runtimeType}'); + debugPrint('📊 startWorkList 长度:${startWorkList.length}'); + debugPrint('📊 startWorkList 内容:$startWorkList'); if (startWorkList.isEmpty) { + debugPrint('🚀 作业列表为空'); ToastUtils.showInfo(context, '作业列表为空,请重新选择路径'); return; } @@ -1422,7 +1428,17 @@ class _MapPageEnterpriseState extends State { //}).toList(); // 步骤2:将 List 转换为 Queue(队列) - final Queue pathQueue = Queue.from(startWorkList); + debugPrint('⚙️ 开始类型转换...'); + final List typedList = startWorkList + .whereType>() + .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 pathQueue = Queue.from(typedList); debugPrint('🚀 开始作业:${_selectedPlot?.plotName ?? "未命名"},路径点数量:${pathQueue.length}'); debugPrint('第一个点 WGS84: ${pathQueue.first.latitude}, ${pathQueue.first.longitude}'); @@ -1589,7 +1605,7 @@ class _MapPageEnterpriseState extends State { width: double.infinity, height: 50, child: ElevatedButton( - onPressed: state.isLoading || gcjPathPoints.isEmpty + onPressed: state.isLoading || startWorkList.isEmpty ? null : () { // 开始作业逻辑