Ver Fonte

所有工具模版修改,标准化,统一化,方便集成

Shun há 2 anos atrás
pai
commit
bb1a85fdea
72 ficheiros alterados com 1074 adições e 437 exclusões
  1. 1 0
      src/YSAI.AllenBradley/AllenBradleyData.cs
  2. 2 2
      src/YSAI.AllenBradley/YSAI.AllenBradley.csproj
  3. 1 0
      src/YSAI.Beckhoff/BeckhoffData.cs
  4. 2 2
      src/YSAI.Beckhoff/YSAI.Beckhoff.csproj
  5. 1 0
      src/YSAI.Can/CanData.cs
  6. 2 2
      src/YSAI.Can/YSAI.Can.csproj
  7. 5 4
      src/YSAI.Core.Wpf/resources/style/Style_ContextMenu.xaml
  8. 10 0
      src/YSAI.Core.Wpf/resources/svg/WindowSvg.xaml
  9. 1 1
      src/YSAI.Core/YSAI.Core.csproj
  10. 1 0
      src/YSAI.Core/communication/BasicsData.cs
  11. 5 1
      src/YSAI.Core/communication/net/http/HttpData.cs
  12. 9 1
      src/YSAI.Core/communication/net/tcp/client/TcpClientData.cs
  13. 7 1
      src/YSAI.Core/communication/net/tcp/service/TcpServiceData.cs
  14. 8 1
      src/YSAI.Core/communication/net/udp/UdpData.cs
  15. 8 1
      src/YSAI.Core/communication/net/ws/client/WsClientData.cs
  16. 19 2
      src/YSAI.Core/communication/net/ws/service/WsServiceData.cs
  17. 1 1
      src/YSAI.Core/communication/net/ws/service/WsServiceOperate.cs
  18. 7 0
      src/YSAI.Core/communication/serial/SerialData.cs
  19. 5 0
      src/YSAI.Core/subscribe/SubscribeData.cs
  20. 2 2
      src/YSAI.DAQ.Samples/YSAI.DAQ.Samples.csproj
  21. 1 0
      src/YSAI.DB/DBData.cs
  22. 2 2
      src/YSAI.DB/YSAI.DB.csproj
  23. 1 0
      src/YSAI.Kafka/KafkaData.cs
  24. 1 1
      src/YSAI.Kafka/YSAI.Kafka.csproj
  25. 1 0
      src/YSAI.Mewtocol/MewtocolData.cs
  26. 2 2
      src/YSAI.Mewtocol/YSAI.Mewtocol.csproj
  27. 1 0
      src/YSAI.Mitsubishi/MitsubishiData.cs
  28. 2 2
      src/YSAI.Mitsubishi/YSAI.Mitsubishi.csproj
  29. 65 62
      src/YSAI.Modbus/ModbusData.cs
  30. 2 2
      src/YSAI.Modbus/YSAI.Modbus.csproj
  31. 1 1
      src/YSAI.Mqtt/YSAI.Mqtt.csproj
  32. 1 0
      src/YSAI.Mqtt/client/MqttClientData.cs
  33. 1 0
      src/YSAI.Mqtt/service/MqttServiceData.cs
  34. 1 0
      src/YSAI.Mqtt/service/websocket/MqttWebSocketServiceData.cs
  35. 1 0
      src/YSAI.NetMQ/NetMQData.cs
  36. 1 1
      src/YSAI.NetMQ/YSAI.NetMQ.csproj
  37. 1 1
      src/YSAI.Netty/YSAI.Netty.csproj
  38. 1 0
      src/YSAI.Netty/client/NettyClientData.cs
  39. 1 0
      src/YSAI.Netty/service/NettyServiceData.cs
  40. 1 0
      src/YSAI.Omron/OmronData.cs
  41. 2 2
      src/YSAI.Omron/YSAI.Omron.csproj
  42. 2 2
      src/YSAI.Opc/YSAI.Opc.csproj
  43. 1 0
      src/YSAI.Opc/da/client/OpcDaClientData.cs
  44. 1 0
      src/YSAI.Opc/da/http/OpcDaHttpData.cs
  45. 1 0
      src/YSAI.Opc/ua/client/OpcUaClientData.cs
  46. 1 0
      src/YSAI.Opc/ua/service/OpcUaServiceData.cs
  47. 1 1
      src/YSAI.RPC.Client.Samples/Program.cs
  48. 1 1
      src/YSAI.RPC.Client.Samples/YSAI.RPC.Client.Samples.csproj
  49. 1 1
      src/YSAI.RPC.Service.Samples/Program.cs
  50. 1 1
      src/YSAI.RPC.Service.Samples/YSAI.RPC.Service.Samples.csproj
  51. 1 0
      src/YSAI.RabbitMQ/RabbitMQData.cs
  52. 1 1
      src/YSAI.RabbitMQ/YSAI.RabbitMQ.csproj
  53. 1 1
      src/YSAI.Redis.Samples/YSAI.Redis.Samples.csproj
  54. 8 6
      src/YSAI.Redis/RedisData.cs
  55. 75 74
      src/YSAI.Redis/RedisOperate.cs
  56. 1 1
      src/YSAI.Redis/YSAI.Redis.csproj
  57. 1 1
      src/YSAI.Relay.Samples/YSAI.Relay.Samples.csproj
  58. 1 1
      src/YSAI.Rpc/YSAI.Rpc.csproj
  59. 1 1
      src/YSAI.Rpc/data/Authentication.cs
  60. 14 4
      src/YSAI.Rpc/data/Client.cs
  61. 17 0
      src/YSAI.Rpc/data/Details.cs
  62. 14 3
      src/YSAI.Rpc/data/Service.cs
  63. 2 2
      src/YSAI.Rpc/service/RpcService.cs
  64. 1 0
      src/YSAI.Siemens/SiemensData.cs
  65. 2 2
      src/YSAI.Siemens/YSAI.Siemens.csproj
  66. 1 4
      src/YSAI.Tool.Wpf/Main.xaml
  67. 15 14
      src/YSAI.Tool.Wpf/YSAI.Tool.Wpf.csproj
  68. 126 0
      src/YSAI.Tool.Wpf/controllers/UdpController.cs
  69. 227 71
      src/YSAI.Tool.Wpf/test.xaml
  70. 114 134
      src/YSAI.Tool.Wpf/testC.cs
  71. 244 11
      src/YSAI.Tool.Wpf/views/Udp.xaml
  72. 10 3
      src/YSAI.Ver.Manage.Tool/Program.cs

+ 1 - 0
src/YSAI.AllenBradley/AllenBradleyData.cs

@@ -16,6 +16,7 @@ namespace YSAI.AllenBradley
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.AllenBradley/YSAI.AllenBradley.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,6 +16,6 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 1 - 0
src/YSAI.Beckhoff/BeckhoffData.cs

@@ -18,6 +18,7 @@ namespace YSAI.Beckhoff
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.Beckhoff/YSAI.Beckhoff.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="Beckhoff.TwinCAT.Ads" Version="6.1.154" />
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 1 - 0
src/YSAI.Can/CanData.cs

@@ -18,6 +18,7 @@ namespace YSAI.Can
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.Can/YSAI.Can.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,7 +16,7 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="Kvaser.CanLib">

+ 5 - 4
src/YSAI.Core.Wpf/resources/style/Style_ContextMenu.xaml

@@ -13,8 +13,8 @@
                 Value="False" />
         <Setter Property="FontSize"
                 Value="13" />
-        <Setter Property="Width"
-                Value="200" />
+        <Setter Property="MinWidth"
+                Value="250" />
         <Setter Property="Background"
                 Value="White" />
         <Setter Property="BorderThickness"
@@ -28,7 +28,7 @@
         <Setter Property="local:ContextMenuHelper.ItemHeight"
                 Value="35" />
         <Setter Property="Foreground"
-                Value="#3E3E3E" />
+                Value="{DynamicResource Font.Content.Foreground}" />
         <Setter Property="local:IconHelper.FontSize"
                 Value="{Binding FontSize, Converter={StaticResource Add3Converter},RelativeSource={RelativeSource Self},Mode=OneWay}" />
         <Setter Property="local:IconHelper.Foreground"
@@ -243,6 +243,7 @@
                                         </BeginStoryboard>
                                     </Trigger.ExitActions>
                                 </Trigger>
+                               
                                 <MultiDataTrigger>
                                     <MultiDataTrigger.Conditions>
                                         <Condition Binding="{Binding Path=(local:ContextMenuHelper.CheckableCheckboxStyle),RelativeSource={RelativeSource Self},Converter={StaticResource IsNullConverter}}"
@@ -268,7 +269,7 @@
                                             Property="Content"
                                             Value="&#xf00c;" />
                                 </MultiDataTrigger>
-
+                               
                                 <Trigger Property="HasItems"
                                          Value="True">
                                     <Setter TargetName="Path"

Diff do ficheiro suprimidas por serem muito extensas
+ 10 - 0
src/YSAI.Core.Wpf/resources/svg/WindowSvg.xaml


+ 1 - 1
src/YSAI.Core/YSAI.Core.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21128</Version>
+    <Version>23.349.9636</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 0
src/YSAI.Core/communication/BasicsData.cs

@@ -11,6 +11,7 @@ namespace YSAI.Core.communication
         /// <summary>
         /// 唯一标识符
         /// </summary>
+        [Category("基础数据")]
         [Description("唯一标识符")]
         public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 5 - 1
src/YSAI.Core/communication/net/http/HttpData.cs

@@ -1,4 +1,5 @@
-using System.Net;
+using System.ComponentModel;
+using System.Net;
 using System.Text;
 using YSAI.Unility;
 
@@ -17,11 +18,14 @@ namespace YSAI.Core.communication.net.http
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
+            [Description("唯一标识符")]
             public string SN { get; set; } = Guid.NewGuid().ToUpperNString();
 
             /// <summary>
             /// 最大连接数
             /// </summary>
+            [Description("最大连接数")]
             public int MaxConnectCount { get; set; } = 10000;
         }
 

+ 9 - 1
src/YSAI.Core/communication/net/tcp/client/TcpClientData.cs

@@ -1,4 +1,6 @@
-namespace YSAI.Core.communication.net.tcp.client
+using System.ComponentModel;
+
+namespace YSAI.Core.communication.net.tcp.client
 {
     public class TcpClientData
     {
@@ -10,26 +12,32 @@
             /// <summary>
             /// 服务端IP
             /// </summary>
+            [Category("基础数据")]
+            [Description("服务端Ip")]
             public string? Ip { get; set; } = "127.0.0.1";
 
             /// <summary>
             /// 服务器端口
             /// </summary>
+            [Description("服务器端口")]
             public int Port { get; set; } = 6688;
 
             /// <summary>
             /// 是否需要断开重新连接
             /// </summary>
+            [Description("是否需要断开重新连接")]
             public bool InterruptReconnection { get; set; } = true;
 
             /// <summary>
             /// 重连间隔(毫秒)
             /// </summary>
+            [Description("重连间隔(毫秒)")]
             public int ReconnectionInterval { get; set; } = 2000;
 
             /// <summary>
             /// 超时时间
             /// </summary>
+            [Description("超时时间")]
             public int Timeout { get; set; } = 1000;
         }
     }

+ 7 - 1
src/YSAI.Core/communication/net/tcp/service/TcpServiceData.cs

