ouruisong 6 місяців тому
батько
коміт
ceaaea19b7

+ 134 - 0
CollaborativePlatformMain/CADStartUtil/FloorDataConfigUtil.cs

@@ -0,0 +1,134 @@
+using CollaborativePlatformMain.DFEntity;
+using DFBIM.CADNETCommon.XmlConfig;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CollaborativePlatformMain.CADStartUtil
+{
+
+    /// <summary>
+    /// 
+    /// <para>文件名(File Name):     FloorDataConfigUtil.cs</para>
+    /// 
+    /// <para>描述(Description):     楼层数据config文件</para>
+    /// 
+    /// <para>数据表(Tables):        nothing</para>
+    /// 
+    /// <para>作者(Author):          Ou Rui Song</para>
+    /// 
+    /// <para>日期(Create Date):     2024年5月8日11:10:37</para>
+    /// 
+    /// 修改记录(Revision History):
+    ///     R1:
+    ///         修改作者:
+    ///         修改日期:
+    ///         修改理由:
+    /// 
+    /// </summary>
+    [Serializable]
+    public class FloorDataConfigUtil: XmlConfigBase
+    {
+        public override object InitConfig()
+        {
+            return new ObservableCollection<List<FloorLayerData>>();
+        }
+
+        public override void SetConfigFile()
+        {
+            ConfigFile = "FloorLayerData.config";
+        }
+
+        ObservableCollection<List<FloorLayerData>> info;
+        public ObservableCollection<List<FloorLayerData>> Info
+        {
+            get { return info == null ? info = new ObservableCollection<List<FloorLayerData>>() : info; }
+            set { info = value; }
+        }
+    }
+
+    /// <summary>
+    /// 
+    /// <para>文件名(File Name):     OpenDrawConfigUtil.cs</para>
+    /// 
+    /// <para>描述(Description):     打开图纸</para>
+    /// 
+    /// <para>数据表(Tables):        nothing</para>
+    /// 
+    /// <para>作者(Author):          Ou Rui Song</para>
+    /// 
+    /// <para>日期(Create Date):     2024年5月8日11:10:37</para>
+    /// 
+    /// 修改记录(Revision History):
+    ///     R1:
+    ///         修改作者:
+    ///         修改日期:
+    ///         修改理由:
+    /// 
+    /// </summary>
+    [Serializable]
+    public class OpenDrawConfigUtil : XmlConfigBase
+    {
+        public override object InitConfig()
+        {
+            return new ObservableCollection<OpenDrawPathData>();
+        }
+
+        public override void SetConfigFile()
+        {
+            ConfigFile = "OpenDrawPathData.config";
+        }
+
+        ObservableCollection<OpenDrawPathData> info;
+        public ObservableCollection<OpenDrawPathData> Info
+        {
+            get { return info == null ? info = new ObservableCollection<OpenDrawPathData>() : info; }
+            set { info = value; }
+        }
+    }
+
+
+    /// <summary>
+    /// 
+    /// <para>文件名(File Name):     OpenDrawConfigUtil.cs</para>
+    /// 
+    /// <para>描述(Description):     打开图纸</para>
+    /// 
+    /// <para>数据表(Tables):        nothing</para>
+    /// 
+    /// <para>作者(Author):          Ou Rui Song</para>
+    /// 
+    /// <para>日期(Create Date):     2024年5月8日11:10:37</para>
+    /// 
+    /// 修改记录(Revision History):
+    ///     R1:
+    ///         修改作者:
+    ///         修改日期:
+    ///         修改理由:
+    /// 
+    /// </summary>
+    [Serializable]
+    public class TwoOpenCADConfigUtil : XmlConfigBase
+    {
+        public override object InitConfig()
+        {
+            return new ObservableCollection<TwoOpenData>();
+        }
+
+        public override void SetConfigFile()
+        {
+            ConfigFile = "CMTwoOpenCAD.config";
+        }
+
+        ObservableCollection<TwoOpenData> info;
+        public ObservableCollection<TwoOpenData> Info
+        {
+            get { return info == null ? info = new ObservableCollection<TwoOpenData>() : info; }
+            set { info = value; }
+        }
+    }
+
+}

+ 93 - 0
CollaborativePlatformMain/CADStartUtil/OpenDrawPathData.cs

@@ -0,0 +1,93 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace CollaborativePlatformMain.CADStartUtil
+{
+    /// <summary>
+    /// 
+    /// <para>文件名(File Name):     OpenDrawPathData.cs</para>
+    /// 
+    /// <para>描述(Description):     打开图纸数据</para>
+    /// 
+    /// <para>数据表(Tables):        nothing</para>
+    /// 
+    /// <para>作者(Author):          Ou Rui Song</para>
+    /// 
+    /// <para>日期(Create Date):     2024年5月8日11:15:12</para>
+    /// 
+    /// 修改记录(Revision History):
+    ///     R1:
+    ///         修改作者:
+    ///         修改日期:
+    ///         修改理由:
+    /// 
+    /// </summary>
+    [Serializable]
+    public class OpenDrawPathData
+    {
+        public OpenDrawPathData()
+        {
+        }
+
+        public OpenDrawPathData(bool isOpen, string path)
+        {
+            IsOpen = isOpen;
+            Path = path;
+        }
+
+
+        /// <summary>
+        /// 是否打开
+        /// </summary>
+        public bool IsOpen { get; set; }
+
+        /// <summary>
+        /// 图纸地址
+        /// </summary>
+        public string Path { get; set; }
+
+    }
+
+
+    /// <summary>
+    /// 
+    /// <para>文件名(File Name):     TwoOpenData.cs</para>
+    /// 
+    /// <para>描述(Description):     二次打开数据</para>
+    /// 
+    /// <para>数据表(Tables):        nothing</para>
+    /// 
+    /// <para>作者(Author):          Ou Rui Song</para>
+    /// 
+    /// <para>日期(Create Date):     2024年5月8日11:15:12</para>
+    /// 
+    /// 修改记录(Revision History):
+    ///     R1:
+    ///         修改作者:
+    ///         修改日期:
+    ///         修改理由:
+    /// 
+    /// </summary>
+    [Serializable]
+    public class TwoOpenData
+    {
+        public TwoOpenData()
+        {
+        }
+
+        public TwoOpenData(bool isOpen)
+        {
+            IsOpen = isOpen;
+        }
+
+
+        /// <summary>
+        /// 是否打开
+        /// </summary>
+        public bool IsOpen { get; set; }
+
+    }
+}

+ 54 - 10
CollaborativePlatformMain/CADStartUtil/StartCADUtil.cs

