查询条件支持下拉多选

This commit is contained in:
RuoYi
2019-05-14 12:23:59 +08:00
parent 0bad889607
commit 7555e5aef1
10 changed files with 3681 additions and 7 deletions

View File

@ -52,7 +52,7 @@
<script th:src="@{/ajax/libs/jquery-ztree/3.5/js/jquery.ztree.all-3.5.js}"></script>
</div>
<!-- select下拉框插件 -->
<!-- select2下拉框插件 -->
<div th:fragment="select2-css">
<link th:href="@{/ajax/libs/select/select2.css}" rel="stylesheet"/>
<link th:href="@{/ajax/libs/select/select2-bootstrap.css}" rel="stylesheet"/>
@ -61,6 +61,14 @@
<script th:src="@{/ajax/libs/select/select2.js}"></script>
</div>
<!-- bootstrap-select下拉框插件 -->
<div th:fragment="bootstrap-select-css">
<link th:href="@{/ajax/libs/bootstrap-select/bootstrap-select.css}" rel="stylesheet"/>
</div>
<div th:fragment="bootstrap-select-js">
<script th:src="@{/ajax/libs/bootstrap-select/bootstrap-select.js}"></script>
</div>
<!-- datetimepicker日期和时间插件 -->
<div th:fragment="datetimepicker-css">
<link th:href="@{/ajax/libs/datapicker/bootstrap-datetimepicker.min.css}" rel="stylesheet"/>

View File

@ -2,6 +2,7 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('操作日志列表')" />
<th:block th:include="include :: bootstrap-select-css" />
</head>
<body class="gray-bg">
<div class="container-div">
@ -16,9 +17,8 @@
<li>
<label>操作人员: </label><input type="text" name="operName"/>
</li>
<li>
<label>操作类型: </label><select name="businessType" th:with="type=${@dict.getType('sys_oper_type')}">
<option value="">所有</option>
<li class="select-selectpicker">
<label>操作类型: </label><select id="businessTypes" th:with="type=${@dict.getType('sys_oper_type')}" class="selectpicker" data-none-selected-text="请选择" multiple>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
@ -35,8 +35,8 @@
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<a class="btn btn-primary btn-rounded btn-sm" onclick="searchPre()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
@ -62,6 +62,7 @@
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-select-js" />
<script th:inline="javascript">
var detailFlag = [[${@permission.hasPermi('monitor:operlog:detail')}]];
var datas = [[${@dict.getType('sys_oper_type')}]];
@ -146,6 +147,17 @@
};
$.table.init(options);
});
function searchPre() {
var data = {};
data.businessTypes = $.common.join($('#businessTypes').selectpicker('val'));
$.table.search('operlog-form', data);
}
function resetPre() {
$.form.reset();
$("#businessTypes").selectpicker('refresh');
}
</script>
</body>
</html>