//侧边栏 $.sidebarMenu = function(menu) { var animationSpeed = 300; $(menu).on('click', 'li a', function(e) { var $this = $(this); var checkElement = $this.next(); if (checkElement.is('.treeview-menu') && checkElement.is(':visible')) { checkElement.slideUp(animationSpeed, function() { checkElement.removeClass('menu-open'); }); checkElement.parent("li").removeClass("active"); } //If the menu is not visible else if ((checkElement.is('.treeview-menu')) && (!checkElement.is(':visible'))) { //Get the parent menu var parent = $this.parents('ul').first(); //Close all open menus within the parent var ul = parent.find('ul:visible').slideUp(animationSpeed); //Remove the menu-open class from the parent ul.removeClass('menu-open'); //Get the parent li var parent_li = $this.parent("li"); //Open the target menu and add the menu-open class checkElement.slideDown(animationSpeed, function() { //Add the class active to the parent li checkElement.addClass('menu-open'); parent.find('li.active').removeClass('active'); parent_li.addClass('active'); }); } //if this isn't a link, prevent the page from being redirected if (checkElement.is('.treeview-menu')) { e.preventDefault(); } }); } $.sidebarMenu($('.sidebar-menu')) //业务系统 //var yewuxitong_path ="http://101.132.37.231:8080/business_test"; var yewuxitong_path ="http://47.100.186.202/business"; var cimcitech_path ="http://47.100.186.202/cimcitech"; //请求链接*****本地 //var core_url="http://10.43.10.32:8080/cimc-core"; //var oneconn_url="http://10.43.10.32:8081/cimc-oneconn"; //var goocontainer_url="http://10.43.10.32:8082/cimc-goocontainer"; /*var core_url="http://47.100.186.202:8080/cimc-core"; var oneconn_url="http://47.100.186.202:8080/cimc-oneconn"; var goocontainer_url="http://47.100.186.202:8080/cimc-goocontainer";*/ //请求链接*****测试 var core_url="http://101.132.37.231:8080/cimc-core"; var oneconn_url="http://101.132.37.231:8080/cimc-oneconn"; var goocontainer_url="http://101.132.37.231:8080/cimc-goocontainer"; //请求链接*****正式 //var core_url="http://api.goocontainers.com/cimc-core"; //var oneconn_url="http://api.goocontainers.com/cimc-oneconn"; //var goocontainer_url="http://api.goocontainers.com/cimc-goocontainer"; //请求链接*****本地(雷) //var core_url="http://10.43.10.33:8080/cimc-core"; //var oneconn_url="http://10.43.10.33:8080/cimc-oneconn"; //var goocontainer_url="http://10.43.10.33:8080/cimc-goocontainer"; var token=localStorage.getItem("PCtoken"); var doc=$(document); var platFormId; var common={ init:function(){ this.eventBind(); this.ellipsis(); this.getPlatFormId() }, ellipsis:function(){ //多行显示省略号 var dom = $(".duohang"); var strArr=[]; for (var i=0;i=100){ content=strArr[i].substr(0,100)+"..."; }else{ content=strArr[i]; } // debugger dom.eq(i).text(content) } }, getPlatFormId:function(){ var that=this; var url=yewuxitong_path + "/news/getPlatformList"; var data={ employeeinfoid:"admin" }; function callBack(res){ console.log(res) var rows= res.content; rows.forEach(function(item,index){ if(item.platformName == "js6668金沙智能"){ sessionStorage.setItem("ZJZNplatformid",item.platformid) } }) }; that.myAjax(url,data,callBack) }, eventBind:function(){ //去登录页面 doc.on("click",".login",function(){ location.href="/admin/start/index.html#/user/login" }) $(".header-out").on("mouseenter",".navList ul li,.coreList",function(){ // var index= $(this).index(".navList ul li a"); var index= $(this).index(); var navList=$(".navList ul li a") var dom= $(".coreList"); for (var i=0;i