|
|
|
@ -7,9 +7,33 @@ |
|
|
|
|
--%> |
|
|
|
|
<!DOCTYPE html> |
|
|
|
|
<html lang="en"> |
|
|
|
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <!--输出,条件,迭代标签库--> |
|
|
|
|
<%@ page pageEncoding="utf-8"%> |
|
|
|
|
<head> |
|
|
|
|
<script id="a_tmpl" type="text/x-jquery-tmpl"> |
|
|
|
|
<a href="#" class="list-group-item list-group-item-action list-group-item-success" id="menu{{= id}}" data-id="{{= id}}" data-name="{{= name}}" data-href="{{= href}}"></a> |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<script id="span_tmpl" type="text/x-jquery-tmpl"> |
|
|
|
|
|
|
|
|
|
{{if length>0}} |
|
|
|
|
|
|
|
|
|
{{= name}}<span class="badge badge-primary badge-pill">{{= length}}</span><i class="fas fa-angle-right"></i> |
|
|
|
|
|
|
|
|
|
{{else}} |
|
|
|
|
|
|
|
|
|
<span class="d-inline-block col-6 text-right">{{= name}}</span><span class="d-inline-block col-6 text-right"><i class="fas fa-adjust"></i></span> |
|
|
|
|
|
|
|
|
|
{{/if}} |
|
|
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<script id="button_tmpl" type="text/x-jquery-tmpl"> |
|
|
|
|
<button type="button" id="btn_{{= id}}" class="btn btn-secondary btn-lg" data-id="{{= id}}"> |
|
|
|
|
{{= name}} |
|
|
|
|
<i class="fas fa-times" style="display: none"></i> |
|
|
|
|
</button> |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
function showMenu() { |
|
|
|
|
var child = $("." + $(this).attr("id")); |
|
|
|
@ -39,30 +63,32 @@ |
|
|
|
|
|
|
|
|
|
for (var menu in menus) { |
|
|
|
|
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>'); |
|
|
|
|
|
|
|
|
|
menuId=$("#a_tmpl").tmpl({'id':id,'name':menus[menu].menuName,'href':menus[menu].href}).appendTo('.list-group'); |
|
|
|
|
|
|
|
|
|
if (menus[menu].menuLevel > 0) { |
|
|
|
|
$(menuId).addClass('offset-' + menus[menu].menuLevel).addClass('menu' + menus[menu].parentId); |
|
|
|
|
$(menuId).hide(); |
|
|
|
|
menuId.addClass('offset-' + menus[menu].menuLevel).addClass('menu' + menus[menu].parentId); |
|
|
|
|
menuId.hide(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$("#span_tmpl").tmpl({'name':menus[menu].menuName,'length':menus[menu].childMenu.length}).appendTo(menuId); |
|
|
|
|
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); |
|
|
|
|
menuId.click(showMenu); |
|
|
|
|
addMenu(menus[menu].childMenu,menus[menu].href); |
|
|
|
|
} else { |
|
|
|
|
// $(menuId+'>span:last').append('<i class="fas fa-adjust"></i>'); |
|
|
|
|
$(menuId).click(function () { |
|
|
|
|
btnId = '#btn' + $(this).attr('id'); |
|
|
|
|
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" data-id="' + $(this).attr('id') + '" href="#iframe' + $(this).attr('id') + '">' + $(this).text() + '\n' + |
|
|
|
|
$("#tabs").append('<button type="button" id="' + btnId.substr(1) + '" class="btn btn-secondary btn-lg" data-id="' + $(this).data('id') + '">' + $(this).text() + '\n' + |
|
|
|
|
' <i class="fas fa-times" style="display: none"></i>\n' + |
|
|
|
|
' </button>') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$(btnId).click(); |
|
|
|
|
|
|
|
|
|
iframe = '#iframe' + $(this).attr('id'); |
|
|
|
|
iframe = '#iframe_' + $(this).data('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' + |
|
|
|
@ -78,12 +104,14 @@ |
|
|
|
|
|
|
|
|
|
$(function () { |
|
|
|
|
addMenu(${menus}['data']); |
|
|
|
|
|
|
|
|
|
$("#datatmlp").tmpl() |
|
|
|
|
}); |
|
|
|
|
</script> |
|
|
|
|
</head> |
|
|
|
|
<div class="show" id="navbarNavDropdown"> |
|
|
|
|
<div class="col-2"> |
|
|
|
|
<div class="list-group" id="list-tab" role="tablist"> |
|
|
|
|
<div class="list-group"> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|