|
|
|
@ -35,33 +35,34 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function addMenu(menus, level, id) { |
|
|
|
|
function addMenu(menus) { |
|
|
|
|
|
|
|
|
|
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' + |
|
|
|
|
id = menus[menu].id; |
|
|
|
|
menuId = '#menu' + id; |
|
|
|
|
$("#list-tab").append('<a class="list-group-item list-group-item-action" id="' + menuId.substr(1) + '" data-toggle="list" data-href="'+menus[menu].href+'">\n' + |
|
|
|
|
' <span class="d-inline-block col-6 text-right">' + menus[menu].menuName + '</span>\n' + |
|
|
|
|
' </a>'); |
|
|
|
|
if (level > 0) { |
|
|
|
|
$(menuId).addClass('offset-' + level).addClass('menu' + id); |
|
|
|
|
if (menus[menu].menuLevel > 0) { |
|
|
|
|
$(menuId).addClass('offset-' + menus[menu].menuLevel).addClass('menu' + menus[menu].parentId); |
|
|
|
|
$(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); |
|
|
|
|
addMenu(menus[menu].childMenu,menus[menu].href); |
|
|
|
|
} else { |
|
|
|
|
// $(menuId+'>span:last').append('<i class="fas fa-adjust"></i>'); |
|
|
|
|
$(menuId).click(function () { |
|
|
|
|
btnId = '#btn' + $(this).data('id'); |
|
|
|
|
btnId = '#btn' + $(this).attr('id'); |
|
|
|
|
if ($(btnId).length == 0) { |
|
|
|
|
$("#tabs").append('<button type="button" id="' + btnId.substr(1) + '" class="btn btn-secondary btn-lg" data-id="'+$(this).data('id')+'" href="#iframe' + $(this).data('id') + '">' + $(this).text() + '\n' + |
|
|
|
|
$("#tabs").append('<button type="button" id="' + btnId.substr(1) + '" class="btn btn-secondary btn-lg" data-id="' + $(this).attr('id') + '" href="#iframe' + $(this).attr('id') + '">' + $(this).text() + '\n' + |
|
|
|
|
' <i class="fas fa-times" style="display: none"></i>\n' + |
|
|
|
|
' </button>') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(btnId).click(); |
|
|
|
|
|
|
|
|
|
iframe = '#iframe' + $(this).data('id'); |
|
|
|
|
iframe = '#iframe' + $(this).attr('id'); |
|
|
|
|
if ($(iframe).length == 0) { |
|
|
|
|
$(top.document).find('#nav-tabContent').append('<div id="' + iframe.substr(1) + '" class="tab-pane fade embed-responsive embed-responsive-16by9" >\n' + |
|
|
|
|
' <iframe class="embed-responsive-item" src="' + $(this).data('href') + '"></iframe>\n' + |
|
|
|
@ -76,9 +77,7 @@ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(function () { |
|
|
|
|
addMenu(${menus}.data, 0 |
|
|
|
|
) |
|
|
|
|
; |
|
|
|
|
addMenu(${menus}['data']); |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
</head> |
|
|
|
|