From 3befbf327b354eacdf7a2a51ec4838cc41addef2 Mon Sep 17 00:00:00 2001 From: Argo-Lenovo Date: Sat, 5 Nov 2016 18:43:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E8=A1=A8=E7=BB=B4=E6=8A=A4?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=AD=97=E5=85=B8=E5=88=86=E9=A1=B9=E3=80=81?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E5=90=8D=E7=A7=B0=E3=80=81=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E7=B1=BB=E5=88=AB=E6=9F=A5=E8=AF=A2=E8=BF=87=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/Models/QueryDictOption.cs | 8 ++++++++ Bootstrap.Admin/Scripts/Dicts.js | 2 +- Bootstrap.Admin/Views/Admin/Dicts.cshtml | 20 ++++++++++++-------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Bootstrap.Admin/Models/QueryDictOption.cs b/Bootstrap.Admin/Models/QueryDictOption.cs index 92a414c1..60d4ec8a 100644 --- a/Bootstrap.Admin/Models/QueryDictOption.cs +++ b/Bootstrap.Admin/Models/QueryDictOption.cs @@ -6,6 +6,10 @@ namespace Bootstrap.Admin.Models { public class QueryDictOption : PaginationOption { + /// + /// 字典分项 + /// + public string Category { get; set; } /// /// 字典名称 /// @@ -21,6 +25,10 @@ namespace Bootstrap.Admin.Models public QueryData 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)); diff --git a/Bootstrap.Admin/Scripts/Dicts.js b/Bootstrap.Admin/Scripts/Dicts.js index 0b98cfe6..b80869dc 100644 --- a/Bootstrap.Admin/Scripts/Dicts.js +++ b/Bootstrap.Admin/Scripts/Dicts.js @@ -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 }, diff --git a/Bootstrap.Admin/Views/Admin/Dicts.cshtml b/Bootstrap.Admin/Views/Admin/Dicts.cshtml index 86072446..53edc9fe 100644 --- a/Bootstrap.Admin/Views/Admin/Dicts.cshtml +++ b/Bootstrap.Admin/Views/Admin/Dicts.cshtml @@ -14,21 +14,25 @@ } @section query {
-
- +
+ + +
+
+
-
- - +
+ +
- + @@ -59,7 +63,7 @@
-
+