wyq преди 1 година
родител
ревизия
fd03a70572
променени са 3 файла, в които са добавени 52 реда и са изтрити 1 реда
  1. 17 0
      XdCxRhDW.App/Image/To.svg
  2. 32 1
      XdCxRhDW.App/UserControl/CtrlHome.cs
  3. 3 0
      XdCxRhDW.App/XdCxRhDW.App.csproj

+ 17 - 0
XdCxRhDW.App/Image/To.svg

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+	 viewBox="0 0 32 32" style="enable-background:new 0 0 32 32;" xml:space="preserve">
+<style type="text/css">
+	.Blue{fill:#1177D7;}
+	.Yellow{fill:#FFB115;}
+	.Black{fill:#727272;}
+	.Green{fill:#039C23;}
+	.Red{fill:#D11C1C;}
+	.st0{opacity:0.75;}
+	.st1{opacity:0.5;}
+</style>
+<g id="Arrow5DownRight">
+	<path class="Blue" d="M18,8l10,10L18,28v-8H5c-0.5,0-1-0.5-1-1V4h4v12h10V8z"/>
+</g>
+</svg>

+ 32 - 1
XdCxRhDW.App/UserControl/CtrlHome.cs

@@ -129,6 +129,10 @@ namespace XdCxRhDW.App.UserControl
                 {
                     EditTarget(items.ToList());
                 });
+                mapControl1.AddRectMenu<PosRes>("转到列表", SvgHelper.LoadFromFile("Image\\To.svg"), items =>
+                {
+                    ToPosList(items.ToList());
+                });
                 mapControl1.AddPosMenu<PosRes>("绘制时差线", SvgHelper.LoadFromFile("Image\\DtoLine.svg"), item =>
                 {
                     DrawDtoLine(item);
@@ -261,6 +265,33 @@ namespace XdCxRhDW.App.UserControl
 
             WaitHelper.CloseForm();
         }
+        private void ToPosList(List<PosRes> items)
+        {
+            if (items == null || items.Count() == 0)
+            {
+                DxHelper.MsgBoxHelper.ShowWarning($"请选择需要转到列表的定位数据信息!");
+                return;
+            }
+            try
+            {
+                var ds = this.gridHomePosRes.DataSource as List<PosRes>;
+                var ids = items.Select(p => p.ID).ToList();
+
+                //删除地图
+                var deleteItems = ds.Where(m => !ids.Contains(m.ID)).ToList();
+                mapControl1.DelPosItem(deleteItems);
+
+                //删除列表
+                ds.RemoveAll(m => !ids.Contains(m.ID));
+                gridView2.RefreshData();
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "转到列表异常!");
+                MsgBoxHelper.ShowError("转到列表异常!");
+            }
+
+        }
         private async void EditTarget(List<PosRes> items)
         {
             if (items == null || items.Count() == 0)
@@ -816,7 +847,7 @@ namespace XdCxRhDW.App.UserControl
         private void btnShowCgRes_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
         {
             var item = gridView2.GetFocusedRow() as PosRes;
-            DxHelper.PopupHelper.ShowPopup(new ShowCgCtrl(item), gridHomePosRes, gridHomePosRes.Height, EnumPopupDirection.Bottom,showCloseButton:true);
+            DxHelper.PopupHelper.ShowPopup(new ShowCgCtrl(item), gridHomePosRes, gridHomePosRes.Height, EnumPopupDirection.Bottom, showCloseButton: true);
         }
 
         private void btnShowCxRes_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)

+ 3 - 0
XdCxRhDW.App/XdCxRhDW.App.csproj

@@ -595,6 +595,9 @@
     <Content Include="Image\Pos.svg">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>
+    <Content Include="Image\To.svg">
+      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+    </Content>
     <Content Include="xcorr\dmc.exe">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </Content>