@@ -1,4 +1,5 @@
-using YSAI.Unility;
+using System.ComponentModel;
+using YSAI.Unility;
 
 namespace YSAI.Core.communication.net.tcp.service
 {
@@ -12,21 +13,26 @@ namespace YSAI.Core.communication.net.tcp.service
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
+            [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 
             /// <summary>
             /// IP
             /// </summary>
+            [Description("Ip")]
             public string? Ip { get; set; } = "127.0.0.1";
 
             /// <summary>
             /// 端口
             /// </summary>
+            [Description("端口")]
             public int Port { get; set; } = 6688;
 
             /// <summary>
             /// 最大连接数
             /// </summary>
+            [Description("最大连接数")]
             public int MaxNumber { get; set; } = 1000;
         }
 

+ 8 - 1
src/YSAI.Core/communication/net/udp/UdpData.cs

@@ -1,4 +1,6 @@
-namespace YSAI.Core.communication.net.udp
+using System.ComponentModel;
+
+namespace YSAI.Core.communication.net.udp
 {
     public class UdpData
     {
@@ -10,21 +12,26 @@
             /// <summary>
             /// IP
             /// </summary>
+            [Category("基础数据")]
+            [Description("Ip")]
             public string? Ip { get; set; } = "0.0.0.0";
 
             /// <summary>
             /// 端口
             /// </summary>
+            [Description("端口")]
             public int Port { get; set; } = 6688;
 
             /// <summary>
             /// 模式
             /// </summary>
+            [Description("模式")]
             public Mode Mode { get; set; } = Mode.Service;
 
             /// <summary>
             /// 广播模式
             /// </summary>
+            [Description("是否启用广播模式")]
             public bool EnableBroadcast { get; set; } = true;
         }
 

+ 8 - 1
src/YSAI.Core/communication/net/ws/client/WsClientData.cs

@@ -1,4 +1,6 @@
-namespace YSAI.Core.communication.net.ws.client
+using System.ComponentModel;
+
+namespace YSAI.Core.communication.net.ws.client
 {
     public class WsClientData
     {
@@ -10,21 +12,26 @@
             /// <summary>
             /// 主机地址
             /// </summary>
+            [Category("基础数据")]
+            [Description("主机地址")]
             public string? Host { get; set; } = "127.0.0.1:6688";
 
             /// <summary>
             /// 是否需要断开重新连接
             /// </summary>
+            [Description("是否需要断开重新连接")]
             public bool InterruptReconnection { get; set; } = true;
 
             /// <summary>
             /// 重连间隔(毫秒)
             /// </summary>
+            [Description("重连间隔(毫秒)")]
             public int ReconnectionInterval { get; set; } = 2000;
 
             /// <summary>
             /// 超时时间
             /// </summary>
+            [Description("超时时间")]
             public int Timeout { get; set; } = 1000;
         }
     }

+ 19 - 2
src/YSAI.Core/communication/net/ws/service/WsServiceData.cs

@@ -1,4 +1,5 @@
-using YSAI.Unility;
+using System.ComponentModel;
+using YSAI.Unility;
 
 namespace YSAI.Core.communication.net.ws.service
 {
@@ -12,12 +13,28 @@ namespace YSAI.Core.communication.net.ws.service
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
+            [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 
             /// <summary>
             /// 支持监控多个,注意必须带 / 结尾
             /// </summary>
-            public List<string> LocalHostArray { get; set; } = new List<string> { "http://127.0.0.1:6688/" };
+            [Description("监控地址,支持监控多个,注意必须带 / 结尾")]
+            public List<Details> LocalHostArray { get; set; } = new List<Details> { new Details() };
+        }
+
+        /// <summary>
+        /// 详情
+        /// </summary>
+        public class Details
+        {
+            /// <summary>
+            /// 地址
+            /// </summary>
+            [Category("基础数据")]
+            [Description("地址")]
+            public string Host { get; set; } = "http://127.0.0.1:6688/";
         }
 
         /// <summary>

+ 1 - 1
src/YSAI.Core/communication/net/ws/service/WsServiceOperate.cs

@@ -223,7 +223,7 @@ namespace YSAI.Core.communication.net.ws.service
                 Communication = new HttpListener();
                 foreach (var localHost in basics.LocalHostArray)
                 {
-                    Communication.Prefixes.Add(localHost);
+                    Communication.Prefixes.Add(localHost.Host);
                 }
                 Communication.Start();
                 //监控开关

+ 7 - 0
src/YSAI.Core/communication/serial/SerialData.cs

@@ -1,4 +1,5 @@
 using Newtonsoft.Json.Converters;
+using System.ComponentModel;
 using System.IO.Ports;
 using System.Text.Json.Serialization;
 
@@ -17,27 +18,33 @@ namespace YSAI.Core.communication.serial
             /// <summary>
             /// 串口号
             /// </summary>
+            [Category("基础数据")]
+            [Description("串口号")]
             public string? PortName { get; set; } = "COM1";
 
             /// <summary>
             /// 波特率
             /// </summary>
+            [Description("波特率")]
             public int BaudRate { get; set; } = 19200;
 
             /// <summary>
             /// 校验位
             /// </summary>
+            [Description("校验位")]
             [JsonConverter(typeof(StringEnumConverter))]
             public Parity ParityBit { get; set; } = Parity.Even;
 
             /// <summary>
             /// 数据位
             /// </summary>
+            [Description("数据位")]
             public int DataBit { get; set; } = 8;
 
             /// <summary>
             /// 停止位
             /// </summary>
+            [Description("停止位")]
             [JsonConverter(typeof(StringEnumConverter))]
             public StopBits StopBit { get; set; } = StopBits.One;
         }

+ 5 - 0
src/YSAI.Core/subscribe/SubscribeData.cs

@@ -18,11 +18,14 @@ namespace YSAI.Core.subscription
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
+            [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 
             /// <summary>
             /// 点位 可为空,可后期赋值
             /// </summary>
+            [Description("点位 可为空,可后期赋值")]
             public Address? Address { get; set; }
 
             /// <summary>
@@ -30,6 +33,7 @@ namespace YSAI.Core.subscription
             /// Address:请求参数;
             /// OperateResult:操作结果
             /// </summary>
+            [Description("执行方法的委托,读取方法,每个通信设备都应该存在")]
             public Func<Address, OperateResult>? Function { get; set; }
         }
 
@@ -41,6 +45,7 @@ namespace YSAI.Core.subscription
             /// <summary>
             /// 处理间隔(毫秒)
             /// </summary>
+            [Category("基础数据")]
             [Description("处理间隔")]
             [Unit("ms")]
             [Display(true, true, true, ParamStructure.dataCate.unmber)]

+ 2 - 2
src/YSAI.DAQ.Samples/YSAI.DAQ.Samples.csproj

@@ -98,8 +98,8 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="YSAI.Mqtt" Version="23.347.21444" />
-    <PackageReference Include="YSAI.Opc" Version="23.347.21444" />
+    <PackageReference Include="YSAI.Mqtt" Version="23.349.10105" />
+    <PackageReference Include="YSAI.Opc" Version="23.349.10105" />
   </ItemGroup>
 
   <ItemGroup>

+ 1 - 0
src/YSAI.DB/DBData.cs

@@ -18,6 +18,7 @@ namespace YSAI.DB
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.DB/YSAI.DB.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -21,6 +21,6 @@
     <PackageReference Include="System.Data.OracleClient" Version="1.0.8" />
     <PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
     <PackageReference Include="System.Data.SQLite" Version="1.0.118" />
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 1 - 0
src/YSAI.Kafka/KafkaData.cs

@@ -24,6 +24,7 @@ namespace YSAI.Kafka
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 1
src/YSAI.Kafka/YSAI.Kafka.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 0
src/YSAI.Mewtocol/MewtocolData.cs

@@ -21,6 +21,7 @@ namespace YSAI.Mewtocol
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.Mewtocol/YSAI.Mewtocol.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="Mewtocol.NET" Version="0.8.1" />
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 1 - 0
src/YSAI.Mitsubishi/MitsubishiData.cs

@@ -19,6 +19,7 @@ namespace YSAI.Mitsubishi
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.Mitsubishi/YSAI.Mitsubishi.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,6 +16,6 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 65 - 62
src/YSAI.Modbus/ModbusData.cs

@@ -9,70 +9,9 @@ using YSAI.Unility;
 
 namespace YSAI.Modbus
 {
+
     public class ModbusData
     {
-        /// <summary>
-        /// 只用于连续读取的返回参数
-        /// </summary>
-        public class RetValue
-        {
-            /// <summary>
-            /// 地址
-            /// </summary>
-            public string? Address { get; set; }
-            /// <summary>
-            /// 值
-            /// </summary>
-            public object? Value { get; set; }
-        }
-
-        /// <summary>
-        /// 数据类型
-        /// </summary>
-        public enum DataType
-        {
-            /// <summary>
-            /// 高位在前
-            /// </summary>
-            MSB,
-
-            /// <summary>
-            /// 低位在前
-            /// </summary>
-            LSB,
-
-            /// <summary>
-            /// 字节
-            /// </summary>
-            Hex,
-
-            /// <summary>
-            /// 二进制
-            /// </summary>
-            Binary,
-
-            /// <summary>
-            /// 有符号
-            /// </summary>
-            Signed,
-
-            /// <summary>
-            /// 值
-            /// </summary>
-            Value
-        }
-
-        /// <summary>
-        /// 协议类型
-        /// </summary>
-        public enum ProtocolType
-        {
-            Rtu,
-            Ascii,
-            Tcp,
-            Udp
-        }
-
         /// <summary>
         /// 基础数据
         /// </summary>
@@ -81,6 +20,7 @@ namespace YSAI.Modbus
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 
@@ -190,6 +130,69 @@ namespace YSAI.Modbus
             [Display(true, true, true, ParamStructure.dataCate.select)]
             public StopBits StopBit { get; set; } = StopBits.One;
         }
+        /// <summary>
+        /// 只用于连续读取的返回参数
+        /// </summary>
+        public class RetValue
+        {
+            /// <summary>
+            /// 地址
+            /// </summary>
+            public string? Address { get; set; }
+            /// <summary>
+            /// 值
+            /// </summary>
+            public object? Value { get; set; }
+        }
+
+        /// <summary>
+        /// 数据类型
+        /// </summary>
+        public enum DataType
+        {
+            /// <summary>
+            /// 高位在前
+            /// </summary>
+            MSB,
+
+            /// <summary>
+            /// 低位在前
+            /// </summary>
+            LSB,
+
+            /// <summary>
+            /// 字节
+            /// </summary>
+            Hex,
+
+            /// <summary>
+            /// 二进制
+            /// </summary>
+            Binary,
+
+            /// <summary>
+            /// 有符号
+            /// </summary>
+            Signed,
+
+            /// <summary>
+            /// 值
+            /// </summary>
+            Value
+        }
+
+        /// <summary>
+        /// 协议类型
+        /// </summary>
+        public enum ProtocolType
+        {
+            Rtu,
+            Ascii,
+            Tcp,
+            Udp
+        }
+
+
 
         /// <summary>
         /// Modbus读取类型

+ 2 - 2
src/YSAI.Modbus/YSAI.Modbus.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -18,6 +18,6 @@
   <ItemGroup>
     <PackageReference Include="NModbus" Version="3.0.81" />
     <PackageReference Include="NModbus.Serial" Version="3.0.81" />
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 1 - 1
src/YSAI.Mqtt/YSAI.Mqtt.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 0
src/YSAI.Mqtt/client/MqttClientData.cs

@@ -21,6 +21,7 @@ namespace YSAI.Mqtt.client
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 0
src/YSAI.Mqtt/service/MqttServiceData.cs

@@ -17,6 +17,7 @@ namespace YSAI.Mqtt.service
             /// <summary>
             /// 端口
             /// </summary>
+            [Category("基础数据")]
             [Description("端口")]
             [Display(true, true, true, ParamStructure.dataCate.unmber)]
             public int Port { get; set; }

+ 1 - 0
src/YSAI.Mqtt/service/websocket/MqttWebSocketServiceData.cs

@@ -24,6 +24,7 @@ namespace YSAI.Mqtt.service.websocket
             /// <summary>
             /// MQTT服务端口
             /// </summary>
+            [Category("基础数据")]
             [Description("端口")]
             [Display(true, true, true, ParamStructure.dataCate.unmber)]
             public int Port { get; set; }

+ 1 - 0
src/YSAI.NetMQ/NetMQData.cs

@@ -16,6 +16,7 @@ namespace YSAI.NetMQ
             /// 客户端;
             /// 当订阅地址与发布地址一致时,此实例又是服务端又是客户端
             /// </summary>
+            [Category("基础数据")]
             [Description("订阅地址")]
             [Display(true, true, false, ParamStructure.dataCate.text)]
             public string? SAddress { get; set; } = "tcp://127.0.0.1:8866";

+ 1 - 1
src/YSAI.NetMQ/YSAI.NetMQ.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 1
src/YSAI.Netty/YSAI.Netty.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 0
src/YSAI.Netty/client/NettyClientData.cs

@@ -15,6 +15,7 @@ namespace YSAI.Netty.client
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 0
src/YSAI.Netty/service/NettyServiceData.cs

@@ -15,6 +15,7 @@ namespace YSAI.Netty.service
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 0
src/YSAI.Omron/OmronData.cs

@@ -22,6 +22,7 @@ namespace YSAI.Omron
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.Omron/YSAI.Omron.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,6 +16,6 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Opc/YSAI.Opc.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="OPCFoundation.NetStandard.Opc.Ua" Version="1.4.372.76" />
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 1 - 0
src/YSAI.Opc/da/client/OpcDaClientData.cs

@@ -20,6 +20,7 @@ namespace YSAI.Opc.da.client
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 0
src/YSAI.Opc/da/http/OpcDaHttpData.cs

@@ -21,6 +21,7 @@ namespace YSAI.Opc.da.http
             /// <summary>
             /// 唯一标识
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 0
src/YSAI.Opc/ua/client/OpcUaClientData.cs

@@ -18,6 +18,7 @@ namespace YSAI.Opc.ua.client
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 0
src/YSAI.Opc/ua/service/OpcUaServiceData.cs

@@ -17,6 +17,7 @@ namespace YSAI.Opc.ua.service
             /// <summary>
             /// 是否应该接受和抑制为证书报告的当前错误
             /// </summary>
+            [Category("基础数据")]
             [Description("是否应该接受和抑制为证书报告的当前错误")]
             [Display(true, true, true, ParamStructure.dataCate.radio)]
             public bool AutoAccept { get; set; }

+ 1 - 1
src/YSAI.RPC.Client.Samples/Program.cs

@@ -12,7 +12,7 @@ RpcClient rpcClient = RpcClient.Instance(new YSAI.Rpc.data.Client.Basics
     Password = "ysai",
     UserName = "ysai",
     ISn = "RPC1",
-    INs = new List<string> { "IHello" },
+    INs = new List<YSAI.Rpc.data.Details> { new YSAI.Rpc.data.Details() { INames = "IHello" } },
 });
 
 LogHelper.Info(rpcClient.Open().ToJson().JsonFormatting());

+ 1 - 1
src/YSAI.RPC.Client.Samples/YSAI.RPC.Client.Samples.csproj

@@ -8,7 +8,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="YSAI.Rpc" Version="23.347.21444" />
+    <PackageReference Include="YSAI.Rpc" Version="23.349.20309" />
   </ItemGroup>
 
 </Project>

+ 1 - 1
src/YSAI.RPC.Service.Samples/Program.cs

@@ -13,7 +13,7 @@ RpcService rpvService = RpcService.Instance(new YSAI.Rpc.data.Service.Basics
                 {
                     new YSAI.Rpc.data.Service.Info
                     {
-                        INs=new List<string>{ "IHello" },
+                        INs=new List<YSAI.Rpc.data.Details>{ new YSAI.Rpc.data.Details() { INames = "IHello" }},
                         ISn="RPC1"
                     }
                 }

+ 1 - 1
src/YSAI.RPC.Service.Samples/YSAI.RPC.Service.Samples.csproj

@@ -7,6 +7,6 @@
     <Nullable>enable</Nullable>
   </PropertyGroup>
 	<ItemGroup>
-		<PackageReference Include="YSAI.Rpc" Version="23.347.21444" />
+		<PackageReference Include="YSAI.Rpc" Version="23.349.20309" />
 	</ItemGroup>
 </Project>

+ 1 - 0
src/YSAI.RabbitMQ/RabbitMQData.cs

@@ -18,6 +18,7 @@ namespace YSAI.RabbitMQ
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 1 - 1
src/YSAI.RabbitMQ/YSAI.RabbitMQ.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 1
src/YSAI.Redis.Samples/YSAI.Redis.Samples.csproj

@@ -58,7 +58,7 @@
   </ItemGroup>
 
   <ItemGroup>
-    <PackageReference Include="YSAI.Redis" Version="23.347.21444" />
+    <PackageReference Include="YSAI.Redis" Version="23.349.24377" />
   </ItemGroup>
 
 </Project>

+ 8 - 6
src/YSAI.Redis/RedisData.cs

@@ -1,4 +1,5 @@
-using YSAI.Model.@interface;
+using System.ComponentModel;
+using YSAI.Model.@interface;
 
 namespace YSAI.Redis
 {
@@ -16,22 +17,23 @@ namespace YSAI.Redis
             /// <summary>
             /// 标识 前缀
             /// </summary>
+            [Category("基础数据")]
+            [Description("标识,前缀")]
             public string TAG { get; set; } = "S:";
             /// <summary>
-            /// 使用标识前缀
-            /// </summary>
-            public bool UseTAG { get; set; } = true;
-            /// <summary>
             /// 连接字符串
             /// </summary>
-            public string CStr { get; set; }
+            [Description("连接字符串")]
+            public string? CStr { get; set; }
             /// <summary>
             /// 选择的数据
             /// </summary>
+            [Description("选择的数据")]
             public int DBI { get; set; } = 0;
             /// <summary>
             /// 有效时间 ms
             /// </summary>
+            [Description("有效时间(ms)")]
             public int Expiry { get; set; } = 86400000;
         }
     }

+ 75 - 74
src/YSAI.Redis/RedisOperate.cs

@@ -260,7 +260,8 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.StringSet(basics.UseTAG ? GTAG(key) : key, value, new TimeSpan(0, 0, 0, 0, basics.Expiry));
+
+                return db.StringSet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value, new TimeSpan(0, 0, 0, 0, basics.Expiry));
             }
             else
             {
@@ -277,7 +278,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.StringGet(basics.UseTAG ? GTAG(key) : key);
+                return db.StringGet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -294,7 +295,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.StringSet(keyValuePairs.Select(x => new KeyValuePair<RedisKey, RedisValue>(basics.UseTAG ? GTAG(x.Key) : x.Key, x.Value)).ToArray());
+                return db.StringSet(keyValuePairs.Select(x => new KeyValuePair<RedisKey, RedisValue>(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(x.Key) : x.Key, x.Value)).ToArray());
             }
             else
             {
@@ -312,7 +313,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.StringSet(basics.UseTAG ? GTAG(key) : key, value?.ToJson(), new TimeSpan(0, 0, 0, 0, basics.Expiry));
+                return db.StringSet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value?.ToJson(), new TimeSpan(0, 0, 0, 0, basics.Expiry));
             }
             else
             {
@@ -329,7 +330,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(db.StringGet(basics.UseTAG ? GTAG(key) : key));
+                return JsonTool.StringToJsonEntity<T>(db.StringGet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -347,7 +348,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.StringSetAsync(basics.UseTAG ? GTAG(key) : key, value, new TimeSpan(0, 0, 0, 0, basics.Expiry));
+                return await db.StringSetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value, new TimeSpan(0, 0, 0, 0, basics.Expiry));
             }
             else
             {
@@ -365,7 +366,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.StringGetAsync(basics.UseTAG ? GTAG(key) : key);
+                return await db.StringGetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -382,7 +383,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.StringSetAsync(keyValuePairs.Select(x => new KeyValuePair<RedisKey, RedisValue>(basics.UseTAG ? GTAG(x.Key) : x.Key, x.Value)).ToArray());
+                return db.StringSetAsync(keyValuePairs.Select(x => new KeyValuePair<RedisKey, RedisValue>(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(x.Key) : x.Key, x.Value)).ToArray());
             }
             return Task.Run(() => false);
         }
