diff --git a/009_DI-Electrical.sln b/009_DI-Electrical.sln index f6d4f9fc..c646d901 100644 --- a/009_DI-Electrical.sln +++ b/009_DI-Electrical.sln @@ -94,6 +94,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "04 Plugin", "04 Plugin", "{ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Department2", "Department2\Department2.csproj", "{74A88CCC-F53B-471C-B350-A2BB5804619C}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.Share", "newFront\c#前端\SWS.Share\SWS.Share.csproj", "{87E71797-E60A-4637-BA32-C8B57154ABC3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Android = Debug|Android @@ -806,6 +808,30 @@ Global {74A88CCC-F53B-471C-B350-A2BB5804619C}.Release|Windows-x64.Build.0 = Release|Any CPU {74A88CCC-F53B-471C-B350-A2BB5804619C}.Release|Windows-x86.ActiveCfg = Release|Any CPU {74A88CCC-F53B-471C-B350-A2BB5804619C}.Release|Windows-x86.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Android.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Android.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|iOS.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|iOS.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Windows-ARM.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Windows-ARM.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Windows-x64.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Windows-x64.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Windows-x86.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Windows-x86.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Android.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Android.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Any CPU.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|iOS.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|iOS.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Windows-ARM.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Windows-ARM.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Windows-x64.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Windows-x64.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Windows-x86.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Windows-x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -848,10 +874,11 @@ Global {56F9A112-FD96-4809-98F4-0D7C5DE0711B} = {D5BF3E92-22DA-4C1B-A736-B9E847A3DE27} {A448AD52-CB49-4206-BBDC-E433574BB88F} = {27B3C269-FF3F-4E1C-9B92-A40F6B4857E0} {74A88CCC-F53B-471C-B350-A2BB5804619C} = {E011739D-4EC0-4E88-B6D1-A86242FBE6B0} + {87E71797-E60A-4637-BA32-C8B57154ABC3} = {D5BF3E92-22DA-4C1B-A736-B9E847A3DE27} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution - EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 SolutionGuid = {968C278F-4142-4DFF-96B0-B3D70A649451} + EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35 EndGlobalSection GlobalSection(Performance) = preSolution HasPerformanceSessions = true diff --git a/Department2/obj/Debug/build.force b/Department2/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/Learun.Application.Web/AppApi/PlotBOMApiController.cs b/Learun.Application.Web/AppApi/PlotBOMApiController.cs index ffff394e..56a34701 100644 --- a/Learun.Application.Web/AppApi/PlotBOMApiController.cs +++ b/Learun.Application.Web/AppApi/PlotBOMApiController.cs @@ -6,6 +6,7 @@ using NPOI.SS.Formula.PTG; using NPOI.Util.Collections; using OfficeOpenXml.Drawing.Vml; using Pipelines.Sockets.Unofficial.Arenas; +using SWS.Share; using System; using System.Collections; using System.Collections.Generic; @@ -31,7 +32,7 @@ namespace Learun.Application.Web.AppApi /// /// [HttpGet] - public IHttpActionResult GetBOMGroupInfo(string ProjectId = "c151f5d4-cbe1-4522-945c-501b1ad990d5", string drawingId = "277d883d-e271-45e4-990b-926585321fa8") + public IHttpActionResult GetBOMGroupInfo(string ProjectId = "403ee1e6-ca2e-4acc-9667-273afd4ea93c", string drawingId = "db834963-f62b-4c44-8180-1b9073819546") { var res = new List();//声明结果 @@ -77,7 +78,7 @@ namespace Learun.Application.Web.AppApi #region 预处理每个位号,然后进行分组 foreach (ec_enginedataEntity tag in allTag) { - var matchedTypes = new List(); + var matchedTypes = new List(); var idx = 0; var GroupName = TrimTagNubmer(tag.TagNumber, out idx);// 如 A-B1,A-B2,取出来的group就是A-B,idx为0 var seq = tag.TagNumber.Substring(idx).Replace(GroupName, "");// 1,2 @@ -127,19 +128,25 @@ namespace Learun.Application.Web.AppApi { List allTagsInThisGroup = group.ToList(); var GroupName = group.Key.Group; //A-ABC, 正常情况下A是system,放下面;B是tag,放上面 + string part1 = string.Empty; + string part0 = string.Empty; if (!GroupName.Contains("-")) - { - - continue; + { + part1 = GroupName; } - var upper_text_Part1 = GroupName.Split('-')[1];//ABC + else + { + part0 = GroupName.Split('-')[0]; + part1 = GroupName.Split('-')[1];//ABC + } + var upper_text_Part1 = part1;//ABC var upper_text_Part2 = "";//seq #region seq的不同情况 //得到每个位号下的seq var allSeqText = allTagsInThisGroup.OrderBy(x => x.Seq).Select(x => x.Seq).ToList(); var allSeq = ExtractNumbers(allSeqText);//把1A 1B 这种情况也处理了,变成1,1 - if (allSeq.Distinct().Count() == 1) + if (allSeq.Distinct().Count() <= 1) { //TAG如果一样的就取这个TAG就行??? upper_text_Part2 = allSeqText.First(); @@ -165,7 +172,7 @@ namespace Learun.Application.Web.AppApi var BOMGroupInfo = new BOMGroupInfo { upper_text = upper_text_Part1 + upper_text_Part2, - lower_text = GroupName.Split('-')[0],//A + lower_text = part0,//A Count = group.Count(), Remark = group.Key.vendor, Model = group.Key.Model, @@ -290,32 +297,5 @@ namespace Learun.Application.Web.AppApi /// public string Name { set; get; } } - public class BOMGroupInfo - { - public string upper_text { set; get; } - public string lower_text { set; get; } - /// - /// 每一行用的symbol是什么 - /// - public string FileId { set; get; } - /// - /// 个数 - /// - public int Count { set; get; } - /// - /// 备注(由 厂商) - /// - public string Remark { set; get; } - /// - /// 规格(由 电制 额定功率 ip等级 防爆等级等属性拼接而成) - /// - public string Spec { set; get; } - - /// - /// 型号 - /// - public string Model { set; get; } - - } } \ No newline at end of file diff --git a/Learun.Application.Web/AppApi/ProjectApiController.cs b/Learun.Application.Web/AppApi/ProjectApiController.cs index 5e5c73e4..b9f80969 100644 --- a/Learun.Application.Web/AppApi/ProjectApiController.cs +++ b/Learun.Application.Web/AppApi/ProjectApiController.cs @@ -1,4 +1,6 @@ -using Learun.Application.TwoDevelopment.ZZDT_EC; +using DocumentFormat.OpenXml.Drawing.Spreadsheet; +using Learun.Application.Base.SystemModule; +using Learun.Application.TwoDevelopment.ZZDT_EC; using Learun.Util; using Learun.Util.SqlSugar; using SqlSugar; @@ -109,5 +111,25 @@ namespace Learun.Application.Web.AppApi return Success(resAll); } + /// + /// 获取项目信息 + /// + /// 项目ID + /// + [HttpGet] + [ResponseType(typeof(TwoDevelopment.ZZDT_EC.ec_projectEntity))] + public IHttpActionResult GetEntity(string projectId) + { + try + { + ec_projectIBLL ec_projectIBLL = new ec_projectBLL(); + var entity = ec_projectIBLL.GetEntity(projectId); + return Success(entity); + } + catch (Exception ex) + { + return Fail(ex.Message); + } + } } } \ No newline at end of file diff --git a/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Application.Web/Learun.Application.Web.csproj index 75876b25..3bda2aa7 100644 --- a/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Application.Web/Learun.Application.Web.csproj @@ -3814,6 +3814,9 @@ + + PreserveNewest + @@ -3909,6 +3912,10 @@ {1d192591-b85a-41db-ae3a-4bf9765786c1} Learun.Workflow.Engine + + {87e71797-e60a-4637-ba32-c8b57154abc3} + SWS.Share + 10.0 diff --git a/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Oracle/obj/Debug/Learun.DataBase.Oracle.csproj.AssemblyReference.cache b/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Oracle/obj/Debug/Learun.DataBase.Oracle.csproj.AssemblyReference.cache new file mode 100644 index 00000000..c3986afc Binary files /dev/null and b/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Oracle/obj/Debug/Learun.DataBase.Oracle.csproj.AssemblyReference.cache differ diff --git a/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Oracle/obj/Debug/build.force b/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Oracle/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Sqlserver/obj/Debug/Learun.DataBase.SqlServer.csproj.AssemblyReference.cache b/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Sqlserver/obj/Debug/Learun.DataBase.SqlServer.csproj.AssemblyReference.cache new file mode 100644 index 00000000..8e1769fc Binary files /dev/null and b/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Sqlserver/obj/Debug/Learun.DataBase.SqlServer.csproj.AssemblyReference.cache differ diff --git a/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Sqlserver/obj/Debug/build.force b/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Sqlserver/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/Learun.Framework.Module/Learun.Db/Learun.DataBase.MySql/obj/Debug/Learun.DataBase.MySqlEx.csproj.AssemblyReference.cache b/Learun.Framework.Module/Learun.Db/Learun.DataBase.MySql/obj/Debug/Learun.DataBase.MySqlEx.csproj.AssemblyReference.cache new file mode 100644 index 00000000..d4b9e141 Binary files /dev/null and b/Learun.Framework.Module/Learun.Db/Learun.DataBase.MySql/obj/Debug/Learun.DataBase.MySqlEx.csproj.AssemblyReference.cache differ diff --git a/Learun.Framework.Module/Learun.Db/Learun.DataBase.MySql/obj/Debug/build.force b/Learun.Framework.Module/Learun.Db/Learun.DataBase.MySql/obj/Debug/build.force deleted file mode 100644 index e69de29b..00000000 diff --git a/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref b/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref new file mode 100644 index 00000000..2fe5958e --- /dev/null +++ b/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref @@ -0,0 +1,5 @@ + + +FD:\陈进步\项目\009\SWSDBSchemeUpgradeTool\MainWindow.xaml;; +FD:\陈进步\项目\009\SWSDBSchemeUpgradeTool\SQLPreview.xaml;; + diff --git a/newFront/c#前端/DI-Electrical/ViewModels/MainWindowViewModel.cs b/newFront/c#前端/DI-Electrical/ViewModels/MainWindowViewModel.cs index 85691f4d..21e0f884 100644 --- a/newFront/c#前端/DI-Electrical/ViewModels/MainWindowViewModel.cs +++ b/newFront/c#前端/DI-Electrical/ViewModels/MainWindowViewModel.cs @@ -50,6 +50,7 @@ namespace DI_Electrical.ViewModels } public void onShowDialogTest(object o) { + IDialogParameters par = new Prism.Services.Dialogs.DialogParameters(); par.Add(GlobalObject.dialogPar.para1.ToString(), "abc你我他"); _dialogService.ShowDialog(nameof(DialogTest), par, (result) => diff --git a/newFront/c#前端/SWS.CAD.Base/General.cs b/newFront/c#前端/SWS.CAD.Base/General.cs index c8ee2e9f..36bdcaf5 100644 --- a/newFront/c#前端/SWS.CAD.Base/General.cs +++ b/newFront/c#前端/SWS.CAD.Base/General.cs @@ -109,8 +109,10 @@ namespace SWS.CAD.Base /// /// 读取图块图纸插入当前文档 /// - /// - public static ObjectId InsertBlock(string fileName, string blockName) + /// 块图纸路径 + /// 块名 + /// 坐标位 + public static ObjectId InsertBlock(string fileName, string blockName, Point3d position) { ObjectId entity = ObjectId.Null; @@ -135,9 +137,10 @@ namespace SWS.CAD.Base using (Transaction trans = db.TransactionManager.StartTransaction()) { BlockTable bt = trans.GetObject(db.BlockTableId, OpenMode.ForRead) as BlockTable; - ObjectId idBtr = doc.Database.Insert(blockName, blockName, blockDb, true); + ObjectId idBtr = doc.Database.Insert(blockName, blockName, blockDb, true); BlockTableRecord curBtr = trans.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord; var block = new BlockReference(Point3d.Origin, idBtr); + block.Position = position; curBtr.AppendEntity(block); trans.AddNewlyCreatedDBObject(block, true); entity = block.Id; @@ -721,6 +724,7 @@ namespace SWS.CAD.Base } #endregion + #region 读取元件块,插入图纸 /// /// 读取元件块,插入图纸 @@ -730,15 +734,15 @@ namespace SWS.CAD.Base /// 位号值 /// 元件类型ID /// 比例大小 - /// 坐标位置 + /// 坐标位置 /// - public static ObjectId AddTagDWG(string filePath, string tagName, string tag, string objTypeId, double scale, Point3d tagPoint) + public static ObjectId AddTagDWG(string filePath, string tagName, string tag, string objTypeId, double scale, Point3d position) { if (scale == 0) { scale = 1; } Document doc = Application.DocumentManager.MdiActiveDocument; var ed = doc.Editor; - ObjectId oid = ObjectId.Null; + ObjectId oid = ObjectId.Null; if (!File.Exists(filePath)) { ed.WriteMessage("\n 错误:图元文件不存在!\n"); @@ -754,7 +758,7 @@ namespace SWS.CAD.Base using (Database sourceDb = new Database(false, true)) { sourceDb.ReadDwgFile(filePath, FileOpenMode.OpenForReadAndAllShare, false, null); - + // 生成唯一块名(避免重名) string blockName = GetUniqueBlockName(destDb, tagName); // 将外部DWG转换为块定义 @@ -764,7 +768,7 @@ namespace SWS.CAD.Base Point3d.Origin, // 插入点(可修改) blockId// bt[blockName] ); - br.Position = tagPoint; + br.Position = position; // 设置比例和旋转 br.ScaleFactors = new Scale3d(scale); //比例因子 br.Rotation = 0.0; // 旋转角度(弧度) @@ -948,18 +952,13 @@ namespace SWS.CAD.Base /// /// 保存图纸 /// - public static void SaveDwg(string filename) + public static void SaveAndCloseDwg(string filename) { Document doc = Application.DocumentManager.MdiActiveDocument; Database db = doc.Database; if (db.Filename.Equals(filename)) { - using (Transaction tr = doc.TransactionManager.StartTransaction()) - { - // 操作数据库... - tr.Commit(); // 必须提交 - } - doc.Database.Save(); + doc.CloseAndSave(filename); } } #endregion @@ -1013,6 +1012,7 @@ namespace SWS.CAD.Base } else { doc.CloseAndDiscard(); } // 重新打开 + Thread.Sleep(200); Application.DocumentManager.Open(filePath, isReadOnly); doc = Application.DocumentManager.MdiActiveDocument; ed = doc.Editor; @@ -1996,6 +1996,144 @@ namespace SWS.CAD.Base } #endregion + + #region 插入文本内容 + public static string InsertTextInfo(List listTextInfo) + { + string res = string.Empty; + try + { + Document doc = Application.DocumentManager.MdiActiveDocument; + Database db = doc.Database; + Editor ed = doc.Editor; + // 开始事务处理 + using (Transaction tr = db.TransactionManager.StartTransaction()) + { + // 打开当前空间(模型空间或图纸空间)用于写入 + BlockTableRecord currentSpace = (BlockTableRecord)tr.GetObject( + db.CurrentSpaceId, OpenMode.ForWrite); + foreach (var textInfo in listTextInfo) + { + if (textInfo.IsMText) + { + // 创建多行文字对象 + MText mText = new MText(); + mText.Contents = textInfo.Text; + mText.Location = textInfo.Position; + mText.TextHeight = textInfo.Height; + mText.Width = textInfo.Width; // 设置文本宽度,控制自动换行 + if (textInfo.Align == 0) + { + mText.Attachment = AttachmentPoint.MiddleLeft; // 设置对齐居左 + } + else if (textInfo.Align == 1) + { + mText.Attachment = AttachmentPoint.BaseCenter; // 设置对齐居中 + } + // 将文字添加到当前空间 + currentSpace.AppendEntity(mText); + tr.AddNewlyCreatedDBObject(mText, true); + } + else + { + // 创建单行文字对象 + DBText dbText = new DBText(); + dbText.TextString = textInfo.Text; + dbText.Position = textInfo.Position; + dbText.AlignmentPoint= textInfo.Position; + dbText.Height = textInfo.Height; + if (textInfo.Align == 0) + { + dbText.HorizontalMode = TextHorizontalMode.TextLeft; // 设置对齐居左 + } + else if (textInfo.Align == 1) + { + dbText.HorizontalMode = TextHorizontalMode.TextCenter; // 设置对齐居中 + } + + // 将文字添加到当前空间 + currentSpace.AppendEntity(dbText); + tr.AddNewlyCreatedDBObject(dbText, true); + } + } + + // 提交事务 + tr.Commit(); + } + return res; + } + catch (Exception ex) + { + return ex.Message; + } + } + #endregion + + #region 读取源图纸,插入当前图纸 + /// + /// 读取源图纸,插入当前图纸 + /// + /// 源图纸路径 + /// 块名 + /// 坐标位置 + /// + public static ObjectId AddBlockDWG(string filePath, string blockName, Point3d position) + { + Document doc = Application.DocumentManager.MdiActiveDocument; + var ed = doc.Editor; + ObjectId oid = ObjectId.Null; + if (!File.Exists(filePath)) + { + ed.WriteMessage("\n 错误: 源图纸不存在!\n"); + return oid; + } + // 获取当前数据库 + Database destDb = HostApplicationServices.WorkingDatabase; + using (Transaction tr = destDb.TransactionManager.StartTransaction()) + { + try + { + // 创建临时数据库读取外部DWG + using (Database sourceDb = new Database(false, true)) + { + sourceDb.ReadDwgFile(filePath, FileOpenMode.OpenForReadAndAllShare, false, null); + + // 生成唯一块名(避免重名) + //string blockName = GetUniqueBlockName(destDb, blockName); + // 将外部DWG转换为块定义 + ObjectId blockId = destDb.Insert(blockName, sourceDb, true); + // 创建块参照 + BlockReference br = new BlockReference( + Point3d.Origin, // 插入点(可修改) + blockId// bt[blockName] + ); + br.Position = position; + // 设置比例和旋转 + br.ScaleFactors = new Scale3d(1.0); //比例因子 + br.Rotation = 0.0; // 旋转角度(弧度) + BlockTableRecord btr = (BlockTableRecord)tr.GetObject( + SymbolUtilityServices.GetBlockModelSpaceId(destDb), + OpenMode.ForWrite + ); + + // 处理插入结果 + btr.AppendEntity(br); + tr.AddNewlyCreatedDBObject(br, true); + tr.Commit(); + oid = br.Id; + } + } + catch (Exception ex) + { + tr.Abort(); + ed.WriteMessage($"\n错误: {ex.Message}\n"); + } + } + return oid; + + + } + #endregion } } diff --git a/newFront/c#前端/SWS.CAD.Base/Model/DtoCadTextInfo.cs b/newFront/c#前端/SWS.CAD.Base/Model/DtoCadTextInfo.cs new file mode 100644 index 00000000..2ceebadb --- /dev/null +++ b/newFront/c#前端/SWS.CAD.Base/Model/DtoCadTextInfo.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Teigha.Geometry; + +namespace SWS.CAD.Base +{ + public class DtoCadTextInfo + { + /// + /// 坐标 + /// + public Point3d Position { get; set; } + /// + /// 是否为多行文本 + /// + public bool IsMText { get; set; } + /// + /// 文本内容,多行文本用\n 进行换行 + /// + public string Text { get; set; } + /// + /// 文本高度 + /// + public double Height { get; set; } + /// + /// 文本宽度 + /// + public double Width { get; set; } + /// + /// 文本对齐方式 0:居左对齐 1:居中对齐 + /// + public double Align { get; set; } + } +} diff --git a/newFront/c#前端/SWS.CAD.Base/SWS.CAD.Base.csproj b/newFront/c#前端/SWS.CAD.Base/SWS.CAD.Base.csproj index ee676d80..9412e79b 100644 --- a/newFront/c#前端/SWS.CAD.Base/SWS.CAD.Base.csproj +++ b/newFront/c#前端/SWS.CAD.Base/SWS.CAD.Base.csproj @@ -52,6 +52,7 @@ + diff --git a/newFront/c#前端/SWS.CAD.sln b/newFront/c#前端/SWS.CAD.sln index 87f32b55..e6768535 100644 --- a/newFront/c#前端/SWS.CAD.sln +++ b/newFront/c#前端/SWS.CAD.sln @@ -27,6 +27,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.WPF", "SWS.WPF\SWS.WPF. EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.CAD", "SWS.CAD\SWS.CAD.csproj", "{6BD9B3FC-7D55-4762-AF68-A50183342537}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SWS.Share", "SWS.Share\SWS.Share.csproj", "{87E71797-E60A-4637-BA32-C8B57154ABC3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -215,6 +217,22 @@ Global {6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x64.Build.0 = Release|Any CPU {6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x86.ActiveCfg = Release|Any CPU {6BD9B3FC-7D55-4762-AF68-A50183342537}.Release|x86.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|ARM64.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|x64.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|x64.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|x86.ActiveCfg = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Debug|x86.Build.0 = Debug|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|Any CPU.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|ARM64.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|ARM64.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|x64.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|x64.Build.0 = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|x86.ActiveCfg = Release|Any CPU + {87E71797-E60A-4637-BA32-C8B57154ABC3}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/newFront/c#前端/SWS.CAD/GlobalObje.cs b/newFront/c#前端/SWS.CAD/GlobalObje.cs index de4a2900..3e72df60 100644 --- a/newFront/c#前端/SWS.CAD/GlobalObje.cs +++ b/newFront/c#前端/SWS.CAD/GlobalObje.cs @@ -132,7 +132,7 @@ namespace SWS.CAD if (_dwgStage == null) { - var serv =GlobalObject.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingStage.ToString())); var res2 = res.Result; return res2; diff --git a/newFront/c#前端/SWS.CAD/Helper/TreeHelper.cs b/newFront/c#前端/SWS.CAD/Helper/TreeHelper.cs index 1682d52b..b0b6bf2b 100644 --- a/newFront/c#前端/SWS.CAD/Helper/TreeHelper.cs +++ b/newFront/c#前端/SWS.CAD/Helper/TreeHelper.cs @@ -58,27 +58,27 @@ namespace SWS.CAD.Helper } #endregion - #region 获取树节点所有图纸名 + #region 获取树节点所有图纸名 - /// - /// 获取树节点所有图纸名 - /// + /// + /// 获取树节点所有图纸名 + /// public static void GetTreeText(Model.TreeModel node) { // 如果根节点为空,则返回null - if (node == null) return ; + if (node == null) return; //没有子节点就返回null - if (node.ChildNodes == null) return ; + if (node.ChildNodes == null) return; // 否则,递归地在子节点中查找 foreach (var child in node.ChildNodes) { GetTreeText(child); - + } if (node.Text.ToLower().EndsWith(".dwg") && !GlobalObject.AllDwgName.Contains(node.Text)) { GlobalObject.AllDwgName.Add(node.Text); } // 如果在当前树中没有找到,返回null - return ; + return; } #endregion } diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs index 4cc233ee..c70099f6 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignPreviewViewModel.cs @@ -10,6 +10,9 @@ using SWS.CAD.Views.Dialog; using Prism.Services.Dialogs; using SWS.Commons; using SWS.Model; +using System.Windows; +using SWS.Service; +using Unity; namespace SWS.CAD.ViewModels { @@ -30,6 +33,11 @@ namespace SWS.CAD.ViewModels } } #endregion + IOModuleService _iOModuleService; + public DialogCablePreAssignPreviewViewModel() + { + _iOModuleService = GlobalObject.container.Resolve(); + } public string Title => ""; @@ -52,30 +60,95 @@ namespace SWS.CAD.ViewModels _PreAssignCables = parameters.GetValue>(GlobalObject.dialogPar.para1.ToString()); } - public override void ExecuteOKCommandAsync(object parameter) + public override async void ExecuteOKCommandAsync(object parameter) { - - if (PreAssignCables.Any(p => p.IsChecked == true)) + bool isShowDialog = false; + List cableids = new List(); + foreach (var preAssignCable in PreAssignCables) { - //打开窗体 - IDialogParameters para = new Prism.Services.Dialogs.DialogParameters(); - para.Add(GlobalObject.dialogPar.para1.ToString(), PreAssignCables); - var _dialogService = GlobalObject._prismContainer.Resolve(); - _dialogService.ShowDialog(nameof(DialogCablePreAssignResult), para, async (RES) => + if (preAssignCable.IsChecked) { - if (RES.Result == ButtonResult.Yes) - { - - } - else if (RES.Result == ButtonResult.No) - { } - }); + cableids.Add(preAssignCable.CableId); + } } - + if (cableids != null && cableids.Count() > 0) + { + bool AcceptNearbyPanel; + MessageBoxResult result = System.Windows.MessageBox.Show($"遇到I/O类型不合适的采集箱,是否需要自动更换就近的采集箱", "KunHengCAD", MessageBoxButton.YesNo, MessageBoxImage.Question); + if (result == MessageBoxResult.Yes) + { + AcceptNearbyPanel = true; + } + else + { + AcceptNearbyPanel = false; + } + + var ResHttp = await _iOModuleService.AutoAssignCable2channel_step1(cableids, AcceptNearbyPanel) as learunHttpRes; + if (ResHttp.code == 200) + { + isShowDialog = true; + } + else + { + if (AcceptNearbyPanel) + { + result = System.Windows.MessageBox.Show($"{ResHttp.info}", "KunHengCAD", MessageBoxButton.YesNo, MessageBoxImage.Question); + if (result == MessageBoxResult.Yes) + { + return; + } + else + { + isShowDialog = true; + + } + } + else + { + var info = ResHttp.info; + // 找到第一个句号的位置 + int firstPeriodIndex = info.IndexOf('。'); + if (firstPeriodIndex >= 0) + { + // 从第一个句号后开始找第二个句号 + int secondPeriodIndex = info.IndexOf('。', firstPeriodIndex + 1); + if (secondPeriodIndex >= 0) + { + // 截取到第二个句号(包括句号) + info = info.Substring(0, secondPeriodIndex + 1); + } + } + System.Windows.MessageBox.Show($"{info}", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; + } + } + if (isShowDialog) + { + //打开窗体 + IDialogParameters para = new Prism.Services.Dialogs.DialogParameters(); + para.Add(GlobalObject.dialogPar.para1.ToString(), PreAssignCables); + var _dialogService = GlobalObject._prismContainer.Resolve(); + _dialogService.ShowDialog(nameof(DialogCablePreAssignResult), para, async (RES) => + { + if (RES.Result == ButtonResult.Yes) + { + + } + else if (RES.Result == ButtonResult.No) + { } + }); + } + + } + else + { + System.Windows.MessageBox.Show("未勾选预分配电缆", "KunHengCAD", MessageBoxButton.OK, MessageBoxImage.Warning); return; + } + //返回的结果 - IDialogParameters res = new Prism.Services.Dialogs.DialogParameters(); + //IDialogParameters res = new Prism.Services.Dialogs.DialogParameters(); //res.Add(GlobalObject.dialogPar.para1.ToString(), SelectedStripParametersInfo); - RequestClose.Invoke(new DialogResult(ButtonResult.Yes, res)); + //RequestClose.Invoke(new DialogResult(ButtonResult.Yes, res)); } public override void ExecuteCloseCommand(object parameter) { @@ -119,7 +192,7 @@ namespace SWS.CAD.ViewModels } return; } - if(parameter.ToString().Equals("清空")) + if (parameter.ToString().Equals("清空")) { foreach (var item in PreAssignCables) { @@ -133,9 +206,18 @@ namespace SWS.CAD.ViewModels #endregion } - public class PreAssignCable: DialogBase + public class PreAssignCable : DialogBase { #region 页面渲染字段 + private string _CableId; + + public string CableId + { + get { return _CableId; } + set { _CableId = value; } + } + + private int _Index; /// /// 序号 @@ -152,7 +234,9 @@ namespace SWS.CAD.ViewModels public bool IsChecked { get { return _IsChecked; } - set { _IsChecked = value; + set + { + _IsChecked = value; RaisePropertyChanged(nameof(IsChecked)); } } @@ -196,14 +280,15 @@ namespace SWS.CAD.ViewModels public PreAssignCable() { - + } public PreAssignCable(ec_Cable ec_Cable) { + CableId = ec_Cable.CableID; TagNumber = ec_Cable.TagNumber; PreAssignIOType = ec_Cable.PreAssignIOType; - CableClass =ec_Cable.CableClass.Equals("homerun") ? "是":"否"; - ToPanel_TagNumber = ec_Cable.ToPanel!=null?ec_Cable.ToPanel.TagNumber:null; + CableClass = ec_Cable.CableClass.Equals("homerun") ? "是" : "否"; + ToPanel_TagNumber = ec_Cable.ToPanel != null ? ec_Cable.ToPanel.TagNumber : null; } #endregion diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs index 30c3fab7..a7b1498b 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogCablePreAssignResultViewModel.cs @@ -7,17 +7,51 @@ using Telerik.Windows.Controls; using Prism.Services.Dialogs; using SWS.Commons; using SWS.Model; +using SWS.Service; +using Unity; +using System.Linq; +using Telerik.Windows.Controls.MaskedInput.Tokens.Numeric; namespace SWS.CAD.ViewModels { public class DialogCablePreAssignResultViewModel : DialogBase, IDialogAware { #region 字段 - private ObservableCollection _PreAssignCables = new ObservableCollection(); + private ObservableCollection _PreAllocationResultls = new ObservableCollection(); /// - /// 端子排参数信息列表 + /// 预分配结果表格源 /// - public ObservableCollection PreAssignCables + public ObservableCollection PreAllocationResultls + { + get { return _PreAllocationResultls; } + set + { + _PreAllocationResultls = value; + RaisePropertyChanged(nameof(PreAllocationResultls)); + } + } + + + private string _SuccessOrFailure = "分配成功"; + /// + /// 选择成功还是选择失败 + /// + public string SuccessOrFailure + { + get { return _SuccessOrFailure; } + set + { + _SuccessOrFailure = value; + RaisePropertyChanged(nameof(SuccessOrFailure)); + UpdataPreAssignCables(); + } + } + + private ObservableCollection _PreAssignCables = new ObservableCollection(); + /// + /// 左侧预分配电缆列表 + /// + public ObservableCollection PreAssignCables { get { return _PreAssignCables; } set @@ -27,90 +61,28 @@ namespace SWS.CAD.ViewModels } } - private StripParametersInfo _SelectedStripParametersInfo; + private ec_Cable _SelectedPreAssignCable; /// - /// 当前选中的信号类型 + /// 选择的预分配电缆 /// - public StripParametersInfo SelectedStripParametersInfo + public ec_Cable SelectedPreAssignCable { - get { return _SelectedStripParametersInfo; } + get { return _SelectedPreAssignCable; } set { - _SelectedStripParametersInfo = value; - RaisePropertyChanged(nameof(SelectedStripParametersInfo)); - } - } - private bool _IsReadOnly; - /// - /// 是否可编辑 - /// - public bool IsReadOnly - { - get { return _IsReadOnly; } - set - { - _IsReadOnly = value; - RaisePropertyChanged(nameof(IsReadOnly)); - } - } - - #region 表格下拉列表 - private List _TermNamingType_ls = new List() { "数字", "字母" }; - /// - /// 端子编号类型 - /// - public List TermNamingType_ls - { - get { return _TermNamingType_ls; } - set - { - _TermNamingType_ls = value; - RaisePropertyChanged(nameof(TermNamingType_ls)); - } - } - private List _TermNamingRule_ls = new List() { "按端子排全局编号", "按通道内端子编号", "按通道编号" }; - /// - /// 端子编号规则 - /// - public List TermNamingRule_ls - { - get { return _TermNamingRule_ls; } - set - { - _TermNamingRule_ls = value; - RaisePropertyChanged(nameof(TermNamingRule_ls)); - } - } - private List _TermNamePrefix_ls = new List() { "通道编号", "+,-,s", "无" }; - /// - /// 端子前缀 - /// - public List TermNamePrefix_ls - { - get { return _TermNamePrefix_ls; } - set - { - _TermNamePrefix_ls = value; - RaisePropertyChanged(nameof(TermNamePrefix_ls)); - } - } - private List _TermNameSuffix_ls = new List() { "通道编号", "+,-,s", "无" }; - /// - /// 端子后缀 - /// - public List TermNameSuffix_ls - { - get { return _TermNameSuffix_ls; } - set - { - _TermNameSuffix_ls = value; - RaisePropertyChanged(nameof(TermNameSuffix_ls)); + _SelectedPreAssignCable = value; + RaisePropertyChanged(nameof(SelectedPreAssignCable)); + UpdataPreAllocationResultls(_SelectedPreAssignCable); } } - #endregion #endregion + IOModuleService _iOModuleService; + public DialogCablePreAssignResultViewModel() + { + _iOModuleService = GlobalObject.container.Resolve(); + } public string Title => ""; public event Action RequestClose; @@ -124,18 +96,31 @@ namespace SWS.CAD.ViewModels } - private List CablePreAssigns; + //全部预分配电缆 + private List AllPreAssignCables; public async void OnDialogOpened(IDialogParameters parameters) { //title = parameters.GetValue(GlobalObject.dialogPar.title.ToString()); title = "信号预分配结果"; - _PreAssignCables = parameters.GetValue>(GlobalObject.dialogPar.para1.ToString()); - _IsReadOnly = parameters.GetValue(GlobalObject.dialogPar.para2.ToString()); + AllPreAssignCables = await _iOModuleService.AutoAssignCable2channel_step2(); + UpdataPreAssignCables(); } - public override void ExecuteOKCommandAsync(object para) + public override async void ExecuteOKCommandAsync(object para) { - + var Cables = new List(); + if (AllPreAssignCables != null) + { + foreach (var PreAssignCable in AllPreAssignCables) + { + if (PreAssignCable.Sets != null && !string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo)) + { + Cables.Add(PreAssignCable); + } + } + } + + var resHttp = await _iOModuleService.AutoAssignCable2channel_step3(Cables); //返回结果 IDialogParameters res = new Prism.Services.Dialogs.DialogParameters(); //res.Add(GlobalObject.dialogPar.para1.ToString(), SelectedStripParametersInfo); @@ -156,6 +141,61 @@ namespace SWS.CAD.ViewModels } #region 方法 + /// + /// 修改预分配电缆列表,成功或者失败的电缆列表 + /// + public void UpdataPreAssignCables() + { + PreAssignCables = new ObservableCollection(); + if (AllPreAssignCables != null) + { + if (SuccessOrFailure.Equals("分配成功")) + { + foreach (var PreAssignCable in AllPreAssignCables) + { + if (PreAssignCable.Sets != null && !string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo)) + { + PreAssignCables.Add(PreAssignCable); + } + } + } + else + { + foreach (var PreAssignCable in AllPreAssignCables) + { + if (PreAssignCable.Sets == null || string.IsNullOrEmpty(PreAssignCable.Sets.FirstOrDefault().ConnectionInfo)) + { + PreAssignCables.Add(PreAssignCable); + } + } + } + } + } + /// + /// 修改表格显示数据 + /// + public void UpdataPreAllocationResultls(ec_Cable cable) + { + + PreAllocationResultls = new ObservableCollection(); + if (cable == null) return; + if (cable.Sets != null) + { + foreach (var Set in cable.Sets) + { + PreAllocationResult preAllocationResult = new PreAllocationResult(); + preAllocationResult.CablePair = Set.CableSetName; + preAllocationResult.IOType = cable.PreAssignIOType; + preAllocationResult.ToPanel_TagNumber = cable.ToPanel == null ? "" : cable.ToPanel.TagNumber; + preAllocationResult.Panel_TagNumber = string.IsNullOrEmpty(Set.ConnectionInfo) ? "" : Set.ConnectionInfo.Split('/')[0].Split(':')[1].Trim(); + preAllocationResult.StripName = string.IsNullOrEmpty(Set.ConnectionInfo) ? "" : Set.ConnectionInfo.Split('/')[1].Split(':')[1].Trim(); + preAllocationResult.Terms = new ObservableCollection(Set.AssignedTerms); + PreAllocationResultls.Add(preAllocationResult); + } + } + + } + public ICommand EditEndCmd => new DelegateCommand(EditEnd); /// /// 编辑结束事件 @@ -168,7 +208,73 @@ namespace SWS.CAD.ViewModels } #endregion } + /// + /// 预分配结果类 + /// + public class PreAllocationResult : DialogBase + { + private string _CablePair; + /// + /// 电缆对 + /// + public string CablePair + { + get { return _CablePair; } + set { _CablePair = value; } + } + + private string _IOType; + /// + /// IO类型 + /// + public string IOType + { + get { return _IOType; } + set { _IOType = value; } + } + private string _ToPanel_TagNumber; + /// + /// 预分配的系统柜 + /// + public string ToPanel_TagNumber + { + get { return _ToPanel_TagNumber; } + set { _ToPanel_TagNumber = value; } + } + + private string _Panel_TagNumber; + /// + /// 实际分配的系统柜 + /// + public string Panel_TagNumber + { + get { return _Panel_TagNumber; } + set { _Panel_TagNumber = value; } + } + + private string _StripName; + /// + /// 实际分配的端子排 + /// + public string StripName + { + get { return _StripName; } + set { _StripName = value; } + } + + private ObservableCollection _Terms; + /// + /// 实际端子 + /// + public ObservableCollection Terms + { + get { return _Terms; } + set { _Terms = value; } + } + + + } } diff --git a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs index fe8399c7..f0f93dd9 100644 --- a/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs +++ b/newFront/c#前端/SWS.CAD/ViewModels/DialogIODistributionVM/DialogIODistributionViewModel.cs @@ -2706,12 +2706,17 @@ namespace SWS.CAD.ViewModels //获取到所有预分配的电缆并设置到页面渲染对象中 IsBusy = true; List CablePreAssigns = await _iOModuleService.GetCablePreAssignPreview(); + if (CablePreAssigns==null) + { + CablePreAssigns = new List(); + } var PreAssignCables = new ObservableCollection(); int index = 0; + foreach (var CablePreAssign in CablePreAssigns) { index++; - PreAssignCables.Add(new PreAssignCable(CablePreAssign) { Index = index }); + PreAssignCables.Add(new PreAssignCable(CablePreAssign) { Index = index ,IsChecked=true}); } IsBusy = false; //打开窗体 diff --git a/newFront/c#前端/SWS.CAD/Views/CheckInApprove.xaml b/newFront/c#前端/SWS.CAD/Views/CheckInApprove.xaml index c11334a2..70666235 100644 --- a/newFront/c#前端/SWS.CAD/Views/CheckInApprove.xaml +++ b/newFront/c#前端/SWS.CAD/Views/CheckInApprove.xaml @@ -11,8 +11,8 @@ AllowsTransparency="True" Background="White" Loaded="Window_Loaded" - ResizeMode="NoResize" - WindowStartupLocation="CenterScreen" + ResizeMode="NoResize" + WindowStartupLocation="CenterScreen" WindowStyle="None"> @@ -24,67 +24,115 @@ - + - + - - - - + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -95,22 +143,23 @@ + Background="{StaticResource ColorPrimary}"> - + + Margin="5" + Command="{Binding OKCommand}" + CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=Window}}" + Content="批量审核" + Style="{StaticResource sysBtn}" + Visibility="{Binding IsShowApprove}" /> - + diff --git a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml index 4e5e9a04..27116793 100644 --- a/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml +++ b/newFront/c#前端/SWS.CAD/Views/Dialog/DialogIODistributions/DialogCablePreAssignResult.xaml @@ -6,6 +6,7 @@ xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:local="clr-namespace:SWS.CAD.Views.CustomControl" + xmlns:cvt="clr-namespace:SWS.Commons.Helper.Converter;assembly=SWS.Commons" mc:Ignorable="d" d:DesignHeight="450" d:DesignWidth="800"> @@ -13,6 +14,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -23,22 +59,55 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/newFront/c#前端/SWS.CAD/Views/LeftPanel.xaml b/newFront/c#前端/SWS.CAD/Views/LeftPanel.xaml index dad986c5..bec49049 100644 --- a/newFront/c#前端/SWS.CAD/Views/LeftPanel.xaml +++ b/newFront/c#前端/SWS.CAD/Views/LeftPanel.xaml @@ -2,16 +2,17 @@ x:Class="SWS.CAD.Views.LeftPanel" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converter="clr-namespace:SWS.CAD.Converter" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" + xmlns:i="http://schemas.microsoft.com/xaml/behaviors" xmlns:local="clr-namespace:SWS.CAD.Views" xmlns:local2="clr-namespace:SWS.Model;assembly=SWS.Model" - xmlns:converter="clr-namespace:SWS.CAD.Converter" - xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" - xmlns:i="http://schemas.microsoft.com/xaml/behaviors" Width="250" + xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" + Width="250" Loaded="UserControl_Loaded"> - - + + @@ -48,32 +49,35 @@ - + - + - - + + - + - - - - - - + + + + + + @@ -122,7 +126,7 @@ - + @@ -136,49 +140,79 @@ - - - - - - - + Grid.Column="1" + Width="auto" + Margin="1,0,0,0" + HorizontalAlignment="Stretch" + Style="{StaticResource sysTextBox}" + Tag="工程文件" + TextChanged="TextBox_TextChanged" /> + + + + + + + - + + x:Name="radTreeView" + Grid.Row="2" + Grid.ColumnSpan="2" + Margin="-5,0,0,0" + telerik:StyleManager.Theme="Green" + FontSize="11" + ItemsSource="{Binding Drawings}" + PreviewMouseRightButtonDown="RadTreeView_PreviewMouseRightButtonDown" + SelectedItem="{Binding selectedNode, Mode=TwoWay}"> + Height="16" + Orientation="Horizontal" + ToolTip="{Binding ToolTipText}"> - + + VerticalAlignment="Center" + Foreground="{Binding FontColor}" + Text="{Binding Text}" /> - + @@ -190,28 +224,32 @@ + x:Name="treeDwgHistory" + Margin="-5,0,0,0" + telerik:StyleManager.Theme="Green" + Background="Transparent" + FontSize="11" + ItemsSource="{Binding historyDrawings}" + PreviewMouseRightButtonDown="treeDwgHistory_PreviewMouseRightButtonDown" + SelectedItem="{Binding selectedHistoryDwg, Mode=TwoWay}"> + Height="16" + Orientation="Horizontal" + ToolTip="{Binding ToolTipText}"> - + - + @@ -231,7 +269,7 @@ - + @@ -242,10 +280,17 @@ -