HomepageForm.xaml.cs 37 KB

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