@@ -397,7 +398,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.StringSetAsync(basics.UseTAG ? GTAG(key) : key, value?.ToJson(), new TimeSpan(0, 0, 0, 0, basics.Expiry));
+                return await db.StringSetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value?.ToJson(), new TimeSpan(0, 0, 0, 0, basics.Expiry));
             }
             else
             {
@@ -414,7 +415,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(await db.StringGetAsync(basics.UseTAG ? GTAG(key) : key));
+                return JsonTool.StringToJsonEntity<T>(await db.StringGetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -435,7 +436,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListLeftPop(basics.UseTAG ? GTAG(key) : key);
+                return db.ListLeftPop(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -452,7 +453,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListRightPop(basics.UseTAG ? GTAG(key) : key);
+                return db.ListRightPop(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -470,7 +471,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListRemove(basics.UseTAG ? GTAG(key) : key, value);
+                return db.ListRemove(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value);
             }
             else
             {
@@ -488,7 +489,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListRightPush(basics.UseTAG ? GTAG(key) : key, value);
+                return db.ListRightPush(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value);
             }
             else
             {
@@ -506,7 +507,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListLeftPush(basics.UseTAG ? GTAG(key) : key, value);
+                return db.ListLeftPush(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value);
             }
             else
             {
@@ -523,7 +524,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListLength(basics.UseTAG ? GTAG(key) : key);
+                return db.ListLength(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -542,7 +543,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(db.ListRange(basics.UseTAG ? GTAG(key) : key, start, stop));
+                return ConvertStrings(db.ListRange(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, start, stop));
             }
             else
             {
@@ -559,7 +560,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(db.ListLeftPop(basics.UseTAG ? GTAG(key) : key));
+                return JsonTool.StringToJsonEntity<T>(db.ListLeftPop(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -576,7 +577,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(db.ListRightPop(basics.UseTAG ? GTAG(key) : key));
+                return JsonTool.StringToJsonEntity<T>(db.ListRightPop(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -594,7 +595,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListRightPush(basics.UseTAG ? GTAG(key) : key, value?.ToJson());
+                return db.ListRightPush(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value?.ToJson());
             }
             else
             {
@@ -612,7 +613,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListLeftPush(basics.UseTAG ? GTAG(key) : key, value?.ToJson());
+                return db.ListLeftPush(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value?.ToJson());
             }
             else
             {
@@ -629,7 +630,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListLeftPopAsync(basics.UseTAG ? GTAG(key) : key);
+                return await db.ListLeftPopAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -646,7 +647,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListRightPopAsync(basics.UseTAG ? GTAG(key) : key);
+                return await db.ListRightPopAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -664,7 +665,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListRemoveAsync(basics.UseTAG ? GTAG(key) : key, value);
+                return await db.ListRemoveAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value);
             }
             else
             {
@@ -682,7 +683,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListRightPushAsync(basics.UseTAG ? GTAG(key) : key, value);
+                return await db.ListRightPushAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value);
             }
             else
             {
@@ -700,7 +701,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListLeftPushAsync(basics.UseTAG ? GTAG(key) : key, value);
+                return await db.ListLeftPushAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value);
             }
             else
             {
@@ -717,7 +718,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListLengthAsync(basics.UseTAG ? GTAG(key) : key);
+                return await db.ListLengthAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -736,7 +737,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.ListRangeAsync(basics.UseTAG ? GTAG(key) : key, start, stop).Result.Select(x => x.ToString());
+                return db.ListRangeAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, start, stop).Result.Select(x => x.ToString());
             }
             else
             {
@@ -753,7 +754,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(await db.ListLeftPopAsync(basics.UseTAG ? GTAG(key) : key));
+                return JsonTool.StringToJsonEntity<T>(await db.ListLeftPopAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -770,7 +771,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(await db.ListRightPopAsync(basics.UseTAG ? GTAG(key) : key));
+                return JsonTool.StringToJsonEntity<T>(await db.ListRightPopAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -788,7 +789,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListRightPushAsync(basics.UseTAG ? GTAG(key) : key, value?.ToJson());
+                return await db.ListRightPushAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value?.ToJson());
             }
             else
             {
@@ -806,7 +807,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.ListLeftPushAsync(basics.UseTAG ? GTAG(key) : key, value.ToJson());
+                return await db.ListLeftPushAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, value.ToJson());
             }
             else
             {
@@ -828,7 +829,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.HashExists(basics.UseTAG ? GTAG(key) : key, hashField);
+                return db.HashExists(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField);
             }
             else
             {
@@ -846,7 +847,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.HashDelete(basics.UseTAG ? GTAG(key) : key, hashField);
+                return db.HashDelete(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField);
             }
             else
             {
@@ -864,7 +865,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.HashDelete(basics.UseTAG ? GTAG(key) : key, hashFields.Select(x => (RedisValue)x).ToArray());
+                return db.HashDelete(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashFields.Select(x => (RedisValue)x).ToArray());
             }
             else
             {
@@ -883,7 +884,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.HashSet(basics.UseTAG ? GTAG(key) : key, hashField, value);
+                return db.HashSet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField, value);
             }
             else
             {
@@ -900,7 +901,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                db.HashSet(basics.UseTAG ? GTAG(key) : key, hashFields.Select(x => new HashEntry(x.Key, x.Value)).ToArray());
+                db.HashSet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashFields.Select(x => new HashEntry(x.Key, x.Value)).ToArray());
             }
         }
 
@@ -914,7 +915,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.HashGet(basics.UseTAG ? GTAG(key) : key, hashField);
+                return db.HashGet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField);
             }
             else
             {
@@ -932,7 +933,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(db.HashGet(basics.UseTAG ? GTAG(key) : key, hashFields.Select(x => (RedisValue)x).ToArray()));
+                return ConvertStrings(db.HashGet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashFields.Select(x => (RedisValue)x).ToArray()));
             }
             else
             {
@@ -949,7 +950,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(db.HashKeys(basics.UseTAG ? GTAG(key) : key));
+                return ConvertStrings(db.HashKeys(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -966,7 +967,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(db.HashValues(basics.UseTAG ? GTAG(key) : key));
+                return ConvertStrings(db.HashValues(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -985,7 +986,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.HashSet(basics.UseTAG ? GTAG(key) : key, hashField, value?.ToJson());
+                return db.HashSet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField, value?.ToJson());
             }
             else
             {
@@ -1003,7 +1004,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(db.HashGet(basics.UseTAG ? GTAG(key) : key, hashField));
+                return JsonTool.StringToJsonEntity<T>(db.HashGet(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField));
             }
             else
             {
@@ -1021,7 +1022,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.HashExistsAsync(basics.UseTAG ? GTAG(key) : key, hashField);
+                return await db.HashExistsAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField);
             }
             else
             {
@@ -1039,7 +1040,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.HashDeleteAsync(basics.UseTAG ? GTAG(key) : key, hashField);
+                return await db.HashDeleteAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField);
             }
             else
             {
@@ -1059,7 +1060,7 @@ namespace YSAI.Redis
             {
                 var fields = hashFields.Select(x => (RedisValue)x);
 
-                return await db.HashDeleteAsync(basics.UseTAG ? GTAG(key) : key, fields.ToArray());
+                return await db.HashDeleteAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, fields.ToArray());
             }
             else
             {
@@ -1078,7 +1079,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.HashSetAsync(basics.UseTAG ? GTAG(key) : key, hashField, value);
+                return await db.HashSetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField, value);
             }
             else
             {
@@ -1095,7 +1096,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                await db.HashSetAsync(basics.UseTAG ? GTAG(key) : key, hashFields.Select(x => new HashEntry(x.Key, x.Value)).ToArray());
+                await db.HashSetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashFields.Select(x => new HashEntry(x.Key, x.Value)).ToArray());
             }
             else
             {
@@ -1113,7 +1114,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.HashGetAsync(basics.UseTAG ? GTAG(key) : key, hashField);
+                return await db.HashGetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField);
             }
             else
             {
@@ -1132,7 +1133,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(await db.HashGetAsync(basics.UseTAG ? GTAG(key) : key, hashFields.Select(x => (RedisValue)x).ToArray()));
+                return ConvertStrings(await db.HashGetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashFields.Select(x => (RedisValue)x).ToArray()));
             }
             else
             {
@@ -1149,7 +1150,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(await db.HashKeysAsync(basics.UseTAG ? GTAG(key) : key));
+                return ConvertStrings(await db.HashKeysAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -1166,7 +1167,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(await db.HashValuesAsync(basics.UseTAG ? GTAG(key) : key));
+                return ConvertStrings(await db.HashValuesAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -1186,7 +1187,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.HashSetAsync(basics.UseTAG ? GTAG(key) : key, hashField, value?.ToJson());
+                return await db.HashSetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField, value?.ToJson());
             }
             else
             {
@@ -1204,7 +1205,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return JsonTool.StringToJsonEntity<T>(db.HashGetAsync(basics.UseTAG ? GTAG(key) : key, hashField).Result);
+                return JsonTool.StringToJsonEntity<T>(db.HashGetAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, hashField).Result);
             }
             else
             {
@@ -1227,7 +1228,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.SortedSetAdd(basics.UseTAG ? GTAG(key) : key, member, score);
+                return db.SortedSetAdd(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, member, score);
             }
             else
             {
@@ -1247,7 +1248,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.SortedSetRangeByRank(basics.UseTAG ? GTAG(key) : key, start, stop, (Order)order).Select(x => x.ToString());
+                return db.SortedSetRangeByRank(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, start, stop, (Order)order).Select(x => x.ToString());
             }
             else
             {
@@ -1264,7 +1265,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.SortedSetLength(basics.UseTAG ? GTAG(key) : key);
+                return db.SortedSetLength(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -1282,7 +1283,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.SortedSetRemove(basics.UseTAG ? GTAG(key) : key, memebr);
+                return db.SortedSetRemove(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, memebr);
             }
             else
             {
@@ -1301,7 +1302,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.SortedSetAdd(basics.UseTAG ? GTAG(key) : key, member?.ToJson(), score);
+                return db.SortedSetAdd(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, member?.ToJson(), score);
             }
             else
             {
@@ -1320,7 +1321,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.SortedSetIncrement(basics.UseTAG ? GTAG(key) : key, member, value);
+                return db.SortedSetIncrement(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, member, value);
             }
             else
             {
@@ -1338,7 +1339,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.SortedSetAddAsync(basics.UseTAG ? GTAG(key) : key, member, score);
+                return await db.SortedSetAddAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, member, score);
             }
             else
             {
@@ -1355,7 +1356,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return ConvertStrings(await db.SortedSetRangeByRankAsync(basics.UseTAG ? GTAG(key) : key));
+                return ConvertStrings(await db.SortedSetRangeByRankAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key));
             }
             else
             {
@@ -1372,7 +1373,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.SortedSetLengthAsync(basics.UseTAG ? GTAG(key) : key);
+                return await db.SortedSetLengthAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -1390,7 +1391,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.SortedSetRemoveAsync(basics.UseTAG ? GTAG(key) : key, memebr);
+                return await db.SortedSetRemoveAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, memebr);
             }
             else
             {
@@ -1409,7 +1410,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.SortedSetAddAsync(basics.UseTAG ? GTAG(key) : key, member?.ToJson(), score);
+                return await db.SortedSetAddAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, member?.ToJson(), score);
             }
             else
             {
@@ -1428,7 +1429,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.SortedSetIncrementAsync(basics.UseTAG ? GTAG(key) : key, member, value);
+                return await db.SortedSetIncrementAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, member, value);
             }
             else
             {
@@ -1456,7 +1457,7 @@ namespace YSAI.Redis
         /// <returns>返回结果(true:表示成功)</returns>
         public bool KeyDelete(string key)
         {
-            key = basics.UseTAG ? GTAG(key) : key;
+            key = !string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key;
 
             if (GetStatus().State)
             {
@@ -1506,7 +1507,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.KeyExists(basics.UseTAG ? GTAG(key) : key);
+                return db.KeyExists(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -1524,7 +1525,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.KeyRename(basics.UseTAG ? GTAG(key) : key, newKey);
+                return db.KeyRename(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, newKey);
             }
             else
             {
@@ -1542,7 +1543,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return db.KeyExpire(basics.UseTAG ? GTAG(key) : key, expiry);
+                return db.KeyExpire(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, expiry);
             }
             else
             {
@@ -1559,7 +1560,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.KeyDeleteAsync(basics.UseTAG ? GTAG(key) : key);
+                return await db.KeyDeleteAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -1593,7 +1594,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.KeyExistsAsync(basics.UseTAG ? GTAG(key) : key);
+                return await db.KeyExistsAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key);
             }
             else
             {
@@ -1611,7 +1612,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.KeyRenameAsync(basics.UseTAG ? GTAG(key) : key, newKey);
+                return await db.KeyRenameAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, newKey);
             }
             else
             {
@@ -1629,7 +1630,7 @@ namespace YSAI.Redis
         {
             if (GetStatus().State)
             {
-                return await db.KeyExpireAsync(basics.UseTAG ? GTAG(key) : key, expiry);
+                return await db.KeyExpireAsync(!string.IsNullOrWhiteSpace(basics.TAG) ? GTAG(key) : key, expiry);
             }
             else
             {

+ 1 - 1
src/YSAI.Redis/YSAI.Redis.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.24377</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 1
src/YSAI.Relay.Samples/YSAI.Relay.Samples.csproj

@@ -8,7 +8,7 @@
   </PropertyGroup>
 
   <ItemGroup>
-    <PackageReference Include="YSAI.Mqtt" Version="23.347.21444" />
+    <PackageReference Include="YSAI.Mqtt" Version="23.349.10105" />
   </ItemGroup>
 
 </Project>

+ 1 - 1
src/YSAI.Rpc/YSAI.Rpc.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.20309</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 1 - 1
src/YSAI.Rpc/data/Authentication.cs

@@ -31,6 +31,6 @@ namespace YSAI.Rpc.data
         /// <summary>
         /// 接口名称集合
         /// </summary>
-        public List<string> INs { get; set; }
+        public List<Details> INs { get; set; }
     }
 }

+ 14 - 4
src/YSAI.Rpc/data/Client.cs

@@ -1,4 +1,6 @@
-namespace YSAI.Rpc.data
+using System.ComponentModel;
+
+namespace YSAI.Rpc.data
 {
     public class Client
     {
@@ -10,33 +12,41 @@
             /// <summary>
             /// IP
             /// </summary>
+            [Category("基础数据")]
+            [Description("Ip")]
             public string Ip { get; set; } = "127.0.0.1";
             /// <summary>
             /// 端口
             /// </summary>
+            [Description("端口")]
             public int Port { get; set; } = 6688;
             /// <summary>
             /// 超时时间
             /// </summary>
+            [Description("超时时间")]
             public int TimeOut { get; set; } = 1000;
-
-
             /// <summary>
             /// 用户名
             /// </summary>
+            [Description("用户名")]
             public string UserName { get; set; } = "ysai";
             /// <summary>
             /// 密码
             /// </summary>
+            [Description("密码")]
             public string Password { get; set; } = "ysai";
             /// <summary>
             /// 唯一标识
             /// </summary>
+            [Description("唯一标识")]
             public string ISn { get; set; } = "888888";
             /// <summary>
             /// 接口名称集合
             /// </summary>
-            public List<string> INs { get; set; }
+            [Description("接口名称集合")]
+            public List<Details> INs { get; set; } = new List<Details>();
         }
+
+
     }
 }

+ 17 - 0
src/YSAI.Rpc/data/Details.cs

@@ -0,0 +1,17 @@
+using System.ComponentModel;
+
+namespace YSAI.Rpc.data
+{
+    /// <summary>
+    /// 详情
+    /// </summary>
+    public class Details
+    {
+        /// <summary>
+        /// 接口名称
+        /// </summary>
+        [Category("基础数据")]
+        [Description("接口名称")]
+        public string INames { get; set; } = "Interface Name";
+    }
+}

+ 14 - 3
src/YSAI.Rpc/data/Service.cs

@@ -1,4 +1,6 @@
-namespace YSAI.Rpc.data
+using System.ComponentModel;
+
+namespace YSAI.Rpc.data
 {
     public class Service
     {
@@ -10,26 +12,32 @@
             /// <summary>
             /// 端口
             /// </summary>
+            [Category("基础数据")]
+            [Description("端口")]
             public int Port { get; set; } = 6688;
 
             /// <summary>
             /// 超时时间
             /// </summary>
+            [Description("超时时间")]
             public int TimeOut { get; set; } = 1000;
 
             /// <summary>
             /// 用户名
             /// </summary>
+            [Description("用户名")]
             public string UserName { get; set; } = "ysai";
             /// <summary>
             /// 密码
             /// </summary>
+            [Description("密码")]
             public string Password { get; set; } = "ysai";
 
             /// <summary>
             /// 信息
             /// </summary>
-            public List<Info> Infos { get; set; }
+            [Description("信息")]
+            public List<Info> Infos { get; set; } = new List<Info>();
         }
         /// <summary>
         /// 用户信息
@@ -39,11 +47,14 @@
             /// <summary>
             /// 唯一标识
             /// </summary>
+            [Category("基础数据")]
+            [Description("唯一标识")]
             public string ISn { get; set; } = "888888";
             /// <summary>
             /// 接口名称集合
             /// </summary>
-            public List<string> INs { get; set; }
+            [Description("接口名称集合")]
+            public List<Details> INs { get; set; } = new List<Details>();
         }
     }
 }

