var ndate=new Date;
var year=ndate.getFullYear(); 
var month=ndate.getMonth()+1;
$('#calendar-dayly').flexoCalendar({
	type: 'normal',
	setYear: year, 
	setMonth: month, 
	selectDate: 'each-each-each',
  onselect: function (date) {
    console.log(date)
  }
})
$('#calendar-weekly').flexoCalendar({
	type: 'weekly', 
	today: true,
	type: 'weekly',
  onselect: function (date) {
    console.log(date)
  }
	})
$('#calendar-monthly').flexoCalendar({
  type: 'monthly',
  onselect: function (date) {
    console.log(date)
  }
})

var $calendarTabs = $('#calendarTabs')
var $calendarWrapper = $('#calendarWrapper')
$calendarTabs.on('click', '.tab', function () {
  $calendarTabs.find('.tab').removeClass('active')
  $(this).addClass('active')
  $('#calendarWrapper .calendar-wrapper').hide().eq($(this).index()).show()
})
//表格显示
$('#chartLeft1').click(function(){
	$('.left-side-table').toggle();
})
$('.left-side-table').click(function(){
	$('.left-side-table').toggle();
	
})
$(document).bind("click", function(){
        $('#chartBottom1 .choosebox').hide();
})
$("#chartBottom1 .choosepc").click(function(){
	$('#chartBottom1 .choosebox').toggle();
	event.stopPropagation();
})
$("#chartBottom1 .choosebox").click(function(){
	
	event.stopPropagation();
})
$('.tab-areas .item').click(function(){
	var type = $.trim($(".switch-bt-active").text());
	var item = $.trim($(this).text());
	
	if(type =='区域'){
		var build = $('select[name="build"]').val();
		$('.choosepc .choose-item').text(type+':'+build+'-'+item);
	}else{
		$('.choosepc .choose-item').text(type+':'+item);
	}
	$('#chartBottom1 .choosebox').hide();
})
$(".a_demo_two").click(function(){
	var i = $(this).index('.a_demo_two');
	$(".a_demo_two").removeClass('switch-bt-active');
	$(this).addClass('switch-bt-active');
	$('.tab-areas .tab-area').addClass('tabshow');
	$(".tab-areas .tab-area").eq(i).removeClass('tabshow');
})
// 中间下拉框点击事件
$("#ln-Dropdown").click(function(e) {
	$(".ln-Dropdown-content").slideToggle(300);
	if(e.target.nodeName == 'LI') {
		console.dir(e.target.attributes.value.value)
		$('#ln-Dropdown').eq(0)[0].children[0].innerText = e.target.innerText
	}
})