|
@@ -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();
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
}
|