+ 2 - 2
src/YSAI.Rpc/service/RpcService.cs

@@ -110,7 +110,7 @@ namespace YSAI.Rpc.service
         /// 客户端信息
         /// 接口名,通道
         /// </summary>
-        public ConcurrentDictionary<List<string>, IChannel> clients = new ConcurrentDictionary<List<string>, IChannel>();
+        public ConcurrentDictionary<List<Details>, IChannel> clients = new ConcurrentDictionary<List<Details>, IChannel>();
         /// <summary>
         /// 任务等待
         /// </summary>
@@ -188,7 +188,7 @@ namespace YSAI.Rpc.service
             else
             {
                 //通过接口名检索到使用哪个通道
-                IChannel channel = clients.FirstOrDefault(c => c.Key.Contains(typeof(T).Name)).Value;
+                IChannel channel = clients.FirstOrDefault(c => c.Key.Contains(c.Key.FirstOrDefault(x => x.INames.Equals(typeof(T).Name)))).Value;
 
                 Proxy proxy = Proxy.Instance(new ProxyData.Basics
                 {

+ 1 - 0
src/YSAI.Siemens/SiemensData.cs

@@ -18,6 +18,7 @@ namespace YSAI.Siemens
             /// <summary>
             /// 唯一标识符
             /// </summary>
+            [Category("基础数据")]
             [Description("唯一标识符")]
             public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
 

+ 2 - 2
src/YSAI.Siemens/YSAI.Siemens.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.347.21444</Version>
+    <Version>23.349.10105</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="S7netplus" Version="0.20.0" />
-    <PackageReference Include="YSAI.Core" Version="23.347.21128" />
+    <PackageReference Include="YSAI.Core" Version="23.349.9636" />
   </ItemGroup>
 </Project>

+ 1 - 4
src/YSAI.Tool.Wpf/Main.xaml

@@ -15,8 +15,6 @@
         <Grid.Resources>
             <ResourceDictionary>
                 <ResourceDictionary.MergedDictionaries>
-                    <!--<ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Theme/Light.xaml" />
-                <ResourceDictionary Source="pack://application:,,,/Wpf.Ui;component/Resources/Wpf.Ui.xaml" />-->
                     <ui:ThemesDictionary Theme="Dark"/>
                     <ui:ControlsDictionary />
                 </ResourceDictionary.MergedDictionaries>
@@ -25,11 +23,10 @@
         <ui:NavigationView 
     MenuItemsSource="{Binding MenuItemsSource}" 
     FooterMenuItemsSource="{Binding FooterMenuItemsSource}" 
-    PaneTitle="Menu" 
     IsBackButtonVisible="Visible"
     IsPaneToggleVisible="True">
             <ui:NavigationView.AutoSuggestBox>
-                <ui:AutoSuggestBox PlaceholderText=" 搜索">
+                <ui:AutoSuggestBox PlaceholderText=" 搜索" >
                     <ui:AutoSuggestBox.Icon>
                         <ui:IconSourceElement>
                             <ui:SymbolIconSource Symbol="Search24" />

+ 15 - 14
src/YSAI.Tool.Wpf/YSAI.Tool.Wpf.csproj

@@ -17,20 +17,21 @@
 		<PackageReference Include="PropertyTools.Wpf" Version="3.1.0" />
 		<PackageReference Include="WPF-UI" Version="3.0.0-preview.13" />
 		<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2210.55" />
-		<PackageReference Include="YSAI.AllenBradley" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Beckhoff" Version="23.347.21444" />
-		<PackageReference Include="YSAI.DB" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Kafka" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Mewtocol" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Mitsubishi" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Modbus" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Mqtt" Version="23.347.21444" />
-		<PackageReference Include="YSAI.NetMQ" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Netty" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Omron" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Opc" Version="23.347.21444" />
-		<PackageReference Include="YSAI.RabbitMQ" Version="23.347.21444" />
-		<PackageReference Include="YSAI.Siemens" Version="23.347.21444" />
+		<PackageReference Include="YSAI.AllenBradley" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Beckhoff" Version="23.349.10105" />
+		<PackageReference Include="YSAI.DB" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Kafka" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Mewtocol" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Mitsubishi" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Modbus" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Mqtt" Version="23.349.10105" />
+		<PackageReference Include="YSAI.NetMQ" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Netty" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Omron" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Opc" Version="23.349.10105" />
+		<PackageReference Include="YSAI.RabbitMQ" Version="23.349.10105" />
+		<PackageReference Include="YSAI.Redis" Version="23.349.24377" />
+		<PackageReference Include="YSAI.Siemens" Version="23.349.10105" />
 	</ItemGroup>
 	<ItemGroup>
 		<ProjectReference Include="..\YSAI.Core.Wpf\YSAI.Core.Wpf.csproj" />

+ 126 - 0
src/YSAI.Tool.Wpf/controllers/UdpController.cs

@@ -1,6 +1,8 @@
 using System.Collections.ObjectModel;
+using System.IO;
 using System.Net;
 using System.Text;
+using System.Windows.Input;
 using YSAI.Core.communication.net.udp;
 using YSAI.Core.Wpf;
 using YSAI.Core.Wpf.mvvm;
@@ -24,8 +26,132 @@ namespace YSAI.Tool.Wpf.controllers
             DataList.Add(new ComboBoxData() { Name = "127.0.0.1" });
             //设置初始语言
             LangsHelper.SetLangs(LangsHelper.GetLangs());
+
+            //初始化基础数据
+            BasicsData = new Basics();
+            //工具标题
+            ToolTitle = "Udp 工具";
+            //配置文件名
+            FileName = "UdpData";
+        }
+
+        #region 统一需要的数据
+        /// <summary>
+        /// 导出的文件名
+        /// </summary>
+        private string FileName { get; set; }
+        /// <summary>
+        /// 工具标题
+        /// </summary>
+        public string ToolTitle
+        {
+            get => GetProperty(() => ToolTitle);
+            set => SetProperty(() => ToolTitle, value);
+        }
+        /// <summary>
+        /// 数据源
+        /// </summary>
+        public Basics BasicsData
+        {
+            get => GetProperty(() => BasicsData);
+            set => SetProperty(() => BasicsData, value);
+        }
+
+        /// <summary>
+        /// 导入基础数据命令
+        /// </summary>
+        public ICommand IncBasics { get => new CommandX(OnIncBasics); }
+        /// <summary>
+        /// 导入基础数据
+        /// </summary>
+        public void OnIncBasics()
+        {
+            (string RetFilePath, string RetFileName) Data = Unility.Windows.FileTool.SelectFiles("json");
+            if (!string.IsNullOrEmpty(Data.RetFilePath))
+            {
+                Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
+                if (BasicsData == null)
+                {
+                    Output("导入失败");
+                }
+                else
+                {
+                    Output("导入成功");
+                    BasicsData = basics;
+                }
+            }
+        }
+        /// <summary>
+        /// 导出基础数据命令
+        /// </summary>
+        public ICommand ExpBasics { get => new CommandX(OnExpBasics); }
+        /// <summary>
+        /// 导出基础数据
+        /// </summary>
+        public void OnExpBasics()
+        {
+            string path = Unility.Windows.FileTool.SelectFolder();
+            if (!string.IsNullOrEmpty(path))
+            {
+                FileTool.StringToFile(Path.Combine(path, $"{FileName}[{DateTime.Now.ToString("yyyyMMddHHmmss")}].json"), BasicsData.ToJson());
+                Output("导出成功");
+            }
+        }
+
+
+        /// <summary>
+        /// 信息
+        /// </summary>
+        public string Info
+        {
+            get => GetProperty(() => Info);
+            set => SetProperty(() => Info, value);
+        }
+
+        /// <summary>
+        /// 信息框事件
+        /// </summary>
+        public ICommand Info_TextChanged { get => new CommandX<System.Windows.Controls.TextChangedEventArgs>(OnInfo_TextChanged); }
+
+        /// <summary>
+        /// 信息框事件
+        /// 让滚动条一直处在最下方
+        /// </summary>
+        public void OnInfo_TextChanged(System.Windows.Controls.TextChangedEventArgs e)
+        {
+            System.Windows.Controls.TextBox textBox = (System.Windows.Controls.TextBox)e.Source;
+            textBox.SelectionStart = textBox.Text.Length;
+            textBox.SelectionLength = 0;
+            textBox.ScrollToEnd();
         }
 
+        /// <summary>
+        /// 输出标准消息
+        /// </summary>
+        /// <param name="Data">数据</param>
+        /// <param name="IsDate">需要时间</param>
+        private void Output(string Data, bool IsDate = true)
+        {
+            System.Windows.Application.Current?.Dispatcher.Invoke(delegate ()
+            {
+                if (Info?.Length > 5000)
+                {
+                    Info = string.Empty;
+                }
+                if (IsDate)
+                {
+                    Info += $" {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")} : {Data}\r\n";
+                }
+                else
+                {
+                    Info += $"{Data}\r\n";
+                }
+            });
+        }
+
+        #endregion 统一需要的数据
+
+
         /// <summary>
         /// 下拉框设备数据
         /// </summary>

