peternameyakj
2024-10-24 7621191445c6f37f0d8253657560be6202778395
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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 
<%@ include file="include/pagetop.jsp"%>
 
<!DOCTYPE html>
<html>
 
    <head>
    
        <%@ include file="include/head.jsp"%>
    
        <style>
            .ifr-content {
                padding-top: 0!important;
                padding-left: 0!important;
            }    
            .ifr-refresh {
                position: absolute;
                top: 45px;
                right: 10px;
                z-index: 100;
            }    
            .ifr-tab {
                margin-top: 40px;
                margin-left: 180px;
/*                 margin-left: 190px; */
                overflow: hidden;
                background-color: #ffffff;
            }
            .ifr-tab .fa-close {
                margin-left: 5px;
            }    
            .ifr-tab-list {
                display: inline-block;
                float: left;
                height: 30px;
                line-height: 30px;
                font-size: 12px;
                padding: 0 20px;
                margin: 0 0 0 0;
                color: #acafb1;
                cursor: pointer;
            }    
            .ifr-tab-list-on {
                background-color: #e4e4e4;
                color: #565656 !important
            }    
            .btn-refresh-size {
                font-size: 20px;
            }
        </style>
    
    </head>
 
    <body>
 
        <div id="top" class="clearfix">
            <!-- Start App Logo -->
            <div class="applogo">
                <a href="#" class="logo">后台管理系统</a>
            </div>
            <!-- End App Logo -->
            <!-- Start Sidebar Show Hide Button -->
            <a href="#" class="sidebar-open-button"><i class="fa fa-bars"></i></a>
            <a href="#" class="sidebar-open-button-mobile"><i class="fa fa-bars"></i></a>
            <!-- End Sidebar Show Hide Button -->
            <!-- Start Top Menu -->
             <div>
                 <%@ include file="include/top.jsp"%>
             </div>             
        </div>
        
        <div class="sidebar clearfix hidden">        
            <%@ include file="include/menu_left.jsp"%>
        </div>
        
        <c:choose>
            <c:when test="${security.isRolesAccessible('ROLE_AGENT')}">
                <div class="ifr-tab marL0">
                     <div link="<%=basePath%>normal/adminUserAction!list.action" class="ifr-tab-list ifr-tab-list-on">用户基础管理</div>
                </div>
                <div class="ifr-refresh"><a class="btn-refresh-size" href="javascript:refresh();"><i class="fa fa-refresh"></i></a></div>
                <div class="content ifr-content marL0">
                    <iframe style="width: 100%;min-height: 1000px;" src="<%=basePath%>normal/adminUserAction!list.action" id="iframepage"
                        frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="iFrameHeight(0)">
                    </iframe>
                </div>
            </c:when>
            <c:otherwise>
    
                <!-- dapp+交易所 菜单 ######################################################################################################## -->
                <c:if test="${!security.isDappOrExchange()}">
                            
                    <div class="ifr-tab marL0">
                         <div link="<%=basePath%>normal/monitorIndexAdmin!view.action" class="ifr-tab-list ifr-tab-list-on">综合查询</div>
                    </div>
                    <div class="ifr-refresh"><a class="btn-refresh-size" href="javascript:refresh();"><i class="fa fa-refresh"></i></a></div>
                    <div class="content ifr-content marL0">
                        <iframe style="width: 100%;min-height: 1000px;" src="<%=basePath%>normal/monitorIndexAdmin!view.action" id="iframepage"
                             frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="iFrameHeight(0)">
                         </iframe>
                    </div>
        
                </c:if>
                
                <!-- 交易所 菜单 ############################################################################################################# -->
                <c:if test="${security.isDappOrExchange()}">
                
                    <div class="ifr-tab marL0">
                         <div link="<%=basePath%>normal/adminIndexAction!view.action" class="ifr-tab-list ifr-tab-list-on">综合查询</div>
                    </div>
                    <div class="ifr-refresh"><a class="btn-refresh-size" href="javascript:refresh();"><i class="fa fa-refresh"></i></a></div>
                    <div class="content ifr-content marL0">
                        <iframe style="width: 100%;min-height: 1000px;" src="<%=basePath%>normal/adminIndexAction!view.action" id="iframepage"
                             frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="iFrameHeight(0)">
                         </iframe>
                    </div>
            
                </c:if>
    
            </c:otherwise>
        </c:choose>
        
        <script>
            function iFrameHeight(index) {
                console.log(index, "index")
                var ifrId = "iframe" + index;
                if (index > 0) {
                    $("iframe").eq(index).attr("id", ifrId);
                } else {
                    ifrId = "iframepage"
                }
                var ifm = document.getElementById(ifrId);
                var subWeb = document.frames ? document.frames[ifrId].document : ifm.contentDocument;
                if (ifm != null && subWeb != null) {
                    ifm.height = subWeb.body.scrollHeight;
                    ifm.width = subWeb.body.scrollWidth;
                }
            }
        </script>
 
        <%@ include file="include/js.jsp"%>
        
    </body>
 
    <script>
        $(window).resize(function() {
            var ifm = document.getElementById("iframepage");
            var subWeb = document.frames ? document.frames["iframepage"].document : ifm.contentDocument;
            if (ifm != null && subWeb != null) {
                ifm.height = subWeb.body.scrollHeight + 40;
                ifm.width = subWeb.body.scrollWidth;
            }
        })
    </script>
    
    <script>
        var tabList = [];
        //点击左侧菜单添加tab
        $(".sidebar-panel a").click(function(e) {
            var title = $(this).find(".sp-title").html();
            var href = $(this).attr("href");
            var nowIndex = $(this).parent().index();
            if (nowIndex == 0) {
                $(".ifr-tab-list").removeClass("ifr-tab-list-on");
                $(".ifr-tab .ifr-tab-list").eq(0).addClass("ifr-tab-list-on");
                //iframe无刷新
                $("iframe").hide();
                $("#iframepage").show();
            } else {
                addTab(title, href, true);
            }
            e.preventDefault();
        })
        //点击头部综合查询菜单
        $(".dropdown-parent a").click(function(e) {
            $(".ifr-tab-list").removeClass("ifr-tab-list-on");
            $(".ifr-tab .ifr-tab-list").eq(0).addClass("ifr-tab-list-on");
            //iframe无刷新
            $("iframe").hide();
            $("#iframepage").show();
            e.preventDefault();
        })
        //点击头部下拉框添加tab
        $(".dropdown-menu a").click(function(e) {
            var title = $(this).find(".sp-title").html();
            var href = $(this).attr("href");
            addTab(title, href, true);
            e.preventDefault();
        })
 
        var menuList = [];
        var sidebarLen = $(".sidebar-panel a").length;
        var dropMenuLen = $(".dropdown-menu a").length;
        for (var i = 0; i < sidebarLen; i++) {
            menuList.push({
                url: $(".sidebar-panel a").eq(i).attr("href"),
                title: $(".sidebar-panel a").eq(i).find(".sp-title").html()
            })
        }
        for (var i = 0; i < dropMenuLen; i++) {
            menuList.push({
                url: $(".dropdown-menu a").eq(i).attr("href"),
                title: $(".dropdown-menu a").eq(i).find(".sp-title").html()
            })
        }
        //点击消息弹窗添加tab
        $("body").on("click", "#tip_alert a", function(e) {
            var title = "";
            var href = $(this).attr("href");
            var hrefNew = href.replace(/^https:\/\/[^/]+/, "");
            menuList.map(function(item) {
                var urlNew = item.url.replace(/^https:\/\/[^/]+/, "");
                if (urlNew == hrefNew) {
                    title = item.title
                }
                return item
            })
            if (title) {
                addTab(title, href, true);
                e.preventDefault();
            }
        })
        //点击消息弹窗添加tab
        $("body").on("click", ".add_tab a", function(e) {
            var title = "";
            var href = $(this).attr("href");
            href = href.split("?")[0];
            var hrefNew = href.replace(/^https:\/\/[^/]+/, "");
            menuList.map(function(item) {
                var urlNew = item.url.replace(/^https:\/\/[^/]+/, "");
                if (urlNew == hrefNew) {
                    title = item.title
                }
                return item
            })
            if (title) {
                addTab(title, href, true);
                e.preventDefault();
            }
        })
 
        function addTab(title, href, isFresh) {
            var oldHref = href;
            var href = href.split("?").length == 2 ? href.split("?")[0] : href;
            var hasIndex = -1;
 
            var hrefNew = href.replace(/^https:\/\/[^/]+/, "");
            
            tabList.map(function(item, index) {
                var itemNew = item.replace(/^https:\/\/[^/]+/, "");
                if (itemNew == hrefNew) {
                    hasIndex = index
                }
                return item;
            })
            if (hasIndex >= 0) {
                $(".ifr-tab-list").removeClass("ifr-tab-list-on");
                $(".ifr-tab .ifr-tab-list").eq(hasIndex + 1).addClass("ifr-tab-list-on");
                //iframe刷新
                // $("#iframepage").attr("src", tabList[hasIndex]);
                //iframe无刷新
                $("iframe").hide();
                var tabIndex = parseInt(hasIndex) + 1;
                $("iframe").eq(tabIndex).show();
                if (isFresh) {
                    $("iframe").eq(tabIndex).attr("src", oldHref);
                }
            } else {
                var newList = '<div class="ifr-tab-list ifr-tab-list-on" link="' +
                    oldHref + '">' + title + '<i class="fa fa-close"></i></div>';
                $(".ifr-tab-list").removeClass("ifr-tab-list-on");
                if ($(".ifr-tab .ifr-tab-list").length == 9) {
                    $(".ifr-tab .ifr-tab-list").eq(1).remove();
                    $("iframe").eq(1).remove();
                    tabList.shift();
                }
                $(".ifr-tab").append(newList);
                tabList.push(href);
 
                //iframe刷新
                // $("#iframepage").attr("src", href);
                //iframe无刷新
                $("iframe").hide();
                var index = $("iframe").length;
                var ifr_html = '<iframe style="width: 100%;min-height: 1000px;" src="' +
                    oldHref + '" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" onLoad="iFrameHeight(' +
                    index + ')"></iframe>'
                $(".ifr-content").append(ifr_html);
            }
        }
 
        //切换tab
        $(".ifr-tab").on("click", ".ifr-tab-list", function(e) {
            var src = $(this).attr("link");
            src = src.split("?").length == 2 ? src.split("?")[0] : src;
 
            $(".ifr-tab-list").removeClass("ifr-tab-list-on");
            $(this).addClass("ifr-tab-list-on");
            //iframe刷新
            // $("#iframepage").attr("src", src);
            //iframe无刷新
            var hasIndex = -1;
            tabList.map(function(item, index) {
                if (item == src) {
                    hasIndex = index
                }
                return item;
            })
            var tabIndex = parseInt(hasIndex) + 1;
            $("iframe").hide();
            if (hasIndex == -1) {
                $("#iframepage").show();
            } else {
                $("iframe").eq(tabIndex).show();
            }
        })
 
        //关闭tab
        $(".ifr-tab").on("click", ".fa-close", function(e) {
            var index = $(this).parent().index();
            var href = $(this).parent().attr("link");
            href = href.split("?").length == 2 ? href.split("?")[0] : href;
 
            var hasIndex = -1;
            tabList.map(function(item, index) {
                if (item == href) {
                    hasIndex = index;
                }
                return item;
            })
 
            if ($(".ifr-tab .ifr-tab-list").eq(index).hasClass("ifr-tab-list-on")) {
                var src = $(".ifr-tab .ifr-tab-list").eq(index - 1).attr("link");
                src = src.split("?").length == 2 ? src.split("?")[0] : src;
 
                $(".ifr-tab-list").removeClass("ifr-tab-list-on");
                $(".ifr-tab .ifr-tab-list").eq(index - 1).addClass("ifr-tab-list-on");
                $(".ifr-tab .ifr-tab-list").eq(index).remove();
                //iframe刷新
                // $("#iframepage").attr("src", src);
                //iframe无刷新
                var nowIndex = -1;
                tabList.map(function(item, index) {
                    if (item == src) {
                        nowIndex = index;
                    }
                    return item;
                })
                var tabIndex = parseInt(nowIndex) + 2;
                $("iframe").hide();
                if (nowIndex == -1) {
                    $("#iframepage").show();
                } else {
                    $("iframe").eq(nowIndex + 1).show();
                }
                $("iframe").eq(tabIndex).remove();
            } else {
                var tabIndex = parseInt(hasIndex) + 1;
                $("iframe").eq(tabIndex).remove();
                $(".ifr-tab .ifr-tab-list").eq(index).remove();
            }
            tabList.splice(hasIndex, 1);
            e.stopPropagation();
        })
 
        function refresh() {
            var href = $(".ifr-tab-list-on").attr("link");
            var hasIndex = -1;
            tabList.map(function(item, index) {
                if (item == href) {
                    hasIndex = index
                }
                return item;
            })
            var tabIndex = parseInt(hasIndex) + 1;
            $("iframe").eq(tabIndex).attr("src", href);
        }
    </script>
 
</html>