@@ -33,9 +33,8 @@ namespace CollaborativePlatformMain.CADStartUtil
     public class StartCADUtil
     {
 
-        static string location;
 
-        public static void StartCADMath()
+        public static void StartCADMath(bool isFloor = true, OpenDrawPathData openDrawPathData = null)
         {
             try
             {
@@ -61,22 +60,36 @@ namespace CollaborativePlatformMain.CADStartUtil
                 var pros = Process.GetProcessesByName("acad");
                 if (pros.Length != 0)
                 {
-                    //已打开cad
-
+                    //已打开cad,写入一个文件,让cad监听文件
+                    if (isFloor)
+                    {
+                        TwoOpenCADConfigUtil twoOpenCADConfigUtil = new TwoOpenCADConfigUtil();
+                        twoOpenCADConfigUtil.Save(new TwoOpenData(true), @"D:\DFBIM\CMTwoOpenFloor.config");
+                    }
+                    else
+                    {
+                        OpenDrawConfigUtil openDrawConfigUtil = new OpenDrawConfigUtil();
+                        openDrawConfigUtil.Save(openDrawPathData, @"D:\DFBIM\OpenDrawPathData.config");
+                    }
                 }
                 else
                 {
-                    location = cadPathpks[0].Location;
+                    string location = cadPathpks[0].Location;
 
                     // 创建一个脚本文件并写入要执行的命令
-                    //string scriptFile = location + "\\autocad_script.scr";
-                    //File.WriteAllText(scriptFile, "DFBIMDwgComparisonCooperate\n");
-
+                    string scriptFile = location + "\\autocad_script.scr";
+                    if (isFloor) File.WriteAllText(scriptFile, "CMOPENCADFLOOR\n");
+                    else
+                    {
+                        OpenDrawConfigUtil openDrawConfigUtil = new OpenDrawConfigUtil();
+                        openDrawConfigUtil.Save(openDrawPathData, @"D:\DFBIM\OpenDrawPathData.config");
+                        File.WriteAllText(scriptFile, "CMOPENCADDRAW\n");
+                    }
                     // 启动AutoCAD进程并运行脚本文件
                     ProcessStartInfo startInfo = new ProcessStartInfo
                     {
                         FileName = location + "\\acad.exe",
-                        //Arguments = $"/b \"{scriptFile}\"",
+                        Arguments = $"/b \"{scriptFile}\"",
                         UseShellExecute = false,
                         RedirectStandardError = true,
                         RedirectStandardInput = true,
@@ -84,8 +97,10 @@ namespace CollaborativePlatformMain.CADStartUtil
                         CreateNoWindow = true
                     };
 
-                    using (Process autocadProcess = new Process { StartInfo = startInfo })
+                    //创建新的线程
+                    using (Process autocadProcess = new Process())
                     {
+                        autocadProcess.StartInfo = startInfo;
                         autocadProcess.Start();
 
                         // 等待AutoCAD进程完成
@@ -103,5 +118,34 @@ namespace CollaborativePlatformMain.CADStartUtil
         }
 
 
+        /// <summary>
+        /// 关闭进程
+        /// </summary>
+        private static void KillProcess(int currentProcessId = -1)
+        {
+            if (currentProcessId == -1) currentProcessId = Process.GetCurrentProcess().Id;
+
+            Process cadProcess = Process.GetProcessById(currentProcessId);
+
+            if (!cadProcess.HasExited)
+            {
+                cadProcess.Kill();
+                //log.Info($"成功关闭CAD应用程序 (PID: {cadProcess.Id})");
+
+            }
+            else
+            {
+                //log.Info($"CAD应用程序 (PID: {cadProcess.Id}) 已经退出。");
+            }
+
+            //kill infoer
+            Process[] processes = Process.GetProcessesByName("WSCommCntr4");
+            if (processes.Length != 0)
+            {
+                processes[0].Kill();
+                //log.Info("kill infoer");
+            }
+        }
+
     }
 }

+ 9 - 0
CollaborativePlatformMain/CollaborativePlatformMain.csproj

@@ -143,6 +143,8 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </ApplicationDefinition>
+    <Compile Include="CADStartUtil\FloorDataConfigUtil.cs" />
+    <Compile Include="CADStartUtil\OpenDrawPathData.cs" />
     <Compile Include="CADStartUtil\SendToCAD.cs" />
     <Compile Include="CADStartUtil\StartCADUtil.cs" />
     <Compile Include="DFEntity\FloorLayerData.cs" />
@@ -162,6 +164,9 @@
     <Compile Include="Form\FloorDrawingForm.xaml.cs">
       <DependentUpon>FloorDrawingForm.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Form\Legend\DetailedLegendPage.xaml.cs">
+      <DependentUpon>DetailedLegendPage.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Form\MessageSubPage\AddImage\AddImageForm.xaml.cs">
       <DependentUpon>AddImageForm.xaml</DependentUpon>
     </Compile>
@@ -231,6 +236,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Form\Legend\DetailedLegendPage.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Form\MessageSubPage\AddImage\AddImageForm.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 5 - 0
CollaborativePlatformMain/DFEntity/FloorLayerData.cs

@@ -25,8 +25,13 @@ namespace CollaborativePlatformMain.DFEntity
     ///         修改理由:
     /// 
     /// </summary>
+    [Serializable]
     public class FloorLayerData
     {
+        public FloorLayerData()
+        {
+        }
+
 
         /// <summary>
         /// 图层管理器

+ 14 - 7
CollaborativePlatformMain/Form/BigFullProfessiongForm.xaml.cs

@@ -29,10 +29,10 @@ namespace CollaborativePlatformMain.Form
         public HomepageForm HomepageForm;
 
 
-        /// <summary>
-        /// 父级窗体
-        /// </summary>
-        public OperatingFloorPage OperatingFloorPage;
+        ///// <summary>
+        ///// 父级窗体
+        ///// </summary>
+        //public OperatingFloorPage OperatingFloorPage;
 
 
         /// <summary>
@@ -53,14 +53,16 @@ namespace CollaborativePlatformMain.Form
 
 
 
-        public BigFullProfessiongForm(HomepageForm homepageForm, FullProfessionPage fullProfessionPage, OperatingFloorPage operatingFloorPage)
+        public BigFullProfessiongForm(HomepageForm homepageForm, FullProfessionPage fullProfessionPage, string bulingName = "")
         {
             InitializeComponent();
             HomepageForm = homepageForm;
             SmallPage = fullProfessionPage;
-            OperatingFloorPage = operatingFloorPage;
+
         }
 
+
+
         /// <summary>
         /// 窗体初始化
         /// </summary>
@@ -130,7 +132,7 @@ namespace CollaborativePlatformMain.Form
         private void Button_Click(object sender, RoutedEventArgs e)
         {
             string value = bt_ditu.Content.ToString();
-            
+
             if (value.Contains("底图"))
             {
                 SelectItemByClick(BigPage.tr_threemodel, false, "Visible");
@@ -428,5 +430,10 @@ namespace CollaborativePlatformMain.Form
                 bt_luotu.Content = "一键落图";
             }
         }
+
+        private void Butto_Click_1(object sender, RoutedEventArgs e)
+        {
+
+        }
     }
 }

+ 13 - 8
CollaborativePlatformMain/Form/HomepageForm.xaml.cs

@@ -23,6 +23,8 @@ using MessageBox = System.Windows.MessageBox;
 using static System.Net.Mime.MediaTypeNames;
 using CollaborativePlatformMain.Form.MessageSubPage;
 using CollaborativePlatformMain.Form.MessageSubPage.CreatLevel;
+using CollaborativePlatformMain.Form.MessageSubPage.Project;
+using CollaborativePlatformMain.DFEntity.MessageSubUtil;
 
 namespace CollaborativePlatformMain.Form
 {
@@ -44,6 +46,11 @@ namespace CollaborativePlatformMain.Form
         public bool IsSeconMessagePage = false;
 
         /// <summary>
+        /// 消息窗体
+        /// </summary>
+        public SeconMessagePage SeconMessagePage = null;
+
+        /// <summary>
         /// 消息
         /// </summary>
         /// <param name="sender"></param>
@@ -59,12 +66,10 @@ namespace CollaborativePlatformMain.Form
             dp_tools.Visibility = Visibility.Collapsed;
             dp_threetools.Visibility = Visibility.Collapsed;
 
-            if (!IsSeconMessagePage)
-            {
-                seconMessagePage.Navigate(new SeconMessagePage(this));
-                IsSeconMessagePage = true;
-            }
-           
+            SeconMessagePage = new SeconMessagePage(this);
+            seconMessagePage.Navigate(SeconMessagePage);
+            IsSeconMessagePage = true;
+
 
             //SwitchMethod(sender as MenuItem, true);
         }
@@ -149,7 +154,7 @@ namespace CollaborativePlatformMain.Form
 
             if (!IsSeconLegendPage)
             {
-                seconLegendPage.Navigate(new SeconLegendPage());
+                seconLegendPage.Navigate(new SeconLegendPage(this));
                 IsSeconLegendPage = true;
             }
         }
