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 index 0b7d950e..c3986afc 100644 Binary files a/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Oracle/obj/Debug/Learun.DataBase.Oracle.csproj.AssemblyReference.cache 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 index 0a03554a..8e1769fc 100644 Binary files a/Learun.Framework.Module/Learun.Db/Learun.DataBase.EF.Sqlserver/obj/Debug/Learun.DataBase.SqlServer.csproj.AssemblyReference.cache 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 index 293a4e6b..d4b9e141 100644 Binary files a/Learun.Framework.Module/Learun.Db/Learun.DataBase.MySql/obj/Debug/Learun.DataBase.MySqlEx.csproj.AssemblyReference.cache 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 index 633d7ec8..2fe5958e 100644 --- a/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref +++ b/SWSDBSchemeUpgradeTool/obj/Debug/SWSDBSchemeUpgradeTool_MarkupCompile.lref @@ -1,5 +1,5 @@  -FC:\repo\CODE\009_DI-Elec\SWSDBSchemeUpgradeTool\MainWindow.xaml;; -FC:\repo\CODE\009_DI-Elec\SWSDBSchemeUpgradeTool\SQLPreview.xaml;; +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 d235b2e6..f45a552e 100644 --- a/newFront/c#前端/SWS.CAD/GlobalObje.cs +++ b/newFront/c#前端/SWS.CAD/GlobalObje.cs @@ -1,5 +1,6 @@ using IniParser; using Prism.Ioc; +using SWS.Commons; using SWS.Model; using SWS.Service; using System; @@ -59,7 +60,7 @@ namespace SWS.CAD if (_dwgType == null) { - var serv = GlobalObje.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_DrawingType.ToString())); var res2 = res.Result; return res2; @@ -83,7 +84,7 @@ namespace SWS.CAD if (_dwgMaterialRange == null) { - var serv = GlobalObje.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_MaterialRange.ToString())); var res2 = res.Result; return res2; @@ -107,7 +108,7 @@ namespace SWS.CAD if (_dwgMaterialCensus == null) { - var serv = GlobalObje.container.Resolve(); + var serv = GlobalObject.container.Resolve(); var res = Task.Run(() => serv.GetDetails(DBConst.Be_MaterialCensus.ToString())); var res2 = res.Result; return res2; @@ -131,7 +132,7 @@ namespace SWS.CAD if (_dwgStage == null) { - var serv = GlobalObje.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/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/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 @@ -