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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
new CusScrollBar({
    contentSelector: '.scroll_cont1', //滚动内容区
    barSelector: '.scroll_bar1', //滚动条
    sliderSelector: '.scroll_slider1' //滚动滑块
});
sgworld = window.external.createSgworld();
var urlPathName = "";
var form = null;
layui.use('form', function () {
    form = layui.form;
    var timeStr = decodeURI(getUrlParam("tm"));
    urlPathName = decodeURI(getUrlParam("urlPathName"));
    GetSk(timeStr, urlPathName);
    setCheck(urlPathName)
    form.on('checkbox(All)', function (data) {
        var fullPath = urlPathName;
        var currentTime = data.elem.title;
        //var color = $(this).next().css("backgroundColor");
        var color = data.elem.value;
        color = color.slice(4, color.indexOf(")"));
        var r = parseInt(color.split(",")[0]);
        var g = parseInt(color.split(",")[1]);
        var b = parseInt(color.split(",")[2]);
        var c = sgworld.Creator.CreateColor(r, g, b, 1);
        var ye = currentTime;
        var bjPath = fullPath + "\\" + ye + "\\" + ye + "边界";
        var lxPath = fullPath + "\\" + ye + "\\" + ye + "裂隙";
        var bjId = sgworld.ProjectTree.FindItem(bjPath);
        var lxId = sgworld.ProjectTree.FindItem(lxPath);
        var bjObj = sgworld.ProjectTree.GetObject(bjId);
        var lxObj = sgworld.ProjectTree.GetObject(lxId);
        var v = $(this).attr("checked");
        if ($(this).attr("checked") == "checked") {
            bjObj.FeatureGroups.SetProperty("Line Color", c.abgrColor);
            lxObj.FeatureGroups.Item(0).SetProperty("Line Color", c.abgrColor);
            sgworld.ProjectTree.SetVisibility(lxId, true);
            sgworld.ProjectTree.SetVisibility(bjId, true);
        } else {
            var bj = sgworld.Creator.CreateColor(255, 0, 0, 1);
            var lx = sgworld.Creator.CreateColor(255, 255, 0, 1);
            bjObj.FeatureGroups.SetProperty("Line Color", bj.abgrColor);
            lxObj.FeatureGroups.Item(0).SetProperty("Line Color", lx.abgrColor);
            sgworld.ProjectTree.SetVisibility(lxId, false);
            sgworld.ProjectTree.SetVisibility(bjId, false);
        }
        /*
        let currentTime = data.elem.title;
        
        let layerId = sgworld.ProjectTree.FindItem(urlPathName + "\\" + currentTime + "\\" + currentTime);
        let layer = sgworld.ProjectTree.GetObject(layerId);
        let Hex = colorRGBtoHex(data.elem.value);
        layer.FeatureGroups.Item(0).SetProperty('Line Color', Hex);
        if (data.elem.checked == true) {
            sgworld.ProjectTree.SetVisibility(layerId, true);
        } else {
            sgworld.ProjectTree.SetVisibility(layerId, false);
        }
        
        */
    });
    
 
});
fullPath = urlPathName;
$("input[type='checkbox']").click(function () {
    var color = $(this).next().css("backgroundColor");
    color = color.slice(4, color.indexOf(")"));
    var r = parseInt(color.split(",")[0]);
    var g = parseInt(color.split(",")[1]);
    var b = parseInt(color.split(",")[2]);
    var c = sgworld.Creator.CreateColor(r, g, b, 1);
    var ye = $(this).attr("title");
    var bjPath = fullPath + "\\" + ye + "\\" + ye + "边界";
    var lxPath = fullPath + "\\" + ye + "\\" + ye + "裂隙";
    var bjId = sgworld.ProjectTree.FindItem(bjPath);
    var lxId = sgworld.ProjectTree.FindItem(lxPath);
    var bjObj = sgworld.ProjectTree.GetObject(bjId);
    var lxObj = sgworld.ProjectTree.GetObject(lxId);
    var v = $(this).attr("checked");
    if ($(this).attr("checked") == "checked") {
        bjObj.FeatureGroups.SetProperty("Line Color", c.abgrColor);
        lxObj.FeatureGroups.Item(0).SetProperty("Line Color", c.abgrColor);
        sgworld.ProjectTree.SetVisibility(lxId, true);
        sgworld.ProjectTree.SetVisibility(bjId, true);
    } else {
        var bj = sgworld.Creator.CreateColor(255, 0, 0, 1);
        var lx = sgworld.Creator.CreateColor(255, 255, 0, 1);
        bjObj.FeatureGroups.SetProperty("Line Color", bj.abgrColor);
        lxObj.FeatureGroups.Item(0).SetProperty("Line Color", lx.abgrColor);
        sgworld.ProjectTree.SetVisibility(lxId, false);
        sgworld.ProjectTree.SetVisibility(bjId, false);
    }
});
 