+ 227 - 71
src/YSAI.Tool.Wpf/test.xaml

@@ -4,82 +4,238 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:c="clr-namespace:YSAI.Tool.Wpf"
-             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
-             xmlns:mvvm="clr-namespace:YSAI.Core.Wpf.mvvm;assembly=YSAI.Core.Wpf"
+             xmlns:btn="clr-namespace:YSAI.Core.Wpf.controls.button;assembly=YSAI.Core.Wpf"
              xmlns:pt="http://propertytools.org/wpf"
              xmlns:helpers="clr-namespace:YSAI.Core.Wpf.style;assembly=YSAI.Core.Wpf"
-             xmlns:btn="clr-namespace:YSAI.Core.Wpf.controls.button;assembly=YSAI.Core.Wpf" Width="700" Height="700">
+             xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters;assembly=YSAI.Core.Wpf"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:mvvm="clr-namespace:YSAI.Core.Wpf.mvvm;assembly=YSAI.Core.Wpf"
+             Background="{DynamicResource ContentBackgroundPicture}" >
     <!--加载控制器-->
     <UserControl.DataContext>
         <c:testC />
     </UserControl.DataContext>
+    <!--资源加载-->
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <cs:CheckConverter x:Key="CheckConverter" />
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ComboBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Button.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_DataGrid.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Border.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TbaControl.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ScrollViewer.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_GroupBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TextBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TreeDataGrid.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_CheckBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_RadioButton.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ContextMenu.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Border Background="#F0F2F0" Width="auto" Height="auto" CornerRadius="{DynamicResource WindowCornerRadius}" Margin="100">
+        <GroupBox Style="{StaticResource GroupBoxTab}" Margin="0"  >
+            <GroupBox.Header>
+                <StackPanel Orientation="Horizontal">
+                    <Grid Background="Transparent">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Tool}" Width="14" />
+                        <TextBlock Text="{Binding ToolTitle}" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                    </Grid>
+                </StackPanel>
+            </GroupBox.Header>
+            <!--基础数据与功能区域-->
+            <Grid >
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="auto"/>
+                    <ColumnDefinition Width="*"/>
+                </Grid.ColumnDefinitions>
+                <!--基础数据-->
+                <Grid Grid.Column="0" Margin="0,0,5,0" Width="500">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="auto"/>
+                        <RowDefinition Height="*"/>
+                    </Grid.RowDefinitions>
+
+                    <!--属性表格-->
+                    <Grid Grid.Row="0">
+                        <Grid.Resources>
+                            <ResourceDictionary>
+                                <Style TargetType="{x:Type Label}" >
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                    <Setter Property="HorizontalAlignment" Value="Left"/>
+                                </Style>
+                                <Style TargetType="ToolTip">
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                    <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
+                                </Style>
+                                <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}" >
+                                    <Setter Property="Height" Value="25"/>
+                                    <Setter Property="Background" Value="White"/>
+                                    <Setter Property="VerticalAlignment" Value="Center"/>
+                                    <Setter Property="helpers:Style_ComboBox.CornerRadius" Value="{DynamicResource WindowCornerRadius}"/>
+                                </Style>
+                                <Style TargetType="{x:Type pt:TextBoxEx}" BasedOn="{StaticResource TextBoxStyle2}">
+                                    <Setter Property="Height" Value="25"/>
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                    <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
+                                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
+                                    <Setter Property="VerticalContentAlignment" Value="Center"/>
+                                </Style>
+
+                                <Style TargetType="CheckBox" BasedOn="{StaticResource CheckBoxStyle}"/>
+
+                                <Style TargetType="ContentControl" >
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                </Style>
+
+                                <Style TargetType="Expander">
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                </Style>
+
+                                <Style TargetType="RadioButton" BasedOn="{StaticResource RadioButtonStyle}"/>
+
+
+                                <Style TargetType="GroupBox" BasedOn="{StaticResource GroupBoxTab}"/>
+
+
+                                <DataTemplate x:Key="HeaderTemplate">
+                                    <StackPanel Orientation="Horizontal">
+                                        <Grid>
+                                            <Grid.ColumnDefinitions>
+                                                <ColumnDefinition Width="auto" />
+                                                <ColumnDefinition Width="*" />
+                                            </Grid.ColumnDefinitions>
+                                            <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource ConfigBase}" Width="14" />
+                                            <TextBlock Text="{Binding}" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                        </Grid>
+                                    </StackPanel>
+                                </DataTemplate>
+
+                            </ResourceDictionary>
+                        </Grid.Resources>
+                        <pt:PropertyGrid  Margin="1,-4,1,0"
+              SelectedObject="{Binding BasicsData}"
+              TabVisibility="VisibleIfMoreThanOne" 
+              TextBlock.Foreground="{DynamicResource Font.Content.Foreground}" 
+              Foreground="{DynamicResource Font.Content.Foreground}"
+              BorderBrush="{DynamicResource Control.Border.Color}"
+              CategoryHeaderTemplate="{StaticResource HeaderTemplate}"/>
+                    </Grid>
+
+                    <!--导入导出按钮-->
+                    <Grid Grid.Row="1">
+                        <GroupBox Style="{StaticResource GroupBoxTab}"  Margin="1" VerticalAlignment="Bottom">
+                            <GroupBox.Header>
+                                <StackPanel Orientation="Horizontal">
+                                    <Grid Background="transparent">
+                                        <Grid.ColumnDefinitions>
+                                            <ColumnDefinition Width="auto" />
+                                            <ColumnDefinition Width="*" />
+                                        </Grid.ColumnDefinitions>
+                                        <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Operate}" Width="14" />
+                                        <TextBlock Text="基础数据操作" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                    </Grid>
+                                </StackPanel>
+                            </GroupBox.Header>
+                            <Grid>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="*"/>
+                                    <ColumnDefinition Width="*"/>
+                                </Grid.ColumnDefinitions>
+                                <btn:ButtonControl  
+Width="200"
+Grid.Column="0"  
+Command="{Binding IncBasics}" 
+HorizontalAlignment="Center" 
+VerticalAlignment="Center" 
+Margin="5"
+IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
+BorderBrush="{DynamicResource Control.Border.Color}"
+IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
+Foreground="{DynamicResource Font.Content.Foreground}"
+Icon="{DynamicResource Inc}"
+Content="导入基础数据"
+CornerRadius="{DynamicResource WindowCornerRadius}" />
+                                <btn:ButtonControl  
+Width="200"
+Grid.Column="1"  
+Command="{Binding ExpBasics}" 
+HorizontalAlignment="Center" 
+VerticalAlignment="Center" 
+Margin="5"
+IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
+BorderBrush="{DynamicResource Control.Border.Color}"
+IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
+Foreground="{DynamicResource Font.Content.Foreground}"
+Icon="{DynamicResource Exp}"
+Content="导出基础数据"
+CornerRadius="{DynamicResource WindowCornerRadius}" />
+                            </Grid>
+                        </GroupBox>
+                    </Grid>
+
+
+                </Grid>
+                <Grid Grid.Column="1">
+                    <Grid.RowDefinitions>
+                        <RowDefinition/>
+                        <RowDefinition/>
+                    </Grid.RowDefinitions>
+                    <!--功能模块-->
+                    <GroupBox Style="{StaticResource GroupBoxTab}" Width="auto" Margin="0" Grid.Row="0">
+                        <GroupBox.Header>
+                            <StackPanel Orientation="Horizontal">
+                                <Grid Background="transparent">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="auto" />
+                                        <ColumnDefinition Width="*" />
+                                    </Grid.ColumnDefinitions>
+                                    <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Function}" Width="14" />
+                                    <TextBlock Text="功能" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                </Grid>
+                            </StackPanel>
+                        </GroupBox.Header>
+
+
+
+                    </GroupBox>
+                    <!--信息-->
+                    <GroupBox Style="{StaticResource GroupBoxTab}" Width="auto" Margin="0,5,0,0"  Grid.Row="1">
+                        <GroupBox.Header>
+                            <StackPanel Orientation="Horizontal">
+                                <Grid Background="transparent">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="auto" />
+                                        <ColumnDefinition Width="*" />
+                                    </Grid.ColumnDefinitions>
+                                    <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Info}" Width="14" />
+                                    <TextBlock Text="信息" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                </Grid>
+                            </StackPanel>
+                        </GroupBox.Header>
+
+                        <TextBox Style="{DynamicResource TextBoxStyle2}" FontSize="13" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible"  Text="{Binding Info}" >
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="TextChanged">
+                                    <mvvm:EventCommand  Command="{Binding Info_TextChanged}" />
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </TextBox>
+
+                    </GroupBox>
+                </Grid>
+            </Grid>
+        </GroupBox>
+    </Border>
+
+
+
 
