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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
var form = null;
var element = null;
var rb = new rightBottomDatlog();
var lc = new leftCenterDatlog();
var TableName = localStorage.getItem("type");
var TableColor = GetCmpareTable(TableName);
 
new CusScrollBar({
    contentSelector: '.scroll_cont1', //滚动内容区
    barSelector: '.scroll_bar1', //滚动条
    sliderSelector: '.scroll_slider1' //滚动滑块
});
 
 
//注意:折叠面板 依赖 element 模块,否则无法进行功能性操作
layui.use(['element', 'form'], function () {
    element = layui.element;
    form = layui.form;
 
   
    form.on('checkbox(pYc)', function (data) {
        window.event.stopPropagation();
    });
 
    let CurrentRoot = YingYongDataSencond.filter(function (item) { return item.Type == TableName });
    var title = CurrentRoot[0].sname;// localStorage.getItem("typeName");
    $(".ttitle").empty();
    $(".ttitle").attr("title",title);
    $(".ttitle").append((title.length>12)?title.substring(0,12):title);
 
     GetYear();
});
 
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);
 
        });
        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() {
    var first = "", second = "", time = "", type = "";
    //获取一级选中菜单
    var checkFirst = $('input:checkbox[name="title"]:checked');
    $.each(checkFirst, function (index, value) {
        first += value.title + "*";
    })
    var checkSecond = $("input:checkbox[name='message']:checked");
    $.each(checkSecond, function (index, value) {
        second += value.title + "*";
    })
    var checkTime = $("input:checkbox[name='time']:checked");
    $.each(checkTime, function (index, value) {
        time += value.title + "*";
    })
    if (time == "") {
        alert("请选择时间");
        return false;
    }
 
    if (second == "" & first == "") {
        alert("请选择图例");
        return false;
    }
 
 
    window.external.closeDialog("右中");
    window.external.closeDialog("左下");
    window.external.closeDialog("右下");
    if (second == "") {
        window.external.createPmDialogDock("右下", url + "../chart/chartDLChoose.html?first=" + first.substring(0, first.length - 1) +
           "&second=" + second.substring(0, second.length - 1) + "&time=" + time.substring(0, time.length - 1), rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
    } else {
        window.external.createPmDialogDock("右中", url + "../legend.html?sk=" + second.substring(0, second.length - 1), lc.width, lc.height, lc.top, lc.left, lc.bottom, lc.right);
        window.external.createPmDialogDock("右下", url + "../chart/chartDLChoose.html?first=" + first.substring(0, first.length - 1) +
            "&second=" + second.substring(0, second.length - 1) + "&time=" + time.substring(0, time.length - 1), rb.width, rb.height, rb.top, rb.left, rb.bottom, rb.right);
    }
 
 
 
 
}
 
 
function GetYear() {
    $.ajax({
        url: "../../../Ashx/Secondcommon.ashx",
        type: "post",
        data: { Action: "GetYear", TableName: TableName },
        dataType: "json",
        async: false,
        success: function (result) {
            var html = '<div class="layui-form-item" pane=""><div class="layui-input-block" style="margin-left:13%;">';
            $.each(result, function (index, value) {
                html += '<input type="checkbox" name="time" value="rgb(95,184,120)" lay-skin="primary" title="' + value.Year + '" >';
            });
            $(".layui-form").empty();
            $(".layui-form").append(html + "</div></div><hr />");
            GetColor();
        }
    })
}
 
 
function GetColor() {
    $.ajax({
        url: "../../../Ashx/DataQH.ashx",
        type: "post",
        data: { Action: "GetColor", colorTable: TableColor },
        dataType: "json",
        async: true,
        success: function (result) {
            //判断使用一级菜单还是二级菜单
            var ContainParent = false;
            for (var i = 0; i < result.length; i++) {
                if (result[i].Type == "parent") {
                    ContainParent = true;
                    break;
                }
            }
            //初始化日期
            var html = "";
            var h1 = "";
            if (ContainParent) {
                $.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 type="checkbox" name="title" data-code="' + value.Code + '"  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 class="layui-colla-item"><div class="layui-colla-title">' +
                                 '<div class="lct"><input type="checkbox" name="title" data-code="' + value.Code + '" 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>';
                    }
                })
 
                //$(".imgFirst").click(qx1);
                //$(".imgSecond").click(qx2);
                FSLevel = false;
            } else {
                $.each(result, function (index, value) {
                    html += '<div class="layui-collapse layui-form"><div class="layui-colla-item"><div class="layui-colla-title">' +
                                 '<div class="lct"><input type="checkbox" name="title" data-code="' + value.Code + '" lay-skin="primary" title="' + value.Name + '" lay-filter="pYc"' +
                                 'value="rgb(' + value.R + ',' + value.G + ',' + value.B + ')"></div><div></div></div>';
                })
                html + '<div class="layui-collapse layui-form">' + html + '</div>';
                $(".imgSecondT").css("display", "none");
                //$(".imgFirst").click(qx1);
                FSLevel = true;
            };
           // alert(html);
 
            //$(".scroll_cont1").empty();
            $(".layui-form").append(html);
            form.render();
            element.render();
        }
    });
}