13693261870
2024-04-02 2a1b873b4b78b508d5d53c57992e734c56619df8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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);
}