@@ -207,7 +212,7 @@ namespace CollaborativePlatformMain.Form
                 seconThreeTools.Navigate(new SeconThreeDimensionalPage(this));
                 IsSeconThreeDimensionalPage = true;
             }
-           
+
         }
 
 

+ 34 - 0
CollaborativePlatformMain/Form/Legend/DetailedLegendPage.xaml

@@ -0,0 +1,34 @@
+<Page x:Class="CollaborativePlatformMain.Form.MessageSubPage.Legend.DetailedLegendPage"
+        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+        xmlns:local="clr-namespace:CollaborativePlatformMain.Form.MessageSubPage.Legend"
+        mc:Ignorable="d"
+        Title="图例详情" Width="663" Height="430"
+        Loaded="Window_Loaded">
+
+    <StackPanel Margin="10,10,0,0">
+        <Button Margin="0,0,0,5" Content="返回" Click="returnBackBu_Click" HorizontalAlignment="Left" Name="returnBackBu"/>
+        <ScrollViewer VerticalScrollBarVisibility="Auto" Padding="0,0,0,20">
+            <ItemsControl x:Name="sv_legend" >
+                <ItemsControl.ItemsPanel>
+                    <ItemsPanelTemplate>
+                        <WrapPanel/>
+                    </ItemsPanelTemplate>
+                </ItemsControl.ItemsPanel>
+
+                <ItemsControl.ItemTemplate>
+                    <DataTemplate>
+                        <StackPanel MouseDown="StackPanel_MouseDown">
+                            <!-- 第一行文本  图片 -->
+                            <Image Source="{Binding ImagePath}" Width="90" Height="60"/>
+                            <!-- 第二行文本  文件夹名称 -->
+                            <Label Name="lb_legendName" Content="{Binding Name}" BorderThickness="0" />
+                        </StackPanel>
+                    </DataTemplate>
+                </ItemsControl.ItemTemplate>
+            </ItemsControl>
+        </ScrollViewer>
+    </StackPanel>
+</Page>

+ 156 - 0
CollaborativePlatformMain/Form/Legend/DetailedLegendPage.xaml.cs

@@ -0,0 +1,156 @@
+using CollaborativePlatformMain.DFEntity.MessageSubUtil;
+using CollaborativePlatformMain.Form.MessageSubPage.AddImage;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace CollaborativePlatformMain.Form.MessageSubPage.Legend
+{
+    /// <summary>
+    /// DetailedLegendForm.xaml 的交互逻辑
+    /// </summary>
+    public partial class DetailedLegendPage : Page
+    {
+
+        /// <summary>
+        /// 父级窗体
+        /// </summary>
+        public SeconLegendPage SeconLegendPage;
+
+        /// <summary>
+        /// 数据信息
+        /// </summary>
+        public List<LegendEntity> LegendEntities = new List<LegendEntity>();
+
+        public Dictionary<string, List<LegendEntity>> KeyValuePairs = new Dictionary<string, List<LegendEntity>>()
+        {
+             {"门窗大样",new List<LegendEntity>(){
+                 new LegendEntity("双开门", @"/Image/folderImage.png"),
+                 new LegendEntity("单开门", @"/Image/folderImage.png"),
+                 new LegendEntity("推拉门", @"/Image/folderImage.png"),
+                 new LegendEntity("平开窗", @"/Image/folderImage.png"),
+                 new LegendEntity("推拉窗", @"/Image/folderImage.png"),
+             } },
+             {"家具",new List<LegendEntity>(){
+                 new LegendEntity("床", @"/Image/folderImage.png"),
+                 new LegendEntity("沙发", @"/Image/folderImage.png"),
+                 new LegendEntity("衣柜", @"/Image/folderImage.png"),
+                 new LegendEntity("玄关柜", @"/Image/folderImage.png"),
+             } },
+             {"户型",new List<LegendEntity>(){
+                  new LegendEntity("一居室", @"/Image/folderImage.png"),
+                  new LegendEntity("二居室", @"/Image/folderImage.png"),
+             } },
+             {"墙体大样",new List<LegendEntity>(){
+                 new LegendEntity("墙体大样图1", @"/Image/folderImage.png"),
+                  new LegendEntity("墙体大样图2", @"/Image/folderImage.png"),
+             } },
+        };
+
+        /// <summary>
+        /// 父级窗体选中标签
+        /// </summary>
+        public string LegendName = "";
+
+        /// <summary>
+        /// 首级页面
+        /// </summary>
+        public HomepageForm HomepageForm;
+
+        public DetailedLegendPage(SeconLegendPage seconLegendPage, HomepageForm homepageForm, string legendName)
+        {
+            InitializeComponent();
+            LegendName = legendName;
+            HomepageForm = homepageForm;
+            SeconLegendPage = seconLegendPage;
+        }
+
+        private void StackPanel_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            StackPanel stackPanel = sender as StackPanel;
+            if (stackPanel == null) return;
+
+            Label label = stackPanel.FindName("lb_legendName") as Label;
+            if (label == null) return;
+            if (label.Content.ToString() == "新增")
+            {
+                AddImageForm addImageForm = new AddImageForm(this);
+                addImageForm.ShowDialog();
+            }
+            else
+            {
+
+            }
+        }
+
+        /// <summary>
+        /// 新增文件夹
+        /// </summary>
+        /// <param name="legendName"></param>
+        public bool AddLegendMath(string legendName)
+        {
+            for (int i = 0; i < LegendEntities.Count; i++)
+            {
+                if (LegendEntities[i].Name.Equals(legendName))
+                {
+                    MessageBox.Show("已具有相同名称文件夹");
+                    return false;
+                }
+            }
+            //添加数据
+            LegendEntity legendEntity = new LegendEntity(legendName, @"/Image/folderImage.png");
+            int index = LegendEntities.Count - 1;
+            LegendEntities.Insert(index, legendEntity);
+
+            sv_legend.ItemsSource = null;
+            sv_legend.ItemsSource = LegendEntities;
+            return true;
+        }
+
+        private void Window_Loaded(object sender, RoutedEventArgs e)
+        {
+            if (LegendName.Equals("门窗大样"))
+            {
+                this.Title = "门窗大样";
+                LegendEntities = KeyValuePairs["门窗大样"];
+            }
+            else if (LegendName.Equals("家具"))
+            {
+                this.Title = "家具";
+                LegendEntities = KeyValuePairs["家具"];
+            }
+            else if (LegendName.Equals("户型"))
+            {
+                this.Title = "户型";
+                LegendEntities = KeyValuePairs["户型"];
+            }
+            else if (LegendName.Equals("墙体大样"))
+            {
+                this.Title = "墙体大样";
+                LegendEntities = KeyValuePairs["墙体大样"];
+            }
+            if (LegendEntities.Where(x => x.Name.Equals("新增")).Count() == 0)
+            {
+                LegendEntity insertLegend = new LegendEntity("新增", @"/Image/add.png");
+                LegendEntities.Add(insertLegend);
+            }
+            sv_legend.ItemsSource = null;
+            sv_legend.ItemsSource = LegendEntities;
+        }
+
+        private void returnBackBu_Click(object sender, RoutedEventArgs e)
+        {
+            HomepageForm.seconLegendPage.Navigate(SeconLegendPage);
+        }
+    }
+}

