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 += '<tr><td>名称</td><td>年份</td><td>覆盖率</td></tr>';
|
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 += '<tr><td rowspan="' + (CurrentRoot[0].ChildRen.length+1) + '">' + arr[i] + ':</td></tr>';
|
FisrtInto = !FisrtInto;
|
}
|
tableHtml += '<tr><td><input type="checkbox" onclick="CheckBoxCheck(this)" name="' + CurrentRoot[0].ChildRen[j].CName +'" value="' + arr[i] +'" />' + CurrentRoot[0].ChildRen[j].CName +'</td>'
|
let a = arr[i];
|
let c = CurrentRoot[0].ChildRen[j].CName;
|
|
$.each(allArea, function (j, value) {
|
if (value.SimName == a && value.Year == c) {
|
tableHtml += '<td>' + parseFloat((value.Area / 71.2) * 100).toFixed(2) + '%</td></tr>'
|
}
|
})
|
}
|
}
|
|
$(".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);
|
}
|