You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.7 KiB
81 lines
2.7 KiB
<%--
|
|
Created by IntelliJ IDEA.
|
|
User: 10295
|
|
Date: 2018/4/15
|
|
Time: 23:25
|
|
To change this template use File | Settings | File Templates.
|
|
--%>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!--输出,条件,迭代标签库-->
|
|
<%@ page pageEncoding="utf-8" %>
|
|
|
|
<script>
|
|
function showMenu() {
|
|
var child = $("." + $(this).attr("id"));
|
|
i = $(this).find('i');
|
|
classPrefix = 'fas fa-angle-';
|
|
if (i.attr('class') == classPrefix + 'right') {
|
|
i.attr('class', classPrefix + 'down');
|
|
child.fadeIn()
|
|
} else {
|
|
i.attr('class', classPrefix + 'right');
|
|
hideMenu(child)
|
|
}
|
|
}
|
|
|
|
function hideMenu(child) {
|
|
if (child.length > 1) {
|
|
child.find('i').attr('class', classPrefix + 'right');
|
|
}
|
|
child.each(function () {
|
|
$(this).fadeOut();
|
|
hideMenu($("." + $(this).attr('id')));
|
|
})
|
|
}
|
|
|
|
|
|
function addMenu(menus, level,id) {
|
|
|
|
for (var menu in menus) {
|
|
href = menus[menu].href;
|
|
menuId='#menu'+menus[menu].id;
|
|
$("#list-tab").append('<a class="list-group-item list-group-item-action" data-href="'+menus[menu].href+'" data-id="'+menus[menu].id+'" id="' + menuId.substr(1) + '" data-toggle="list">\n' +
|
|
' ' + menus[menu].menuName + '\n' +
|
|
' </a>');
|
|
if (level > 0) {
|
|
$(menuId).addClass('offset-' + level).addClass('menu' + id);
|
|
$(menuId).hide();
|
|
}
|
|
if (menus[menu].childMenu.length > 0) {
|
|
$(menuId).append('<i class="fas fa-angle-right"></i><span class="badge badge-primary badge-pill offset-8">' + menus[menu].childMenu.length + '</span>').click(showMenu);
|
|
addMenu(menus[menu].childMenu, level + 1, menus[menu].id);
|
|
} else {
|
|
$(menuId).click(function () {
|
|
btnId='#btn'+$(this).data('id');
|
|
if ($(btnId).length == 0) {
|
|
$("#tabs").append('<button type="button" id="' + btnId.substr(1) + '" class="btn btn-secondary btn-lg">' + $(this).text() + '\n' +
|
|
' <i class="fas fa-times" style="display: none"></i>\n' +
|
|
' </button>')
|
|
}
|
|
|
|
$(top.document).find('.navbar>' + btnId).click();
|
|
$(top.document).find('#myIframe').attr('src', $(this).data('href'));
|
|
});
|
|
}
|
|
}
|
|
}
|
|
|
|
$(function () {
|
|
addMenu(${menus}.data, 0
|
|
)
|
|
;
|
|
});
|
|
</script>
|
|
|
|
<div class="list-group col-2 float-left" id="list-tab" role="tablist">
|
|
|
|
</div>
|
|
|
|
|
|
</html>
|
|
|