+ 17 - 8
CollaborativePlatformMain/Form/MessageSubPage/AddImage/AddImageForm.xaml.cs

@@ -1,4 +1,5 @@
-using System;
+using CollaborativePlatformMain.Form.MessageSubPage.Legend;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -22,15 +23,15 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.AddImage
         /// <summary>
         /// 父级窗体
         /// </summary>
-        public SeconLegendPage SeconLegendPage;
+        public Page ParentPage = null;
 
         /// <summary>
         /// 创建新文件夹分级
         /// </summary>
-        public AddImageForm(SeconLegendPage seconLegendPage)
+        public AddImageForm(Page seconLegendPage)
         {
             InitializeComponent();
-            SeconLegendPage = seconLegendPage;
+            ParentPage = seconLegendPage;
         }
 
         /// <summary>
@@ -46,9 +47,17 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.AddImage
                 MessageBox.Show("文件夹名称不允许为空!");
                 return;
             }
-            SeconLegendPage.AddLegendMath(name);
-
-            this.Close();
+            if (ParentPage != null)
+            {
+                if (ParentPage is SeconLegendPage seconLegendPage)
+                {
+                    if (seconLegendPage.AddLegendMath(name)) this.Close();
+                }
+                else if (ParentPage is DetailedLegendPage detailedLegendPage)
+                {
+                    if (detailedLegendPage.AddLegendMath(name)) this.Close();
+                }
+            }
         }
     }
-}
+}

+ 33 - 0
CollaborativePlatformMain/Form/MessageSubPage/Project/NewProjrctPage.xaml.cs

@@ -26,6 +26,7 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
         public SeconProjectPage SeconProjectPage;
 
 
+
         public NewProjrctPage(SeconProjectPage seconProjectPage)
         {
             InitializeComponent();
@@ -141,6 +142,38 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
 
             ProjectEntity projectInfo = new ProjectEntity(projectName, buildDatas);
 
+
+            //存储消息数据
+            if (!projectName.Contains("项目")) projectName = projectName + " 项目";
+            //二级菜单
+            string seconNode = projectName + "建筑" + "图纸更新";
+
+            bool isExisteSecon = false;
+            for (int i = 0; i < SeconMessagePage.MessageDatas.Count; i++)
+            {
+                MessageData existMessageData = SeconMessagePage.MessageDatas[i];
+                if (existMessageData.SeconNode.Equals(seconNode))
+                {
+                    foreach (var item in BuildNames)
+                    {
+                        SeconMessagePage.MessageDatas[i].ThreeNodes.Add(projectName + item + "更新");
+                    }
+                    isExisteSecon = true;
+                    break;
+                }
+            }
+            if (!isExisteSecon)
+            {
+                MessageData newMessageData = new MessageData();
+                newMessageData.SeconNode = seconNode;
+                foreach (var item in BuildNames)
+                {
+                    newMessageData.ThreeNodes.Add(projectName + "建筑" + item + "更新");
+                }
+                SeconMessagePage.MessageDatas.Add(newMessageData);
+            }
+
+            //messageData
             SeconProjectPage.ProjectEntities.Add(projectInfo);
             SeconProjectPage.FlushData();
         }

+ 47 - 11
CollaborativePlatformMain/Form/MessageSubPage/Project/OperatingFloorPage.xaml.cs

@@ -47,33 +47,35 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
         /// <summary>
         /// 建筑展示数据
         /// </summary>
-        public ObservableCollection<OperatEntity> ArchOperaDatas = new ObservableCollection<OperatEntity>();
+        public static ObservableCollection<OperatEntity> ArchOperaDatas = new ObservableCollection<OperatEntity>();
 
         /// <summary>
         /// 结构展示数据
         /// </summary>
-        public ObservableCollection<OperatEntity> StruOperaDatas = new ObservableCollection<OperatEntity>();
+        public static ObservableCollection<OperatEntity> StruOperaDatas = new ObservableCollection<OperatEntity>();
 
         /// <summary>
         /// 给排水展示数据
         /// </summary>
-        public ObservableCollection<OperatEntity> WaterOperaDatas = new ObservableCollection<OperatEntity>();
+        public static ObservableCollection<OperatEntity> WaterOperaDatas = new ObservableCollection<OperatEntity>();
 
         /// <summary>
         /// 暖通展示数据
         /// </summary>
-        public ObservableCollection<OperatEntity> WarmOperaDatas = new ObservableCollection<OperatEntity>();
+        public static ObservableCollection<OperatEntity> WarmOperaDatas = new ObservableCollection<OperatEntity>();
 
         /// <summary>
         /// 电气展示数据
         /// </summary>
-        public ObservableCollection<OperatEntity> EleOperaDatas = new ObservableCollection<OperatEntity>();
+        public static ObservableCollection<OperatEntity> EleOperaDatas = new ObservableCollection<OperatEntity>();
+
+
 
 
         /// <summary>
         /// 全专业窗体
         /// </summary>
-        public FullProfessionPage FullProfessionPage;
+        public static FullProfessionPage FullProfessionPage;
 
         /// <summary>
         /// 窗体初始化
@@ -96,12 +98,17 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
                 tr_threemodel.ItemsSource = ArchOperaDatas;
 
                 IsFirstShow = false;
+
+                FullProfessionPage = new FullProfessionPage(HomepageForm);
+                FullProfessionPage.Width = 483;
+                FullProfessionPage.Height = 370;
+                frame_FullProdess.Navigate(FullProfessionPage);
+                SeconProjectPage.floor_quanPages.Add(FirstData, FullProfessionPage);
             }
 
