HomepageForm.xaml.cs 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
  1. using CollaborativePlatformMain.DFEntity;
  2. using CollaborativePlatformMain.Form.UserControlForm;
  3. using CollaborativePlatformMain.Util;
  4. using HandyControl.Controls;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Collections.ObjectModel;
  8. using System.Diagnostics.Eventing.Reader;
  9. using System.Drawing.Printing;
  10. using System.Linq;
  11. using System.Text;
  12. using System.Threading.Tasks;
  13. using System.Windows;
  14. using System.Windows.Controls;
  15. using System.Windows.Data;
  16. using System.Windows.Documents;
  17. using System.Windows.Input;
  18. using System.Windows.Media;
  19. using System.Windows.Media.Imaging;
  20. using System.Windows.Shapes;
  21. using Window = System.Windows.Window;
  22. using MessageBox = System.Windows.MessageBox;
  23. using static System.Net.Mime.MediaTypeNames;
  24. using CollaborativePlatformMain.Form.MessageSubPage;
  25. using CollaborativePlatformMain.Form.MessageSubPage.CreatLevel;
  26. namespace CollaborativePlatformMain.Form
  27. {
  28. /// <summary>
  29. /// HomepageForm.xaml 的交互逻辑
  30. /// </summary>
  31. public partial class HomepageForm : Window
  32. {
  33. public HomepageForm()
  34. {
  35. InitializeComponent();
  36. }
  37. #region 最左边消息
  38. /// <summary>
  39. /// 消息
  40. /// </summary>
  41. /// <param name="sender"></param>
  42. /// <param name="e"></param>
  43. private void message_Click(object sender, MouseButtonEventArgs e)
  44. {
  45. MenuItem menuItem = sender as MenuItem;
  46. ModifyBackground(menuItem);
  47. dp_message.Visibility = Visibility.Visible;
  48. dp_project.Visibility = Visibility.Collapsed;
  49. dp_contacts.Visibility = Visibility.Collapsed;
  50. dp_gallery.Visibility = Visibility.Collapsed;
  51. dp_tools.Visibility = Visibility.Collapsed;
  52. dp_threetools.Visibility = Visibility.Collapsed;
  53. seconMessagePage.Navigate(new SeconMessagePage(this));
  54. //SwitchMethod(sender as MenuItem, true);
  55. }
  56. /// <summary>
  57. /// 项目下TreeView绑定的数据
  58. /// </summary>
  59. private List<TreeViewBind> treeViewBinds = new List<TreeViewBind>();
  60. /// <summary>
  61. /// 项目
  62. /// </summary>
  63. /// <param name="sender"></param>
  64. /// <param name="e"></param>
  65. private void project_Click(object sender, MouseButtonEventArgs e)
  66. {
  67. MenuItem menuItem = sender as MenuItem;
  68. ModifyBackground(menuItem);
  69. dp_message.Visibility = Visibility.Collapsed;
  70. dp_project.Visibility = Visibility.Visible;
  71. dp_contacts.Visibility = Visibility.Collapsed;
  72. dp_gallery.Visibility = Visibility.Collapsed;
  73. dp_tools.Visibility = Visibility.Collapsed;
  74. dp_threetools.Visibility = Visibility.Collapsed;
  75. seconProjectPage.Navigate(new SeconProjectPage());
  76. }
  77. /// <summary>
  78. /// 联系人
  79. /// </summary>
  80. /// <param name="sender"></param>
  81. /// <param name="e"></param>
  82. private void contacts_Click(object sender, MouseButtonEventArgs e)
  83. {
  84. MenuItem menuItem = sender as MenuItem;
  85. ModifyBackground(menuItem);
  86. dp_message.Visibility = Visibility.Collapsed;
  87. dp_project.Visibility = Visibility.Collapsed;
  88. dp_contacts.Visibility = Visibility.Visible;
  89. dp_gallery.Visibility = Visibility.Visible;
  90. dp_tools.Visibility = Visibility.Collapsed;
  91. dp_threetools.Visibility = Visibility.Collapsed;
  92. seconContactsPage.Navigate(new SeconContactsPage(this));
  93. }
  94. /// <summary>
  95. /// 图库大样图
  96. /// </summary>
  97. /// <param name="sender"></param>
  98. /// <param name="e"></param>
  99. private void gallery_Click(object sender, MouseButtonEventArgs e)
  100. {
  101. MenuItem menuItem = sender as MenuItem;
  102. ModifyBackground(menuItem);
  103. dp_message.Visibility = Visibility.Collapsed;
  104. dp_project.Visibility = Visibility.Collapsed;
  105. dp_contacts.Visibility = Visibility.Collapsed;
  106. dp_gallery.Visibility = Visibility.Visible;
  107. dp_tools.Visibility = Visibility.Collapsed;
  108. dp_threetools.Visibility = Visibility.Collapsed;
  109. seconLegendPage.Navigate(new SeconLegendPage());
  110. }
  111. /// <summary>
  112. /// 工具库
  113. /// </summary>
  114. /// <param name="sender"></param>
  115. /// <param name="e"></param>
  116. private void tool_Click(object sender, MouseButtonEventArgs e)
  117. {
  118. MenuItem menuItem = sender as MenuItem;
  119. ModifyBackground(menuItem);
  120. dp_message.Visibility = Visibility.Collapsed;
  121. dp_project.Visibility = Visibility.Collapsed;
  122. dp_contacts.Visibility = Visibility.Collapsed;
  123. dp_gallery.Visibility = Visibility.Collapsed;
  124. dp_tools.Visibility = Visibility.Visible;
  125. dp_threetools.Visibility = Visibility.Collapsed;
  126. seconToolsPage.Navigate(new SeconToolLibraryPage());
  127. }
  128. /// <summary>
  129. /// 三维
  130. /// </summary>
  131. /// <param name="sender"></param>
  132. /// <param name="e"></param>
  133. private void three_Click(object sender, MouseButtonEventArgs e)
  134. {
  135. MenuItem menuItem = sender as MenuItem;
  136. ModifyBackground(menuItem);
  137. dp_message.Visibility = Visibility.Collapsed;
  138. dp_project.Visibility = Visibility.Collapsed;
  139. dp_contacts.Visibility = Visibility.Collapsed;
  140. dp_gallery.Visibility = Visibility.Collapsed;
  141. dp_tools.Visibility = Visibility.Collapsed;
  142. dp_threetools.Visibility = Visibility.Visible;
  143. seconThreeTools.Navigate(new SeconThreeDimensionalPage(this));
  144. }
  145. /// <summary>
  146. /// 设置最左测导航的颜色
  147. /// </summary>
  148. /// <param name="menuItem"></param>
  149. /// <param name="isHoShow"></param>
  150. public void ModifyBackground(MenuItem menuItem)
  151. {
  152. List<MenuItem> allMenuItems = CollaborationUtil.GetChildObjects<System.Windows.Controls.MenuItem>(mu_leftMenu);
  153. foreach (var baseMenuItem in allMenuItems)
  154. {
  155. if (baseMenuItem.Header.ToString() == menuItem.Header.ToString())
  156. {
  157. baseMenuItem.Background = new SolidColorBrush(Colors.Beige);
  158. }
  159. else
  160. {
  161. baseMenuItem.Background = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#1E9FFF"));
  162. }
  163. }
  164. }
  165. #endregion
  166. #region 工具中间按钮
  167. private ObservableCollection<CBButtonControlsData> ToolLists = new ObservableCollection<CBButtonControlsData>();
  168. /// <summary>
  169. /// 功能名字对应的功能数据
  170. /// </summary>
  171. private Dictionary<string, ObservableCollection<CBButtonControlsData>> ToolName_ToolDatas = new Dictionary<string, ObservableCollection<CBButtonControlsData>>()
  172. {
  173. {
  174. "平台图纸治理",new ObservableCollection<CBButtonControlsData>()
  175. {
  176. new CBButtonControlsData("功能1",false,""),
  177. new CBButtonControlsData("功能2",false,""),
  178. new CBButtonControlsData("功能3",false,""),
  179. new CBButtonControlsData("功能4",false,""),
  180. new CBButtonControlsData("功能5",false,""),
  181. new CBButtonControlsData("功能6",false,""),
  182. new CBButtonControlsData("功能7",false,""),
  183. new CBButtonControlsData("功能8",false,""),
  184. }
  185. },
  186. {
  187. "块处理",new ObservableCollection<CBButtonControlsData>()
  188. {
  189. new CBButtonControlsData("处理1",false,""),
  190. new CBButtonControlsData("处理2",false,""),
  191. new CBButtonControlsData("处理3",false,""),
  192. new CBButtonControlsData("处理4",false,""),
  193. new CBButtonControlsData("处理5",false,""),
  194. new CBButtonControlsData("处理6",false,""),
  195. new CBButtonControlsData("处理7",false,""),
  196. new CBButtonControlsData("处理8",false,""),
  197. }
  198. },
  199. {
  200. "大样处理",new ObservableCollection<CBButtonControlsData>()
  201. {
  202. new CBButtonControlsData("大样1",false,""),
  203. new CBButtonControlsData("大样2",false,""),
  204. new CBButtonControlsData("大样3",false,""),
  205. new CBButtonControlsData("大样4",false,""),
  206. new CBButtonControlsData("大样5",false,""),
  207. new CBButtonControlsData("大样6",false,""),
  208. new CBButtonControlsData("大样7",false,""),
  209. new CBButtonControlsData("大样8",false,""),
  210. }
  211. },
  212. {
  213. "图纸对比",new ObservableCollection<CBButtonControlsData>()
  214. {
  215. new CBButtonControlsData("图纸对比",false,"")
  216. }
  217. },
  218. {
  219. "二维审查",new ObservableCollection<CBButtonControlsData>()
  220. {
  221. new CBButtonControlsData("二维审查",false,"")
  222. }
  223. }, {
  224. "三维",new ObservableCollection<CBButtonControlsData>()
  225. {
  226. new CBButtonControlsData("三维",false,"")
  227. }
  228. },
  229. };
  230. private void toolnavigation_Click(object sender, RoutedEventArgs e)
  231. {
  232. //Button button = sender as Button;
  233. //if (button != null && ToolName_ToolDatas.ContainsKey(button.Content.ToString()))
  234. //{
  235. // ObservableCollection<CBButtonControlsData> cbButtonControls = ToolName_ToolDatas[button.Content.ToString()];
  236. // wp_tools.Children.Clear();
  237. // foreach (var cbButtonControl in cbButtonControls)
  238. // {
  239. // wp_tools.Children.Add(new CBButtonControls(cbButtonControl));
  240. // }
  241. //}
  242. }
  243. /// <summary>
  244. /// 添加漂浮工具
  245. /// </summary>
  246. /// <param name="sender"></param>
  247. /// <param name="e"></param>
  248. private void bt_addTools(object sender, RoutedEventArgs e)
  249. {
  250. foreach (var tool in ToolName_ToolDatas)
  251. {
  252. foreach (var value in tool.Value)
  253. {
  254. if (!value.CbIsCheck)
  255. {
  256. if (ToolLists.Where(x => x.Guid.Equals(value.Guid)).Count() > 0)
  257. {
  258. for (int i = 0; i < ToolLists.Count; i++)
  259. {
  260. if (ToolLists[i].Guid.Equals(value.Guid))
  261. {
  262. ToolLists.RemoveAt(i);
  263. i--;
  264. }
  265. }
  266. }
  267. }
  268. else
  269. {
  270. if (ToolLists.Where(x => x.Guid.Equals(value.Guid)).Count() > 0) continue;
  271. ToolLists.Add(value);
  272. }
  273. }
  274. }
  275. }
  276. /// <summary>
  277. /// 悬浮窗
  278. /// </summary>
  279. private ObservableCollection<LVProjectInfoEntity> ToolDatas = new ObservableCollection<LVProjectInfoEntity>()
  280. {
  281. new LVProjectInfoEntity("图纸对比", ""),
  282. new LVProjectInfoEntity("超模全解析", ""),
  283. new LVProjectInfoEntity("超模数字化建模", "")
  284. };
  285. #endregion
  286. #region 中间的按钮
  287. private void General_Click(object sender, MouseButtonEventArgs e)
  288. {
  289. }
  290. #endregion
  291. #region 横向通知消息栏
  292. private List<Button> menuItems = new List<Button>();
  293. /// <summary>
  294. /// 通知公告数据
  295. /// </summary>
  296. private List<NotificationAnnouncement> notificationDatas = new List<NotificationAnnouncement>();
  297. /// <summary>
  298. /// 通知公告
  299. /// </summary>
  300. /// <param name="sender"></param>
  301. /// <param name="e"></param>
  302. private void me_announcementClick(object sender, RoutedEventArgs e)
  303. {
  304. //notificationDatas = new List<NotificationAnnouncement>();
  305. //for (int i = 0; i < new List<string>() { "国博城项目建筑图纸更新", "北京大兴项目结构图纸更新", "绿地项目人防图纸更新" }.Count; i++)
  306. //{
  307. // NotificationAnnouncement notificationAnnouncement = new NotificationAnnouncement();
  308. // notificationAnnouncement.MessageCategory = "通知公告";
  309. // if (i == 0)
  310. // {
  311. // notificationAnnouncement.Content = "国博城项目总消息";
  312. // notificationAnnouncement.SpecificContent = "按甲方要求,国博城项目务必在4月15号之前完成报审版。";
  313. // }
  314. // else if (i == 1)
  315. // {
  316. // notificationAnnouncement.Content = "北京大兴项目总消息";
  317. // notificationAnnouncement.SpecificContent = "按甲方要求,北京大兴项目务必在4月22号之前完成报审版。";
  318. // }
  319. // else if (i == 2)
  320. // {
  321. // notificationAnnouncement.Content = "绿地项目总消息";
  322. // notificationAnnouncement.SpecificContent = "按甲方要求,绿地项目务必在4月30号之前完成报审版。";
  323. // }
  324. // notificationDatas.Add(notificationAnnouncement);
  325. //}
  326. //me_message.Children.Clear();
  327. //foreach (var notificationData in notificationDatas)
  328. //{
  329. // Button button = new Button();
  330. // button.Content = notificationData.Content;
  331. // button.BorderThickness = new Thickness(0);
  332. // button.Width = 180;
  333. // button.Height = 30;
  334. // button.Click += new RoutedEventHandler(messageBtnClick);
  335. // button.Tag = notificationData;
  336. // button.HorizontalContentAlignment = HorizontalAlignment.Left;
  337. // me_message.Children.Add(button);
  338. //}
  339. }
  340. /// <summary>
  341. /// 项目
  342. /// </summary>
  343. /// <param name="sender"></param>
  344. /// <param name="e"></param>
  345. private void me_projectClick(object sender, RoutedEventArgs e)
  346. {
  347. //notificationDatas = new List<NotificationAnnouncement>();
  348. //foreach (var xiangmu in new List<string>() { "国博城项目建筑图纸更新", "北京大兴项目结构图纸更新", "绿地项目人防图纸更新" })
  349. //{
  350. // NotificationAnnouncement notificationAnnouncement = new NotificationAnnouncement();
  351. // notificationAnnouncement.Content = xiangmu;
  352. // notificationAnnouncement.MessageCategory = "项目消息";
  353. // if (xiangmu.Equals("国博城项目建筑图纸更新"))
  354. // {
  355. // notificationAnnouncement.SpecificContent = "国博城项目建筑1#楼3层更新。";
  356. // }
  357. // else if (xiangmu.Equals("北京大兴项目结构图纸更新"))
  358. // {
  359. // notificationAnnouncement.SpecificContent = "北京大兴项目结构2#楼1层墙柱平法图更新。";
  360. // }
  361. // else if (xiangmu.Equals("绿地项目人防图纸更新"))
  362. // {
  363. // notificationAnnouncement.SpecificContent = "绿地项目地下人防图更新。";
  364. // }
  365. // notificationDatas.Add(notificationAnnouncement);
  366. //}
  367. //me_message.Children.Clear();
  368. //foreach (var notificationData in notificationDatas)
  369. //{
  370. // Button button = new Button();
  371. // button.Content = notificationData.Content;
  372. // button.BorderThickness = new Thickness(0);
  373. // button.Width = 180;
  374. // button.Height = 30;
  375. // button.Click += new RoutedEventHandler(messageBtnClick);
  376. // button.Tag = notificationData;
  377. // button.HorizontalContentAlignment = HorizontalAlignment.Left;
  378. // me_message.Children.Add(button);
  379. //}
  380. }
  381. /// <summary>
  382. /// 系统
  383. /// </summary>
  384. /// <param name="sender"></param>
  385. /// <param name="e"></param>
  386. private void me_systemClick(object sender, RoutedEventArgs e)
  387. {
  388. // NotificationAnnouncement notificationAnnouncement = new NotificationAnnouncement();
  389. // notificationAnnouncement.Content = "系统更新";
  390. // notificationAnnouncement.SpecificContent = "交互平台版本更新至2.0版本· 本次更新了:· 1.主界面消息分组。· 2.修改了登陆界面。· 请及时更新!!";
  391. // notificationAnnouncement.MessageCategory = "系统消息";
  392. // NotificationAnnouncement notificationAnnouncement2 = new NotificationAnnouncement();
  393. // notificationAnnouncement2.Content = "停服升级";
  394. // notificationAnnouncement2.SpecificContent = "交互平台版本将在4月13日8点20分至4月13日8点50分进行停服更新·本次停服更新不会导致您的数据丢失。";
  395. // notificationAnnouncement2.MessageCategory = "系统消息";
  396. // notificationDatas = new List<NotificationAnnouncement>()
  397. // {
  398. // notificationAnnouncement,
  399. // notificationAnnouncement2
  400. //};
  401. // me_message.Children.Clear();
  402. // foreach (var notificationData in notificationDatas)
  403. // {
  404. // Button button = new Button();
  405. // button.Content = notificationData.Content;
  406. // button.BorderThickness = new Thickness(0);
  407. // button.Width = 180;
  408. // button.Height = 30;
  409. // button.Click += new RoutedEventHandler(messageBtnClick);
  410. // button.Tag = notificationData;
  411. // button.HorizontalContentAlignment = HorizontalAlignment.Left;
  412. // me_message.Children.Add(button);
  413. // }
  414. }
  415. /// <summary>
  416. /// 具体消息按钮
  417. /// </summary>
  418. /// <param name="sender"></param>
  419. /// <param name="e"></param>
  420. private void messageBtnClick(object sender, RoutedEventArgs e)
  421. {
  422. //me_right.Children.Clear();
  423. //Button button = sender as Button;
  424. //NotificationAnnouncement announcement = button.Tag as NotificationAnnouncement;
  425. //List<string> specificContent = announcement.SpecificContent.Split('·').ToList();
  426. //foreach (var specificConten in specificContent)
  427. //{
  428. // TextBlock textBlock = new TextBlock();
  429. // textBlock.Text = specificConten;
  430. // textBlock.FontSize = 15;
  431. // textBlock.FontFamily = new FontFamily("黑体");
  432. // me_right.Children.Add(textBlock);
  433. //}
  434. //if (announcement.MessageCategory.Equals("项目消息"))
  435. //{
  436. // DockPanel dockPanel = new DockPanel();
  437. // dockPanel.Margin = new Thickness(0, 10, 30, 0);
  438. // dockPanel.HorizontalAlignment = HorizontalAlignment.Right;
  439. // TextBlock textBlock = new TextBlock();
  440. // textBlock.Text = "查看";
  441. // textBlock.FontSize = 13;
  442. // textBlock.Foreground = new SolidColorBrush(Colors.Green);
  443. // textBlock.TextDecorations = TextDecorations.Underline;
  444. // textBlock.Margin = new Thickness(0, 0, 10, 0);
  445. // textBlock.FontFamily = new FontFamily("黑体");
  446. // textBlock.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Look);
  447. // dockPanel.Children.Add(textBlock);
  448. // TextBlock textBlock2 = new TextBlock();
  449. // textBlock2.Text = "忽略";
  450. // textBlock2.FontSize = 13;
  451. // textBlock2.FontFamily = new FontFamily("黑体");
  452. // textBlock2.Foreground = new SolidColorBrush(Colors.Green);
  453. // textBlock2.TextDecorations = TextDecorations.Underline;
  454. // textBlock2.PreviewMouseLeftButtonDown += new MouseButtonEventHandler(Message_Ignore);
  455. // dockPanel.Children.Add(textBlock2);
  456. // me_right.Children.Add(dockPanel);
  457. //}
  458. }
  459. /// <summary>
  460. /// 查看消息
  461. /// </summary>
  462. /// <param name="sender"></param>
  463. /// <param name="e"></param>
  464. public void Message_Look(object sender, RoutedEventArgs e)
  465. {
  466. MessageBox.Show("查看消息");
  467. }
  468. /// <summary>
  469. /// 忽略消息
  470. /// </summary>
  471. /// <param name="sender"></param>
  472. /// <param name="e"></param>
  473. public void Message_Ignore(object sender, RoutedEventArgs e)
  474. {
  475. MessageBox.Show("忽略消息");
  476. }
  477. #endregion
  478. #region 项目中间部分
  479. ///// <summary>
  480. ///// 项目信息示例
  481. ///// </summary>
  482. //private ObservableCollection<LVProjectInfoEntity> lvProjects = new ObservableCollection<LVProjectInfoEntity>()
  483. //{
  484. // new LVProjectInfoEntity("项目名称:", "北京大兴项目"),
  485. // new LVProjectInfoEntity("项目业态:", "住宅"),
  486. // new LVProjectInfoEntity("项目地址:", "山东省济南市"),
  487. // new LVProjectInfoEntity("项目团队:", "项目团队")
  488. //};
  489. ///// <summary>
  490. ///// 项目信息示例
  491. ///// </summary>
  492. //private ObservableCollection<LVTeamMembersEntity> lvTeamMemberss = new ObservableCollection<LVTeamMembersEntity>()
  493. //{
  494. // new LVTeamMembersEntity("主管:", "李明"),
  495. // new LVTeamMembersEntity("建筑组员:", "李明"),
  496. // new LVTeamMembersEntity("结构组员:", "张修"),
  497. // new LVTeamMembersEntity("给排水组员:", "邢华"),
  498. // new LVTeamMembersEntity("暖通组员:", "杨程"),
  499. // new LVTeamMembersEntity("电气组员:", "欧瑞"),
  500. //};
  501. ///// <summary>
  502. ///// 项目TreeView
  503. ///// </summary>
  504. ///// <param name="sender"></param>
  505. ///// <param name="e"></param>
  506. //private void tv_projectLeftButtonUp(object sender, MouseButtonEventArgs e)
  507. //{
  508. // #region 隐藏所有的无用控件
  509. // lv_projectInfo.Visibility = Visibility.Collapsed;
  510. // sp_info.Visibility = Visibility.Collapsed;
  511. // sp_work.Visibility = Visibility.Collapsed;
  512. // sp_addPro.Visibility = Visibility.Collapsed;
  513. // #endregion
  514. // TreeViewBind treeView = tr_vw.SelectedItem as TreeViewBind;
  515. // if (treeView == null) return;
  516. // string name = treeView.Name;
  517. // if (name.Equals("项目信息"))
  518. // {
  519. // sp_info.Visibility = Visibility.Visible;
  520. // lv_projectInfo.Visibility = Visibility.Visible;
  521. // lv_projectInfo.ItemsSource = null;
  522. // lv_projectInfo.ItemsSource = lvProjects;
  523. // }
  524. // else if (name.Equals("团队成员"))
  525. // {
  526. // sp_info.Visibility = Visibility.Visible;
  527. // lv_projectInfo.Visibility = Visibility.Visible;
  528. // lv_projectInfo.ItemsSource = null;
  529. // lv_projectInfo.ItemsSource = lvTeamMemberss;
  530. // }
  531. // else if (name.Equals("工作台"))
  532. // {
  533. // sp_work.Visibility = Visibility.Visible;
  534. // tr_is.ItemsSource = null;
  535. // if (!treeView.IsPro)
  536. // {
  537. // List<TreeViewBind> TreeViewDatas = new List<TreeViewBind>();
  538. // TreeViewDatas.Add(new TreeViewBind("小学项目", new List<TreeViewBind>() { new TreeViewBind("新建图纸") }));
  539. // this.tr_is.ItemsSource = TreeViewDatas;
  540. // }
  541. // else
  542. // {
  543. // this.tr_is.ItemsSource = TreeViewDatas;
  544. // }
  545. // }
  546. // else if (name.Equals("自定义"))
  547. // {
  548. // }
  549. //}
  550. ///// <summary>
  551. ///// lv内修改按钮
  552. ///// </summary>
  553. ///// <param name="sender"></param>
  554. ///// <param name="e"></param>
  555. //private void btn_lv_update(object sender, RoutedEventArgs e)
  556. //{
  557. // Button button = sender as Button;
  558. // LVProjectInfoEntity lvProjectInfo = button.Tag as LVProjectInfoEntity;
  559. // if (lvProjectInfo != null)
  560. // {
  561. // }
  562. //}
  563. ///// <summary>
  564. ///// 上传图纸
  565. ///// </summary>
  566. ///// <param name="sender"></param>
  567. ///// <param name="e"></param>
  568. //private void Button_Click(object sender, RoutedEventArgs e)
  569. //{
  570. // TreeViewBind treeViewBind = TreeViewDatas.First(s => s.Name.Equals("小学项目 一号楼"));
  571. // UploadDrawingForm upWindow = new UploadDrawingForm(TreeViewDatas);
  572. // foreach (var item in treeViewBind.Children)
  573. // {
  574. // if (item.Name.Equals("上传新图")) continue;
  575. // upWindow.str.Add(item.Name);
  576. // }
  577. // upWindow.ShowDialog();
  578. // this.tr_is.ItemsSource = null;
  579. // this.tr_is.ItemsSource = TreeViewDatas;
  580. //}
  581. //#region 工作台
  582. ///// <summary>
  583. ///// 工作台数据绑定
  584. ///// </summary>
  585. //public static ObservableCollection<TreeViewBind> TreeViewDatas = new ObservableCollection<TreeViewBind>()
  586. //{
  587. // new TreeViewBind("小学项目 一号楼",
  588. // new List<TreeViewBind>()
  589. // {
  590. // new TreeViewBind("上传图纸")
  591. // })
  592. //};
  593. ///// <summary>
  594. ///// 版本名称
  595. ///// </summary>
  596. //private List<string> ProVersions = new List<string>();
  597. ///// <summary>
  598. ///// 本专业
  599. ///// </summary>
  600. ///// <param name="sender"></param>
  601. ///// <param name="e"></param>
  602. //private void pre_Click(object sender, MouseButtonEventArgs e)
  603. //{
  604. // tr_all.Visibility = Visibility.Collapsed;
  605. // tr_is.Visibility = Visibility.Visible;
  606. // bt_proBig.Visibility = Visibility.Collapsed;
  607. //}
  608. ///// <summary>
  609. ///// 全专业
  610. ///// </summary>
  611. ///// <param name="sender"></param>
  612. ///// <param name="e"></param>
  613. //private void all_Click(object sender, MouseButtonEventArgs e)
  614. //{
  615. // tr_is.Visibility = Visibility.Collapsed;
  616. // tr_all.Visibility = Visibility.Visible;
  617. // tv_building.ItemsSource = null;
  618. // tv_building.ItemsSource = TreeViewDatas;
  619. // bt_proBig.Visibility = Visibility.Visible;
  620. //}
  621. ///// <summary>
  622. ///// treeview点击
  623. ///// </summary>
  624. ///// <param name="sender"></param>
  625. ///// <param name="e"></param>
  626. //private void tr_is_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
  627. //{
  628. // TreeViewBind treeView = tr_is.SelectedItem as TreeViewBind;
  629. // //切换展开和下拉
  630. // if (treeView == null)
  631. // {
  632. // return;
  633. // }
  634. // if (tr_is.ItemContainerGenerator.ContainerFromItem(treeView) is TreeViewItem currentItem)
  635. // {
  636. // if (!currentItem.IsExpanded)
  637. // {
  638. // currentItem.IsExpanded = true;
  639. // }
  640. // else
  641. // {
  642. // currentItem.IsExpanded = false;
  643. // }
  644. // }
  645. // if (treeView.Name.Contains("更新图纸"))
  646. // {
  647. // TreeViewBind treeViewBind = TreeViewDatas.First(s => s.Name.Equals("小学项目 一号楼"));
  648. // UploadDrawingForm upWindow = new UploadDrawingForm(TreeViewDatas);
  649. // foreach (var item in treeViewBind.Children)
  650. // {
  651. // if (item.Name.Equals("治理图纸")) break;
  652. // upWindow.str.Add(item.Name);
  653. // }
  654. // upWindow.ShowDialog();
  655. // string t7 = DateTime.Now.ToShortTimeString();
  656. // string t3 = DateTime.Now.ToLongDateString() + t7;
  657. // string proVersion = "";
  658. // if (ProVersions.Contains(t3 + "版本"))
  659. // {
  660. // int proVersionIndex = 0;
  661. // for (int i = 0; i < 100; i++)
  662. // {
  663. // int j = i + 1;
  664. // if (ProVersions.Contains(t3 + "(" + j + ")" + "版本"))
  665. // {
  666. // continue;
  667. // }
  668. // else
  669. // {
  670. // proVersionIndex = i + 1;
  671. // break;
  672. // }
  673. // }
  674. // proVersion = t3 + "(" + proVersionIndex + ")" + "版本";
  675. // }
  676. // else
  677. // {
  678. // proVersion = t3 + "版本";
  679. // }
  680. // ProVersions.Add(proVersion);
  681. // TreeViewBind TreeViewBind1 = new TreeViewBind(proVersion, new List<TreeViewBind>()
  682. // {
  683. // new TreeViewBind("原图"),
  684. // new TreeViewBind("对比图"),
  685. // new TreeViewBind("治理图纸", new List<TreeViewBind>()
  686. // {
  687. // new TreeViewBind("F1"),
  688. // new TreeViewBind("F2",
  689. // new List<TreeViewBind>()
  690. // {
  691. // new TreeViewBind("墙柱"),
  692. // new TreeViewBind("门窗"),
  693. // new TreeViewBind("功能区标签"),
  694. // new TreeViewBind("未命名")
  695. // })
  696. // })
  697. // });
  698. // int index = CollaborationUtil.GetIndexByTreeView("更新图纸", TreeViewDatas.FirstOrDefault().Children);
  699. // TreeViewDatas.FirstOrDefault().Children.Insert(index, TreeViewBind1);
  700. // this.tr_is.ItemsSource = null;
  701. // this.tr_is.ItemsSource = TreeViewDatas;
  702. // }
  703. // else if (treeView.Name.Contains("上传图纸"))
  704. // {
  705. // string t7 = DateTime.Now.ToShortTimeString();
  706. // string t3 = DateTime.Now.ToLongDateString() + t7;
  707. // ProVersions.Add(t3 + "版本");
  708. // TreeViewBind TreeViewBind1 = new TreeViewBind(t3 + "版本", new List<TreeViewBind>()
  709. // {
  710. // new TreeViewBind("原图"),
  711. // new TreeViewBind("治理图纸", new List<TreeViewBind>()
  712. // {
  713. // new TreeViewBind("F1"),
  714. // new TreeViewBind("F2",
  715. // new List<TreeViewBind>()
  716. // {
  717. // new TreeViewBind("墙柱"),
  718. // new TreeViewBind("门窗"),
  719. // new TreeViewBind("功能区标签"),
  720. // new TreeViewBind("未命名")
  721. // })
  722. // })
  723. // });
  724. // TreeViewDatas.FirstOrDefault().Children.Insert(0, TreeViewBind1);
  725. // TreeViewDatas.FirstOrDefault().Children.Add(new TreeViewBind("更新图纸"));
  726. // for (int i = 0; i < TreeViewDatas.FirstOrDefault().Children.Count; i++)
  727. // {
  728. // if (TreeViewDatas.FirstOrDefault().Children[i].Name.Equals("上传图纸"))
  729. // {
  730. // TreeViewDatas.FirstOrDefault().Children.RemoveAt(i);
  731. // i--;
  732. // break;
  733. // }
  734. // }
  735. // tr_is.ItemsSource = null;
  736. // tr_is.ItemsSource = TreeViewDatas;
  737. // }
  738. //}
  739. ///// <summary>
  740. ///// 放大
  741. ///// </summary>
  742. ///// <param name="sender"></param>
  743. ///// <param name="e"></param>
  744. //private void bt_proBigClick(object sender, RoutedEventArgs e)
  745. //{
  746. // ProjectForm projectForm = new ProjectForm(this, TreeViewDatas);
  747. // this.Hide();
  748. // projectForm.ShowDialog();
  749. // this.Show();
  750. //}
  751. //#endregion
  752. //#region 新增项目
  753. //private void bt_addPro(object sender, RoutedEventArgs e)
  754. //{
  755. // #region 隐藏所有的无用控件
  756. // lv_projectInfo.Visibility = Visibility.Collapsed;
  757. // sp_info.Visibility = Visibility.Collapsed;
  758. // sp_work.Visibility = Visibility.Collapsed;
  759. // #endregion
  760. // sp_addPro.Visibility = Visibility.Visible;
  761. //}
  762. //private void close_Click(object sender, RoutedEventArgs e)
  763. //{
  764. // gd_top.Visibility = Visibility.Collapsed;
  765. //}
  766. //private void bd_Initialized(object sender, EventArgs e)
  767. //{
  768. //}
  769. //private void st_Initialized(object sender, EventArgs e)
  770. //{
  771. //}
  772. //private void wt_Initialized(object sender, EventArgs e)
  773. //{
  774. //}
  775. //private void wm_Initialized(object sender, EventArgs e)
  776. //{
  777. //}
  778. //private void ele_Initialized(object sender, EventArgs e)
  779. //{
  780. //}
  781. //private void submit_Click(object sender, RoutedEventArgs e)
  782. //{
  783. //}
  784. //private void saveFile_Click(object sender, RoutedEventArgs e)
  785. //{
  786. //}
  787. //private void savePage_Click(object sender, RoutedEventArgs e)
  788. //{
  789. //}
  790. //private void ele_Click(object sender, RoutedEventArgs e)
  791. //{
  792. //}
  793. //private void wm_Click(object sender, RoutedEventArgs e)
  794. //{
  795. //}
  796. //private void wt_Click(object sender, RoutedEventArgs e)
  797. //{
  798. //}
  799. //private void st_Click(object sender, RoutedEventArgs e)
  800. //{
  801. //}
  802. //private void bd_Click(object sender, RoutedEventArgs e)
  803. //{
  804. //}
  805. //#endregion
  806. #endregion
  807. /// <summary>
  808. /// 青蓝小助手
  809. /// </summary>
  810. /// <param name="sender"></param>
  811. /// <param name="e"></param>
  812. private void bt_qlxzs_Click(object sender, RoutedEventArgs e)
  813. {
  814. this.Visibility = Visibility.Collapsed;
  815. StandardizedAssistantForm assistantForm = new StandardizedAssistantForm(this);
  816. assistantForm.Show();
  817. }
  818. }
  819. }