-    <Grid  Background="White">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="auto"/>
-            <RowDefinition Height="auto"/>
-        </Grid.RowDefinitions>
-        <!--属性表格-->
-        <Grid>
-            <Grid.Resources>
-                <ResourceDictionary>
-                    <ResourceDictionary.MergedDictionaries>
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ComboBox.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Button.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_DataGrid.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Border.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TbaControl.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ScrollViewer.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_GroupBox.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TextBox.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TreeDataGrid.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_CheckBox.xaml" />
-                        <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_RadioButton.xaml" />
-                    </ResourceDictionary.MergedDictionaries>
-                    <Style TargetType="{x:Type Label}" >
-                        <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
-                        <Setter Property="HorizontalAlignment" Value="Left"/>
-                    </Style>
-                    <Style TargetType="ToolTip">
-                        <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
-                        <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
-                    </Style>
-                    <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}" >
-                        <Setter Property="Height" Value="25"/>
-                        <Setter Property="Background" Value="White"/>
-                        <Setter Property="VerticalAlignment" Value="Center"/>
-                        <Setter Property="helpers:Style_ComboBox.CornerRadius" Value="{DynamicResource WindowCornerRadius}"/>
-                    </Style>
-                    <Style TargetType="{x:Type pt:TextBoxEx}" BasedOn="{StaticResource TextBoxStyle2}">
-                        <Setter Property="Height" Value="25"/>
-                        <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
-                        <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
-                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
-                        <Setter Property="VerticalContentAlignment" Value="Center"/>
-                    </Style>
-                    <Style TargetType="GroupBox" BasedOn="{StaticResource GroupBoxTab}"/>
-                    <Style TargetType="CheckBox" BasedOn="{StaticResource CheckBoxStyle}"/>
-                </ResourceDictionary>
-            </Grid.Resources>
-            <pt:PropertyGrid 
-                      SelectedObject="{Binding DataMode}"
-                      TabVisibility="VisibleIfMoreThanOne" 
-                      TextBlock.Foreground="{DynamicResource Font.Content.Foreground}" 
-                      Foreground="{DynamicResource Font.Content.Foreground}"
-                      BorderBrush="{DynamicResource Control.Border.Color}"
-                      CategoryControlType="GroupBox"/>
-        </Grid>
-
-        <btn:ButtonControl  Grid.Row="1"  Width="80"  Command="{Binding Start}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"
-                     IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
-                     BorderBrush="{DynamicResource Control.Border.Color}"
-                     IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
-                     Foreground="{DynamicResource Font.Content.Foreground}"
-                     Icon="{DynamicResource Start}"
-                     Content="测试"
-                     CornerRadius="{DynamicResource WindowCornerRadius}" />
-    </Grid>
-    
-    
-   
 </UserControl>