-            FullProfessionPage = new FullProfessionPage(HomepageForm);
-            FullProfessionPage.Width = 483;
-            FullProfessionPage.Height = 370;
-            frame_FullProdess.Navigate(FullProfessionPage);
+
+
+
         }
 
         private void tr_threemodel_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
@@ -137,6 +144,7 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
             sp_AllSingle.Visibility = Visibility.Visible;
         }
 
+        public UploadDrawingForm UploadDrawingForm = null;
 
         /// <summary>
         /// 上传图纸
@@ -150,11 +158,13 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
             {
                 UploadDrawingForm uploadDrawingForm = new UploadDrawingForm(this, false);
                 uploadDrawingForm.Show();
+                UploadDrawingForm = uploadDrawingForm;
                 button.Content = "更新图纸";
             }
             else
             {
                 UploadDrawingForm uploadDrawingForm = new UploadDrawingForm(this, true);
+                UploadDrawingForm = uploadDrawingForm;
                 uploadDrawingForm.Show();
             }
         }
@@ -167,6 +177,32 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
             tr_threemodel.ItemsSource = null;
             tr_threemodel.ItemsSource = ArchOperaDatas;
 
+            for (int i = 0; i < SeconMessagePage.MessageDatas.Count; i++)
+            {
+                MessageData messageData = SeconMessagePage.MessageDatas[i];
+                for (int j = 0; j < ArchOperaDatas.Count; j++)
+                {
+                    string node = ArchOperaDatas[j].Node;
+
+                    //拆分出楼栋和项目名称
+                    string[] spString = node.Split(' ');
+
+                    string projectName = spString.First();
+                    string budingName = spString.Last();
+
+                    if (!projectName.Contains("项目")) projectName = projectName + "项目";
+                    projectName = projectName + "建筑";
+                    string secondeName = projectName + "图纸更新";
+                    if (messageData.SeconNode.Replace(" ", "").Equals(secondeName)) 
+                    {
+                        foreach (var item in UploadDrawingForm.ArchLayerDatas)
+                        {
+                            messageData.ThreeNodes.Add(projectName + budingName + item.FloorName + "更新");
+                        }
+
+                    }
+                }
+            }
             FullProfessionPage.tr_threemodel.ItemsSource = ArchOperaDatas;
         }
 
@@ -177,7 +213,7 @@ namespace CollaborativePlatformMain.Form.MessageSubPage.Project
         /// <param name="e"></param>
         private void bt_openBig_Click(object sender, RoutedEventArgs e)
         {
-            BigFullProfessiongForm bigFullProfessiongForm = new BigFullProfessiongForm(HomepageForm, FullProfessionPage,this);
+            BigFullProfessiongForm bigFullProfessiongForm = new BigFullProfessiongForm(HomepageForm, FullProfessionPage);
             bigFullProfessiongForm.Show();
 
             HomepageForm.Hide();

+ 40 - 16
CollaborativePlatformMain/Form/MessageSubPage/SeconLegendPage.xaml.cs

@@ -1,5 +1,6 @@
 using CollaborativePlatformMain.DFEntity.MessageSubUtil;
 using CollaborativePlatformMain.Form.MessageSubPage.AddImage;
+using CollaborativePlatformMain.Form.MessageSubPage.Legend;
 using CollaborativePlatformMain.Util;
 using System;
 using System.Collections.Generic;
@@ -22,29 +23,29 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
     /// </summary>
     public partial class SeconLegendPage : Page
     {
-        public SeconLegendPage()
+
+        public HomepageForm HomepageForm;
+
+        public SeconLegendPage(HomepageForm homepageForm)
         {
             InitializeComponent();
+            HomepageForm = homepageForm;
         }
 
         /// <summary>
         /// 文件夹名称
         /// </summary>
-        public List<LegendEntity> LegendEntities = new List<LegendEntity>(); 
+        public List<LegendEntity> LegendEntities = new List<LegendEntity>() {
+             new LegendEntity("门窗大样", @"/Image/folderImage.png"),
+             new LegendEntity("家具", @"/Image/folderImage.png"),
+             new LegendEntity("户型", @"/Image/folderImage.png"),
+             new LegendEntity("墙体大样", @"/Image/folderImage.png"),
+             new LegendEntity("新增", @"/Image/add.png"),
+        };
 
 
         private void Window_Loaded(object sender, RoutedEventArgs e)
         {
-            LegendEntity legendEntity1 = new LegendEntity("门窗大样", @"/Image/folderImage.png");
-            LegendEntity legendEntity2 = new LegendEntity("家具", @"/Image/folderImage.png");
-            LegendEntity legendEntity3 = new LegendEntity("户型", @"/Image/folderImage.png");
-            LegendEntity legendEntity4 = new LegendEntity("墙体大样", @"/Image/folderImage.png");
-            LegendEntity legendEntity5 = new LegendEntity("新增", @"/Image/add.png");
-            LegendEntities.Add(legendEntity1);
-            LegendEntities.Add(legendEntity2);
-            LegendEntities.Add(legendEntity3);
-            LegendEntities.Add(legendEntity4);
-            LegendEntities.Add(legendEntity5);
 
 
             sv_legend.ItemsSource = null;
@@ -62,6 +63,11 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
         public int Num = 1;
 
         /// <summary>
+        /// 是否存在页面
+        /// </summary>
+        public Dictionary<string, Page> id_Pages = new Dictionary<string, Page>();
+
+        /// <summary>
         /// 新增文件夹分级
         /// </summary>
         /// <param name="sender"></param>
@@ -81,7 +87,17 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
             }
             else
             {
-
+                if (id_Pages.Where(x => x.Key == label.Content.ToString()).Count() == 0)
+                {
+                    DetailedLegendPage detailedLegendForm = new DetailedLegendPage(this, HomepageForm, label.Content.ToString());
+
+                    HomepageForm.seconLegendPage.Navigate(detailedLegendForm);
+                    id_Pages.Add(label.Content.ToString(), detailedLegendForm);
+                }
+                else
+                {
+                    HomepageForm.seconLegendPage.Navigate(id_Pages[label.Content.ToString()]);
+                }
             }
         }
 
@@ -90,16 +106,24 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
         /// 新增文件夹
         /// </summary>
         /// <param name="legendName"></param>
-        public void AddLegendMath(string legendName)
+        public bool AddLegendMath(string legendName)
         {
+            for (int i = 0; i < LegendEntities.Count; i++)
+            {
+                if (LegendEntities[i].Name.Equals(legendName))
+                {
+                    MessageBox.Show("已具有相同名称文件夹");
+                    return false;
+                }
+            }
             //添加数据
-            LegendEntity legendEntity=new LegendEntity(legendName, @"/Image/folderImage.png");
+            LegendEntity legendEntity = new LegendEntity(legendName, @"/Image/folderImage.png");
             int index = LegendEntities.Count - 1;
             LegendEntities.Insert(index, legendEntity);
 
             sv_legend.ItemsSource = null;
             sv_legend.ItemsSource = LegendEntities;
-
+            return true;
         }
 
         /// <summary>

+ 7 - 4
CollaborativePlatformMain/Form/MessageSubPage/SeconMessagePage.xaml

@@ -26,9 +26,12 @@
             </StackPanel>
         </StackPanel>
 
-        <StackPanel Margin="10,0,0,0" Name="me_right" HorizontalAlignment="Left"  Height="400"  Width="483">
-            
-        </StackPanel>
+        <ScrollViewer VerticalScrollBarVisibility="Auto" Height="400" Width="483">
+            <StackPanel Margin="10,0,0,0" Name="me_right" HorizontalAlignment="Left"  >
+
+            </StackPanel>
+        </ScrollViewer>
+
 
     </DockPanel>
-</Page>
+</Page>

+ 193 - 53
CollaborativePlatformMain/Form/MessageSubPage/SeconMessagePage.xaml.cs

@@ -1,6 +1,8 @@
 using CollaborativePlatformMain.DFEntity.MessageSubUtil;
+using CollaborativePlatformMain.Form.MessageSubPage.Project;
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -36,16 +38,19 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
         }
 
 
