function InitTree() { $(".point-tree .tree").find('.chapter-name').each(function() { var obj = $(this); if (obj.next().length > 0) { obj.prepend("").find("a.ac").siblings("span.icon").css("backgroundColor","transparent"); //obj.attr('href', 'javascript:void(0)'); } }); } if (typeof(jslist) != 'undefined') { jslist[hashPage].push('InitTree'); } else { InitTree(); } $(".header .nav .nav-li").eq(10).find(".dropdown .dropdown-menu li:eq(0),.dropdown>a[data-toggle=dropdown]").addClass('ac'); $(".point-tree .tree .chapter-list").eq(0).addClass("root-chapter-list"); if (location.href.indexOf("QuestionBank") != -1) { var muluStructure = sessionStorage.getItem("QmuluStructure") || null; } else if (location.href.indexOf("Mind") != -1) { var muluStructure = sessionStorage.getItem("MmuluStructure") || null; } var timer = setInterval(function() { if ($(".root-chapter-list .chapter-name .icon").length) { clearInterval(timer); if (muluStructure) { var muluStructureObj = JSON.parse(muluStructure); $(muluStructureObj.iconClass).each(function(i, v) { $(".root-chapter-list .chapter-name .icon").eq(i).removeClass().addClass(v); }); $(muluStructureObj.chapterListStyle).each(function(i, v) { $(".root-chapter-list .chapter-list").eq(i).attr("style", v); }); } } }, 30); $(document).on("click", "span.icon", function(event) { var chaptername = $(this).closest('.chapter-name'); if (chaptername.siblings(".chapter-list").length != 0) { chaptername.children(".icon").toggleClass("expand fold"); chaptername.siblings(".chapter-list").slideToggle(300, function() { // $(window).trigger("scroll"); var o = { "iconClass": [], "chapterListStyle": [] }; var rcl = $(this).parents(".tree .root-chapter-list").eq(0); rcl.find(".chapter-name .icon").each(function(i, v) { o.iconClass.push($(v).attr("class")); }); rcl.find(".chapter-list").each(function(i, v) { o.chapterListStyle.push($(v).attr("style")); }); if (location.href.indexOf("QuestionBank") != -1) { sessionStorage.setItem("QmuluStructure", JSON.stringify(o)); } else if (location.href.indexOf("Mind") != -1) { sessionStorage.setItem("MmuluStructure", JSON.stringify(o)); } }); /*chaptername.parent("li").siblings("li").children(".chapter-list").slideUp(300); chaptername.parent("li").siblings("li").children(".chapter-name").children(".icon").removeClass('fold').addClass('expand');*/ } }); if (typeof(echarts) != "undefined") { // 数据统计 var myChart = echarts.init($("#dataStatistic")[0]); var seriesData = [500, 1000, 800, 600]; $(seriesData).each(function(i, v) { $(".data-statistic .dataStatistic-text p").eq(i).append(v); }); var option = { title: { text: '数据统计', textStyle: { color: '#333', fontSize: 14 } }, grid: { bottom: 10, top: 50, left: 10, right: 10 }, xAxis: { type: 'category', data: ['试题总量', '试题浏览总量', '今日更新试题', '今日浏览试题'], axisLine: { lineStyle: { color: '#999' } }, axisTick: { show: false }, axisLabel: { show: false, interval: 0 } }, tooltip: { show: true }, yAxis: { show: false }, series: [{ data: seriesData, type: 'bar', itemStyle: { normal: { color: function(params) { var colorList = ['#8c69dc', '#69dcd5', '#d69b4a', '#6aa6e5']; return colorList[params.dataIndex]; } } }, label: { normal: { show: true, position: 'top', } }, barWidth: 15 }] }; myChart.setOption(option); } // choose-textbook; function createLi(arr) { var str = ""; $(arr).each(function(i, v) { str += "