fs-danaus
2022-08-05 4a551fc73bd4c86f43aa68c0aab8d1dbeae46836
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<%@page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@page import="com.yc.sdk.shopping.util.SettingKey" %>
<%@page import="java.net.URLDecoder" %>
<%
    //用于控制导航
    String navigation = request.getParameter("navi");
    String URL = SettingKey.getHostUrl(request);
    String str_menuid = request.getParameter("menuid");
    String menuName = request.getParameter("menuname");
    int menuid = (str_menuid != null ? Integer.parseInt(str_menuid) : 0);
%>
<!DOCTYPE HTML >
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>佛山市盈晨科技有限公司</title>
 
    <script type="text/javascript"
            src="<%=URL%>/js/jquery-1.4.4.min.js?v=<%=com.yc.utils.FileUtil.getVerstion(request, "/js/jquery-1.4.4.min.js")%>"></script>
    <script type="text/javascript"
            src="<%=URL%>/js/encode.js?v=<%=com.yc.utils.FileUtil.getVerstion(request, "/js/encode.js")%>"></script>
    <style type="text/css">
        body {
            ont-family: Arial, tahoma, Helvetica, sans-serif;
            font-size: 12px;
            margin: 0px;
        }
 
        .content {
            float: left;
            width: 100%
        }
 
        .item:hover {
            width: 110px;
            height: 105px;
            border: 1px dashed;
            border-radius: 5px;
            text-align: center;
            float: left;
            margin: 14px;
            cursor: pointer;
            white-space: nowrap;
            background: #FFFFBB;
        }
 
        .dis {
            /*color: rgb(44, 141, 251);*/
            font-size: 13px;
            margin-top: 3px;
        }
 
        .item {
            width: 110px;
            height: 105px;
            border: 0px dashed;
            text-align: center;
            float: left;
            margin: 15px;
            /*margin: 0px 15px 15px 15px;*/
            cursor: pointer;
            white-space: nowrap;
        }
 
        .items {
            overflow: hidden;
            width: 100%;
            /*height: 25px;*/
            /*border-bottom: 1px solid #CCCCCC;*/
        }
 
        .img {
            width: 62px;
            height: 62px;
            margin-top: 5px;
        }
 
        .img img {
            width: 100%;
            height: 100%;
            border: 0px;
        }
 
        #navigation {
            padding: 20px 50px 10px 40px
        }
 
        #navigation a {
            margin-left: 10px;
            font-size: 11pt;
 
        }
 
        .buju {
            float: right;
            margin-right: 50px;
            background-color: #2C8DFB;
            cursor: pointer;
            color: #fff;
            padding: 20px;
            border-radius: 10px;
            line-height: 0;
        }
 
        a:link {
            text-decoration: none; /* 指正常的未被访问过的链接*/
        }
 
        a:visited {
            text-decoration: none; /*指已经访问过的链接*/
        }
 
        a:hover {
            text-decoration: none; /*指鼠标在链接*/
        }
 
        a:active {
            text-decoration: none; /* 指正在点的链接*/
        }
 
        .group {
            padding: 10px 50px 10px 40px;
        }
 
        .fieldset {
            margin: 0px !important;
        }
 
        .otherF {
            width: 90%;
            border-radius: 10px;
            border: 1px dashed #a9c6f5;
            margin-bottom: 10px !important;
        }
 
        legend {
            width: auto;
            margin-left: 5px;
        }
 
        .group-name {
            font-size: 15px;
            color: #223e67;
            font-weight: 600;
        }
    </style>
</head>
<body>
<div class="content">
    <!-- 导航 -->
 
    <div id="navigation">
        <%
            if (null == navigation) {
        %>
        <a href="/general/home/iconMenuCenter.jsp">开始</a> <a
            href="javascript:layout();" class="buju">布局设置</a>
        <%
        } else {
        %>
        <%=URLDecoder.decode(navigation, "utf-8")%>
        <%
            if (null != menuName) {
                menuName = URLDecoder.decode(menuName, "utf-8");
        %>
        —— <a menuid="<%=str_menuid%>"
              href="javascript:navi('<%=str_menuid%>');" style="margin-left: 1px;"><%=menuName%>
    </a>
        <%
                }
            }
        %>
    </div>
    <div class="group">
 
    </div>