-        public List<MessageData> tongzhis1 = new List<MessageData>();
-        public List<MessageData> tongzhis2 = new List<MessageData>();
+        public ObservableCollection<MessageData> tongzhis1 = new ObservableCollection<MessageData>();
+        public ObservableCollection<MessageData> tongzhis2 = new ObservableCollection<MessageData>();
 
-        public List<MessageData> xiangmu1 = new List<MessageData>();
-        public List<MessageData> xiangmu2 = new List<MessageData>();
+        public ObservableCollection<MessageData> xiangmu1 = new ObservableCollection<MessageData>();
+        public ObservableCollection<MessageData> xiangmu2 = new ObservableCollection<MessageData>();
 
         public List<MessageData> xitong1 = new List<MessageData>();
         public List<MessageData> xitong2 = new List<MessageData>();
 
-
+        /// <summary>
+        /// 消息更新
+        /// </summary>
+        public static List<MessageData> MessageDatas = new List<MessageData>();
 
 
         /// <summary>
@@ -59,10 +64,9 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
 
             for (int i = 0; i < secondaryNodes.Count; i++)
             {
-
-
                 if (i == 0)
                 {
+
                     List<string> projects = new List<string>() { "国博城项目总消息", "北京大兴项目总消息", "绿地项目总消息" };
 
                     MessageData messageData = new MessageData();
@@ -94,7 +98,10 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
                 }
                 else if (i == 1)
                 {
-                    List<string> projects = new List<string>() { "国博城项目建筑图纸更新", "北京大兴项目结构图纸更新", "绿地项目人防图纸更新" };
+
+                    List<string> projects = new List<string>() { };
+                    //添加新增数据
+                    projects.AddRange(MessageDatas.Select(x => x.SeconNode).ToList());
 
                     MessageData messageData = new MessageData();
                     messageData.SeconNode = secondaryNodes[i];
@@ -105,21 +112,32 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
                     {
                         MessageData threeData = new MessageData();
                         threeData.SeconNode = projects[j];
-                        if (j == 0)
+                        //if (j == 0)
+                        //{
+                        //    List<string> nodes = new List<string>() { "国博城项目建筑1#楼3层更新。", "国博城项目建筑1#楼5层更新", "国博城项目建筑2#楼3层更新。" };
+                        //    threeData.ThreeNodes = nodes;
+                        //}
+                        //else if (j == 1)
+                        //{
+                        //    List<string> nodes = new List<string>() { "北京大兴项目结构2#楼1层墙柱平法图更新。", "北京大兴项目结构1#楼3层墙柱平法图更新。" };
+                        //    threeData.ThreeNodes = nodes;
+                        //}
+                        //else if (j == 2)
+                        //{
+                        //    List<string> nodes = new List<string>() { "绿地项目地下人防图更新。", "绿地项目暖通3#楼3层更新" };
+                        //    threeData.ThreeNodes = nodes;
+                        //}
+                        //else
+                        //{
+                        foreach (var item in MessageDatas)
                         {
-                            List<string> nodes = new List<string>() { "国博城项目建筑1#楼3层更新。" };
-                            threeData.ThreeNodes = nodes;
-                        }
-                        else if (j == 1)
-                        {
-                            List<string> nodes = new List<string>() { "北京大兴项目结构2#楼1层墙柱平法图更新。" };
-                            threeData.ThreeNodes = nodes;
-                        }
-                        else if (j == 2)
-                        {
-                            List<string> nodes = new List<string>() { "绿地项目地下人防图更新。" };
-                            threeData.ThreeNodes = nodes;
+                            if (item.SeconNode.Equals(threeData.SeconNode))
+                            {
+                                threeData.ThreeNodes = item.ThreeNodes;
+                                break;
+                            }
                         }
+                        //}
                         xiangmu2.Add(threeData);
                     }
                 }
@@ -194,7 +212,7 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
                 button.BorderThickness = new Thickness(0);
                 button.Width = 180;
                 button.Height = 30;
-                button.Background= Brushes.WhiteSmoke;
+                button.Background = Brushes.WhiteSmoke;
                 button.Visibility = Visibility.Visible;
                 button.Click += new RoutedEventHandler(messageBtnClick);
                 button.Tag = item;
@@ -276,43 +294,165 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
             me_right.Children.Clear();
             foreach (var specificConten in specificContent)
             {
-                TextBlock textBlock = new TextBlock();
-                textBlock.Text = specificConten;
-                textBlock.FontSize = 15;
-                textBlock.FontFamily = new FontFamily("黑体");
-                me_right.Children.Add(textBlock);
+
+                //TextBlock textBlock = new TextBlock();
+                //textBlock.Text = specificConten;
+                //textBlock.FontSize = 15;
+                //textBlock.FontFamily = new FontFamily("黑体");
+                //textBlock.DataContext = announcement;
+                //me_right.Children.Add(textBlock);
+                //ScrollViewer scrollViewer=new ScrollViewer();
+                //scrollViewer.VerticalScrollBarVisibility= ScrollBarVisibility.Auto;
+                //me_right.Children.Add(scrollViewer);
+                if (SelectNode.Equals("项目"))
+                {
+                    DockPanel dockPanel = new DockPanel();
+                    dockPanel.Margin = new Thickness(0, 10, 30, 0);
+                    dockPanel.HorizontalAlignment = HorizontalAlignment.Right;
+
+                    TextBlock textBlock1 = new TextBlock();
+                    textBlock1.Text = "查看";
+                    textBlock1.FontSize = 13;
+                    textBlock1.Foreground = new SolidColorBrush(Colors.Green);
+                    textBlock1.TextDecorations = TextDecorations.Underline;
+                    textBlock1.Margin = new Thickness(0, 0, 10, 0);
+                    textBlock1.FontFamily = new FontFamily("黑体");
+                    textBlock1.DataContext = specificConten;
+                    textBlock1.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Look);
+                    textBlock1.HorizontalAlignment = HorizontalAlignment.Right;
+                    dockPanel.Children.Add(textBlock1);
+
+                    TextBlock textBlock2 = new TextBlock();
+                    textBlock2.Text = "忽略";
+                    textBlock2.FontSize = 13;
+                    textBlock2.FontFamily = new FontFamily("黑体");
+                    textBlock2.Foreground = new SolidColorBrush(Colors.Green);
+                    textBlock2.TextDecorations = TextDecorations.Underline;
+                    textBlock2.DataContext = specificConten;
+                    textBlock2.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Ignore);
+
+                    dockPanel.Children.Add(textBlock2);
+                    dockPanel.HorizontalAlignment = HorizontalAlignment.Right;
+                    StackPanel stackPanel1 = new StackPanel();
+
+                    TextBlock textBlock = new TextBlock();
+                    textBlock.Text = specificConten;
+                    textBlock.FontSize = 15;
+                    textBlock.FontFamily = new FontFamily("黑体");
+                    textBlock.DataContext = specificConten;
+                    textBlock.HorizontalAlignment = HorizontalAlignment.Left;
+                    stackPanel1.DataContext = specificConten;
+                    stackPanel1.Children.Add(textBlock);
+                    stackPanel1.Children.Add(dockPanel);
+                    stackPanel1.Width = 480;
+
+                    me_right.Children.Add(stackPanel1);
+                }
             }
 
