字典表维护增加字典分项、字典名称、字典类别查询过滤
This commit is contained in:
parent
6419ca64e7
commit
3befbf327b
|
@ -6,6 +6,10 @@ namespace Bootstrap.Admin.Models
|
|||
{
|
||||
public class QueryDictOption : PaginationOption
|
||||
{
|
||||
/// <summary>
|
||||
/// 字典分项
|
||||
/// </summary>
|
||||
public string Category { get; set; }
|
||||
/// <summary>
|
||||
/// 字典名称
|
||||
/// </summary>
|
||||
|
@ -21,6 +25,10 @@ namespace Bootstrap.Admin.Models
|
|||
public QueryData<Dict> RetrieveData()
|
||||
{
|
||||
var data = DictHelper.RetrieveDicts();
|
||||
if (!string.IsNullOrEmpty(Category))
|
||||
{
|
||||
data = data.Where(t => t.Category.Contains(Category));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(Name))
|
||||
{
|
||||
data = data.Where(t => t.Name.Contains(Name));
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
$('table').smartTable({
|
||||
url: '../api/Dicts', //请求后台的URL(*)
|
||||
sortName: 'Category',
|
||||
queryParams: function (params) { return $.extend(params, { name: $("#txt_dict_name").val(), define: $("#txt_dict_cate").val() }); },
|
||||
queryParams: function (params) { return $.extend(params, { category: $('#txt_dict_cate').val(), name: $("#txt_dict_name").val(), define: $("#txt_dict_define").val() }); },
|
||||
columns: [{ checkbox: true },
|
||||
{ title: "Id", field: "ID", events: bsa.idEvents(), formatter: BootstrapAdmin.idFormatter },
|
||||
{ title: "字典分项", field: "Category", sortable: true },
|
||||
|
|
|
@ -14,21 +14,25 @@
|
|||
}
|
||||
@section query {
|
||||
<form class="form-inline" role="form">
|
||||
<div class="form-group col-lg-5">
|
||||
<label class="control-label" for="txt_dict_name">字典分项</label>
|
||||
<div class="form-group col-lg-3">
|
||||
<label class="control-label" for="txt_dict_cate">字典分项</label>
|
||||
<input type="text" class="form-control" id="txt_dict_cate" />
|
||||
</div>
|
||||
<div class="form-group col-lg-3">
|
||||
<label class="control-label" for="txt_dict_name">字典名称</label>
|
||||
<input type="text" class="form-control" id="txt_dict_name" />
|
||||
</div>
|
||||
<div class="form-group col-lg-5">
|
||||
<label class="control-label" for="txt_dict_cate">字典类别</label>
|
||||
<input type="text" class="form-control hide" id="txt_dict_cate" />
|
||||
<div class="form-group col-lg-3">
|
||||
<label class="control-label" for="txt_dict_define">字典类别</label>
|
||||
<input type="text" class="form-control hide" id="txt_dict_define" />
|
||||
<div class="btn-group">
|
||||
<button type="button" class="btn btn-default">未选择</button>
|
||||
<button type="button" class="btn btn-default">全部</button>
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
|
||||
<span class="caret"></span>
|
||||
<span class="sr-only">下拉按钮</span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu">
|
||||
<li><a href="#" data-val="">未选择</a></li>
|
||||
<li><a href="#" data-val="">全部</a></li>
|
||||
<li><a href="#" data-val="1">自定义</a></li>
|
||||
<li><a href="#" data-val="0">系统使用</a></li>
|
||||
</ul>
|
||||
|
@ -59,7 +63,7 @@
|
|||
<label class="control-label" for="dictCode">字典代码</label>
|
||||
<input type="text" class="form-control" id="dictCode" name="dictCode" maxlength="50" />
|
||||
</div>
|
||||
<div class="form-group col-lg-6">
|
||||
<div class="form-group col-lg-2">
|
||||
<label class="control-label" for="dictDefine">字典类别</label>
|
||||
<input type="text" class="form-control" id="dictDefine" name="dictDefine" maxlength="50" />
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue