toolbarEvent.js 1.99 KB
var _toolbarEvent = (function(){
	$('#exitBtn').on('click', function(){
		layer.confirm('确定要退出系统?', {
			btn : [ '退出', '取消' ],
			icon : 3,
			skin : 'layui-layer-cfm-delete'
		}, function(){
			//清除标记
			storage.removeItem('real_control_flag');
			//解绑事件
			$(document).unbind('ajaxSend', interceptPOST);
			layer.closeAll();
			//注销websocket
			_socket.close();
			window.location.href = '/pages/control/lineallot/allot.html';
		});
	});
	//调度指令
	$('#msgAndDirect').on('click', function(){
		$.get('/pages/control/line/child_pages/historyDirective.html', function(content){
			layer.open({
			  type: 1,
			  area: '980px',
			  content: content,
			  title : '指令下发记录',
			  shift: 5,
			  success: function(){
			  }
			});
		});
	});
	
	//设备上报
	$('#deviceReport').on('click', function(){
		$.get('/pages/control/line/child_pages/deviceReport.html', function(content){
			layer.open({
			  type: 1,
			  area: '930px',
			  content: content,
			  title : '设备上报',
			  shift: 5,
			  success: function(){
				  
			  }
			});
		});
	});
	
	//TTS语音设置
	$('#ttsConfigure').on('click', function(){
		$.get('/pages/control/line/child_pages/ttsConfigure.html', function(content){
			layer.open({
			  type: 1,
			  area: '530px',
			  content: content,
			  title : 'TTS',
			  shift: 5,
			  success: function(){
			  }
			});
		});
	});
	
	//设备管理
	$('#deviceConfig').on('click', function(){
		$.get('/pages/control/line/child_pages/deviceConfig.html', function(content){
			layer.open({
			  type: 1,
			  area: '530px',
			  content: content,
			  title : '设备管理',
			  shift: 5,
			  success: function(){
			  }
			});
		});
	});
	
	//更新日志
	$('#updateLogLink').on('click', function(){
		layer.alert(updateLog.text, {
			title: updateLog.title,
			area: ['410px', '250px'],
			shift : 5
		});
	});
	
	countDown('toolbarEvent.js');
})();