let allArea = ""; sgworld = window.external.createSgworld(); //滚动条 new CusScrollBar({ contentSelector: '.scroll_cont1', //滚动内容区 barSelector: '.scroll_bar1', //滚动条 sliderSelector: '.scroll_slider1' //滚动滑块 }); //获取地址栏参数 let SonType = getUrlParam("SonRootType"); //获取数据 window.onload = function () { let arr = SonType.split('~'); let tableHtml = ""; $.ajax({ url: "../Ashx/DataWX.ashx", type: "post", data: { Action: "GetWxArea" }, dataType: "json", async: false, success: function (result) { let a = JSON.stringify(result); allArea = result; tableHtml += '名称年份覆盖率'; for (let i = 0; i < arr.length;i++) { let CurrentRoot = BaseDataSecond.filter(function (item) { return item.Type == arr[i] }); let FisrtInto = false; for (let j = 0; j < CurrentRoot[0].ChildRen.length; j++) { if (!FisrtInto) { tableHtml += '' + arr[i] + ':'; FisrtInto = !FisrtInto; } tableHtml += '' + CurrentRoot[0].ChildRen[j].CName +'' let a = arr[i]; let c = CurrentRoot[0].ChildRen[j].CName; $.each(allArea, function (j, value) { if (value.SimName == a && value.Year == c) { tableHtml += '' + parseFloat((value.Area / 71.2) * 100).toFixed(2) + '%' } }) } } $(".Table").empty(); $(".Table").append(tableHtml); } }); } function CheckBoxCheck(obj) { let CurrentRoot = BaseDataSecond.filter(function (item) { return item.Type == obj.value }); let FullPath = CurrentRoot[0].rootname + "\\" + CurrentRoot[0].name + "\\" + CurrentRoot[0].sname + "\\" + obj.name; let FullId = sgworld.ProjectTree.FindItem(FullPath); sgworld.ProjectTree.SetVisibility(FullId, obj.checked); }