/*$$
 $ @Author: 刘晓飞
 $ @Date: 2021-10-31 10:59:18
 $ @LastEditTime: 2022-11-10 21:53:15
 $ @LastEditors: 云业科技
 $ @Description: 
 $ @FilePath: \demo.18zhuan.cn\public\ui\dist\js\admin.js
 $ @
 $*/
// JavaScript Document
function changeHeight() {
	c = $(window).height() - $(".main-header").outerHeight();
	breadheight = $(".content-header").outerHeight();
	$(".sidebar").height(c);
	$(".sidebar").css("overflow", "auto");
	$(".content-wrapper, .right-side").css("height", c)
	$(".content-wrapper, .right-side").css("min-height", c)
	$(".right-side").css("overflow", "auto");
	$("#maincontent").css("height", c - 46);
}
function changefrmHeight() {
	fh = $(window).height() - $(".main-footer").outerHeight();
	$("#mainwrap").css("min-height", fh);
}
function menuclick() {
	$(".sidebar-menu>li>ul>li a").click(function () {
		$(".sidebar-menu>li>ul>li").removeClass("active");
		$(this).parent().addClass("active");
	});
}
function leftsidebar(obj) {
	$(obj).parent().siblings().removeClass("active");
	$(obj).parent().addClass("active");
}


function showsidermenu(obj) {
	var navid = obj.id;
	var sidermenuhtml;
	switch (navid) {
		case "yyinfo":
			sidermenuhtml = menu_yyinfo;
			break;
		case "yysystem":
			sidermenuhtml = menu_yymodel;
			break;
		case "yymember":
			sidermenuhtml = menu_yymember;
			break;
		case "yyapps":
			sidermenuhtml = menu_yyapps;
			break;
		default:
			sidermenuhtml = menu_yyinfo;
	}
	var navid = obj.id;
	var treebox = $('.sidebar-menu');
	//treebox.children('#yunyetophead').html('内容面板');
	$('.nav-sidebar').children('.treeview').remove();
	$('.nav-sidebar').html(sidermenuhtml);
	if (navid != "yyinfo") {
		menuclick();
	}
	$('.navbar-nav').children('li').removeClass("active");
	$("#" + navid).parent().addClass("active");
}

function empty(str) {
	if (str == null || str == 'null' || str == undefined || str == 'undefined' || str == "" || str.match(/^[\s]*$/)) {
		return true;
	} else {
		return false;
	}
}



function showDiv(obj, num, len, cssname = 'menu') {
	for (var id = 0; id < len; id++) {
		var setBlock = obj + id;
		if (id == num) {
			try { document.getElementById(setBlock).style.display = "block" } catch (e) { };
		} else {
			try { document.getElementById(setBlock).style.display = "none" } catch (e) { };
		}
	}
	for (var id = 0; id < len; id++) {
		var setID = obj + "menu" + id;
		if (id == num) {
			try { document.getElementById(setID).className = cssname + " active" } catch (e) { };
		} else {
			try { document.getElementById(setID).className = cssname } catch (e) { };
		}
	}
}


