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.
145 lines
4.7 KiB
145 lines
4.7 KiB
6 years ago
|
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||
6 years ago
|
<%--
|
||
|
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>
|
||
6 years ago
|
<style>
|
||
|
.gold {
|
||
|
background: gold;
|
||
|
color: black;
|
||
|
margin-right: 5px;
|
||
|
}
|
||
|
</style>
|
||
|
|
||
6 years ago
|
<script id="form_tmpl" type="text/x-jquery-tmpl">
|
||
|
|
||
|
<div class="jumbotron text-center">
|
||
|
<div class="h1">{{= title}}</div>
|
||
6 years ago
|
<div class="col-auto">
|
||
6 years ago
|
{{each data}}
|
||
|
|
||
|
<div class="btn-group">
|
||
6 years ago
|
<button type="button" class="btn btn-info dropdown-toggle gold" data-toggle="dropdown"
|
||
6 years ago
|
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>
|
||
|
|
||
6 years ago
|
<div id="typeButton" class="input-group-prepend">
|
||
6 years ago
|
|
||
|
</div>
|
||
|
|
||
|
</div>
|
||
6 years ago
|
|
||
|
</br>
|
||
|
|
||
|
<div class="form-row justify-content-center">
|
||
|
<div class="col-auto">
|
||
|
<label class="sr-only" for="inlineFormInputGroup">Username</label>
|
||
|
<div class="input-group mb-2">
|
||
|
<div class="input-group-prepend">
|
||
|
<div class="input-group-text">关键词</div>
|
||
|
</div>
|
||
|
<input type="text" class="form-control" name="title" <c:if test="${!empty command}"> value="${command.title}"</c:if>>
|
||
|
</div>
|
||
|
</div>
|
||
|
<div class="col-auto">
|
||
6 years ago
|
<button type="button" class="btn btn-secondary" id="query">查询</button>
|
||
|
</div>
|
||
|
<div class="col-auto">
|
||
|
<button type="button" class="btn btn-secondary" id="download">下载选中弹幕</button>
|
||
6 years ago
|
</div>
|
||
|
</div>
|
||
|
|
||
6 years ago
|
</div>
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<script id="form_btn_tmpl" type="text/x-jquery-tmpl">
|
||
6 years ago
|
<button type="button" class="btn btn-outline-info" >{{= title}}<i class="fas fa-times" data-type="{{= type}}"></i></button>
|
||
|
|
||
|
|
||
6 years ago
|
</script>
|
||
|
|
||
|
<script id="form_input_tmpl" type="text/x-jquery-tmpl">
|
||
6 years ago
|
<input type="hidden" name="typeIds" id="type{{= value}}" value="{{= value}}"/>
|
||
6 years ago
|
</script>
|
||
|
|
||
|
<script>
|
||
|
$(function () {
|
||
|
|
||
|
regionJson =${regionJson};
|
||
6 years ago
|
$("#form_tmpl").tmpl({'title': '弹幕查询', 'data': regionJson}).appendTo('#queryDiv');
|
||
6 years ago
|
|
||
|
$(".dropdown-item").click(function () {
|
||
6 years ago
|
$("#form_btn_tmpl").tmpl({'title': $(this).text(),'type':$(this).data("type")}).appendTo("#typeButton");
|
||
6 years ago
|
$(this).hide();
|
||
6 years ago
|
$("#form_input_tmpl").tmpl({
|
||
|
'value': $(this).data("type"),
|
||
|
'index': $("input[id^=type]").length
|
||
|
}).prependTo("#queryDiv");
|
||
6 years ago
|
});
|
||
|
|
||
6 years ago
|
<c:if test="${!empty command&&!empty command.typeIds}">
|
||
|
<c:forEach items="${command.typeIds}" var="typeId">
|
||
|
$('.dropdown-item[data-type=${typeId}]').click();
|
||
|
</c:forEach>
|
||
|
</c:if>
|
||
|
|
||
6 years ago
|
$('.input-group-prepend').on('click', 'i', function () {
|
||
6 years ago
|
$(this).parent().remove();
|
||
6 years ago
|
$("#type" + $(this).data("type")).remove();
|
||
6 years ago
|
$(".dropdown-item[data-type="+$(this).data("type")+"]").show();
|
||
6 years ago
|
});
|
||
|
|
||
6 years ago
|
$("#query,#pageButton button").click(function () {
|
||
6 years ago
|
$("#pageForm").attr("action","/data/table?currentPage="+($(this).val()==''?0:$(this).val())+"&pageSize=${datas.pageSize}").submit();
|
||
6 years ago
|
});
|
||
6 years ago
|
|
||
6 years ago
|
$("#download").click(function(){
|
||
|
if($("input[name=cids]:not([disabled]):checked").length==0){
|
||
|
alert("清选中需要下载的弹幕");
|
||
|
return;
|
||
|
}
|
||
|
var fileNmae;
|
||
|
if($("#query").val()!=''){
|
||
|
fileNmae=$("#query").val();
|
||
|
}else{
|
||
|
fileNmae=new Date().getTime();
|
||
|
}
|
||
|
$("#pageForm").attr("action","/data/download?fileName="+fileNmae).submit();
|
||
6 years ago
|
});
|
||
|
|
||
|
});
|
||
|
</script>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
6 years ago
|
<div id="queryDiv">
|
||
6 years ago
|
|
||
6 years ago
|
</div>
|
||
6 years ago
|
|
||
|
</body>
|
||
|
</html>
|