//获取色块值并且展示出来
function GetSk(parm0, parm1) {
    var timeArr = parm0.split('+');
    let html = "";
    for (var i = 0; i < timeArr.length; i++) {
        var R = parseInt(Math.random() * 255);
        var G = parseInt(Math.random() * 255);
        var B = parseInt(Math.random() * 255);
        html += '<input type="checkbox" name="yearXz"  lay-skin="primary"  lay-filter="All"  title="' + timeArr[i] + '"  value="RGB(' + R + ',' + G + ',' + B + ')">';
    }
    $(".message").empty();
    $(".message").append(html);
    form.render();
}
 
//设置牛心山选择
function setCheck(fullPath) {
    var dYear = localStorage.getItem("CheckPointYear");
    $("input[type='checkbox']").each(function () {
        $(this).attr("checked", false);
        $(this).attr("disabled", false);
        var ye = $(this).attr("title");
        var bjPath = fullPath + "\\" + ye + "\\" + ye + "边界";
        var lxPath = fullPath + "\\" + ye + "\\" + ye + "裂隙";
        var bjId = sgworld.ProjectTree.FindItem(bjPath);
        var lxId = sgworld.ProjectTree.FindItem(lxPath);
        var bjObj = sgworld.ProjectTree.GetObject(bjId);
        var lxObj = sgworld.ProjectTree.GetObject(lxId);
        var bj = sgworld.Creator.CreateColor(255, 0, 0, 1);
        var lx = sgworld.Creator.CreateColor(255, 255, 0, 1);
        bjObj.FeatureGroups.SetProperty("Line Color", bj.abgrColor);
        lxObj.FeatureGroups.Item(0).SetProperty("Line Color", lx.abgrColor);
        if (dYear == $(this).attr("title")) {
            $(this).attr("checked", true);
            $(this).attr("disabled", true);
        }
        else if (dYear == null) {
            if ($(this).attr("title") == "2019") {
                $(this).attr("checked", true);
                $(this).attr("disabled", true);
            }
        }
    });
    $("input[type='checkbox']").change(function () {
        var color = $(this).next().css("backgroundColor");
        color = color.slice(4, color.indexOf(")"));
        var r = parseInt(color.split(",")[0]);
        var g = parseInt(color.split(",")[1]);
        var b = parseInt(color.split(",")[2]);
        var c = sgworld.Creator.CreateColor(r, g, b, 1);
        var ye = $(this).attr("title");
        var bjPath = fullPath + "\\" + ye + "\\" + ye + "边界";
        var lxPath = fullPath + "\\" + ye + "\\" + ye + "裂隙";
        var bjId = sgworld.ProjectTree.FindItem(bjPath);
        var lxId = sgworld.ProjectTree.FindItem(lxPath);
        var bjObj = sgworld.ProjectTree.GetObject(bjId);
        var lxObj = sgworld.ProjectTree.GetObject(lxId);
        var v = $(this).attr("checked");
        if ($(this).attr("checked") == "checked") {
            bjObj.FeatureGroups.SetProperty("Line Color", c.abgrColor);
            lxObj.FeatureGroups.Item(0).SetProperty("Line Color", c.abgrColor);
            sgworld.ProjectTree.SetVisibility(lxId, true);
            sgworld.ProjectTree.SetVisibility(bjId, true);
        } else {
            var bj = sgworld.Creator.CreateColor(255, 0, 0, 1);
            var lx = sgworld.Creator.CreateColor(255, 255, 0, 1);
            bjObj.FeatureGroups.SetProperty("Line Color", bj.abgrColor);
            lxObj.FeatureGroups.Item(0).SetProperty("Line Color", lx.abgrColor);
            sgworld.ProjectTree.SetVisibility(lxId, false);
            sgworld.ProjectTree.SetVisibility(bjId, false);
        }
    });
}