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.
 
 

86 lines
2.5 KiB

<%--
Created by IntelliJ IDEA.
User: 10295
Date: 2018/5/23
Time: 0:31
To change this template use File | Settings | File Templates.
--%>
<%@ page pageEncoding="utf-8" %>
<html>
<head>
<script id="form_tmpl" type="text/x-jquery-tmpl">
<div class="jumbotron text-center">
<div class="h1">{{= title}}</div>
<div class="row-fluid">
{{each data}}
<div class="btn-group">
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
{{= $value.name}}
</button>
<div class="dropdown-menu">
{{each $value.children}}
<a class="dropdown-item" data-type="{{= $value.tid}}">{{= $value.name}}</a>
{{/each}}
</div>
</div>
{{/each}}
</div>
</br>
<div class="input-group justify-content-center">
<div class="h3">筛选条件:</div>
<div class="input-group-prepend">
</div>
</div>
</div>
</script>
<script id="form_btn_tmpl" type="text/x-jquery-tmpl">
<button type="button" class="btn btn-outline-info" >{{= title}}<i class="fas fa-times"></i></button>
</script>
<script id="form_input_tmpl" type="text/x-jquery-tmpl">
<input type="hidden" name="typeId" id="type{{= value}}" value="{{= value}}"/>
</script>
<script>
$(function () {
regionJson =${regionJson};
$("#form_tmpl").tmpl({'title': '弹幕查询', 'data': regionJson}).appendTo('#queryForm');
$(".dropdown-item").click(function () {
$("#form_btn_tmpl").tmpl({'title':$(this).text()}).appendTo(".input-group-prepend");
$(this).hide();
$("#form_input_tmpl").tmpl({'value':$(this).data("type")}).prependTo("#queryForm");
});
$('.input-group-prepend').on('click','i',function () {
a=$('.dropdown-item:contains('+$(this).parent().text()+')');
a.show();
$(this).parent().remove();
$("#type"+a.data("type")).remove();
});
});
</script>
</head>
<body>
<form id="queryForm" action="/data/table">
</form>
</body>
</html>