+ 114 - 134
src/YSAI.Tool.Wpf/testC.cs

@@ -1,156 +1,136 @@
-using System.ComponentModel;
+using System.IO;
 using System.Windows.Input;
 using YSAI.Core.Wpf.mvvm;
 using YSAI.Unility;
-
+using static YSAI.Opc.ua.client.OpcUaClientData;
 namespace YSAI.Tool.Wpf
 {
-    public class Basics
-    {
-        //
-        // 摘要:
-        //     唯一标识符
-        [Category("基础数据")]
-        [Description("唯一标识符")]
-        public string? SN { get; set; } = Guid.NewGuid().ToUpperNString();
-
-
-        //
-        // 摘要:
-        //     用户名
-        [Description("用户名")]
-        public string? UserName { get; set; }
-
-        //
-        // 摘要:
-        //     密码
-        [Description("密码")]
-        public string? Password { get; set; }
-
-        //
-        // 摘要:
-        //     证书路径
-        [Description("证书路径")]
-        public string? Cer { get; set; }
-
-        //
-        // 摘要:
-        //     密钥
-        [Description("密钥")]
-        public string? SecreKey { get; set; }
-
-        //
-        // 摘要:
-        //     服务地址
-        [Description("服务地址")]
-        public string? ServerUrl { get; set; }
-
-        //
-        // 摘要:
-        //     客户端名称(唯一)
-        [Description("客户端名称")]
-        public string? CustomName { get; set; } = Guid.NewGuid().ToLowerNString();
-
-
-        //
-        // 摘要:
-        //     超时时间
-        [Description("超时时间")]
-        public int Timeout { get; set; } = 5000;
-
-
-        //
-        // 摘要:
-        //     是否需要断开重新连接
-        [Description("是否需要断开重新连接")]
-        public bool InterruptReconnection { get; set; } = true;
-
-
-        //
-        // 摘要:
-        //     重连间隔(毫秒)
-        [Description("重连间隔")]
-        public int ReconnectionInterval { get; set; } = 2000;
-
-
-        //
-        // 摘要:
-        //     取样时间间隔
-        [Description("取样时间间隔")]
-        public int SamplingInterval { get; set; } = 100;
-
-
-        //
-        // 摘要:
-        //     发布时间间隔
-        [Description("发布时间间隔")]
-        public int PublishingInterval { get; set; } = 1000;
-
-
-        //
-        // 摘要:
-        //     保活计数, 如果到发布周期但没有新数据,服务端会跳过但保活次数定义了最多可以跳过多少次,之后哪怕是空消息也要发给客户端,告诉客户的订阅仍然有效,但没数据
-        [Description("保活计数")]
-        public int KeepAliveCount { get; set; } = 261120;
-
-
-        //
-        // 摘要:
-        //     寿命计数, 客户端有责任向服务端发送订阅请求,然后服务端才能发送数据变更通知。服务端通过判断是否有新的请求来判断客户端是否活着。LifeTimeCount定义新请求之前最多允许多少个发布周期,超过后服务端判定客户端失活,清除订阅,
-        //     必须是【保活计数】的三倍以“上”
-        [Description("寿命计数")]
-        public int LifetimeCount { get; set; } = 783360;
-
-
-        //
-        // 摘要:
-        //     队列大小
-        [Description("队列大小")]
-        public int QueueSize { get; set; } = 1020;
-
-
-        //
-        // 摘要:
-        //     订阅单组最大数, 0:不执行分组,数据少时使用, 100:每组订阅100个数据点,自动根据传入的值分组,你有1000个点位,每组最大数是100,这时就会自动分配10个组来执行订阅
-        //     数据是根据实际情况来定
-        [Description("订阅单组最大数")]
-        public int SubscribeSingleGroupMaxCount { get; set; }
-
-        //
-        // 摘要:
-        //     任务数量
-        [Description("任务数量")]
-        public int TaskNumber { get; set; } = 5;
-
-
-        //
-        // 摘要:
-        //     任务处理间隔(毫秒)
-        [Description("任务处理间隔")]
-        public int TaskHandleInterval { get; set; } = 100;
-
-    }
     public class testC : NotifyObject
     {
         public testC()
         {
-            DataMode = new Basics();
+            //初始化基础数据
+            BasicsData = new Basics();
+            //工具标题
+            ToolTitle = "OpcUa 客户端工具";
+            //配置文件名
+            FileName = "OpcUaClientData";
+        }
+
+        #region 统一需要的数据
+        /// <summary>
+        /// 导出的文件名
+        /// </summary>
+        private string FileName { get; set; }
+        /// <summary>
+        /// 工具标题
+        /// </summary>
+        public string ToolTitle
+        {
+            get => GetProperty(() => ToolTitle);
+            set => SetProperty(() => ToolTitle, value);
         }
         /// <summary>
         /// 数据源
         /// </summary>
-        public Basics DataMode
+        public Basics BasicsData
         {
-            get => GetProperty(() => DataMode);
-            set => SetProperty(() => DataMode, value);
+            get => GetProperty(() => BasicsData);
+            set => SetProperty(() => BasicsData, value);
         }
 
-        public ICommand Start { get => new CommandX(OnStart); }
+        /// <summary>
+        /// 导入基础数据命令
+        /// </summary>
+        public ICommand IncBasics { get => new CommandX(OnIncBasics); }
+        /// <summary>
+        /// 导入基础数据
+        /// </summary>
+        public void OnIncBasics()
+        {
+            (string RetFilePath, string RetFileName) Data = Unility.Windows.FileTool.SelectFiles("json");
+            if (!string.IsNullOrEmpty(Data.RetFilePath))
+            {
+                Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
+                if (BasicsData == null)
+                {
+                    Output("导入失败");
+                }
+                else
+                {
+                    Output("导入成功");
+                    BasicsData = basics;
+                }
+            }
+        }
+        /// <summary>
+        /// 导出基础数据命令
+        /// </summary>
+        public ICommand ExpBasics { get => new CommandX(OnExpBasics); }
+        /// <summary>
+        /// 导出基础数据
+        /// </summary>
+        public void OnExpBasics()
+        {
+            string path = Unility.Windows.FileTool.SelectFolder();
+            if (!string.IsNullOrEmpty(path))
+            {
+                FileTool.StringToFile(Path.Combine(path, $"{FileName}[{DateTime.Now.ToString("yyyyMMddHHmmss")}].json"), BasicsData.ToJson());
+                Output("导出成功");
+            }
+        }
 
-        public void OnStart()
+
+        /// <summary>
+        /// 信息
+        /// </summary>
+        public string Info
+        {
+            get => GetProperty(() => Info);
+            set => SetProperty(() => Info, value);
+        }
+
+        /// <summary>
+        /// 信息框事件
+        /// </summary>
+        public ICommand Info_TextChanged { get => new CommandX<System.Windows.Controls.TextChangedEventArgs>(OnInfo_TextChanged); }
+
+        /// <summary>
+        /// 信息框事件
+        /// 让滚动条一直处在最下方
+        /// </summary>
+        public void OnInfo_TextChanged(System.Windows.Controls.TextChangedEventArgs e)
         {
+            System.Windows.Controls.TextBox textBox = (System.Windows.Controls.TextBox)e.Source;
+            textBox.SelectionStart = textBox.Text.Length;
+            textBox.SelectionLength = 0;
+            textBox.ScrollToEnd();
+        }
 
-            Console.WriteLine();
+        /// <summary>
+        /// 输出标准消息
+        /// </summary>
+        /// <param name="Data">数据</param>
+        /// <param name="IsDate">需要时间</param>
+        private void Output(string Data, bool IsDate = true)
+        {
+            System.Windows.Application.Current?.Dispatcher.Invoke(delegate ()
+            {
+                if (Info?.Length > 5000)
+                {
+                    Info = string.Empty;
+                }
+                if (IsDate)
+                {
+                    Info += $" {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")} : {Data}\r\n";
+                }
+                else
+                {
+                    Info += $"{Data}\r\n";
+                }
+            });
         }
+
+        #endregion 统一需要的数据
     }
 }

+ 244 - 11
src/YSAI.Tool.Wpf/views/Udp.xaml

@@ -4,17 +4,250 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:YSAI.Tool.Wpf.views"
-              xmlns:c="clr-namespace:YSAI.Tool.Wpf.controllers"
-             xmlns:btn="clr-namespace:YSAI.Core.Wpf.controls.button;assembly=YSAI.Core.Wpf"
+             
              xmlns:lang="http://wpflocalizeextension.codeplex.com"
-            lang:LocalizeDictionary.DesignCulture="zh"
-            lang:ResxLocalizationProvider.DefaultAssembly="YSAI.Langs"
-            lang:ResxLocalizationProvider.DefaultDictionary="Lang"
-             xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters;assembly=YSAI.Core.Wpf">
+             lang:LocalizeDictionary.DesignCulture="zh"
+             lang:ResxLocalizationProvider.DefaultAssembly="YSAI.Langs"
+             lang:ResxLocalizationProvider.DefaultDictionary="Lang"
+             xmlns:c="clr-namespace:YSAI.Tool.Wpf.controllers"
+             xmlns:btn="clr-namespace:YSAI.Core.Wpf.controls.button;assembly=YSAI.Core.Wpf"
+             xmlns:pt="http://propertytools.org/wpf"
+             xmlns:helpers="clr-namespace:YSAI.Core.Wpf.style;assembly=YSAI.Core.Wpf"
+             xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters;assembly=YSAI.Core.Wpf"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:mvvm="clr-namespace:YSAI.Core.Wpf.mvvm;assembly=YSAI.Core.Wpf"
+             Background="{DynamicResource ContentBackgroundPicture}">
     <UserControl.DataContext>
         <c:UdpController />
     </UserControl.DataContext>
+
+
+    <!--资源加载-->
     <UserControl.Resources>
