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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
sgworld = window.external.createSgworld();
var form = null;
var element = null;
var lc = new leftCenterDatlog();
new CusScrollBar({
    contentSelector: '.scroll_cont1', //滚动内容区
    barSelector: '.scroll_bar1', //滚动条
    sliderSelector: '.scroll_slider1' //滚动滑块
});
//注意:折叠面板 依赖 element 模块,否则无法进行功能性操作
layui.use(['element', 'form'], function () {
    element = layui.element;
    form = layui.form;
    var title = decodeURI(getUrlParam("title")); //localStorage.getItem("typeName");
    $(".ttitle").empty();
    $(".ttitle").append(title);
    GetColor();
    form.on('checkbox(pYc)', function (data) {
        window.event.stopPropagation();
    });
});
 
var skFirst = [];
//获取一级菜单选中事件
var qxF = false;
function qx1() {
    if (qxF == false) {
        qxF = true;
        var checkItem = $("input:checkbox[name='title']");
        checkItem.each(function (index, item) {
            $(item).attr('checked', true);
        });
        form.render();
    } else {
        qxF = false;
        var checkItem = $("input:checkbox[name='title']");
        checkItem.each(function (index, item) {
            $(item).removeAttr('checked');
        });
        form.render();
    }
}
 
//获取二级菜单选中事件
var qxS = false;
var skSecond = [];
function qx2() {
    if (qxS == false) {
        qxS = true;
        var checkItem = $("input:checkbox[name='message']");
        checkItem.each(function (index, item) {
            $(item).attr('checked', true);
            //var tname = $(item).attr('title');
            //skSecond.push(tname);
        });
        form.render();
    } else {
        qxS = false;
        var checkItem = $("input:checkbox[name='message']");
        checkItem.each(function (index, item) {
            $(item).removeAttr('checked');
        });
        form.render();
    }
}
 
 
var url = getRootPath();
//确定菜单
 
 
function sure() {
    if (temID != null) {
        sgworld.ProjectTree.DeleteItem(temID);
        temID = null;
    }
    var second = "";
    var whereSecond = "";
    var checkSecond = $("input:checkbox[name='message']:checked");
    $.each(checkSecond, function (index, value) {
        second += value.title + "*";
        whereSecond += ("SJBM='" + value.getAttribute("data-code") + "' AND ");
    });
 
    second=second.substring(0, second.length - 1);
    if (second == "") {
        window.external.closeDialog("右中");
 
    } else {
        window.external.createPmDialogDock("右中", url + "legend.html?sk=" + second + "&type=" + getUrlParam("Type"), lc.width, lc.height, lc.top, lc.left, lc.bottom, lc.right);
    }
 
    if (whereSecond == "") {
        alert("请选择二级分类");
        return false;
    }
 
   var ThisLayer = sgworld.ProjectTree.FindItem(localStorage.getItem("pathName")+"\\"+CurrentYear);
   var LayerObj = sgworld.ProjectTree.GetObject(sgworld.ProjectTree.GetNextItem(ThisLayer, 11));
    LayerObj.load();
    LayerObj.Filter = whereSecond.substring(0, whereSecond.length - 4);
    LayerObj.Refresh();
    
 
}
 
 
//获取文本框数值
function GetColor() {
    ;
    var TableName = getUrlParam("Type");//localStorage.getItem("type");
    var TableColor = GetCmpareTable(TableName);
    $.ajax({
        url: "../../../Ashx/DataQH.ashx",
        type: "post",
        data: { Action: "GetColor", colorTable: TableColor },
        dataType: "json",
        async: false,
        success: function (result) {
            var html = "";
            var h1 = "";
 
            $.each(result, function (index, value) {
 
                if (value.Type == "parent") {
                    if (html == "") {
                        html += '<div class="layui-collapse layui-form"><div class="layui-colla-item"><div class="layui-colla-title">' +
                             '<div class="lct"><input checked type="checkbox" data-code="' + value.Code + '"  name="title" lay-skin="primary" title="' + value.Name + '" lay-filter="pYc"' +
                             'value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')"></div><div><img src="img/加号.png" /></div></div><div class="layui-colla-content">' +
                             '<div class="layui-form-item"><div class="layui-input-block">';
                    } else {
                        html += '</div></div></div></div></div><div class="layui-collapse layui-form"><div class="layui-colla-item"><div class="layui-colla-title">' +
                             '<div class="lct"><input type="checkbox"  data-code="' + value.Code + '"  name="title" lay-skin="primary" title="' + value.Name + '" lay-filter="pYc"' +
                             'value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')"></div><div><img src="img/加号.png" /></div></div><div class="layui-colla-content">' +
                             '<div class="layui-form-item"><div class="layui-input-block">';
                    }
                } else if (value.Type == "Gparent") {
                    return;
                } else {
                    html += '<input type="checkbox" name="message" data-code="' + value.Code + '"  lay-skin="primary"  title="' + value.Name + '"  value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')">';
                }
 
                if (result.length - 1 == index) {
                    html += '</div></div></div></div></div>';
                }
 
 
 
            })
            // alert(html);
            $(".scroll_cont1").empty();
            $(".scroll_cont1").append(html);
            form.render();
            element.render();
        }
    });
 
}
 
//加载影像数据
var CurrentYear = "";
function GetYX(year) {
    sgworld.ProjectTree.SetVisibility("",false);
    if (year == "") {
        return false;
    } else {
        CurrentYear = year;
       var ThisId = sgworld.ProjectTree.FindItem(localStorage.getItem("pathName") + "\\" + year);
        //alert(localStorage.getItem("pathName") + "\\" + year);
        if (ThisId == "") {
            return false;
        } else {
            var alpah = localStorage.getItem("alpha");
            if (alpah == null) {
                alpah = 70;
            }
            var childId = sgworld.ProjectTree.GetNextItem(ThisId, 11);
            var dd = Number(alpah) / 100;
            var layer = sgworld.ProjectTree.GetObject(childId);
            layer.FeatureGroups.Item(0).SetProperty("Fill Opacity", dd);
            sgworld.ProjectTree.SetVisibility(ThisId,true);
        }
    }
}
 
function closeCurrent() {
    window.external.closeDialog("右中");
    window.external.closeDialog("左下");
    window.external.closeDialog("右上");
    window.external.closeDialog("右下");
    window.external.InvokeScript("左上", "ReFresh", "");
    //关闭图层
    sgworld.ProjectTree.SetVisibility("", false);
    sgworld.ProjectTree.SetVisibility(sgworld.ProjectTree.FindItem("qinghai"), true);
}