-            if (SelectNode.Equals("项目"))
+
+        }
+
+
+        /// <summary>
+        /// 忽略事件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void Message_Ignore(object sender, RoutedEventArgs e)
+        {
+            int count = xiangmu2.Count;
+            TextBlock textBlock = sender as TextBlock;
+            string messageData = textBlock.DataContext as string;
+            bool isEqual = false;
+
+            //删除单独一条消息
+            foreach (var item in xiangmu2)
             {
-                DockPanel dockPanel = new DockPanel();
-                dockPanel.Margin = new Thickness(0, 10, 30, 0);
-                dockPanel.HorizontalAlignment = HorizontalAlignment.Right;
-
-                TextBlock textBlock = new TextBlock();
-                textBlock.Text = "查看";
-                textBlock.FontSize = 13;
-                textBlock.Foreground = new SolidColorBrush(Colors.Green);
-                textBlock.TextDecorations = TextDecorations.Underline;
-                textBlock.Margin = new Thickness(0, 0, 10, 0);
-                textBlock.FontFamily = new FontFamily("黑体");
-                //textBlock.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Look);
-
-                dockPanel.Children.Add(textBlock);
-
-                TextBlock textBlock2 = new TextBlock();
-                textBlock2.Text = "忽略";
-                textBlock2.FontSize = 13;
-                textBlock2.FontFamily = new FontFamily("黑体");
-                textBlock2.Foreground = new SolidColorBrush(Colors.Green);
-                textBlock2.TextDecorations = TextDecorations.Underline;
-                //textBlock2.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Ignore);
-
-                dockPanel.Children.Add(textBlock2);
-                me_right.Children.Add(dockPanel);
+                for (int i = 0; i < item.ThreeNodes.Count; i++)
+                {
+                    string iThreeNode = item.ThreeNodes[i];
+
+                    if (iThreeNode.Equals(messageData))
+                    {
+                        item.ThreeNodes.RemoveAt(i);
+                        isEqual = true;
+                        break;
+                    }
+                }
+                if (isEqual) break;
+            }
+            for (int i = 0; i < me_right.Children.Count; i++)
+            {
+                if (me_right.Children[i] is StackPanel stackPanel)
+                {
+                    for (int j = 0; j < stackPanel.Children.Count; j++)
+                    {
+                        string stackMessageData = stackPanel.DataContext as string;
+                        if (stackMessageData.Equals(messageData))
+                        {
+                            me_right.Children.RemoveAt(i);
+                            i--;
+                            break;
+                        }
+                    }
+                }
+            }
+            xiangmu2 = new ObservableCollection<MessageData>(xiangmu2.Where(x => x.ThreeNodes.Count > 0));
+
+            //一条信息没有父级删除
+            if (count != xiangmu2.Count)
+            {
+                me_message.Children.Clear();
+                foreach (var item in xiangmu2)
+                {
+                    Button button = new Button();
+                    button.Content = item.SeconNode;
+                    button.BorderThickness = new Thickness(0);
+                    button.Width = 180;
+                    button.Height = 30;
+                    button.Tag = item;
+                    button.Click += new RoutedEventHandler(messageBtnClick);
+                    button.HorizontalContentAlignment = HorizontalAlignment.Left;
+                    me_message.Children.Add(button);
+                }
             }
+
         }
 
+        /// <summary>
+        /// 查看
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void Message_Look(object sender, RoutedEventArgs e)
+        {
+            TextBlock textBlock = sender as TextBlock;
+            string messageData = textBlock.DataContext as string;
+
+            Dictionary<string, FullProfessionPage> keyValuePairs = SeconProjectPage.floor_quanPages;
+
+            FullProfessionPage fullProfessionPage = null;
+            foreach (var item in keyValuePairs)
+            {
+                string probBuliName = item.Key.Replace(" ", "");
+                messageData = messageData.Replace("项目", "");
+                messageData = messageData.Replace(" ", "");
+                messageData = messageData.Replace("更新", "");
+                messageData = messageData.Replace("建筑", "");
+                if (messageData.Contains(probBuliName))
+                {
+                    fullProfessionPage = item.Value;
+                    break;
+                }
+            }
 
+            if (fullProfessionPage != null)
+            {
+                BigFullProfessiongForm bigFullProfessiongForm = new BigFullProfessiongForm(Homepage, OperatingFloorPage.FullProfessionPage, messageData);
+                bigFullProfessiongForm.ShowDialog();
+            }
+
+        }
     }
 }

+ 4 - 0
CollaborativePlatformMain/Form/MessageSubPage/SeconProjectPage.xaml.cs

@@ -34,6 +34,7 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
 
         public SeconProjectPage(HomepageForm homepageForm)
         {
+
             InitializeComponent();
             HomepageForm = homepageForm;
         }
@@ -78,6 +79,9 @@ namespace CollaborativePlatformMain.Form.MessageSubPage
 
         public Dictionary<string, Page> id_Pages = new Dictionary<string, Page>();
 
+        public static Dictionary<string, FullProfessionPage> floor_quanPages = new Dictionary<string, FullProfessionPage>();
+
+
 
         /// <summary>
         /// treeview点击事件

+ 125 - 10
CollaborativePlatformMain/Form/UploadDrawingForm.xaml.cs

@@ -1,12 +1,16 @@
-using CollaborativePlatformMain.DFEntity;
+using CollaborativePlatformMain.CADStartUtil;
+using CollaborativePlatformMain.DFEntity;
 using CollaborativePlatformMain.DFEntity.MessageSubUtil;
 using CollaborativePlatformMain.Form.MessageSubPage.Project;
 using CollaborativePlatformMain.Form.UserControlForm;
+using DFBIM.CADNETCommon.XmlConfig;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
+using System.IO;
 using System.Linq;
 using System.Text;
+using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -134,15 +138,20 @@ namespace CollaborativePlatformMain.Form
                 //对比版本
                 string banben = cb_dwgName.SelectedItem as string;
 
-                //选择的对比范围
-                List<NativeDataInfo> selNativeDatas = cb_floor.ItemsSource.Where(x => x.IsSelect).ToList();
 
