Переглянути джерело

Merge branch 'master' of http://139.155.15.221:3000/zoulei/XdCxRhDW

gongqiuhong 1 рік тому
батько
коміт
67e81165b3

+ 1 - 0
XdCxRhDW.App/EditForms/EditorTar.cs

@@ -63,6 +63,7 @@ namespace XdCxRhDW.App.EditForms
                 else
                 {
                     info.ID = 0;
+                    info.TargetName = "未知目标";
                 }
                 this.DialogResult = DialogResult.OK;
             }

+ 18 - 22
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -47,7 +47,7 @@ namespace XdCxRhDW.App.UserControl
     public partial class CtrlHome : DevExpress.XtraEditors.XtraUserControl
     {
         List<TaskInfo> list = new List<TaskInfo>();
-       public CtrlHome()
+        public CtrlHome()
         {
             InitializeComponent();
             gridHomeTask.Init();
@@ -57,20 +57,20 @@ namespace XdCxRhDW.App.UserControl
             {
                 mapService = db.SysSetings.FirstOrDefault().MapService;
             }
-                mapControl1.UseDefalutOptions()
-                //.UseCluster()//定位点使用内置聚合
-                .UseClearAll()
-                .UseDistanceLine()
-                .UseMarkDot()
-                .UseExportImg()
-                .UseExportXlsx()
-                .UseExportCsv()
-                .SetMapLayerType(mapService)
-                //.SetMapLayerType("")
-                .UseDrawRect(rect =>
-                {
-                    (double startLon, double startLat, double centerLon, double centerLat, double endLon, double endLat, double lonRange, double latRange) = rect;
-                });
+            mapControl1.UseDefalutOptions()
+            //.UseCluster()//定位点使用内置聚合
+            .UseClearAll()
+            .UseDistanceLine()
+            .UseMarkDot()
+            .UseExportImg()
+            .UseExportXlsx()
+            .UseExportCsv()
+            .SetMapLayerType(mapService)
+            //.SetMapLayerType("")
+            .UseDrawRect(rect =>
+            {
+                (double startLon, double startLat, double centerLon, double centerLat, double endLon, double endLat, double lonRange, double latRange) = rect;
+            });
 
         }
         private async void GridView1_FocusedRowObjectChanged(object sender, DevExpress.XtraGrid.Views.Base.FocusedRowObjectChangedEventArgs e)
@@ -627,17 +627,13 @@ namespace XdCxRhDW.App.UserControl
                         var tarItem = await db.PosRes.Where(p => p.ID == item.ID).FirstOrDefaultAsync();
                         if (tarItem != null)
                         {
-                            tarItem.TargetID = tar.ID;
-                            tarItem.TarName = tar.TargetName;
+                            item.TargetID= tarItem.TargetID = tar.ID;
+                            item.TarName = tarItem.TarName = tar.TargetName;
                         }
+
                     }
                     await db.SaveChangesAsync();
                 }
-                this.Invoke(new Action(() =>
-                {
-                    gridView2.RefreshData();
-                }));
-
             }
             catch (Exception ex)
             {