+        <ResourceDictionary>
+            <cs:CheckConverter x:Key="CheckConverter" />
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ComboBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Button.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_DataGrid.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Border.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TbaControl.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ScrollViewer.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_GroupBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TextBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TreeDataGrid.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_CheckBox.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_RadioButton.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ContextMenu.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Border Background="#F0F2F0" Width="auto" Height="auto" CornerRadius="{DynamicResource WindowCornerRadius}" Margin="100">
+        <GroupBox Style="{StaticResource GroupBoxTab}" Margin="0"  >
+            <GroupBox.Header>
+                <StackPanel Orientation="Horizontal">
+                    <Grid Background="Transparent">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition Width="auto" />
+                            <ColumnDefinition Width="*" />
+                        </Grid.ColumnDefinitions>
+                        <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Tool}" Width="14" />
+                        <TextBlock Text="{Binding ToolTitle}" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                    </Grid>
+                </StackPanel>
+            </GroupBox.Header>
+            <!--基础数据与功能区域-->
+            <Grid >
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="auto"/>
+                    <ColumnDefinition Width="*"/>
+                </Grid.ColumnDefinitions>
+                <!--基础数据-->
+                <Grid Grid.Column="0" Margin="0,0,5,0" Width="500">
+                    <Grid.RowDefinitions>
+                        <RowDefinition Height="auto"/>
+                        <RowDefinition Height="*"/>
+                    </Grid.RowDefinitions>
+
+                    <!--属性表格-->
+                    <Grid Grid.Row="0">
+                        <Grid.Resources>
+                            <ResourceDictionary>
+                                <Style TargetType="{x:Type Label}" >
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                    <Setter Property="HorizontalAlignment" Value="Left"/>
+                                </Style>
+                                <Style TargetType="ToolTip">
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                    <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
+                                </Style>
+                                <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}" >
+                                    <Setter Property="Height" Value="25"/>
+                                    <Setter Property="Background" Value="White"/>
+                                    <Setter Property="VerticalAlignment" Value="Center"/>
+                                    <Setter Property="helpers:Style_ComboBox.CornerRadius" Value="{DynamicResource WindowCornerRadius}"/>
+                                </Style>
+                                <Style TargetType="{x:Type pt:TextBoxEx}" BasedOn="{StaticResource TextBoxStyle2}">
+                                    <Setter Property="Height" Value="25"/>
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                    <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
+                                    <Setter Property="HorizontalContentAlignment" Value="Center"/>
+                                    <Setter Property="VerticalContentAlignment" Value="Center"/>
+                                </Style>
+
+                                <Style TargetType="CheckBox" BasedOn="{StaticResource CheckBoxStyle}"/>
+
+                                <Style TargetType="ContentControl" >
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                </Style>
+
+                                <Style TargetType="Expander">
+                                    <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
+                                </Style>
+
+                                <Style TargetType="RadioButton" BasedOn="{StaticResource RadioButtonStyle}"/>
+
+
+                                <Style TargetType="GroupBox" BasedOn="{StaticResource GroupBoxTab}"/>
+
+
+                                <DataTemplate x:Key="HeaderTemplate">
+                                    <StackPanel Orientation="Horizontal">
+                                        <Grid>
+                                            <Grid.ColumnDefinitions>
+                                                <ColumnDefinition Width="auto" />
+                                                <ColumnDefinition Width="*" />
+                                            </Grid.ColumnDefinitions>
+                                            <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource ConfigBase}" Width="14" />
+                                            <TextBlock Text="{Binding}" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                        </Grid>
+                                    </StackPanel>
+                                </DataTemplate>
+
+                            </ResourceDictionary>
+                        </Grid.Resources>
+                        <pt:PropertyGrid  Margin="1,-4,1,0"
+              SelectedObject="{Binding BasicsData}"
+              TabVisibility="VisibleIfMoreThanOne" 
+              TextBlock.Foreground="{DynamicResource Font.Content.Foreground}" 
+              Foreground="{DynamicResource Font.Content.Foreground}"
+              BorderBrush="{DynamicResource Control.Border.Color}"
+              CategoryHeaderTemplate="{StaticResource HeaderTemplate}"/>
+                    </Grid>
+
+                    <!--导入导出按钮-->
+                    <Grid Grid.Row="1">
+                        <GroupBox Style="{StaticResource GroupBoxTab}"  Margin="1" VerticalAlignment="Bottom">
+                            <GroupBox.Header>
+                                <StackPanel Orientation="Horizontal">
+                                    <Grid Background="transparent">
+                                        <Grid.ColumnDefinitions>
+                                            <ColumnDefinition Width="auto" />
+                                            <ColumnDefinition Width="*" />
+                                        </Grid.ColumnDefinitions>
+                                        <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Operate}" Width="14" />
+                                        <TextBlock Text="基础数据操作" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                    </Grid>
+                                </StackPanel>
+                            </GroupBox.Header>
+                            <Grid>
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="*"/>
+                                    <ColumnDefinition Width="*"/>
+                                </Grid.ColumnDefinitions>
+                                <btn:ButtonControl  
+Width="200"
+Grid.Column="0"  
+Command="{Binding IncBasics}" 
+HorizontalAlignment="Center" 
+VerticalAlignment="Center" 
+Margin="5"
+IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
+BorderBrush="{DynamicResource Control.Border.Color}"
+IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
+Foreground="{DynamicResource Font.Content.Foreground}"
+Icon="{DynamicResource Inc}"
+Content="导入基础数据"
+CornerRadius="{DynamicResource WindowCornerRadius}" />
+                                <btn:ButtonControl  
+Width="200"
+Grid.Column="1"  
+Command="{Binding ExpBasics}" 
+HorizontalAlignment="Center" 
+VerticalAlignment="Center" 
+Margin="5"
+IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
+BorderBrush="{DynamicResource Control.Border.Color}"
+IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
+Foreground="{DynamicResource Font.Content.Foreground}"
+Icon="{DynamicResource Exp}"
+Content="导出基础数据"
+CornerRadius="{DynamicResource WindowCornerRadius}" />
+                            </Grid>
+                        </GroupBox>
+                    </Grid>
+
+
+                </Grid>
+                <Grid Grid.Column="1">
+                    <Grid.RowDefinitions>
+                        <RowDefinition/>
+                        <RowDefinition/>
+                    </Grid.RowDefinitions>
+                    <!--功能模块-->
+                    <GroupBox Style="{StaticResource GroupBoxTab}" Width="auto" Margin="0" Grid.Row="0">
+                        <GroupBox.Header>
+                            <StackPanel Orientation="Horizontal">
+                                <Grid Background="transparent">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="auto" />
+                                        <ColumnDefinition Width="*" />
+                                    </Grid.ColumnDefinitions>
+                                    <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Function}" Width="14" />
+                                    <TextBlock Text="功能" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                </Grid>
+                            </StackPanel>
+                        </GroupBox.Header>
+
+
+
+                    </GroupBox>
+                    <!--信息-->
+                    <GroupBox Style="{StaticResource GroupBoxTab}" Width="auto" Margin="0,5,0,0"  Grid.Row="1">
+                        <GroupBox.Header>
+                            <StackPanel Orientation="Horizontal">
+                                <Grid Background="transparent">
+                                    <Grid.ColumnDefinitions>
+                                        <ColumnDefinition Width="auto" />
+                                        <ColumnDefinition Width="*" />
+                                    </Grid.ColumnDefinitions>
+                                    <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Info}" Width="14" />
+                                    <TextBlock Text="信息" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                </Grid>
+                            </StackPanel>
+                        </GroupBox.Header>
+
+                        <TextBox Style="{DynamicResource TextBoxStyle2}" FontSize="13" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible"  Text="{Binding Info}" >
+                            <i:Interaction.Triggers>
+                                <i:EventTrigger EventName="TextChanged">
+                                    <mvvm:EventCommand  Command="{Binding Info_TextChanged}" />
+                                </i:EventTrigger>
+                            </i:Interaction.Triggers>
+                        </TextBox>
+
+                    </GroupBox>
+                </Grid>
+            </Grid>
+        </GroupBox>
+    </Border>
+
+
+
+
+
+
+    <!--<UserControl.Resources>
         <ResourceDictionary>
             <cs:CheckConverter x:Key="CheckConverter" />
             <ResourceDictionary.MergedDictionaries>
@@ -57,14 +290,14 @@
                     <RowDefinition Height="200" />
                     <RowDefinition  Height="400" />
                 </Grid.RowDefinitions>
-                <!--设置区域-->
+                --><!--设置区域--><!--
                 <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="0" Margin="5">
                     <GroupBox.Header>
                         <Border>
                             <TextBlock Text="{lang:Loc SetRegion}" Foreground="{DynamicResource Font.Head.Foreground}" />
                         </Border>
                     </GroupBox.Header>
-                    <!--设置区域-->
+                    --><!--设置区域--><!--
                     <Grid>
                         <Grid.ColumnDefinitions>
                             <ColumnDefinition Width="auto" />
@@ -105,7 +338,7 @@
                    
                     </Grid>
                 </GroupBox>
-                <!--发送区域-->
+                --><!--发送区域--><!--
                 <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="1" Margin="5">
                     <GroupBox.Header>
                         <Border>
@@ -152,7 +385,7 @@
                         </GroupBox>
                     </Grid>
                 </GroupBox>
-                <!--接收区域-->
+                --><!--接收区域--><!--
                 <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="2" Margin="5">
                     <GroupBox.Header>
                         <Border>
@@ -198,5 +431,5 @@
                 </GroupBox>
             </Grid>
         </GroupBox>
-    </Grid>
+    </Grid>-->
 </UserControl>

+ 10 - 3
src/YSAI.Ver.Manage.Tool/Program.cs

@@ -136,6 +136,8 @@ foreach (var item in paths)
         //不显示程序窗口
         process.StartInfo.CreateNoWindow = true;
         process.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
+        //打包状态
+        bool PackState = true;
         //显示信息
         process.OutputDataReceived += delegate (object sender, DataReceivedEventArgs e)
         {
@@ -144,18 +146,23 @@ foreach (var item in paths)
         //显示异常信息
         process.ErrorDataReceived += delegate (object sender, DataReceivedEventArgs e)
         {
-            //LogHelper.Verbose(e.Data);
+            if (!string.IsNullOrWhiteSpace(e.Data))
+            {
+                PackState = false;
+                LogHelper.Error(e.Data);
+            }
         };
         //启动程序
         process.Start();
         //写入命令
         process.StandardInput.WriteLine($"dotnet pack {item.path} -c Release");
+        process.StandardInput.WriteLine("exit");
         process.StandardInput.AutoFlush = true;
 
         process.BeginErrorReadLine();
         process.BeginOutputReadLine();
 
-        process.StandardInput.WriteLine("exit");
+
 
         //等待程序执行完退出进程
         process.WaitForExit();
@@ -168,7 +175,7 @@ foreach (var item in paths)
         {
             LogHelper.Info("╠═══════════════════════════════════╬═══════════════════════════════╣");
         }
-        LogHelper.Info(string.Format("║{0,-10}{1,-20}{2,-5}║{3,-10}{4,-17}║", string.Empty, item.name, string.Empty, string.Empty, "打包成功"));
+        LogHelper.Info(string.Format("║{0,-10}{1,-20}{2,-5}║{3,-10}{4,-17}║", string.Empty, item.name, string.Empty, string.Empty, PackState ? "打包成功 [ √ ]" : "打包失败 [ × ]"));
         index++;
     }
 }