You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							88 lines
						
					
					
						
							2.8 KiB
						
					
					
				
			
		
		
		
			
			
			
				
					
				
				
					
				
			
		
		
	
	
							88 lines
						
					
					
						
							2.8 KiB
						
					
					
				| var App = function () { | |
|     this.Map = new Map(this); | |
|     this.RealtimePanel = new RealtimePanel(this); | |
|     this.HistoryPanel = new HistoryPanel(this); | |
| 
 | |
|     this.Startup = function () { | |
|         moment.locale(); | |
|         this.Relayout(); | |
|         this.RedirectPage(); | |
|          | |
|         this.Map.Startup(); | |
|         this.RealtimePanel.Startup(); | |
|         this.HistoryPanel.Startup(); | |
| 
 | |
|         window.onresize = this.Relayout.bind(this); | |
|         $('#real-time').on('click', this.OnRealtimeTabClick.bind(this)); | |
|         $('#history-time').on('click', this.OnHistoryTabClick.bind(this)); | |
|         $('#shrink').on('click', this.OnShrinkClick.bind(this)); | |
|     }; | |
| 
 | |
|     this.Relayout = function () { | |
|         var width = $(window).width(); | |
|         var height = $(window).height(); | |
| 
 | |
|         $('.main').width(width - (this.IsShrink ? 0 : 286)); | |
|         $('.main').height(height - 54); | |
|         $('.right').height(height - 54); | |
| 
 | |
|         this.RealtimePanel.Relayout(); | |
|         this.HistoryPanel.Relayout(); | |
|     }; | |
| 
 | |
|     this.RedirectPage = function () { | |
|         var user = document.getElementById('user-info'); | |
|         if (user.getAttribute('class') === 'user-login') | |
|             window.location.href = '/User/Login'; | |
|         else | |
|             return; | |
|     }; | |
| 
 | |
|     this.OnRealtimeTabClick = function (event) { | |
|         $(event.target).addClass("active").siblings().removeClass('active'); | |
|         $(".right-content .param").eq(0).css("display", "block").siblings().css("display", "none"); | |
| 
 | |
|         this.Map.MultiLayers = false; | |
|     }; | |
| 
 | |
|     this.OnHistoryTabClick = function (event) { | |
|         $(event.target).addClass("active").siblings().removeClass('active'); | |
|         $(".right-content .param").eq(1).css("display", "block").siblings().css("display", "none"); | |
|         $("#task-grid").datagrid("resize"); | |
| 
 | |
|         this.Map.MultiLayers = true; | |
|         this.HistoryPanel.Relayout(); | |
|     }; | |
| 
 | |
|     this.ShowDialog = function () { | |
|         $('.dialog').show(); | |
|     }; | |
| 
 | |
|     this.HideDialog = function () { | |
|         $('.dialog').hide(); | |
|     }; | |
| 
 | |
|     this.OnShrinkClick = function () { | |
|         var width = $(window).width(); | |
|         this.IsShrink = !this.IsShrink; | |
|         if (this.IsShrink) { | |
|             $('.main').width(width); | |
|             $('.shrink').addClass('shrink-toggle'); | |
|             $('.right').addClass('right-toggle'); | |
|             $('.real-btn').addClass('real-btn-toggle'); | |
|             $('.shadow').addClass('shadow-toggle'); | |
|         } else { | |
|             $('.main').width(width - 286); | |
|             $('.shrink').removeClass('shrink-toggle'); | |
|             $('.right').removeClass('right-toggle'); | |
|             $('.real-btn').removeClass('real-btn-toggle'); | |
|             $('.shadow').removeClass('shadow-toggle'); | |
|         } | |
|         this.Map.CenterMap(40.854662, 111.746303, 7); | |
|     } | |
| }; | |
| 
 | |
| $(document).ready(function () { | |
|     var app = new App(); | |
|     app.Startup(); | |
| }); |