zoulei 1 year ago
parent
commit
8b77927483

+ 1 - 1
XdCxRhDW.App/Controllers/PosController.cs

@@ -2174,7 +2174,7 @@ namespace XdCxRhDW.App.Controllers
                             itemPos.CheckRes = await db.CheckRes.FirstOrDefaultAsync(p => p.ID == itemPos.CheckResID);
                         }
                         posList.AddRange(posRes);
-                        return Success(posList, "数据过多,只返回前5000条数据!");
+                        return Success(posList);
                     }
                 }
                 return Success(posList);

+ 0 - 29
XdCxRhDW.App/Image/DfoLine.svg

@@ -1,29 +0,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">
-	.Red{fill:#D11C1C;}
-	.Yellow{fill:#FFB115;}
-	.Blue{fill:#1177D7;}
-	.Green{fill:#039C23;}
-	.Black{fill:#727272;}
-	.White{fill:#FFFFFF;}
-	.st0{opacity:0.5;}
-	.st1{opacity:0.75;}
-	.st2{opacity:0.35;}
-	.st3{opacity:0.65;}
-</style>
-<g id="Spline3D">
-	<g class="st1">
-		<path class="Green" d="M20.6,8.6C17.8,10.8,16,14.2,16,18c0,0.6-0.1,1.1-0.4,1.6C15,21,13.6,22,12,22c-2.2,0-4-1.8-4-4
-			c0-3.3-2.7-6-6-6v2v2c1.1,0,2,0.9,2,2c0,4.4,3.6,8,8,8c0.7,0,1.4-0.1,2-0.3c0,0,0.1,0,0.1,0c0.2-0.1,0.5-0.1,0.7-0.2
-			c0.1,0,0.1,0,0.2-0.1c0.3-0.1,0.5-0.2,0.8-0.4c0.1-0.1,0.3-0.2,0.4-0.2c0.1-0.1,0.2-0.1,0.3-0.2c0.2-0.1,0.3-0.2,0.4-0.3
-			c0.1-0.1,0.2-0.2,0.3-0.2c1.7-1.5,2.7-3.6,2.7-6c0-2.7,1.4-5.1,3.4-6.6c1.3-0.9,2.9-1.4,4.6-1.4V8.3V6C25.2,6,22.6,7,20.6,8.6z"/>
-	</g>
-	<path class="Green" d="M14,20c0.6,0,1.1-0.1,1.6-0.4C15,21,13.6,22,12,22c-2.2,0-4-1.8-4-4c0-3.3-2.7-6-6-6l2-2c3.3,0,6,2.7,6,6
-		C10,18.2,11.8,20,14,20z M20,18c0,2.4-1.1,4.5-2.7,6c0.1-0.1,0.3-0.2,0.4-0.3l2-2c1.4-1.4,2.3-3.4,2.3-5.7c0-1.7,0.5-3.3,1.4-4.6
-		C21.4,12.9,20,15.3,20,18z M28,6v2.3V10l2-2V4L28,6z"/>
-	<g class="st0">
-		<path class="Green" d="M20.6,8.6C22.6,7,25.2,6,28,6l2-2C26.2,4,22.8,5.8,20.6,8.6z"/>
-	</g>
-</g>
-</svg>

+ 0 - 20
XdCxRhDW.App/Image/DtoLine.svg

@@ -1,20 +0,0 @@
-<?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">
-	.Green{fill:#039C23;}
-	.Black{fill:#727272;}
-	.Red{fill:#D11C1C;}
-	.Yellow{fill:#FFB115;}
-	.Blue{fill:#1177D7;}
-	.White{fill:#FFFFFF;}
-	.st0{opacity:0.5;}
-	.st1{opacity:0.75;}
-</style>
-<g id="EnableClustering">
-	<path class="Green" d="M32,16c0,4.4-3.6,8-8,8c-0.2,0-0.3,0-0.5,0c1.6-2.3,2.5-5.1,2.5-8s-0.9-5.6-2.5-8c0.2,0,0.3,0,0.5,0
-		C28.4,8,32,11.6,32,16z M14,16c0-3.9,2.3-7.5,5.8-9.1C17.7,5.1,15,4,12,4C5.4,4,0,9.4,0,16c0,6.6,5.4,12,12,12c3,0,5.7-1.1,7.8-2.9
-		C16.3,23.5,14,19.9,14,16z M21.3,8.5C18.2,9.6,16,12.5,16,16s2.2,6.4,5.3,7.5C23,21.5,24,18.9,24,16S23,10.5,21.3,8.5z"/>
-</g>
-</svg>

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

@@ -1,17 +0,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">
-	.Black{fill:#727272;}
-	.Blue{fill:#1177D7;}
-	.Green{fill:#039C23;}
-	.Yellow{fill:#FFB115;}
-	.Red{fill:#D11C1C;}
-	.White{fill:#FFFFFF;}
-	.st0{opacity:0.5;}
-	.st1{opacity:0.75;}
-</style>
-<path class="Black" d="M24,24.8V28H4V4h20v7.2l2-2V3c0-0.5-0.5-1-1-1H3C2.5,2,2,2.5,2,3v26c0,0.5,0.5,1,1,1h22c0.5,0,1-0.5,1-1v-6.2
-	L24,24.8z"/>
-<path class="Blue" d="M29,17l-8,8l-4-4l8-8L29,17z M30,16l1.7-1.7c0.4-0.4,0.4-1,0-1.3L29,10.3c-0.4-0.4-1-0.4-1.3,0L26,12L30,16z
-	 M16,22v4h4L16,22z"/>
-</svg>

+ 0 - 33
XdCxRhDW.App/Image/GDOP.svg

@@ -1,33 +0,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">
-	.Red{fill:#D11C1C;}
-	.Yellow{fill:#FFB115;}
-	.Blue{fill:#1177D7;}
-	.Green{fill:#039C23;}
-	.Black{fill:#727272;}
-	.White{fill:#FFFFFF;}
-	.st0{opacity:0.5;}
-	.st1{opacity:0.75;}
-	.st2{opacity:0.35;}
-	.st3{opacity:0.65;}
-</style>
-<g id="RadarLine_1_">
-	<g class="st2">
-		<path class="Black" d="M23.7,9.7C23.5,9.9,23.3,10,23,10c-0.6,0-1-0.4-1-1c0-0.3,0.1-0.5,0.3-0.7C20.6,6.9,18.4,6,16,6
-			c-5,0-9.2,3.7-9.9,8.6C6.3,14.2,6.6,14,7,14c0.6,0,1,0.4,1,1s-0.4,1-1,1c-0.5,0-0.9-0.3-1-0.8c0,0.3,0,0.5,0,0.8
-			c0,5.5,4.5,10,10,10c0.3,0,0.5,0,0.8,0c-0.5-0.1-0.8-0.5-0.8-1c0-0.6,0.4-1,1-1s1,0.4,1,1c0,0.4-0.2,0.7-0.6,0.9
-			C22.3,25.2,26,21,26,16C26,13.6,25.1,11.4,23.7,9.7z M16,24c-4.4,0-8-3.6-8-8c0-3,1.6-5.5,4-6.9V9c0-0.6,0.4-1,1-1
-			c0.3,0,0.6,0.1,0.7,0.3C14.5,8.1,15.2,8,16,8c4.4,0,8,3.6,8,8S20.4,24,16,24z M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16
-			S24.8,0,16,0z M16,30C8.3,30,2,23.7,2,16S8.3,2,16,2s14,6.3,14,14S23.7,30,16,30z M16,12c-2.2,0-4,1.8-4,4s1.8,4,4,4s4-1.8,4-4
-			S18.2,12,16,12z M16,18c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S17.1,18,16,18z"/>
-	</g>
-	<path class="Blue" d="M23,6c-1.3,0-2.4,0.8-2.8,2h-4.4c-0.4-1.2-1.5-2-2.8-2c-1.7,0-3,1.3-3,3c0,0.5,0.1,0.9,0.3,1.3l-2,2
-		C7.9,12.1,7.5,12,7,12c-1.7,0-3,1.3-3,3s1.3,3,3,3c0.5,0,0.9-0.1,1.3-0.3l6,6C14.1,24.1,14,24.5,14,25c0,1.7,1.3,3,3,3s3-1.3,3-3
-		c0-0.9-0.4-1.8-1.1-2.3L23,12c1.6,0,3-1.4,3-3C26,7.3,24.7,6,23,6z M7,16c-0.6,0-1-0.4-1-1c0-0.6,0.4-1,1-1s1,0.4,1,1
-		C8,15.6,7.6,16,7,16z M13,8c0.6,0,1,0.4,1,1c0,0.6-0.4,1-1,1s-1-0.4-1-1C12,8.4,12.4,8,13,8z M17,26c-0.6,0-1-0.4-1-1
-		c0-0.6,0.4-1,1-1s1,0.4,1,1C18,25.6,17.6,26,17,26z M17,22C17,22,17,22,17,22c-0.5,0-0.9,0.1-1.3,0.3l-6-6C9.9,15.9,10,15.5,10,15
-		s-0.1-0.9-0.3-1.3l2-2c0.4,0.2,0.8,0.3,1.3,0.3c1.3,0,2.4-0.8,2.8-2h4.4c0.2,0.5,0.5,1,1,1.3L17,22z M23,10c-0.6,0-1-0.4-1-1
-		c0-0.6,0.4-1,1-1s1,0.4,1,1C24,9.6,23.6,10,23,10z"/>
-</g>
-</svg>

+ 0 - 24
XdCxRhDW.App/Image/Pos.svg

@@ -1,24 +0,0 @@
-<?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">
-	.Black{fill:#727272;}
-	.Green{fill:#039C23;}
-	.Yellow{fill:#FFB115;}
-	.Blue{fill:#1177D7;}
-	.Red{fill:#D11C1C;}
-</style>
-<g id="Handwheel">
-	<path class="Blue" d="M29,14h-3.1c-0.2-2.3-1.1-4.4-2.5-6l2.2-2.2c0.4-0.4,0.4-1,0-1.4s-1-0.4-1.4,0L22,6.5c-1.7-1.4-3.8-2.3-6-2.5
-		V1c0-0.5-0.4-1-1-1s-1,0.5-1,1v3.1c-2.3,0.2-4.4,1.1-6,2.5L5.8,4.4C5.4,4,4.8,4,4.4,4.4s-0.4,1,0,1.4L6.5,8c-1.4,1.7-2.3,3.8-2.5,6
-		H1c-0.6,0-1,0.5-1,1s0.4,1,1,1h3.1c0.2,2.3,1.1,4.4,2.5,6l-2.2,2.2c-0.4,0.4-0.4,1,0,1.4s1,0.4,1.4,0L8,23.5c1.7,1.4,3.8,2.3,6,2.5
-		V29c0,0.5,0.4,1,1,1s1-0.5,1-1v-3.1c2.3-0.2,4.4-1.1,6-2.5l2.2,2.2c0.4,0.4,1,0.4,1.4,0s0.4-1,0-1.4L23.5,22c1.4-1.7,2.3-3.8,2.5-6
-		H29c0.6,0,1-0.5,1-1S29.6,14,29,14z M16,6.1c1.7,0.2,3.3,0.9,4.6,1.9l-2.9,2.9c-0.5-0.3-1.1-0.6-1.8-0.7V6.1z M14,6.1v4
-		c-0.6,0.1-1.2,0.4-1.8,0.7L9.4,8C10.7,6.9,12.3,6.3,14,6.1z M8,9.4l2.9,2.9c-0.3,0.5-0.6,1.1-0.7,1.8h-4C6.3,12.3,6.9,10.7,8,9.4z
-		 M6.1,16h4c0.1,0.6,0.4,1.2,0.7,1.8L8,20.6C6.9,19.3,6.3,17.7,6.1,16z M14,23.9c-1.7-0.2-3.3-0.9-4.6-1.9l2.9-2.9
-		c0.5,0.3,1.1,0.6,1.8,0.7V23.9z M15,18c-1.7,0-3-1.3-3-3s1.3-3,3-3s3,1.3,3,3S16.7,18,15,18z M16,23.9v-4c0.6-0.1,1.2-0.4,1.8-0.7
-		l2.9,2.9C19.3,23.1,17.7,23.7,16,23.9z M22,20.6l-2.9-2.9c0.3-0.5,0.6-1.1,0.7-1.8h4C23.7,17.7,23.1,19.3,22,20.6z M19.9,14
-		c-0.1-0.6-0.4-1.2-0.7-1.8L22,9.4c1,1.3,1.7,2.9,1.9,4.6H19.9z"/>
-</g>
-</svg>

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

@@ -1,17 +0,0 @@
-<?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>

+ 2 - 4
XdCxRhDW.App/ServerContext.cs

@@ -61,8 +61,6 @@ namespace XdCxRhDW.App
                     Serilog.Log.Error(ex, "处理服务状态上报异常");
                 }
             });
-
-
             CheckSvrState();
         }
 
@@ -77,7 +75,7 @@ namespace XdCxRhDW.App
                 return list.FindAll(p => p.SvrType == type);
             }
         }
-        public ModelSvr GetOne(EnumSvrType type,string svrID)
+        public ModelSvr GetOne(EnumSvrType type, string svrID)
         {
             lock (this)
             {
@@ -88,7 +86,7 @@ namespace XdCxRhDW.App
         {
             lock (this)
             {
-               return list.FirstOrDefault(p => p.SvrType == type);
+                return list.FirstOrDefault(p => p.SvrType == type);
             }
         }
 

+ 12 - 12
XdCxRhDW.App/UserControl/CtrlSvrs.Designer.cs

@@ -7,18 +7,18 @@
         /// </summary>
         private System.ComponentModel.IContainer components = null;
 
-        /// <summary> 
-        /// Clean up any resources being used.
-        /// </summary>
-        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
-        protected override void Dispose(bool disposing)
-        {
-            if (disposing && (components != null))
-            {
-                components.Dispose();
-            }
-            base.Dispose(disposing);
-        }
+        ///// <summary> 
+        ///// Clean up any resources being used.
+        ///// </summary>
+        ///// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+        //protected override void Dispose(bool disposing)
+        //{
+        //    if (disposing && (components != null))
+        //    {
+        //        components.Dispose();
+        //    }
+        //    base.Dispose(disposing);
+        //}
 
         #region Component Designer generated code
 

+ 48 - 36
XdCxRhDW.App/UserControl/CtrlSvrs.cs

@@ -38,53 +38,65 @@ namespace XdCxRhDW.App.UserControl
         {
             this.list.AddRange(ServerContext.Instance.GetAll());
             gridView1.RefreshData();
-           Messenger.Defalut.Sub<List<ModelSvr>>("服务集合改变", items =>
+            Messenger.Defalut.Sub<List<ModelSvr>>("服务集合改变", RefreshSvr);
+
+        }
+        private void RefreshSvr(List<ModelSvr> items)
+        {
+            if (!this.IsHandleCreated || this.Disposing || this.IsDisposed) return;
+            try
             {
-                try
+                var listCopy = list.Skip(0).ToList();
+                foreach (var item in listCopy)
                 {
-                    var listCopy = list.Skip(0).ToList();
-                    foreach (var item in listCopy)
+                    var find = items.Find(p => p.BaseHttpAddr == item.BaseHttpAddr);
+                    if (find == null)
                     {
-                        var find = items.Find(p => p.BaseHttpAddr == item.BaseHttpAddr);
-                        if (find == null)
-                        {
-                            list.Remove(item);
-                        }
+                        list.Remove(item);
                     }
-                    foreach (var item in items)
+                }
+                foreach (var item in items)
+                {
+                    var find = list.Find(p => p.BaseHttpAddr == item.BaseHttpAddr);
+                    if (find == null)
                     {
-                        var find = list.Find(p => p.BaseHttpAddr == item.BaseHttpAddr);
-                        if (find == null)
-                        {
-                            list.Add(new ModelSvr()
-                            {
-                                SvrType = item.SvrType,
-                                SvrID = item.SvrID,
-                                BaseHttpAddr = item.BaseHttpAddr,
-                                SwaggerAddr = item.SwaggerAddr,
-                                ReportTime = DateTime.Now,
-                            });
-                        }
-                        else
+                        list.Add(new ModelSvr()
                         {
-                            find.BaseHttpAddr = item.BaseHttpAddr;
-                            find.SwaggerAddr = item.SwaggerAddr;
-                            find.SvrType = item.SvrType;
-                            find.SvrID = item.SvrID;
-                            find.ReportTime = DateTime.Now;
-                        }
+                            SvrType = item.SvrType,
+                            SvrID = item.SvrID,
+                            BaseHttpAddr = item.BaseHttpAddr,
+                            SwaggerAddr = item.SwaggerAddr,
+                            ReportTime = DateTime.Now,
+                        });
                     }
-                    this.BeginInvoke(new Action(() =>
+                    else
                     {
-                        gridView1.RefreshData();
-                    }));
+                        find.BaseHttpAddr = item.BaseHttpAddr;
+                        find.SwaggerAddr = item.SwaggerAddr;
+                        find.SvrType = item.SvrType;
+                        find.SvrID = item.SvrID;
+                        find.ReportTime = DateTime.Now;
+                    }
                 }
-                catch (Exception ex)
+                this.BeginInvoke(new Action(() =>
                 {
-                    Serilog.Log.Error(ex, "处理服务状态上报异常");
-                }
-            });
+                    gridView1.RefreshData();
+                }));
+            }
+            catch (Exception ex)
+            {
+                Serilog.Log.Error(ex, "处理服务状态上报异常");
+            }
+        }
 
+        protected override void Dispose(bool disposing)
+        {
+            Messenger.Defalut.UnSub<List<ModelSvr>>("服务集合改变", RefreshSvr);
+            if (disposing && (components != null))
+            {
+                components.Dispose();
+            }
+            base.Dispose(disposing);
         }
     }
 }

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

@@ -559,24 +559,6 @@
     <EmbeddedResource Include="UserControl\X3DFGDOPParam .resx">
       <DependentUpon>X3DFGDOPParam .cs</DependentUpon>
     </EmbeddedResource>
-    <Content Include="Image\DfoLine.svg">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Image\DtoLine.svg">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Image\Edit.svg">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Image\GDOP.svg">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Image\Pos.svg">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
-    <Content Include="Image\To.svg">
-      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
-    </Content>
     <Content Include="定位.ico" />
   </ItemGroup>
   <ItemGroup>

+ 14 - 0
XdCxRhDW.Framework/Messenger.cs

@@ -23,7 +23,21 @@ public class Messenger
             cache.Add(key, new List<dynamic>());
         cache[key].Add(act);
     }
+    public void UnSub<T>(string key, Action<T> act)
+    {
+        if (cache.ContainsKey(key))
+        {
+            var items = cache[key].Skip(0).ToList();
+            foreach (var item in items)
+            {
+                if (item is Action<T> actExist)
+                {
+                    cache[key].Remove(actExist);
+                }
+            }
+        }
 
+    }
     public void Pub<T>(string key, T data)
     {
         if (cache.TryGetValue(key, out List<dynamic> list))