diff --git a/newFront/c#前端/CAD.Extend/.vs/CAD.Extend.csproj.dtbcache.json b/newFront/c#前端/CAD.Extend/.vs/CAD.Extend.csproj.dtbcache.json
new file mode 100644
index 00000000..f1669d77
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/.vs/CAD.Extend.csproj.dtbcache.json
@@ -0,0 +1 @@
+{"RootPath":"E:\\Di-Electrical\\c#前端\\CAD.Extend","ProjectFileName":"CAD.Extend.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"Commands.cs"},{"SourceFile":"GlobalObject.cs"},{"SourceFile":"Model\\KeyValueModel.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"ViewModels\\DialogConvertBaseMapViewModel.cs"},{"SourceFile":"ViewModels\\myViewModelBase\\DialogBase.cs"},{"SourceFile":"Views\\CustomControl\\customWindowTitleBar.xaml.cs"},{"SourceFile":"Views\\CustomDialogWindow.xaml.cs"},{"SourceFile":"Views\\DialogConvertBaseMap.xaml.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"}],"References":[{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\DryIoc.dll.5.4.3\\lib\\net45\\DryIoc.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Microsoft.Bcl.AsyncInterfaces.8.0.0\\lib\\net462\\Microsoft.Bcl.AsyncInterfaces.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\\lib\\net462\\Microsoft.Extensions.DependencyInjection.Abstractions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Microsoft.Xaml.Behaviors.Wpf.1.1.122\\lib\\net462\\Microsoft.Xaml.Behaviors.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\PresentationCore.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\PresentationFramework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.Container.Abstractions.9.0.106\\lib\\net47\\Prism.Container.Abstractions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.Container.DryIoc.9.0.106\\lib\\net47\\Prism.Container.DryIoc.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.Container.Unity.9.0.106\\lib\\net462\\Prism.Container.Unity.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.Core.9.0.537\\lib\\net47\\Prism.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.DryIoc.9.0.537\\lib\\net47\\Prism.DryIoc.Wpf.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.Events.9.0.537\\lib\\net47\\Prism.Events.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.Unity.9.0.537\\lib\\net47\\Prism.Unity.Wpf.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Prism.Wpf.9.0.537\\lib\\net47\\Prism.Wpf.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD.Base\\bin\\Debug\\SWS.CAD.Base.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":true,"ProjectPath":"E:\\Di-Electrical\\c#前端\\SWS.CAD.Base\\bin\\Debug\\SWS.CAD.Base.dll"},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Configuration.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Drawing.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\net461\\System.Runtime.CompilerServices.Unsafe.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\net461\\System.Threading.Tasks.Extensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\System.ValueTuple.4.5.0\\lib\\net47\\System.ValueTuple.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Windows.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Windows.Forms.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xaml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.FileDialogs.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.GridView.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.Input.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.Navigation.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Unity.Abstractions.5.11.7\\lib\\net48\\Unity.Abstractions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Unity.Container.5.11.11\\lib\\net48\\Unity.Container.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\WindowsBase.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"E:\\Di-Electrical\\c#前端\\CAD.Extend\\bin\\Debug\\CAD.Extend.dll","OutputItemRelativePath":"CAD.Extend.dll"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
\ No newline at end of file
diff --git a/newFront/c#前端/CAD.Extend/CAD.Extend.csproj b/newFront/c#前端/CAD.Extend/CAD.Extend.csproj
new file mode 100644
index 00000000..37231d23
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/CAD.Extend.csproj
@@ -0,0 +1,189 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {8740B023-B585-4E69-8521-4F62FA754A1B}
+ Library
+ Properties
+ CAD.Extend
+ CAD.Extend
+ v4.8
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\..\..\..\..\Program Files\KunHeng\KunHengCAD V21 zh_CN\BrxMgd.dll
+
+
+ ..\packages\DryIoc.dll.5.4.3\lib\net45\DryIoc.dll
+
+
+ ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
+
+
+ ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll
+
+
+ ..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.122\lib\net462\Microsoft.Xaml.Behaviors.dll
+
+
+
+
+ ..\packages\Prism.Core.9.0.537\lib\net47\Prism.dll
+
+
+ ..\packages\Prism.Container.Abstractions.9.0.106\lib\net47\Prism.Container.Abstractions.dll
+
+
+ ..\packages\Prism.Container.DryIoc.9.0.106\lib\net47\Prism.Container.DryIoc.dll
+
+
+ ..\packages\Prism.Container.Unity.9.0.106\lib\net462\Prism.Container.Unity.dll
+
+
+ ..\packages\Prism.DryIoc.9.0.537\lib\net47\Prism.DryIoc.Wpf.dll
+
+
+ ..\packages\Prism.Events.9.0.537\lib\net47\Prism.Events.dll
+
+
+ ..\packages\Prism.Unity.9.0.537\lib\net47\Prism.Unity.Wpf.dll
+
+
+ ..\packages\Prism.Wpf.9.0.537\lib\net47\Prism.Wpf.dll
+
+
+
+
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
+
+
+ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll
+
+
+
+
+
+
+
+
+
+
+
+
+ ..\..\..\..\..\Program Files\KunHeng\KunHengCAD V21 zh_CN\TD_Mgd.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.Data.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.FileDialogs.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.GridView.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.Input.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.Navigation.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Data.dll
+
+
+ ..\packages\Unity.Abstractions.5.11.7\lib\net48\Unity.Abstractions.dll
+
+
+ ..\packages\Unity.Container.5.11.11\lib\net48\Unity.Container.dll
+
+
+
+
+
+
+
+
+
+
+
+ customWindowTitleBar.xaml
+
+
+ CustomDialogWindow.xaml
+
+
+ DialogConvertBaseMap.xaml
+
+
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+
+
+ {d4a15774-1469-45a0-9eff-771271764a00}
+ SWS.CAD.Base
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/CAD.Extend/CAD.Extend.csproj.user b/newFront/c#前端/CAD.Extend/CAD.Extend.csproj.user
new file mode 100644
index 00000000..0a8cb176
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/CAD.Extend.csproj.user
@@ -0,0 +1,7 @@
+
+
+
+ Program
+ D:\Program Files\KunHeng\KunHengCAD V21 zh_CN\kunhengcad.exe
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/CAD.Extend/Commands.cs b/newFront/c#前端/CAD.Extend/Commands.cs
new file mode 100644
index 00000000..12c90eba
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/Commands.cs
@@ -0,0 +1,145 @@
+using System;
+using System.Linq;
+using System.Windows.Forms;
+using Bricscad.Ribbon;
+using Bricscad.Windows;
+using CAD.Extend;
+using CAD.Extend.ViewModels;
+using CAD.Extend.Views;
+using Prism.Container.DryIoc;
+using Prism.Dialogs;
+using Prism.Ioc;
+using SWS.CAD.Base;
+using Teigha.Runtime;
+using Telerik.Windows.Controls;
+using Unity;
+using Application = Bricscad.ApplicationServices.Application;
+
+[assembly: CommandClass(typeof(Commands))]
+[assembly: ExtensionApplication(typeof(Commands))]
+namespace CAD.Extend
+{
+ public partial class Commands : IExtensionApplication
+ {
+
+ public void Initialize()
+ {
+
+ try
+ {
+ AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
+ if (RibbonServices.RibbonPaletteSet == null)
+ RibbonServices.CreateRibbonPaletteSet();
+
+ Register();
+
+ AddTab();
+ }
+ catch (System.Exception e)
+ {
+ Application.ShowAlertDialog(" An exception occurred in Initialize():\n" + e.ToString());
+ }
+ }
+
+ private void Register()
+ {
+
+ GlobalObject._prismContainer = new DryIocContainerExtension();
+ GlobalObject._prismContainer.Register();
+ GlobalObject._prismContainer.Register();
+ GlobalObject._prismContainer.RegisterDialog();
+ }
+
+ private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
+ {
+ try
+ {
+ // 记录异常信息到日志文件,这里简单打印到控制台
+ System.Exception ex = e.ExceptionObject as System.Exception;
+ Console.WriteLine($"发生未处理的异常: {ex.Message}");
+ Console.WriteLine($"异常堆栈跟踪: {ex.StackTrace}");
+
+ // 关闭所有打开的对话框窗口
+
+
+ // 提示用户发生了错误
+ MessageBox.Show("发生错误,请检查日志文件以获取更多信息。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
+ }
+ catch (System.Exception innerEx)
+ {
+ // 如果在处理异常时又发生了异常,简单打印信息
+ Console.WriteLine($"处理异常时发生错误: {innerEx.Message}");
+ }
+ }
+
+ public void Terminate()
+ {
+ }
+
+ void AddTab()
+ {
+ RibbonControl rbnCtrl = ComponentManager.Ribbon; //整个上面都是ribbon,比如莫工做的电气系统,就是ribbon中的一个tab
+
+ if (rbnCtrl == null) return;
+ #region create Ribbon tab
+ RibbonTab tab1 = new RibbonTab();
+ tab1.Title = "扩展功能";
+ tab1.Id = "扩展功能";
+ rbnCtrl.Tabs.Add(tab1);//一个就行了
+ #endregion
+
+ #region Ribbon 图层管理
+ RibbonPanelSource dataSource = new RibbonPanelSource();
+ dataSource.Title = "图层操作";
+ dataSource.Id = "图层操作";
+ RibbonPanel dataPanel = new RibbonPanel();
+ dataPanel.Source = dataSource;
+ tab1.Panels.Add(dataPanel);
+
+ //垂直排列按钮panel
+ RibbonRowPanel ribbonRowPanel = new RibbonRowPanel();
+
+ #region buttons 一键转底图
+ RibbonButton btnSinalManage = new RibbonButton();
+ btnSinalManage.ToolTip = "一键转底图";
+ btnSinalManage.Text = "一键转底图";
+ btnSinalManage.ButtonStyle = RibbonButtonStyle.SmallWithText;
+ btnSinalManage.CommandHandler = new DelegateCommand(x =>
+ {
+ var listObjectId=General.GetSelectedObjectId();
+ if (listObjectId==null||!listObjectId.Any())
+ {
+ MessageBox.Show("请先选择图元!");
+ return;
+ }
+ //打开窗体
+ Prism.Dialogs.DialogParameters para = new Prism.Dialogs.DialogParameters();
+ para.Add(GlobalObject.dialogPar.info.ToString(), listObjectId);
+ var _dialogService = GlobalObject._prismContainer.Resolve();
+ _dialogService.ShowDialog(nameof(DialogConvertBaseMap), para, (RES) =>
+ {
+ if (RES.Result == ButtonResult.Yes)
+ {
+
+ }
+ else if (RES.Result == ButtonResult.No)
+ { }
+ });
+ });
+ btnSinalManage.Image = GlobalObject.ImageSourceFromEmbeddedResourceStream(@"CAD.Extend.Images.pic1.png");
+ btnSinalManage.Id = "一键转底图";
+ ribbonRowPanel.Items.Add(btnSinalManage);
+ ribbonRowPanel.Items.Add(new RibbonRowBreak());//换行,这样可以使按钮多行排列
+ #endregion
+ dataSource.Items.Add(ribbonRowPanel);
+ #endregion
+
+ }
+
+ }
+}
+
+
+
+
+
diff --git a/newFront/c#前端/CAD.Extend/GlobalObject.cs b/newFront/c#前端/CAD.Extend/GlobalObject.cs
new file mode 100644
index 00000000..44e4c135
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/GlobalObject.cs
@@ -0,0 +1,48 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.IO;
+using System.Linq;
+using System.Net.Http;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media;
+using Prism.Ioc;
+using Unity;
+
+namespace CAD.Extend
+{
+ public class GlobalObject
+ {
+ public static IContainerExtension _prismContainer;
+ public enum dialogPar
+ {
+ info,
+ para1,
+ para2
+ }
+ ///
+ /// 获取图片
+ ///
+ /// 包括命名空间
+ ///
+ public static System.Windows.Media.ImageSource ImageSourceFromEmbeddedResourceStream(string resName)
+ {
+ System.Reflection.Assembly assy = System.Reflection.Assembly.GetExecutingAssembly();
+ //foreach (string resource in assy.GetManifestResourceNames())
+ //{
+ // Console.WriteLine(resource);//遍历所有的内嵌资源
+ //}
+ System.IO.Stream stream = assy.GetManifestResourceStream(resName);
+ if (stream == null)
+ return null;
+ System.Windows.Media.Imaging.BitmapImage img = new System.Windows.Media.Imaging.BitmapImage();
+ img.BeginInit();
+ img.StreamSource = stream;
+ img.EndInit();
+ return img;
+ }
+
+ }
+}
diff --git a/newFront/c#前端/CAD.Extend/Properties/AssemblyInfo.cs b/newFront/c#前端/CAD.Extend/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..feb0fe8d
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/Properties/AssemblyInfo.cs
@@ -0,0 +1,33 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("CAD.Extend")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("CAD.Extend")]
+[assembly: AssemblyCopyright("Copyright © 2025")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
+[assembly: Guid("8740b023-b585-4e69-8521-4f62fa754a1b")]
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/newFront/c#前端/CAD.Extend/ViewModels/DialogConvertBaseMapViewModel.cs b/newFront/c#前端/CAD.Extend/ViewModels/DialogConvertBaseMapViewModel.cs
new file mode 100644
index 00000000..25e55cae
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/ViewModels/DialogConvertBaseMapViewModel.cs
@@ -0,0 +1,206 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Threading;
+using System.Windows;
+using System.Windows.Input;
+using System.Windows.Media;
+using Bricscad.Windows;
+using CAD.Extend.Model;
+using Prism.Commands;
+using Prism.Dialogs;
+using SWS.CAD.Base;
+using Teigha.Colors;
+using Teigha.DatabaseServices;
+using Brush = System.Windows.Media.Brush;
+using Color = System.Windows.Media.Color;
+
+namespace CAD.Extend.ViewModels
+{
+ public class DialogConvertBaseMapViewModel : DialogBase, IDialogAware
+ {
+ #region binding
+ private ObservableCollection _listLayerName = new ObservableCollection();
+ ///
+ /// 底图名列表
+ ///
+ public ObservableCollection listLayerName
+ {
+ get { return _listLayerName; }
+ set { _listLayerName = value; RaisePropertyChanged(nameof(listLayerName)); }
+ }
+ private KeyValueModel _SelectedLayerName;
+ ///
+ /// 选中的底图名
+ ///
+ public KeyValueModel SelectedLayerName
+ {
+ get { return _SelectedLayerName; }
+ set { _SelectedLayerName = value; RaisePropertyChanged(nameof(SelectedLayerName)); }
+ }
+ private bool _IsToBlock;
+ ///
+ /// 是否转为图块
+ ///
+ public bool IsToBlock
+ {
+ get { return _IsToBlock; }
+ set { _IsToBlock = value; RaisePropertyChanged(nameof(IsToBlock)); }
+ }
+ #endregion
+
+ private string _BlockName = "EI-Elec专用底图";
+ ///
+ /// 块名
+ ///
+ public string BlockName
+ {
+ get { return _BlockName; }
+ set { _BlockName = value; RaisePropertyChanged(nameof(BlockName)); }
+ }
+ private Brush _BlockColor;
+ ///
+ /// 图层颜色
+ ///
+ public Brush BlockColor
+ {
+ get { return _BlockColor; }
+ set { _BlockColor = value; RaisePropertyChanged(nameof(BlockColor)); }
+ }
+
+ ///
+ /// 随机块名
+ ///
+ public ICommand Command_BlockName { get; set; }
+ ///
+ /// 颜色
+ ///
+ public ICommand Command_Color { get; set; }
+ ///
+ /// 图层颜色 默认灰色
+ ///
+ Teigha.Colors.Color layerColor = Teigha.Colors.Color.FromColorIndex(ColorMethod.ByAci, 8);
+ List listObjectId = new List();
+ string layerName = "EI-Elec专用底图图层";
+ public DialogConvertBaseMapViewModel()
+ {
+ title = "背景底图设置";
+ Command_BlockName = new DelegateCommand(onBlockName);
+ Command_Color = new DelegateCommand(onColor);
+ System.Drawing.Color winColor = layerColor.ColorValue;
+ var c = Color.FromArgb(winColor.A, winColor.R, winColor.G, winColor.B);
+ BlockColor = new SolidColorBrush(c);
+ }
+ ///
+ /// 颜色选择
+ ///
+ public void onColor()
+ {
+ var list=General.GetTopLevelDictionaryNames();
+
+ ColorDialog dlg = new ColorDialog();
+
+ if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+ {
+ layerColor = dlg.Color;
+ System.Drawing.Color winColor = dlg.Color.ColorValue;
+ var b = Color.FromArgb(winColor.A, winColor.R, winColor.G, winColor.B);
+ BlockColor = new SolidColorBrush(b);
+ }
+ }
+ ///
+ /// 随机块名
+ ///
+ public void onBlockName()
+ {
+ var a = GetRndABC();
+ Thread.Sleep(10);
+ var b = GetRndABC();
+ Thread.Sleep(10);
+ var c = GetRndABC();
+ BlockName = "EI-Elec图块" + a + b + c;
+ }
+ public string GetRndABC()
+ {
+ // a-z ASCII值 97-122
+ // A-Z ASCII值 65-90
+ int i = new Random().Next(65, 90);
+ char c = (char)i;
+ return c.ToString();
+ }
+
+ #region Dialog
+
+ public DialogCloseListener RequestClose { get; }
+
+ public bool CanCloseDialog()
+ {
+ return true;
+ }
+
+ public void OnDialogClosed()
+ {
+
+ }
+
+ #endregion
+
+ public void OnDialogOpened(IDialogParameters parameters)
+ {
+ listObjectId = parameters.GetValue>(GlobalObject.dialogPar.info.ToString());
+ var list = General.GetAllLayerNames();
+ foreach (var layerName in list)
+ {
+ if (layerName.Equals(layerName))
+ { listLayerName.Insert(0, new KeyValueModel() { Key = layerName, Value = layerName }); }
+ else
+ {
+ listLayerName.Add(new KeyValueModel() { Key = layerName, Value = layerName });
+ }
+ }
+ if (!listLayerName.Where(a => a.Key == layerName).Any())
+ { listLayerName.Insert(0, new KeyValueModel() { Key = layerName, Value = layerName }); }
+ SelectedLayerName = listLayerName[0];
+ }
+ public override void ExecuteOKCommandAsync(object para)
+ {
+ if (IsToBlock)
+ {
+ if (string.IsNullOrEmpty(BlockName))
+ {
+ MessageBox.Show("块名不能为空!");
+ return;
+ }
+ if (General.CheckHasBlockName(BlockName))
+ {
+ MessageBox.Show("块名已存在,请更换块名!");
+ return;
+ }
+ General.SetEntityToLayer(listObjectId, SelectedLayerName.Value, layerColor, BlockName);
+ }
+ else
+ {
+ General.SetEntityToLayer(listObjectId, SelectedLayerName.Value, layerColor);
+ }
+ MessageBox.Show("底图设置成功!");
+ //Prism.Dialogs.DialogParameters resPara = new Prism.Dialogs.DialogParameters();
+ //RequestClose.Invoke(resPara, ButtonResult.Yes);
+ }
+ public override void ExecuteCloseCommand(object parameter)
+ {
+ if (parameter as string == "ClickNo")
+ {
+ RequestClose.Invoke(ButtonResult.No);
+ }
+ else
+ {
+ RequestClose.Invoke(ButtonResult.Cancel);
+ }
+ this.Dispose();
+ }
+
+ }
+
+
+}
diff --git a/newFront/c#前端/CAD.Extend/app.config b/newFront/c#前端/CAD.Extend/app.config
new file mode 100644
index 00000000..c5c88e05
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/app.config
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/CAD.Extend/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs b/newFront/c#前端/CAD.Extend/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs
new file mode 100644
index 00000000..15efebfc
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/obj/Debug/.NETFramework,Version=v4.8.AssemblyAttributes.cs
@@ -0,0 +1,4 @@
+//
+using System;
+using System.Reflection;
+[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
diff --git a/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache b/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache
new file mode 100644
index 00000000..29871103
Binary files /dev/null and b/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.AssemblyReference.cache differ
diff --git a/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.FileListAbsolute.txt b/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.FileListAbsolute.txt
new file mode 100644
index 00000000..5bb1707d
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/obj/Debug/CAD.Extend.csproj.FileListAbsolute.txt
@@ -0,0 +1 @@
+E:\Di-Electrical\c#前端\CAD.Extend\obj\Debug\CAD.Extend.csproj.AssemblyReference.cache
diff --git a/newFront/c#前端/CAD.Extend/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/newFront/c#前端/CAD.Extend/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
new file mode 100644
index 00000000..541f4246
Binary files /dev/null and b/newFront/c#前端/CAD.Extend/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache differ
diff --git a/newFront/c#前端/CAD.Extend/packages.config b/newFront/c#前端/CAD.Extend/packages.config
new file mode 100644
index 00000000..496f75f8
--- /dev/null
+++ b/newFront/c#前端/CAD.Extend/packages.config
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/DI-Electrical/.vs/DI-Electrical.csproj.dtbcache.json b/newFront/c#前端/DI-Electrical/.vs/DI-Electrical.csproj.dtbcache.json
new file mode 100644
index 00000000..77dfad2d
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/.vs/DI-Electrical.csproj.dtbcache.json
@@ -0,0 +1 @@
+{"RootPath":"E:\\Di-Electrical\\c#前端\\DI-Electrical","ProjectFileName":"DI-Electrical.csproj","Configuration":"Debug|AnyCPU","FrameworkPath":"","Sources":[{"SourceFile":"App.xaml.cs"},{"SourceFile":"Event\\loginEvent.cs"},{"SourceFile":"GlobalObject.cs"},{"SourceFile":"Helper\\ConfigService.cs"},{"SourceFile":"Helper\\FileHelper.cs"},{"SourceFile":"Helper\\LoggerHelper.cs"},{"SourceFile":"Model\\ec_project.cs"},{"SourceFile":"Model\\NoEntity\\ConfigIni.cs"},{"SourceFile":"Model\\NoEntity\\learunHttpRes.cs"},{"SourceFile":"Model\\NoEntity\\loginRes.cs"},{"SourceFile":"Model\\NoEntity\\PageModel.cs"},{"SourceFile":"Model\\user.cs"},{"SourceFile":"Services\\HttpService.cs"},{"SourceFile":"Services\\LoginService.cs"},{"SourceFile":"Services\\ProjectService.cs"},{"SourceFile":"Services\\UserService.cs"},{"SourceFile":"ViewModels\\ConfigViewModel.cs"},{"SourceFile":"ViewModels\\LoginViewModel.cs"},{"SourceFile":"ViewModels\\DialogTestViewModel.cs"},{"SourceFile":"ViewModels\\myViewModelBase\\DialogBase.cs"},{"SourceFile":"ViewModels\\ProjectViewModel.cs"},{"SourceFile":"Views\\Config.xaml.cs"},{"SourceFile":"Views\\CustomControl\\customWindowTitleBar.xaml.cs"},{"SourceFile":"Helper\\PasswordHelper.cs"},{"SourceFile":"ViewModels\\MainWindowViewModel.cs"},{"SourceFile":"Views\\Dialog\\DialogTest.xaml.cs"},{"SourceFile":"Views\\Login.xaml.cs"},{"SourceFile":"Views\\MainWindow.xaml.cs"},{"SourceFile":"Views\\Project.xaml.cs"},{"SourceFile":"Properties\\AssemblyInfo.cs"},{"SourceFile":"Properties\\Resources.Designer.cs"},{"SourceFile":"Properties\\Settings.Designer.cs"},{"SourceFile":"obj\\Debug\\.NETFramework,Version=v4.8.AssemblyAttributes.cs"},{"SourceFile":"E:\\Di-Electrical\\c#前端\\DI-Electrical\\obj\\Debug\\Views\\Config.g.cs"},{"SourceFile":"E:\\Di-Electrical\\c#前端\\DI-Electrical\\obj\\Debug\\Views\\CustomControl\\customWindowTitleBar.g.cs"},{"SourceFile":"E:\\Di-Electrical\\c#前端\\DI-Electrical\\obj\\Debug\\Views\\Dialog\\DialogTest.g.cs"},{"SourceFile":"E:\\Di-Electrical\\c#前端\\DI-Electrical\\obj\\Debug\\Views\\MainWindow.g.cs"},{"SourceFile":"E:\\Di-Electrical\\c#前端\\DI-Electrical\\obj\\Debug\\Views\\Project.g.cs"},{"SourceFile":"E:\\Di-Electrical\\c#前端\\DI-Electrical\\obj\\Debug\\GeneratedInternalTypeHelper.g.cs"}],"References":[{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\DryIoc.dll.5.4.3\\lib\\net45\\DryIoc.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\EasyEncryption.1.0.2\\lib\\EasyEncryption.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\ini-parser.2.5.2\\lib\\net20\\INIFileParser.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Microsoft.Bcl.AsyncInterfaces.8.0.0\\lib\\net462\\Microsoft.Bcl.AsyncInterfaces.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\Microsoft.CSharp.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\\lib\\net462\\Microsoft.Extensions.DependencyInjection.Abstractions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\mscorlib.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Newtonsoft.Json.13.0.3\\lib\\net45\\Newtonsoft.Json.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\PresentationCore.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\PresentationFramework.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Configuration.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Core.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.DataSetExtensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Net.Http.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\System.Runtime.CompilerServices.Unsafe.4.5.3\\lib\\net461\\System.Runtime.CompilerServices.Unsafe.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\System.Threading.Tasks.Extensions.4.5.4\\lib\\net461\\System.Threading.Tasks.Extensions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\System.ValueTuple.4.5.0\\lib\\net47\\System.ValueTuple.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Web.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xaml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\System.Xml.Linq.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.FileDialogs.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.GridView.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.Input.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Controls.Navigation.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\SWS.CAD\\RefDLL\\WPF45\\Telerik.Windows.Data.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Unity.Abstractions.5.11.7\\lib\\net48\\Unity.Abstractions.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"E:\\Di-Electrical\\c#前端\\packages\\Unity.Container.5.11.11\\lib\\net48\\Unity.Container.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""},{"Reference":"C:\\Program Files (x86)\\Reference Assemblies\\Microsoft\\Framework\\.NETFramework\\v4.8\\WindowsBase.dll","ResolvedFrom":"","OriginalItemSpec":"","Name":"","EmbedInteropTypes":false,"CopyLocal":false,"IsProjectReference":false,"ProjectPath":""}],"Analyzers":[],"Outputs":[{"OutputItemFullPath":"E:\\Di-Electrical\\c#前端\\DI-Electrical\\bin\\Debug\\DI-Electrical.exe","OutputItemRelativePath":"DI-Electrical.exe"},{"OutputItemFullPath":"","OutputItemRelativePath":""}],"CopyToOutputEntries":[]}
\ No newline at end of file
diff --git a/newFront/c#前端/DI-Electrical/App.config b/newFront/c#前端/DI-Electrical/App.config
new file mode 100644
index 00000000..efa79b30
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/App.config
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/DI-Electrical/App.xaml b/newFront/c#前端/DI-Electrical/App.xaml
new file mode 100644
index 00000000..0d30f24b
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/App.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/newFront/c#前端/DI-Electrical/App.xaml.cs b/newFront/c#前端/DI-Electrical/App.xaml.cs
new file mode 100644
index 00000000..be4c6c7c
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/App.xaml.cs
@@ -0,0 +1,71 @@
+using System.Windows;
+using DI_Electrical.Helper;
+using DI_Electrical.Services;
+using DI_Electrical.ViewModels;
+using DI_Electrical.Views;
+using DI_Electrical.Views.Dialog;
+using DI_Electrical.Views.Dialog.DialogSignalManagements;
+using Prism.Events;
+using Prism.Ioc;
+using Prism.Services.Dialogs;
+using Prism.Unity;
+using Unity;
+
+namespace DI_Electrical
+{
+ ///
+ /// App.xaml 的交互逻辑
+ ///
+ public partial class App : PrismApplication
+ {
+ protected override Window CreateShell()
+ {
+ return Container.Resolve();
+ }
+
+ protected override void InitializeShell(Window shell)
+ {
+ var login = Container.Resolve();
+ login.ShowDialog();
+ if (GlobalObject.userInfo == null)
+ {
+ Application.Current?.Shutdown();
+ return;
+ }
+ var project = Container.Resolve();
+ project.ShowDialog();
+ if (GlobalObject.curProject == null)
+ {
+ Application.Current?.Shutdown();
+ return;
+ }
+ base.InitializeShell(shell);
+
+ }
+
+ protected override void RegisterTypes(IContainerRegistry containerRegistry)
+ {
+ containerRegistry.RegisterForNavigation();
+ containerRegistry.RegisterForNavigation();
+ containerRegistry.RegisterForNavigation();
+ containerRegistry.RegisterForNavigation();
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterDialog();
+ containerRegistry.RegisterDialog();
+
+ containerRegistry.Register();
+
+ containerRegistry.RegisterSingleton();
+ containerRegistry.RegisterSingleton();
+ containerRegistry.RegisterSingleton();
+ containerRegistry.RegisterSingleton();
+ containerRegistry.RegisterSingleton();
+ containerRegistry.RegisterSingleton();
+ containerRegistry.RegisterSingleton();
+
+ }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/DI-Electrical.csproj b/newFront/c#前端/DI-Electrical/DI-Electrical.csproj
new file mode 100644
index 00000000..576fa5cc
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/DI-Electrical.csproj
@@ -0,0 +1,308 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {924A2824-BE62-42A7-81A8-49BEFCB3801F}
+ WinExe
+ DI_Electrical
+ DI-Electrical
+ v4.8
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+ true
+
+
+ x64
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+ false
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\DryIoc.dll.5.4.3\lib\net45\DryIoc.dll
+
+
+ ..\packages\EasyEncryption.1.0.2\lib\EasyEncryption.dll
+
+
+ ..\packages\ini-parser.2.5.2\lib\net20\INIFileParser.dll
+
+
+ ..\packages\log4net.3.1.0\lib\net462\log4net.dll
+
+
+ ..\packages\Microsoft.Bcl.AsyncInterfaces.8.0.0\lib\net462\Microsoft.Bcl.AsyncInterfaces.dll
+
+
+ ..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.8.0.1\lib\net462\Microsoft.Extensions.DependencyInjection.Abstractions.dll
+
+
+ ..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.122\lib\net462\Microsoft.Xaml.Behaviors.dll
+
+
+ False
+ ..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll
+
+
+ ..\packages\Prism.Core.8.1.97\lib\net47\Prism.dll
+
+
+ ..\packages\Prism.Unity.8.1.97\lib\net47\Prism.Unity.Wpf.dll
+
+
+ ..\packages\Prism.Wpf.8.1.97\lib\net47\Prism.Wpf.dll
+
+
+
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
+
+
+ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.Data.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.FileDialogs.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.GridView.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.Input.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Controls.Navigation.dll
+
+
+ False
+ ..\SWS.CAD\RefDLL\WPF45\Telerik.Windows.Data.dll
+
+
+ ..\packages\Unity.Abstractions.5.11.7\lib\net48\Unity.Abstractions.dll
+
+
+ ..\packages\Unity.Container.5.11.11\lib\net48\Unity.Container.dll
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Config.xaml
+
+
+ customWindowTitleBar.xaml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ DialogInput.xaml
+
+
+ DialogSignalManagement.xaml
+
+
+ DialogSignalNotice.xaml
+
+
+ DialogSignalPropertyhisAndLogs.xaml
+
+
+ DialogSignalSelect.xaml
+
+
+ DialogTest.xaml
+
+
+ Login.xaml
+
+
+ MainWindow.xaml
+
+
+ Project.xaml
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+ PreserveNewest
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ MSBuild:Compile
+ Designer
+
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/DI-Electrical/DI-Electrical.csproj.user b/newFront/c#前端/DI-Electrical/DI-Electrical.csproj.user
new file mode 100644
index 00000000..0b246432
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/DI-Electrical.csproj.user
@@ -0,0 +1,6 @@
+
+
+
+ ProjectFiles
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/DI-Electrical/Event/loginEvent.cs b/newFront/c#前端/DI-Electrical/Event/loginEvent.cs
new file mode 100644
index 00000000..77a5e263
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Event/loginEvent.cs
@@ -0,0 +1,14 @@
+using Newtonsoft.Json.Linq;
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DI_Electrical.Event
+{
+ public class loginEvent: PubSubEvent
+ {
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Helper/ConfigService.cs b/newFront/c#前端/DI-Electrical/Helper/ConfigService.cs
new file mode 100644
index 00000000..dbfee4b3
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Helper/ConfigService.cs
@@ -0,0 +1,107 @@
+using System;
+using System.IO;
+using DI_Electrical.Services;
+using IniParser;
+
+namespace DI_Electrical.Helper
+{
+ public class ConfigService
+ {
+ //public string path = Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\AppData\Roaming\SWS\Config.ini");
+ public string path = GlobalObject.ConfigPath;// Path.Combine(AppDomain.CurrentDomain.BaseDirectory,@"\Config.ini");
+ public FileIniDataParser parser = new FileIniDataParser();
+ public HttpService _httpService;
+ ///
+ /// config.ini 给默认值,且创建出来
+ ///
+ void SetDefaultConfigValue()
+ {
+ if (!File.Exists(path))
+ {
+ //默认值
+ var data = parser.Parser.Parse("");
+ data["Profile"]["Address"] = "1.117.161.11";
+ data["Profile"]["Port"] = "8080";
+ string userProfilePath = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
+
+ data["Profile"]["Directory"] = $"{userProfilePath}\\AppData\\Roaming\\SWS";
+ Directory.CreateDirectory(Path.GetDirectoryName(path));
+ parser.WriteFile(path, data);
+ GlobalObject.isConfigIniCreateBySys = true;
+ }
+ else
+ {
+ GlobalObject.isConfigIniCreateBySys = false;
+ }
+ }
+ public ConfigService(HttpService httpService)
+ {
+ _httpService = httpService;
+ SetDefaultConfigValue();
+ string address;
+ int port;
+ string locDrawingPath;
+ Read(out address, out port,out locDrawingPath);
+ _httpService.Init(address, port);
+ }
+ public void Read(out string address, out int port, out string directory)
+ {
+ var data = parser.ReadFile(path);
+ address = data["Profile"]["Address"];
+ port = int.Parse(data["Profile"]["Port"]);
+ directory = data["Profile"]["Directory"];
+ }
+
+ ///
+ /// 查询某个
+ ///
+ ///
+ ///
+ public string Read(string keyName)
+ {
+ var data = parser.ReadFile(path);
+ return data["Profile"][keyName];
+ }
+ ///
+ /// 查询某个
+ ///
+ /// 节点
+ /// key名称
+ ///
+ public string Read(string session,string keyName)
+ {
+ try
+ {
+ var data = parser.ReadFile(path);
+ return data[session][keyName];
+ }
+ catch
+ {
+ return null;
+ }
+ }
+ ///
+ /// 保存某个
+ ///
+ ///
+ ///
+ public void Save(string keyName, string value)
+ {
+ var data = parser.ReadFile(path);
+ data["Profile"][keyName] = value;
+ parser.WriteFile(path, data);
+ }
+ ///
+ /// 保存某个值
+ ///
+ /// 节点
+ /// key名称
+ /// 值
+ public void Save(string session, string keyName, string value)
+ {
+ var data = parser.ReadFile(path);
+ data[session][keyName] = value;
+ parser.WriteFile(path, data);
+ }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Helper/Converter/CollectionToStringConverter.cs b/newFront/c#前端/DI-Electrical/Helper/Converter/CollectionToStringConverter.cs
new file mode 100644
index 00000000..c3cf061c
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Helper/Converter/CollectionToStringConverter.cs
@@ -0,0 +1,45 @@
+using System;
+using System.Collections.ObjectModel;
+using System.Globalization;
+using System.Windows.Data;
+using DI_Electrical.Models;
+
+namespace DI_Electrical.Helper.Converter
+{
+ public class CollectionToStringConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ ObservableCollection WHCPUs = value as ObservableCollection;
+ if (WHCPUs != null)
+ {
+ string sWHCPU = "";
+ for (int i = 0; i < WHCPUs.Count; i++)
+ {
+ if (i!= WHCPUs.Count-1)
+ {
+ if (WHCPUs[i] != null)
+ {
+ sWHCPU = sWHCPU + WHCPUs[i].DataItemCode + "|";
+ }
+ }
+ else
+ {
+ if (WHCPUs[i] != null)
+ {
+ sWHCPU = sWHCPU + WHCPUs[i].DataItemCode;
+ }
+
+ }
+ }
+ return sWHCPU;
+ }
+ return null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Helper/Converter/RadGridViewRowToBoolConverter.cs b/newFront/c#前端/DI-Electrical/Helper/Converter/RadGridViewRowToBoolConverter.cs
new file mode 100644
index 00000000..227021a3
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Helper/Converter/RadGridViewRowToBoolConverter.cs
@@ -0,0 +1,55 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using DI_Electrical.ViewModels;
+
+namespace DI_Electrical.Helper.Converter
+{
+ public class RadGridViewRowToBoolConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ SignalManagementInfo smif = value as SignalManagementInfo;
+ if (smif != null)
+ {
+ if (smif.Status.Equals("deleted") || smif.Status.Equals("Confirmed"))
+ {
+ return true;
+ }
+ if (smif.type.Equals("信号"))
+ {
+ switch (parameter.ToString())
+ {
+ case "关联的电缆信息":
+ case "关联的通道信息":
+ return true;
+ }
+ }
+ else
+ {
+ switch (parameter.ToString())
+ {
+ case "组别":
+ case "编码":
+ case "信号类型":
+ case "Min":
+ case "Max":
+ case "单位":
+ case "CODE":
+ case "设备名":
+ case "关联的电缆信息":
+ case "关联的通道信息":
+ return true;
+ }
+ }
+
+ }
+ return false;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Helper/Converter/StatusToColourConverter.cs b/newFront/c#前端/DI-Electrical/Helper/Converter/StatusToColourConverter.cs
new file mode 100644
index 00000000..627eb147
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Helper/Converter/StatusToColourConverter.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Globalization;
+using System.Windows.Data;
+using DI_Electrical.ViewModels;
+
+namespace DI_Electrical.Helper.Converter
+{
+ internal class StatusToColourConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ SignalManagementInfo smif = value as SignalManagementInfo;
+ if (smif != null)
+ {
+ return smif.Status;
+ }
+ return null;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Helper/FileHelper.cs b/newFront/c#前端/DI-Electrical/Helper/FileHelper.cs
new file mode 100644
index 00000000..b1c4b224
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Helper/FileHelper.cs
@@ -0,0 +1,118 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Dl_Electrical.Helper
+{
+ public static class FileHelper
+ {
+ ///
+ /// dwg等文件名是否合法。不带后缀
+ ///
+ ///
+ ///
+ public static bool IsValidFileName(string fileName)
+ {
+ if (string.IsNullOrEmpty(fileName))
+ {
+ return false;
+ }
+
+ // 获取 Windows 文件系统中不允许出现在文件名中的字符数组
+ char[] invalidChars = Path.GetInvalidFileNameChars();
+
+ // 检查文件名中是否包含非法字符
+ foreach (char c in invalidChars)
+ {
+ if (fileName.IndexOf(c) >= 0)
+ {
+ return false;
+ }
+ }
+
+ // 检查是否为保留文件名
+ string[] reservedNames = { "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" };
+ string trimmedFileName = Path.GetFileNameWithoutExtension(fileName).Trim().ToUpper();
+ foreach (string reservedName in reservedNames)
+ {
+ if (trimmedFileName == reservedName)
+ {
+ return false;
+ }
+ }
+
+ // 检查文件名是否以空格或句点结尾
+ if (fileName.TrimEnd().Length != fileName.Length || fileName.TrimEnd('.').Length != fileName.Length)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+
+ public static string GetFileMD5(string filePath)
+ {
+ if (string.IsNullOrEmpty(filePath) || !File.Exists(filePath))
+ {
+ throw new ArgumentException("文件路径无效或文件不存在", nameof(filePath));
+ }
+
+ using (var md5 = MD5.Create()) // 创建 MD5 哈希算法实例
+ using (var stream = File.OpenRead(filePath)) // 打开文件流
+ {
+ // 计算文件的 MD5 值
+ byte[] hashBytes = md5.ComputeHash(stream);
+
+ // 将字节数组转换为十六进制字符串
+ StringBuilder sb = new StringBuilder();
+ foreach (var b in hashBytes)
+ {
+ sb.Append(b.ToString("x2")); // x2 格式化为两位小写十六进制数
+ }
+
+ return sb.ToString(); // 返回 MD5 值的字符串
+ }
+ }
+
+ #region 检查文件是否被其他进程占用
+ ///
+ /// 检查文件是否被其他进程占用
+ ///
+ public static bool IsFileLocked(string filePath)
+ {
+ try
+ {
+ // 尝试以独占模式打开文件
+ using (FileStream fs = File.Open(
+ filePath,
+ FileMode.Open,
+ FileAccess.ReadWrite,
+ FileShare.None)) // FileShare.None 表示禁止共享
+ {
+ return false; // 成功打开则未被占用
+ }
+ }
+ catch (IOException ex)
+ {
+ // 检查特定错误码
+ int errorCode = Marshal.GetHRForException(ex) & 0xFFFF;
+ return errorCode == 32 || errorCode == 33; // 32: 共享冲突, 33: 进程锁定
+ }
+ catch (UnauthorizedAccessException)
+ {
+ return true; // 无权限访问(可能被占用)
+ }
+ catch
+ {
+ return false; // 其他异常视为未被占用
+ }
+ }
+ #endregion
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Helper/LoggerHelper.cs b/newFront/c#前端/DI-Electrical/Helper/LoggerHelper.cs
new file mode 100644
index 00000000..49673fbc
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Helper/LoggerHelper.cs
@@ -0,0 +1,145 @@
+using System;
+using System.IO;
+using System.Reflection;
+using Dl_Electrical.Helper;
+using Newtonsoft.Json.Linq;
+
+namespace DI_Electrical.Helper
+{
+ ///
+ /// nLog使用帮助类
+ ///
+ public class LoggerHelper
+ {
+ private static readonly log4net.ILog loginfo = log4net.LogManager.GetLogger("loginfo");
+ private static readonly log4net.ILog logerror = log4net.LogManager.GetLogger("logerror");
+ private static readonly log4net.ILog logdebug = log4net.LogManager.GetLogger("logdebug");
+ private static readonly log4net.ILog logwarn = log4net.LogManager.GetLogger("logwarn");
+ private static readonly log4net.ILog logfatal = log4net.LogManager.GetLogger("logfatal");
+
+ private static LoggerHelper _obj = null;
+ private static string logPath = string.Empty;
+ private LoggerHelper()
+ {
+ string codeBase = Assembly.GetExecutingAssembly().CodeBase;
+ string dllPath = codeBase.Replace("file:///", "");
+ dllPath = Path.GetDirectoryName(dllPath);
+ logPath = Path.Combine(dllPath, "Logs\\");
+ var configFile = new FileInfo(Path.Combine(dllPath, "log4net.config"));
+ log4net.Config.XmlConfigurator.ConfigureAndWatch(configFile);
+ }
+ ///
+ /// 获取当前的日志记录对象。
+ ///
+ public static LoggerHelper Current
+ {
+ get => _obj ?? (new LoggerHelper());
+ set => _obj = value;
+ }
+
+ #region Debug,调试
+ ///
+ /// 调试信息输出。
+ ///
+ /// 需要记录的信息。
+ public void Debug(string msg)
+ {
+ logdebug.Debug(msg);
+ }
+
+ #endregion
+
+ #region Info,信息
+ ///
+ /// 普通信息输出。
+ ///
+ /// 需要记录的信息。
+ public void Info(string msg)
+ {
+ loginfo.Info(msg);
+ }
+
+ #endregion
+
+ #region Warn,警告
+ ///
+ /// 警告级别信息输出。
+ ///
+ /// 需要记录的信息。
+ public void Warn(string msg)
+ {
+ logwarn.Warn(msg);
+ }
+
+ #endregion
+
+ #region Error,错误
+ ///
+ /// 错误级别信息输出。
+ ///
+ /// 需要记录的信息。
+ public void Error(string msg)
+ {
+ logerror.Error("----------------------------Error BEGIN------------------------------");
+ logerror.Error(msg);
+ logerror.Error("-----------------------------Error END-------------------------------");
+ }
+ #endregion
+
+ #region Fatal,致命错误
+ ///
+ /// 致命错误级别信息输出。
+ ///
+ /// 需要记录的信息。
+ /// 需要记录的系统异常。
+ public void Fatal(string msg)
+ {
+ logfatal.Fatal("----------------------------Fatal BEGIN------------------------------");
+ logerror.Fatal(msg);
+ logerror.Fatal("-----------------------------Fatal END-------------------------------");
+ }
+ #endregion
+
+ #region 输出json日志
+
+ ///
+ /// 输出json日志
+ ///
+ /// json方法名
+ /// json数据
+ public void WriteJson(string funName, string json)
+ {
+ try
+ {
+ //json路径文件名 Environment.ExpandEnvironmentVariables(@"%USERPROFILE%\AppData\Roaming\SWS\Logs\"
+ string filename = Path.Combine(logPath, funName + ".json");
+ //判断文件是否被打开占用
+ if (!FileHelper.IsFileLocked(filename))
+ {
+ File.Delete(filename);
+ string strJson = string.Empty;
+ if (json.StartsWith("["))
+ {
+ //格式化json数据 当前为组类型
+ JArray jobj = JArray.Parse(json);
+ strJson = jobj.ToString();
+ }
+ else if (json.StartsWith("{"))
+ {
+ //格式化json数据 当前为类类型
+ JObject jobj = JObject.Parse(json);
+ strJson = jobj.ToString();
+ }
+ //创建json文件,并输出数据
+ FileStream fs = new FileStream(filename, FileMode.Append);
+ StreamWriter wr = null;
+ wr = new StreamWriter(fs);
+ wr.WriteLine(strJson);
+ wr.Close();
+ }
+ }
+ catch { }
+ }
+ #endregion
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Helper/PasswordHelper.cs b/newFront/c#前端/DI-Electrical/Helper/PasswordHelper.cs
new file mode 100644
index 00000000..107ad48f
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Helper/PasswordHelper.cs
@@ -0,0 +1,51 @@
+using Microsoft.Xaml.Behaviors;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using Telerik.Windows.Controls;
+
+namespace DI_Electrical.Helper
+{
+ public class PasswordBoxBehavior : Behavior
+ {
+ public static readonly DependencyProperty PasswordProperty =
+ DependencyProperty.Register(nameof(Password), typeof(string), typeof(PasswordBoxBehavior),
+ new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnPasswordChanged));
+
+ public string Password
+ {
+ get { return (string)GetValue(PasswordProperty); }
+ set { SetValue(PasswordProperty, value); }
+ }
+
+ protected override void OnAttached()
+ {
+ base.OnAttached();
+ AssociatedObject.PasswordChanged += OnPasswordChanged;
+ }
+
+ protected override void OnDetaching()
+ {
+ base.OnDetaching();
+ AssociatedObject.PasswordChanged -= OnPasswordChanged;
+ }
+
+ private void OnPasswordChanged(object sender, RoutedEventArgs e)
+ {
+ Password = AssociatedObject.Password;
+ }
+
+ private static void OnPasswordChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ if (d is PasswordBoxBehavior behavior)
+ {
+ behavior.AssociatedObject.Password = e.NewValue as string ?? string.Empty;
+ }
+ }
+ }
+
+
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/NoEntity/ConfigIni.cs b/newFront/c#前端/DI-Electrical/Model/NoEntity/ConfigIni.cs
new file mode 100644
index 00000000..a060f56c
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/NoEntity/ConfigIni.cs
@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DI_Electrical.Model
+{
+ public class ConfigIni
+ {
+ ///
+ /// 用户名
+ ///
+ public string UserName { get; set; }
+ ///
+ /// 用户密码
+ ///
+ public string UserPs { get; set; }
+ ///
+ /// 项目id
+ ///
+ public string ProjectID { get; set; }
+ ///
+ /// 服务器ip
+ ///
+ public string Address { get; set; }
+ ///
+ /// 端口
+ ///
+ public string Port { get; set; }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/NoEntity/PageModel.cs b/newFront/c#前端/DI-Electrical/Model/NoEntity/PageModel.cs
new file mode 100644
index 00000000..6867d306
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/NoEntity/PageModel.cs
@@ -0,0 +1,11 @@
+using System.Collections.Generic;
+
+namespace DI_Electrical.Model
+{
+ public class PageModel
+ {
+ public List Rows { get; set; }
+ public int Total { get; set; }
+ public int Records { get; set; }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/NoEntity/learunHttpRes.cs b/newFront/c#前端/DI-Electrical/Model/NoEntity/learunHttpRes.cs
new file mode 100644
index 00000000..cef59a30
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/NoEntity/learunHttpRes.cs
@@ -0,0 +1,13 @@
+namespace DI_Electrical.Model
+{
+ ///
+ /// learun mvc标准的http返回结果
+ ///
+ ///
+ public class learunHttpRes
+ {
+ public int code { get; set; }
+ public string info { get; set; }
+ public T data { get; set; }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/NoEntity/loginRes.cs b/newFront/c#前端/DI-Electrical/Model/NoEntity/loginRes.cs
new file mode 100644
index 00000000..1f1741d5
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/NoEntity/loginRes.cs
@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DI_Electrical.Model
+{
+ public class loginRes
+ {
+ public string token { get; set; }
+ public string loginMark { get; set; }
+ public string account { get; set; }
+ public string userId { get; set; }
+ public string RealName { get; set; }
+
+ public string userPs { get; set; }
+ public string IsIOModuleAdmin { get; set; }
+ public string isFirstLogin { get; set; }
+ public string Department { get; set; }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/ec_Wire_Group.cs b/newFront/c#前端/DI-Electrical/Model/ec_Wire_Group.cs
new file mode 100644
index 00000000..51f82012
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/ec_Wire_Group.cs
@@ -0,0 +1,438 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DI_Electrical.Models
+{
+ public class ec_Wire_Group
+ {
+ public ec_Wire_Group()
+ {
+ //SoftTags = new List();
+ NewSoftTags = new List();
+ //Status = WireGroupStatusEnum.New;
+ }
+ #region 实体成员
+ ///
+ /// 状态。比如“待删除的”。默认为New
+ /// 去找lr base dataitem数据字典的be_signalstate
+ ///
+ //[JsonConverter(typeof(SignalStatusConverter))]
+ public WireGroupStatusEnum Status { get; set; } = WireGroupStatusEnum.New;
+
+ ///
+ /// 某一个输出的信号,可以关联多个输入的信号。关联的是
+ ///
+ public string LinkedID { get; set; } = "";
+
+ ///
+ /// ID
+ ///
+ ///
+
+ public string Wire_Group_ID { get; set; }
+
+ ///
+ /// 信号名称(CH. No.)。
+ /// 1462,C列。
+ /// 8600,A列。
+ /// 如果是虚拟点。就是主信号+
+ ///
+ ///
+ public string Group_Name { get; set; } = "";
+ ///
+ /// ChannelID。ec_panel_channel里。
+ /// 如果为空,说明这个信号是关联前的状态(或者说未关联的状态)
+ ///
+ ///
+ public string ChannelID { get; set; } = "";
+ ///
+ /// 英文描述(Description)。
+ /// 1462,D列。
+ /// 8600,B列。
+ ///
+ ///
+ public string Group_Desc_EN { get; set; } = "";
+ ///
+ /// 中文描述。
+ /// 8600,B列(第二行)。
+ ///
+ ///
+ public string Group_Desc { get; set; } = "";
+ ///
+ /// (Signal_Type)信号类型,如4-20mA。
+ /// 1462,I列。
+ /// 8600,E列(模拟量)或F列(开关量)。
+ ///
+ ///
+ public string IO_Type { get; set; } = "";
+
+ ///
+ /// 信号的分组(组成Group Name的第一部分)
+ ///
+ ///
+ public string Signal_Group { get; set; } = "";
+ ///
+ /// 信号的序号(组成Group Name的第二部分)
+ ///
+ ///
+ public string Signal_SeqNo { get; set; } = "";
+ ///
+ /// 信号组模板ID(平台上,savesignal时,不会带出这个)。
+ /// 只是公司级上才有意义。
+ ///
+ ///
+ public string WireGroupTemplateID { get; set; } = "";
+ ///
+ /// 代码。
+ /// 1462,H列。
+ ///
+ ///
+ public string Code { get; set; } = "";
+ ///
+ /// Range_Min。
+ /// 1462,J列。
+ /// 8600,G列(111~222)。
+ ///
+ ///
+ public string Range_Min { get; set; } = "";
+ ///
+ /// Range_Max.
+ /// 1462,k列。
+ /// 8600,G列(111~222)。
+ ///
+ ///
+ public string Range_Max { get; set; } = "";
+ ///
+ /// Range_Min和Range_Max的单位。
+ /// 1462,L列。
+ /// 8600,H列。
+ ///
+ ///
+ public string Unit { get; set; } = "";
+ ///
+ /// Alarm_LL。
+ /// 1462,m列。
+ /// 8600,J列(第一行或第二行不确定)。
+ ///
+ ///
+ public string Alarm_LL { get; set; } = "";
+ ///
+ /// Alarm_L。
+ /// 1462,n列。
+ /// 8600,I列(第一行或第二行不确定)。
+ ///
+ ///
+ public string Alarm_L { get; set; } = "";
+ ///
+ /// Alarm_H。
+ /// 1462,o列。
+ /// 8600,I列(第一行或第二行不确定)。
+ ///
+ ///
+ public string Alarm_H { get; set; } = "";
+ ///
+ /// Alarm_HH。
+ /// 1462,p列。
+ /// 8600,J列(第一行或第二行不确定)。
+ ///
+ ///
+ public string Alarm_HH { get; set; } = "";
+ ///
+ /// AL_GRP 延申报警组。
+ /// 1462,S列。
+ /// 8600,U列。
+ ///
+ ///
+ public string AL_GRP { get; set; } = "";
+ ///
+ /// BL_GRP 抑制报警。
+ /// 1462,T列。
+ /// 8600,T列。
+ ///
+ ///
+ public string BL_GRP { get; set; } = "";
+ ///
+ /// 延时。
+ /// 1462,U列。
+ /// 8600,S列。
+ ///
+ ///
+ public string Time_Delay { get; set; } = "";
+ ///
+ /// 供应商。
+ /// 1463,V列。
+ /// 8600,L列。
+ ///
+ ///
+ public string Supplier { get; set; } = "";
+
+ ///
+ /// 设备名
+ ///
+ ///
+ public string EquipName { get; set; } = "";
+ ///
+ /// 传感器代码。
+ /// 1462,W列。
+ /// 8600,K列。
+ ///
+ ///
+ public string SENSOR_CODE { get; set; } = "";
+ ///
+ /// VDR_Record。
+ /// 1462,X列。
+ ///
+ ///
+ public bool VDR_Record { get; set; } = false;
+
+ ///
+ /// 是否为slow down信号。
+ /// 1462,Q列。
+ ///
+ ///
+ public bool SLD { get; set; } = false;
+
+ ///
+ /// 是否为shut down信号。
+ /// 1462,R列。
+ ///
+ ///
+ public bool SHD { get; set; } = false;
+ ///
+ /// Remarks。
+ /// 1462,Y列。
+ /// 8600,X列。
+ ///
+ ///
+ public string Remarks { get; set; } = "";
+
+ ///
+ /// 信号归属
+ /// true,代表该信号是电气进行最终审核确认;
+ /// false,代表该信号是轮机进行最终审核确认;
+ ///
+ public bool ElecOnly { get; set; } = false;
+
+ ///
+ /// 是否为通讯点。
+ /// 1462,通过里的文字判断
+ /// 8600,通过K列里的文字判断
+ ///
+ public bool CommunicationPoint { get; set; } = false;
+
+
+ /////
+ ///// ECC 。Bool类型数据库要么是int要么是bool
+ /////
+ //public bool ECC { get; set; } = false;
+
+ /////
+ ///// WCC
+ /////
+ //public bool WCC { get; set; } = false;
+ /////
+ ///// BCC
+ /////
+ //public bool BCC { get; set; } = false;
+ ///
+ /// IO类型,AI AO DI DO
+ ///
+ public string InOrOut { get; set; } = "";
+ ///
+ /// 驾驶室(控制台)。
+ /// 8600,M列。导入时,如果2行都有值,中间会|分开
+ ///
+ public string WHConsole { get; set; } = "";
+ ///
+ /// 驾驶室(计算机)。
+ /// 8600,N列。导入时,如果2行都有值,中间会|分开
+ ///
+ public string WHCPU { get; set; } = "";
+ ///
+ /// 集控室(控制台)。
+ /// 8600,O列。导入时,如果2行都有值,中间会|分开
+ ///
+ public string ECRConsole { get; set; } = "";
+ ///
+ /// 集控室(计算机)。
+ /// 8600,P列(excel中,两行均有值时,以|分开)
+ ///
+ public string ECRCPU { get; set; } = "";
+ ///
+ /// 船舶办公室(控制台)。
+ /// 8600,Q列。导入时,如果2行都有值,中间会|分开
+ ///
+ public string ShipOfficeConsole { get; set; } = "";
+ ///
+ /// 船舶办公室(计算机)。
+ /// 8600,R列。导入时,如果2行都有值,中间会|分开
+ ///
+ public string ShipOfficeCPU { get; set; } = "";
+ ///
+ /// 安全保护。(和 列有关系)
+ /// 8600,V列。
+ ///
+ public string SafetyProt { get; set; } = "";
+ ///
+ /// 安全保护延时。
+ /// 8600,V列下。
+ ///
+ public string SafetyDelay { get; set; } = "";
+
+ ///
+ /// SeriousType
+ /// 1462,AG列。
+ ///
+ ///
+ public string SeriousType { get; set; } = "";
+
+ ///
+ /// 自动控制。
+ /// 8600,W列。
+ ///
+ public string AutoCtrl { get; set; } = "";
+ ///
+ /// 爸爸。如果有值,则代表其为虚拟点的概念
+ ///
+ ///
+ public string ParentID { get; set; } = "";
+ ///
+ /// 删除标记。因为哪怕是删除了,也要保留数据,以便日后查看。
+ ///
+ public bool DeleteFlg { get; set; } = false;
+
+ ///
+ /// 电缆位号(某些项目的里,是允许编辑的IO_allowManualAssign)
+ ///
+ public string CableName { get; set; }
+ ///
+ /// 通讯类信号的母线ID
+ ///
+ public string CableId { get; set; }
+ ///
+ /// 创建人
+ ///
+ ///
+ public string CreateUserID { get; set; }
+ ///
+ /// 创建时间
+ ///
+ ///
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 更新人
+ ///
+ ///
+ public string UpdateUserID { get; set; }
+ ///
+ /// 更新时间
+ ///
+ ///
+ public DateTime? UpdateTime { get; set; }
+ #endregion
+
+
+ #region 扩展字段
+ /////
+ ///// 虚拟点 集合
+ /////
+ ////[SugarColumn(IsIgnore = true)]
+ //[Obsolete]
+ //[Navigate(NavigateType.OneToMany, nameof(ec_SofttagEntity.Wire_Group_ID))] //配置了导航,方便DeleteNav,ec_softtag表中的wiregroupid
+ //public List SoftTags { get; set; }
+
+
+
+ public List NewSoftTags { get; set; }
+ ///
+ /// 柜子
+ ///
+
+ public string PanelName { get; set; }
+ ///
+ /// 通道号
+ ///
+
+ public string ChannelName { get; set; }
+ ///
+ /// 端子排
+ ///
+
+ public string StripName { get; set; }
+
+ ///
+ /// 电缆对
+ ///
+
+ public string CableSetName { get; set; }
+
+ ///
+ /// status的具体文字描述
+ ///
+
+ public string StatusValue { get; set; }
+
+
+ ///
+ /// 操作历史(因为现在插件端的保存是一次性的。哪怕有多个动作,也只是一次提交)
+ ///
+
+ public List ActionHistorys { get; set; }
+
+ ///
+ /// 信号属性变更历史
+ ///
+
+ public List Propertyhis { get; set; }
+
+ ///
+ /// 信号日志
+ ///
+
+ public List Logs { get; set; }
+ #endregion
+ }
+ public enum WireGroupStatusEnum
+ {
+ ///
+ /// 待删除
+ ///
+ [Description("待删除")]
+ ToDelete = 01,
+ ///
+ /// 新增的
+ ///
+ [Description("新增的")]
+ New = 02,
+ ///
+ /// 已关联
+ ///
+ [Description("已使用(关联)")]
+ Used = 03,
+ ///
+ /// 已审核
+ ///
+ [Description("已确认(审核)")]
+ Confirmed = 04,
+ ///
+ /// 重新打开
+ ///
+ [Description("重新打开")]
+ Reopen = 05,
+ ///
+ /// 彻底删除
+ ///
+ [Description("彻底删除")]
+ deleted = 06
+ }
+ public class ActionHistory
+ {
+ public DateTime? ActionTime { get; set; }
+ public Action ActionType { get; set; }
+ public string reason { get; set; }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/ec_dataitemdetail.cs b/newFront/c#前端/DI-Electrical/Model/ec_dataitemdetail.cs
new file mode 100644
index 00000000..b655e641
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/ec_dataitemdetail.cs
@@ -0,0 +1,81 @@
+using DryIoc.ImTools;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DI_Electrical.Models
+{
+ public class ec_dataitemdetail
+ {
+ #region 实体成员
+ ///
+ /// 字典明细ID
+ ///
+
+ public string DataItemDetailID { get; set; }
+ ///
+ /// 字典分类ID(存的是
+ ///
+ public string DataItemID { get; set; } = "";
+ ///
+ /// 上级字典明细ID。
+ ///
+ public string UpDataItemDetailID { get; set; } = "";
+ ///
+ /// 字典明细名称
+ ///
+ public string DataItemName { get; set; } = "";
+ ///
+ /// 字典明细名称(英文)
+ ///
+ public string DataItemNameEN { get; set; } = "";
+ ///
+ /// 字典明细编号
+ ///
+ public string DataItemCode { get; set; } = "";
+ ///
+ /// 排序
+ ///
+ public int? OrderID { get; set; }
+ ///
+ /// 是否有效
+ ///
+ public int? IsEnabled { get; set; }
+ ///
+ /// 备注
+ ///
+ public string Remark { get; set; } = "";
+ ///
+ /// 创建人
+ ///
+ public string CreateUserID { get; set; }
+ ///
+ /// 创建时间
+ ///
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 更新人
+ ///
+ public string UpdateUserID { get; set; }
+ ///
+ /// 更新时间
+ ///
+ public DateTime? UpdateTime { get; set; }
+ #endregion
+
+ #region 扩展字段
+ ///
+ /// 字典编号。如Be_signal_group
+ ///
+
+ public string ItemCode { get; set; } = "";
+ ///
+ /// 信号
+ ///
+
+ public List Signals { get; set; }
+ #endregion
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/ec_project.cs b/newFront/c#前端/DI-Electrical/Model/ec_project.cs
new file mode 100644
index 00000000..979d1dce
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/ec_project.cs
@@ -0,0 +1,123 @@
+using System;
+
+namespace DI_Electrical.Model
+{
+ ///
+ /// 项目
+ ///
+ public class ec_project
+ {
+ #region 实体成员
+ ///
+ /// 项目ID
+ ///
+ ///
+ public string ProjectId { get; set; }
+ ///
+ /// 项目名称
+ ///
+ ///
+ public string ProjectName { get; set; } = "";
+ ///
+ /// 项目代号
+ ///
+ ///
+ public string ProjectCode { get; set; } = "";
+
+ /////
+ ///// 船检
+ /////
+ //public string ShipCheck { get; set; } = "";
+ ///
+ /// 船名(中文)
+ ///
+ ///
+ public string ShipNameCN { get; set; } = "";
+ ///
+ /// 船名(英文)
+ ///
+ ///
+ public string ShipNameEN { get; set; } = "";
+ ///
+ /// 船型(中文)
+ ///
+ ///
+ public string ShipTypeCN { get; set; } = "";
+ ///
+ /// 船型(英文)
+ ///
+ ///
+ public string ShipTypeEN { get; set; } = "";
+ ///
+ /// 船级社(id)。和船检的概念有些冲突
+ ///
+ ///
+ public string ShipSociety { get; set; } = "";
+ ///
+ /// 船东
+ ///
+ ///
+ public string ShipOwner { get; set; } = "";
+ ///
+ /// 挂旗国(船籍国)
+ ///
+ ///
+ public string FlagState { get; set; } = "";
+ ///
+ /// IMO编号
+ ///
+ ///
+ public string IMONumber { get; set; } = "";
+ ///
+ /// 项目更多描述一
+ ///
+ ///
+ public string Describe1 { get; set; } = "";
+ ///
+ /// 项目更多描述二
+ ///
+ ///
+ public string Describe2 { get; set; } = "";
+ ///
+ /// 项目更多描述三
+ ///
+ ///
+ public string Describe3 { get; set; } = "";
+ ///
+ /// 项目更多描述四
+ ///
+ ///
+ public string Describe4 { get; set; } = "";
+ ///
+ /// 项目更多描述五
+ ///
+ ///
+ public string Describe5 { get; set; } = "";
+ ///
+ /// 项目序号
+ ///
+ ///
+ public int? ProjectIndex { get; set; }
+ ///
+ /// 创建人
+ ///
+ ///
+ public string CreateUserID { get; set; }
+ ///
+ /// 创建时间
+ ///
+ ///
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 更新人
+ ///
+ ///
+ public string UpdateUserID { get; set; }
+ ///
+ /// 更新时间
+ ///
+ ///
+ public DateTime? UpdateTime { get; set; }
+ #endregion
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/ec_wire_group_log.cs b/newFront/c#前端/DI-Electrical/Model/ec_wire_group_log.cs
new file mode 100644
index 00000000..a7770640
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/ec_wire_group_log.cs
@@ -0,0 +1,95 @@
+using Newtonsoft.Json.Converters;
+using Newtonsoft.Json;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace DI_Electrical.Models
+{
+ public class ec_wire_group_log
+ {
+ public ec_wire_group_log()
+ {
+
+ }
+ public ec_wire_group_log(Action OperateType, string WireGroupID)
+ {
+ this.OperateType = OperateType;
+ this.WireGroupID = WireGroupID;
+
+ }
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// 因为的关系,所以时间是有值的
+ public ec_wire_group_log(Action OperateType, string WireGroupID, DateTime? createtime)
+ {
+ this.OperateType = OperateType;
+ this.WireGroupID = WireGroupID;
+
+ if (createtime != null)
+ {
+ this.CreateTime = createtime;
+ }
+
+ }
+ #region 实体成员
+ ///
+ /// 操作日志ID
+ ///
+ ///
+
+ public string WireGroupLogID { get; set; }
+ ///
+ /// 信号ID
+ ///
+ ///
+ public string WireGroupID { get; set; }
+ ///
+ /// 操作类型
+ ///
+ ///
+ [JsonConverter(typeof(StringEnumConverter))]
+ public Action OperateType { get; set; }
+ ///
+ /// 备注
+ ///
+ ///
+ public string ExtraMsg { get; set; }
+ ///
+ /// 创建人
+ ///
+ ///
+ public string CreateUserID { get; set; }
+ ///
+ /// 创建时间
+ ///
+ ///
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 更新人
+ ///
+ ///
+ public string UpdateUserID { get; set; }
+ ///
+ /// 更新时间
+ ///
+ ///
+ public DateTime? UpdateTime { get; set; }
+ #endregion
+
+
+ #region 扩展字段
+ ///
+ /// 创建人名称
+ ///
+ ///
+
+ public string CreateUserName { get; set; }
+ #endregion
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/ec_wire_group_notice.cs b/newFront/c#前端/DI-Electrical/Model/ec_wire_group_notice.cs
new file mode 100644
index 00000000..df9893ee
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/ec_wire_group_notice.cs
@@ -0,0 +1,130 @@
+using System;
+
+namespace DI_Electrical.Models
+
+{
+ ///
+ /// 动作。和状态是两码事情。
+ ///
+ public enum Action
+ {
+
+ 新增 = 0,
+ 修改 = 1,
+ 准备删除 = 2,
+ 撤销删除 = 3,
+ 删除 = 4,
+ 关联通道 = 5,
+ 审核 = 6,
+ 重新打开 = 7,
+ 关联解除 = 8,
+ 回收站恢复 = 9
+ }
+
+ public enum Department
+ {
+ 轮机 = 0,
+ 电气 = 1
+ }
+
+ public class ec_wire_group_notice
+ {
+ public ec_wire_group_notice()
+ {
+ }
+ ///
+ ///
+ ///
+ ///
+ /// 接收方
+ ///
+ public ec_wire_group_notice(Action action, Department departmentRetrieveNotice, string WireGroupID)
+ {
+ ActionID = action;
+ CompanyID = departmentRetrieveNotice;
+ this.WireGroupID = WireGroupID;
+
+ }
+
+ #region 实体成员
+ ///
+ /// 信号表通知ID
+ ///
+ ///
+ public string WireGroupNoticeID { get; set; }
+ ///
+ /// 信号ID
+ ///
+ ///
+ public string WireGroupID { get; set; } = "";
+ ///
+ /// 动作
+ ///
+ ///
+ public Action ActionID { get; set; }
+
+ ///
+ /// 额外的消息(如删除时,必须要给一个删除理由)
+ ///
+ ///
+ public string Message { get; set; } = "";
+ ///
+ /// 是否被确认。false未读。true已读。
+ ///
+ public bool CheckFLG { get; set; } = false;
+ ///
+ /// 接收者的部门
+ ///
+ public Department CompanyID { get; set; }
+ ///
+ /// 创建人(也就是发起通知的人)
+ ///
+ ///
+ public string CreateUserID { get; set; }
+ ///
+ /// 创建时间
+ ///
+ ///
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 更新人(也就是确认这个消息已阅的人)
+ ///
+ ///
+ public string UpdateUserID { get; set; }
+ ///
+ /// 更新时间
+ ///
+ ///
+ public DateTime? UpdateTime { get; set; }
+ #endregion
+
+ #region 扩展字段
+
+ ///
+ /// 动作(描述)
+ ///
+ ///
+ public string Action { get; set; }
+
+ ///
+ /// 创建人名称
+ ///
+ ///
+ public string CreateUserName { get; set; }
+
+ ///
+ /// 批准人名字
+ ///
+ ///
+ public string UpdateUserName { get; set; }
+ #region 用于前端UI渲染,对应的信号的内容
+ public string Group_Name { get; set; }
+ public string Group_Desc { get; set; }
+ public string Group_Desc_EN { get; set; }
+ public string IO_Type { get; set; }
+ #endregion
+ #endregion
+
+ }
+}
+
diff --git a/newFront/c#前端/DI-Electrical/Model/ec_wire_group_propertyhis.cs b/newFront/c#前端/DI-Electrical/Model/ec_wire_group_propertyhis.cs
new file mode 100644
index 00000000..501cb19b
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/ec_wire_group_propertyhis.cs
@@ -0,0 +1,71 @@
+using System;
+
+namespace DI_Electrical.Models
+{
+ public class ec_wire_group_propertyhis
+ {
+ #region 实体成员
+ ///
+ /// 信号属性历史ID
+ ///
+ ///
+
+ public string WireGroupPropertyhisID { get; set; }
+ ///
+ /// 信号ID
+ ///
+ ///
+ public string WireGroupID { get; set; } = "";
+ ///
+ /// 属性名称
+ ///
+ ///
+ public string PropertyName { get; set; } = "";
+ ///
+ /// 旧属性值
+ ///
+ ///
+ public string OldPropertyValue { get; set; } = "";
+ ///
+ /// 新属性值
+ ///
+ ///
+ public string NewPropertyValue { get; set; } = "";
+ ///
+ /// 创建人
+ ///
+ ///
+ public string CreateUserID { get; set; }
+ ///
+ /// 创建时间
+ ///
+ ///
+ public DateTime? CreateTime { get; set; }
+ ///
+ /// 更新人
+ ///
+ ///
+ public string UpdateUserID { get; set; }
+ ///
+ /// 更新时间
+ ///
+ ///
+ public DateTime? UpdateTime { get; set; }
+ #endregion
+
+ #region 扩展字段
+ ///
+ /// 创建人名称
+ ///
+ ///
+
+ public string CreateUserName { get; set; }
+ ///
+ /// 属性名称描述
+ ///
+ ///
+
+ public string PropertyNameDec { get; set; } = "";
+ #endregion
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Model/user.cs b/newFront/c#前端/DI-Electrical/Model/user.cs
new file mode 100644
index 00000000..abdd6bd1
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Model/user.cs
@@ -0,0 +1,199 @@
+using System;
+
+namespace DI_Electrical.Model
+{
+ public class User
+ {
+ #region 实体成员
+ ///
+ /// 用户主键
+ ///
+ public string F_UserId { get; set; }
+ ///
+ /// 工号
+ ///
+ public string F_EnCode { get; set; }
+ ///
+ /// 账户
+ ///
+ public string F_Account { get; set; }
+ ///
+ /// 登录密码
+ ///
+ public string F_Password { get; set; }
+ ///
+ /// 密码秘钥
+ ///
+ public string F_Secretkey { get; set; }
+ ///
+ /// 真实姓名
+ ///
+ public string F_RealName { get; set; }
+ ///
+ /// 呢称
+ ///
+ public string F_NickName { get; set; }
+ ///
+ /// 头像
+ ///
+ public string F_HeadIcon { get; set; }
+ ///
+ /// 快速查询
+ ///
+ public string F_QuickQuery { get; set; }
+ ///
+ /// 简拼
+ ///
+ public string F_SimpleSpelling { get; set; }
+ ///
+ /// 性别
+ ///
+ public int? F_Gender { get; set; }
+ ///
+ /// 生日
+ ///
+ public DateTime? F_Birthday { get; set; }
+ ///
+ /// 手机
+ ///
+ public string F_Mobile { get; set; }
+ ///
+ /// 电话
+ ///
+ public string F_Telephone { get; set; }
+ ///
+ /// 电子邮件
+ ///
+ public string F_Email { get; set; }
+ ///
+ /// QQ号
+ ///
+ public string F_OICQ { get; set; }
+ ///
+ /// 微信号
+ ///
+ public string F_WeChat { get; set; }
+ ///
+ /// MSN
+ ///
+ public string F_MSN { get; set; }
+ ///
+ /// 公司或部门的主键
+ ///
+ public string F_CompanyId { get; set; }
+ ///
+ /// 部门主键
+ ///
+ public string F_DepartmentId { get; set; }
+ ///
+ /// 安全级别
+ ///
+ public int? F_SecurityLevel { get; set; }
+ ///
+ /// 单点登录标识
+ ///
+ public int? F_OpenId { get; set; }
+ ///
+ /// 密码提示问题
+ ///
+ public string F_Question { get; set; }
+ ///
+ /// 密码提示答案
+ ///
+ public string F_AnswerQuestion { get; set; }
+ ///
+ /// 允许多用户同时登录
+ ///
+ public int? F_CheckOnLine { get; set; }
+ ///
+ /// 允许登录时间开始
+ ///
+ public DateTime? F_AllowStartTime { get; set; }
+ ///
+ /// 允许登录时间结束
+ ///
+ public DateTime? F_AllowEndTime { get; set; }
+ ///
+ /// 暂停用户开始日期
+ ///
+ public DateTime? F_LockStartDate { get; set; }
+ ///
+ /// 暂停用户结束日期
+ ///
+ public DateTime? F_LockEndDate { get; set; }
+ ///
+ /// 排序码
+ ///
+ public int? F_SortCode { get; set; }
+ ///
+ /// 删除标记
+ ///
+ public int? F_DeleteMark { get; set; }
+ ///
+ /// 有效标志
+ ///
+ public int? F_EnabledMark { get; set; }
+ ///
+ /// 备注
+ ///
+ public string F_Description { get; set; }
+ ///
+ /// 创建日期
+ ///
+ public DateTime? F_CreateDate { get; set; }
+ ///
+ /// 创建用户主键
+ ///
+ public string F_CreateUserId { get; set; }
+ ///
+ /// 创建用户
+ ///
+ public string F_CreateUserName { get; set; }
+ ///
+ /// 修改日期
+ ///
+ public DateTime? F_ModifyDate { get; set; }
+ ///
+ /// 修改用户主键
+ ///
+ public string F_ModifyUserId { get; set; }
+ ///
+ /// 修改用户
+ ///
+ public string F_ModifyUserName { get; set; }
+ ///
+ /// 密码更新时间
+ ///
+ public DateTime? PasswordUpdateTime { get; set; }//add by chenkai 20210322
+ ///
+ /// 微信OpenId
+ ///
+ public string WX_OpenId { get; set; }
+ #endregion
+
+
+ #region 扩展属性
+ ///
+ /// 登录信息
+ ///
+ public string LoginMsg { get; set; }
+ ///
+ /// 登录状态
+ ///
+ public bool LoginOk { get; set; }
+
+ ///
+ /// 公司名称
+ ///
+ public string F_FullName { get; set; }
+ ///
+ /// 岗位名称
+ ///
+ public string F_PostName { get; set; }
+ ///
+ /// 单位名称
+ ///
+ public string F_CompanyName { get { return F_FullName; } }
+ #endregion
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Properties/AssemblyInfo.cs b/newFront/c#前端/DI-Electrical/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..e8c85fde
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Properties/AssemblyInfo.cs
@@ -0,0 +1,52 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// 有关程序集的一般信息由以下
+// 控制。更改这些特性值可修改
+// 与程序集关联的信息。
+[assembly: AssemblyTitle("DI-Electrical")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("DI-Electrical")]
+[assembly: AssemblyCopyright("Copyright © 2025")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// 将 ComVisible 设置为 false 会使此程序集中的类型
+//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
+//请将此类型的 ComVisible 特性设置为 true。
+[assembly: ComVisible(false)]
+
+//若要开始生成可本地化的应用程序,请设置
+//.csproj 文件中的 CultureYouAreCodingWith
+//在 中。例如,如果你使用的是美国英语。
+//使用的是美国英语,请将 设置为 en-US。 然后取消
+//对以下 NeutralResourceLanguage 特性的注释。 更新
+//以下行中的“en-US”以匹配项目文件中的 UICulture 设置。
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //主题特定资源词典所处位置
+ //(未在页面中找到资源时使用,
+ //或应用程序资源字典中找到时使用)
+ ResourceDictionaryLocation.SourceAssembly //常规资源词典所处位置
+ //(未在页面中找到资源时使用,
+ //、应用程序或任何主题专用资源字典中找到时使用)
+)]
+
+
+// 程序集的版本信息由下列四个值组成:
+//
+// 主版本
+// 次版本
+// 生成号
+// 修订号
+//
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/newFront/c#前端/DI-Electrical/Properties/Resources.Designer.cs b/newFront/c#前端/DI-Electrical/Properties/Resources.Designer.cs
new file mode 100644
index 00000000..b78274f2
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// 此代码由工具生成。
+// 运行时版本: 4.0.30319.42000
+//
+// 对此文件的更改可能导致不正确的行为,如果
+// 重新生成代码,则所做更改将丢失。
+//
+//------------------------------------------------------------------------------
+
+namespace DI_Electrical.Properties
+{
+
+
+ ///
+ /// 强类型资源类,用于查找本地化字符串等。
+ ///
+ // 此类是由 StronglyTypedResourceBuilder
+ // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
+ // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
+ // (以 /str 作为命令选项),或重新生成 VS 项目。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// 返回此类使用的缓存 ResourceManager 实例。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DI_Electrical.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// 重写当前线程的 CurrentUICulture 属性,对
+ /// 使用此强类型资源类的所有资源查找执行重写。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Properties/Resources.resx b/newFront/c#前端/DI-Electrical/Properties/Resources.resx
new file mode 100644
index 00000000..af7dbebb
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/DI-Electrical/Properties/Settings.Designer.cs b/newFront/c#前端/DI-Electrical/Properties/Settings.Designer.cs
new file mode 100644
index 00000000..f1d1fdd5
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace DI_Electrical.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Properties/Settings.settings b/newFront/c#前端/DI-Electrical/Properties/Settings.settings
new file mode 100644
index 00000000..033d7a5e
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/newFront/c#前端/DI-Electrical/Services/DataItemService.cs b/newFront/c#前端/DI-Electrical/Services/DataItemService.cs
new file mode 100644
index 00000000..caf4d613
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Services/DataItemService.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+using DI_Electrical.Models;
+
+namespace DI_Electrical.Services
+{
+ public class DataItemService : HttpService
+ {
+ public DataItemService( ) : base()
+ {
+
+ }
+
+ public async Task> GetDetails(string itemCode)
+ {
+ var res = await this.GetAsync>($"DataItemApi/GetDetails?projectId={GlobalObject.curProject.ProjectId}&itemCode={itemCode}");
+ //OnRefresh();
+ if (res.code == 200)
+ {
+
+ return res.data;
+ }
+ else
+ {
+ return null;//ERROR INFO
+ }
+ }
+
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Services/HttpService.cs b/newFront/c#前端/DI-Electrical/Services/HttpService.cs
new file mode 100644
index 00000000..2485af1a
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Services/HttpService.cs
@@ -0,0 +1,263 @@
+using System;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using DI_Electrical.Helper;
+using DI_Electrical.Model;
+using Newtonsoft.Json;
+namespace DI_Electrical.Services
+{
+ public class HttpService
+ {
+ public HttpService()
+ {
+ }
+ public void Init(string address, int port)
+ {
+ // 如果 GlobalObject.client 已经是 null,初始化一个新的 HttpClient 实例
+ //if (GlobalObject.client == null)
+ //{
+ GlobalObject.client = new HttpClient()
+ {
+ BaseAddress = new Uri($"http://{address}:{port}/api/"),
+ Timeout = TimeSpan.FromSeconds(120)
+ };
+ //}
+ //else
+ //{
+ // // 如果已经有 client 实例,则更新它的 BaseAddress
+ // GlobalObject.client.BaseAddress = new Uri($"http://{address}:{port}/api/");
+ //}
+ }
+
+ ///
+ /// 带入授权码。
+ ///
+ ///
+ protected virtual void OnInitAuthorizationCode()
+ {
+ //httpClient.DefaultRequestHeaders.Add("User-Agent", "Mozilla/5.0 (Windows 10.0.22621.1265; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/110.0.835.163 Safari/535.1");
+
+ //if (AuthorizationCode.IsNullOrEmpty() || httpClient == null) return;
+ //httpClient.DefaultRequestHeaders.Add("Authorization", "Bearer " + AuthorizationCode);
+ }
+ protected virtual void OnInitRequestHeader(HttpClient httpClient, string mediaType)
+ {
+ //httpClient.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue(mediaType));
+ httpClient.DefaultRequestHeaders.Add("Accept", mediaType);
+ httpClient.DefaultRequestHeaders.Add("ContentType", mediaType);
+ }
+
+ private void WriteLog(string requestUri, string strJson)
+ {
+ try
+ {
+ var uri = new Uri(GlobalObject.client.BaseAddress + requestUri);
+ var funName = uri.Segments.Last();
+ LoggerHelper.Current.WriteJson(funName, strJson);
+ }
+ catch { }
+ }
+
+ public async Task> GetAsync(string requestUri)
+ {
+ //httpClient.Timeout = TimeSpan.FromSeconds(3000);
+ OnInitAuthorizationCode();
+ string result = string.Empty;
+ learunHttpRes resultObj = null;
+ try
+ {
+ var response = await GlobalObject.client.GetAsync(requestUri);
+ if (response.StatusCode != HttpStatusCode.OK)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] 获取数据失败, 返回HTTP代码:" + response.StatusCode;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new HttpRequestException(errorMsg);
+ }
+ result = await response.Content.ReadAsStringAsync();
+ WriteLog(requestUri, result);
+ resultObj = JsonConvert.DeserializeObject>(result);
+ }
+ catch (JsonException)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] 解析为{typeof(T).Name}失败,原始返回数据为: " + result;
+ LoggerHelper.Current.Error(errorMsg);
+ resultObj = new learunHttpRes() { code = -100, info = errorMsg };
+ return resultObj;
+ }
+ catch (Exception ex)
+ {
+ string errorMsg = $"接口:{requestUri}失败,异常:{ex.Message} ";
+ LoggerHelper.Current.Error(errorMsg);
+ resultObj = new learunHttpRes() { code = -100, info=errorMsg };
+ return resultObj;
+ }
+
+ if (resultObj.code != 200)
+ {
+ switch (resultObj.code)
+ {
+ case 400:
+ case 500:
+ break;
+ //业务错误,不是http本质错误
+ default:
+ string errorMsg = $"服务器地址 [{requestUri}] Get失败, 返回自定义代码:" + resultObj.code;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new HttpRequestException(errorMsg);
+ }
+
+ }
+ LoggerHelper.Current.Info($"Get成功:{requestUri}");
+ return resultObj;
+
+
+ }
+ public async Task GetAsyncByOnlyData(string requestUri)
+ {
+ //httpClient.Timeout = TimeSpan.FromSeconds(3000);
+ OnInitAuthorizationCode();
+ string result = string.Empty;
+ T resultObj;
+ try
+ {
+ var response = await GlobalObject.client.GetAsync(requestUri);
+ if (response.StatusCode != HttpStatusCode.OK)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] 获取数据失败, 返回HTTP代码:" + response.StatusCode;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new HttpRequestException(errorMsg);
+ }
+ result = await response.Content.ReadAsStringAsync();
+ WriteLog(requestUri, result);
+ resultObj = JsonConvert.DeserializeObject(result);
+ }
+ catch (JsonException)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] 解析为{typeof(T).Name}失败,原始返回数据为: " + result;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new JsonException(errorMsg);
+ }
+ catch (Exception ex)
+ {
+ string errorMsg = $"接口:{requestUri}失败,异常:{ex.Message} ";
+ LoggerHelper.Current.Error(errorMsg);
+ throw new JsonException(errorMsg);
+ }
+
+ LoggerHelper.Current.Info($"Get成功:{requestUri}");
+ return resultObj;
+
+
+ }
+ ///
+ ///
+ ///
+ /// 响应后的返回数据的类型
+ /// POST数据对象的类型
+ ///
+ ///
+ ///
+ ///
+ ///
+ public async Task> PostBodyAsync(string requestUri, T1 postObj)
+ {
+ OnInitAuthorizationCode();
+
+ string contentType = "application/json";
+ string strContent = postObj != null ? JsonConvert.SerializeObject(postObj) : "";
+ var content = new StringContent(strContent, Encoding.UTF8, contentType);
+ OnInitRequestHeader(GlobalObject.client, contentType);
+ learunHttpRes resultObj = null;
+ string result = string.Empty;
+ try
+ {
+ var response = await GlobalObject.client.PostAsync(requestUri, content);
+ if (response.StatusCode != HttpStatusCode.OK)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] Post数据失败, 返回HTTP代码:" + response.StatusCode;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new HttpRequestException(errorMsg);
+ }
+ result = await response.Content.ReadAsStringAsync();
+ WriteLog(requestUri, result);
+ resultObj = JsonConvert.DeserializeObject>(result);
+ }
+ catch (JsonException)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] 解析为{typeof(T).Name}失败,原始返回数据为: " + result;
+ LoggerHelper.Current.Error(errorMsg);
+ resultObj = new learunHttpRes() { code = -100, info = errorMsg };
+ return resultObj;
+ }
+ catch (Exception ex)
+ {
+ string errorMsg = $"接口:{requestUri}失败,参数数据为:{strContent},异常:{ex.Message} ";
+ LoggerHelper.Current.Error(errorMsg);
+ resultObj = new learunHttpRes() { code = -100, info = errorMsg };
+ return resultObj;
+ }
+
+ if (resultObj.code != 200)
+ {
+ switch (resultObj.code)
+ {
+ case 400:
+ case 500:
+ break;
+ //业务错误,不是http本质错误
+ default:
+ string errorMsg = $"服务器地址 [{requestUri}] Post失败, 返回自定义代码:" + resultObj.code;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new HttpRequestException(errorMsg);
+ }
+
+ }
+ LoggerHelper.Current.Info($"Post成功:{requestUri}");
+ return resultObj;
+
+
+ }
+
+
+
+ public async Task PostFileAsync(string requestUri, Stream stream, string fileName)
+ {
+ OnInitAuthorizationCode();
+
+ string contentType = "multipart/form-data";
+ var streamContent = new StreamContent(stream, (int)stream.Length);
+ streamContent.Headers.Add("Content-Type", "application/octet-stream");
+ var content = new MultipartFormDataContent
+ {
+ { streamContent, "file", fileName }
+ };
+ OnInitRequestHeader(GlobalObject.client, contentType);
+ var response = await GlobalObject.client.PostAsync(requestUri, content);
+ if (response.StatusCode != HttpStatusCode.OK)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] Post数据失败, 返回HTTP代码:" + response.StatusCode;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new HttpRequestException(errorMsg);
+ }
+ var result = await response.Content.ReadAsStringAsync();
+ T resultObj;
+ try
+ {
+ resultObj = JsonConvert.DeserializeObject(result);
+ }
+ catch (JsonException)
+ {
+ string errorMsg = $"服务器地址 [{requestUri}] 解析为 string 失败,原始返回数据为: " + result;
+ LoggerHelper.Current.Error(errorMsg);
+ throw new JsonException(errorMsg);
+ }
+ LoggerHelper.Current.Info($"Post上传文件成功:{requestUri}");
+ return resultObj;
+ }
+
+ }
+}
diff --git a/newFront/c#前端/DI-Electrical/Services/LoginService.cs b/newFront/c#前端/DI-Electrical/Services/LoginService.cs
new file mode 100644
index 00000000..c8e8e21f
--- /dev/null
+++ b/newFront/c#前端/DI-Electrical/Services/LoginService.cs
@@ -0,0 +1,50 @@
+using System;
+using System.Net.Http;
+using System.Threading.Tasks;
+using DI_Electrical.Model;
+using EasyEncryption;
+using Newtonsoft.Json;
+
+namespace DI_Electrical.Services
+{
+ public class LoginService : HttpService
+ {
+ public LoginService() : base()
+ {
+
+ }
+
+ public async Task Login(string userName, string passwordOrigin)
+ {
+
+ var password = MD5.ComputeMD5Hash(passwordOrigin); //B156525AFDB610B9D6830A1E9D0A1024
+ try
+ {
+ var res = await this.GetAsync