</div>
</body>
<script type="text/javascript">
    $(function () {
        <%--$.post('/iconData.do',{'menuid':<%=menuid%>},function(data){--%>
        $.ajax({
            url: '/layout/iconGroup.do',
            type: 'post',
            data: JSON.stringify({'menuId': <%=menuid%>}),
            contentType: "application/json",
            success: function (res) {
                if (res == null || res.code == -1) {
                    alert('加载失败');
                    return;
                }
                let data = res.data;
                if (res.code == 0 && data != null && data.length > 0) {
                    var str = '';
                    var groupStr = '';
                    data.forEach(function (item, index) {
                        if (item.menuType && item.groups) {//有分组
                            if (str) {
                                groupStr = groupEleStr('', '', str);
                                $(".content .group").append(groupStr);
                            }
                            str = '';
                            item.groups.forEach(function (currentItem, index) {
                                str += elementStr(currentItem);
                            });
                            groupStr = groupEleStr(item.menuType, 'otherF', str);
                            $(".content .group").append(groupStr);
                            str = '';
                        } else {
                            str += elementStr(item);
                        }
                    });
                    if (str) {
                        groupStr = groupEleStr('', '', str);
                        $(".content .group").append(groupStr);
                        str = '';
                    }
                    clickItem();
                }
            }
        }).error(function (e) {
            console.log(e);
        });
    });
 
    function clickItem() {
        $(".item").click(function () {//点击图片标执行的函数
            var formid = $(this).attr("formid");
            var menuName = $(this).find(".dis").text();
            var navi = $("#navigation").html();
            if ("null" == formid || "" == formid) {
                var t = $(this).attr("menuid");
                var para = encodeURI(encodeURI("menuid=" + t + "&menuname=" + menuName + "&navi=" + navi));
                para = ENCODE.encode(para);
                location = "/general/home/iconMenuCenter.jsp?" + para;
            } else {
                var formtype = $(this).attr("formtype");
                parent.addTab(menuName, formid, formtype, "");
            }
        });
    }
 
    function navi(id) {//点击导航栏执行的函数
        var tempObje = $("#navigation").find("a[menuid='" + id + "']");
        var navis = tempObje.prevAll();
        var array = [];
        var obj = $("<div>");
        obj.append(tempObje.clone());
        array.push(' —— ' + obj.html());
        obj.remove();
        navis.each(function () {
            var obj = $("<div>");
            obj.append($(this).clone());
            array.push(obj.html());
            obj.remove();
        });
        var t = "";
        for (i = array.length - 1; i >= 0; i--) {
            t += array[i];
        }
        var para = encodeURI(encodeURI("menuid=" + id + "&navi=" + t));
        para = ENCODE.encode(para);
        location = "/general/home/iconMenuCenter.jsp?" + para;
    }
 
    // 生成图标元素字符串
    function elementStr(dataset) {
        var cd = dataset.menuName.length;
        var name = dataset.menuName;
        return '<div class="item" id="' + dataset.menuId + '" menuid="' + dataset.menuId
            + '" formid="' + dataset.formId + '"formtype="' + dataset.formType + '">'
            + '<a title="' + name + '">' + '<img data-id="' + dataset.menuId
            + '"  class="img" src="' + dataset.largImagePath + '"/>'
            + '<div class="dis">' + (cd > 6 ? name.substring(0, 6) + '<br>' + name.substring(6, cd) : name) + '</div>' + '</a>' + '</div>';
    }
 
    // 生成分组元素字符串
    function groupEleStr(groupName, className, item) {
        className = className ? className : '';
        if (groupName) {
            return '<fieldset class="fieldset ' + className + '">' + ' <legend>'
                + '<span class="group-name" data-name="' + groupName + '">'
                + groupName + '</span>' + '<span class="group-tree-bar">'
                + '<i class="iconfont icon-bianji" data-name="' + groupName
                + '"></i>' + '<i class="iconfont icon-lajixiang"></i>' + '</span>'
                + '</legend>' + ' <div class="items">' + item + '</div>' + '</fieldset>';
        } else {
            return '<div class="items">' + item + '</div>';
        }
    }
 
    function layout() {
        top.addTab('图标导航设置', '', '', '', '/general/layoutIcon/layoutIndex.jsp', '', '');
    }
</script>
</html>