-                ObservableCollection<OperatEntity> duibiDatas = new ObservableCollection<OperatEntity>();
-                foreach (var nativeDataInfo in selNativeDatas)
+                //选择的对比范围
+                if (cb_floor.ItemsSource != null)
                 {
-                    duibiDatas.Add(new OperatEntity(nativeDataInfo.Name, "", new ObservableCollection<OperatEntity>(), false));
+                    List<NativeDataInfo> selNativeDatas = cb_floor.ItemsSource.Where(x => x.IsSelect).ToList();
+
+                    ObservableCollection<OperatEntity> duibiDatas = new ObservableCollection<OperatEntity>();
+                    foreach (var nativeDataInfo in selNativeDatas)
+                    {
+                        duibiDatas.Add(new OperatEntity(nativeDataInfo.Name, "", new ObservableCollection<OperatEntity>(), false));
+                    }
+                    twoDatas.Add(new OperatEntity("对比图-" + banben, "", duibiDatas, false));
                 }
-                twoDatas.Add(new OperatEntity("对比图-" + banben, "", duibiDatas, false));
+
             }
 
             //三级
@@ -194,10 +203,116 @@ namespace CollaborativePlatformMain.Form
         /// <param name="e"></param>
         private void bt_xaunze_Click(object sender, RoutedEventArgs e)
         {
-            FloorDrawingForm floorDrawingForm = new FloorDrawingForm(this);
-            floorDrawingForm.Show();
+            //FloorDrawingForm floorDrawingForm = new FloorDrawingForm(this);
+            //floorDrawingForm.Show();
+
+            StartCADUtil.StartCADMath();
+
+            MonitorFloorDataFilePath();
+
+            //this.Hide();
+        }
+
+        /// <summary>
+        /// 监听文件
+        /// </summary>
+        public FileSystemWatcher fileSystemWatcher;
+
+        /// <summary>
+        /// 计时器
+        /// </summary>
+        public System.Threading.Timer m_timer = null;
+
+        /// <summary>
+        /// 定时器触发间隔
+        /// </summary>
+        private int TimeoutMillis = 2000;
+
+        public void MonitorFloorDataFilePath()
+        {
+            ArchLayerDatas = new List<FloorLayerData>();
+
+            // 创建FileSystemWatcher实例
+            fileSystemWatcher = new FileSystemWatcher();
+            // 设置要监视的文件夹路径
+            fileSystemWatcher.Path = @"D:\DFBIM";
+
+            // 设置要监视的更改类型
+            fileSystemWatcher.NotifyFilter = NotifyFilters.LastAccess |
+                                   NotifyFilters.LastWrite |
+                                   NotifyFilters.FileName |
+                                   NotifyFilters.DirectoryName;
+
+
+
+            // 如果有需要,设置过滤条件,例如只监视txt文件
+            fileSystemWatcher.Filter = "*.config";
+
+
+
+            // 添加事件处理程序
+            fileSystemWatcher.Changed += fsw_Changed;
+            //fileSystemWatcher.Created += OnChanged;
+            //fileSystemWatcher.Deleted += OnChanged;
+            //fileSystemWatcher.Renamed += OnRenamed;
+
+            // 开始监视
+            fileSystemWatcher.EnableRaisingEvents = true;
+
+            if (m_timer == null)
+            {
+                //设置定时器的回调函数。此时定时器未启动
+                m_timer = new System.Threading.Timer(new TimerCallback(OnChanged),
+                                             null, Timeout.Infinite, Timeout.Infinite);
+            }
+
+        }
+
+        /// <summary>
+        /// 文件监听时间
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        void fsw_Changed(object sender, FileSystemEventArgs e)
+        {
+            //重新设置定时器的触发间隔,并且仅仅触发一次
+            m_timer.Change(TimeoutMillis, Timeout.Infinite);
+        }
+
+        /// <summary>
+        /// 当文件被更改、创建或删除时调用
+        /// </summary>
+        /// <param name="source"></param>
+        /// <param name="e"></param>
+        private void OnChanged(object source)
+        {
+            //读取配置文件数据
+            FloorDataConfigUtil xmlInfo = new FloorDataConfigUtil();
+            ArchLayerDatas.AddRange(xmlInfo.Load<List<FloorLayerData>>(@"D:\DFBIM\FloorLayerData.config"));
+
+            Dictionary<int, string> keyValuePairs = new Dictionary<int, string>();
+            keyValuePairs.Add(0, "风管");
+            keyValuePairs.Add(1, "风机");
+            keyValuePairs.Add(2, "风口");
+            keyValuePairs.Add(3, "水管");
+            keyValuePairs.Add(4, "套管");
+
+            List<FloorLayerData> warmDatas = new List<FloorLayerData>();
+            for (int i = 0; i < ArchLayerDatas.Count; i++)
+            {
+                List<FloorLayerData> layerDatas = new List<FloorLayerData>();
+                for (int j = 0; j < 5; j++)
+                {
+                    FloorLayerData layerData = new FloorLayerData(keyValuePairs[j]);
+                    layerDatas.Add(layerData);
+                }
+
+                warmDatas.Add(new FloorLayerData(ArchLayerDatas[i].FloorName, layerDatas));
+            }
+            WarmLayerDatas = warmDatas;
 
-            this.Hide();
+            // 停止监视
+            fileSystemWatcher.EnableRaisingEvents = false;
         }
 
 

+ 7 - 3
CollaborativePlatformMain/MainWindow.xaml

@@ -91,9 +91,13 @@
 
                 </StackPanel>
 
-                <StackPanel>
-                    <Button Width="80" Content="eargjiag" Click="Button_Click"/>
-                </StackPanel>
+                <DockPanel>
+                    <Button Width="80" Content="楼栋管理器" Click="Button_Click"/>
+                    <Button Width="80" Content="再次楼栋" Click="Button_Click"/>
+                    
+                    <Button Width="80" Content="打开图纸" Click="Button_Click_1"/>
+                    <Button Width="80" Content="再次打开图纸" Click="Button_Click_1"/>
+                </DockPanel>
                 
             </StackPanel>
         </Border>

+ 10 - 2
CollaborativePlatformMain/MainWindow.xaml.cs

@@ -1,6 +1,9 @@
-using CollaborativePlatformMain.CADStartUtil;
+using Autodesk.AutoCAD.EditorInput;
+using CollaborativePlatformMain.CADStartUtil;
 using CollaborativePlatformMain.Form;
 using CollaborativePlatformMain.Util;
+using DFBIM.CADNETCommon.ExtensionMethod;
+using DFBIM.CADNETCommon.ReconStruct;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -141,7 +144,12 @@ namespace CollaborativePlatformMain
         /// <param name="e"></param>
         private void Button_Click(object sender, RoutedEventArgs e)
         {
-            StartCADUtil.StartCADMath();
+            StartCADUtil.StartCADMath(true);
+        }
+
+        private void Button_Click_1(object sender, RoutedEventArgs e)
+        {
+            StartCADUtil.StartCADMath(false,new OpenDrawPathData(true, @"C:\Users\jiantu\Desktop\Drawing2.dwg"));
         }
     }
 }