From 2f2aedc432db35cb9287dc7d86612cd5d0292991 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Thu, 31 Aug 2017 19:54:12 +0800 Subject: [PATCH] complete user list --- OpenAuth.App/CategoryManagerApp.cs | 4 +- OpenAuth.App/OrgManagerApp.cs | 4 +- OpenAuth.App/RoleManagerApp.cs | 4 +- OpenAuth.App/UserManagerApp.cs | 4 +- OpenAuth.App/ViewModel/GridData.cs | 14 +- OpenAuth.App/WFFormService.cs | 2 +- OpenAuth.App/WFProcessInstanceService.cs | 6 +- OpenAuth.App/WFSchemeService.cs | 2 +- .../Controllers/UserManagerController.cs | 2 +- OpenAuth.Mvc/OpenAuth.Mvc.csproj | 1 - OpenAuth.Mvc/Views/UserManager/Index.cshtml | 17 +- OpenAuth.Mvc/js/users.js | 31 +- OpenAuth.Mvc/json/usersList.json | 367 ------------------ 13 files changed, 53 insertions(+), 405 deletions(-) delete mode 100644 OpenAuth.Mvc/json/usersList.json diff --git a/OpenAuth.App/CategoryManagerApp.cs b/OpenAuth.App/CategoryManagerApp.cs index 3250caad..dd593c01 100644 --- a/OpenAuth.App/CategoryManagerApp.cs +++ b/OpenAuth.App/CategoryManagerApp.cs @@ -73,9 +73,9 @@ namespace OpenAuth.App }; return new GridData() { - records = total, + count = total, total = (int)Math.Ceiling((double)total/pagesize), - rows = query.ToList(), + data = query.ToList(), page = pageindex }; } diff --git a/OpenAuth.App/OrgManagerApp.cs b/OpenAuth.App/OrgManagerApp.cs index 1e1c7aab..4587fdc0 100644 --- a/OpenAuth.App/OrgManagerApp.cs +++ b/OpenAuth.App/OrgManagerApp.cs @@ -44,8 +44,8 @@ namespace OpenAuth.App return new GridData { page = 1, - rows = query.ToList(), - records = query.Count(), + data = query.ToList(), + count = query.Count(), total = 1 }; } diff --git a/OpenAuth.App/RoleManagerApp.cs b/OpenAuth.App/RoleManagerApp.cs index 60a70c00..e63df70a 100644 --- a/OpenAuth.App/RoleManagerApp.cs +++ b/OpenAuth.App/RoleManagerApp.cs @@ -67,9 +67,9 @@ namespace OpenAuth.App var result = new GridData { - records = total, + count = total, total = (int)Math.Ceiling((double)total/pagesize), - rows = rolevms.ToList(), + data = rolevms.ToList(), page = pageindex }; diff --git a/OpenAuth.App/UserManagerApp.cs b/OpenAuth.App/UserManagerApp.cs index bf17d479..f303e13c 100644 --- a/OpenAuth.App/UserManagerApp.cs +++ b/OpenAuth.App/UserManagerApp.cs @@ -71,9 +71,9 @@ namespace OpenAuth.App return new GridData { - records = records, + count = records, total = (int)Math.Ceiling((double)records / pagesize), - rows = userviews, + data = userviews, page = pageindex }; } diff --git a/OpenAuth.App/ViewModel/GridData.cs b/OpenAuth.App/ViewModel/GridData.cs index c19e38fd..45315976 100644 --- a/OpenAuth.App/ViewModel/GridData.cs +++ b/OpenAuth.App/ViewModel/GridData.cs @@ -18,7 +18,15 @@ namespace OpenAuth.App.ViewModel /// jqGrid的返回值 /// public class GridData - { + { + /// + /// 状态码 + /// + public int code; + /// + /// 操作消息 + /// + public string msg; /// /// 页码 /// @@ -30,11 +38,11 @@ namespace OpenAuth.App.ViewModel /// /// 总记录条数 /// - public int records; + public int count; /// /// 数据内容 /// - public dynamic rows; + public dynamic data; } } \ No newline at end of file diff --git a/OpenAuth.App/WFFormService.cs b/OpenAuth.App/WFFormService.cs index 234e293f..346bd94a 100644 --- a/OpenAuth.App/WFFormService.cs +++ b/OpenAuth.App/WFFormService.cs @@ -44,7 +44,7 @@ namespace OpenAuth.App int cnt = _unitWork.Find(null).Count(); result.total = cnt % pageSize == 0 ? cnt / pageSize : cnt / pageSize + 1; - result.rows = _unitWork.Find(pageCurrent, pageSize, "ModifyDate descending", null).ToList(); + result.data = _unitWork.Find(pageCurrent, pageSize, "ModifyDate descending", null).ToList(); return result; } diff --git a/OpenAuth.App/WFProcessInstanceService.cs b/OpenAuth.App/WFProcessInstanceService.cs index fe9906c1..a03a3c93 100644 --- a/OpenAuth.App/WFProcessInstanceService.cs +++ b/OpenAuth.App/WFProcessInstanceService.cs @@ -315,19 +315,19 @@ namespace OpenAuth.App if (type == "inbox") //待办事项 { result.total = cnt%pageSize == 0? cnt/pageSize : cnt/pageSize + 1; - result.rows = _unitWork.Find(pageCurrent, pageSize, "CreateDate descending", null).ToList(); + result.data = _unitWork.Find(pageCurrent, pageSize, "CreateDate descending", null).ToList(); } else if (type == "outbox") //已办事项 { result.total = cnt % pageSize == 0 ? cnt / pageSize : cnt / pageSize + 1; - result.rows = _unitWork.Find(pageCurrent, pageSize, "CreateDate descending", null).ToList(); + result.data = _unitWork.Find(pageCurrent, pageSize, "CreateDate descending", null).ToList(); } else //我的流程 { result.total = cnt % pageSize == 0 ? cnt / pageSize : cnt / pageSize + 1; - result.rows = _unitWork.Find(pageCurrent, pageSize, "CreateDate descending", null).ToList(); + result.data = _unitWork.Find(pageCurrent, pageSize, "CreateDate descending", null).ToList(); } return result; diff --git a/OpenAuth.App/WFSchemeService.cs b/OpenAuth.App/WFSchemeService.cs index e65d1000..f45c5dc0 100644 --- a/OpenAuth.App/WFSchemeService.cs +++ b/OpenAuth.App/WFSchemeService.cs @@ -116,7 +116,7 @@ namespace OpenAuth.App int cnt = _unitWork.Find(null).Count(); result.total = cnt%pageSize ==0?cnt/pageSize:cnt/pageSize+1; - result.rows = _unitWork.Find(pageCurrent, pageSize, "ModifyDate descending", null).ToList(); + result.data = _unitWork.Find(pageCurrent, pageSize, "ModifyDate descending", null).ToList(); return result; } diff --git a/OpenAuth.Mvc/Controllers/UserManagerController.cs b/OpenAuth.Mvc/Controllers/UserManagerController.cs index 493bd305..5125d709 100644 --- a/OpenAuth.Mvc/Controllers/UserManagerController.cs +++ b/OpenAuth.Mvc/Controllers/UserManagerController.cs @@ -69,7 +69,7 @@ namespace OpenAuth.Mvc.Controllers /// public string GetAccessedUsers() { - IEnumerable users = App.Load(Guid.Empty, 1, 10).rows; + IEnumerable users = App.Load(Guid.Empty, 1, 10).data; var result = new Dictionary(); foreach (var user in users) { diff --git a/OpenAuth.Mvc/OpenAuth.Mvc.csproj b/OpenAuth.Mvc/OpenAuth.Mvc.csproj index 9b42eef9..100e4003 100644 --- a/OpenAuth.Mvc/OpenAuth.Mvc.csproj +++ b/OpenAuth.Mvc/OpenAuth.Mvc.csproj @@ -350,7 +350,6 @@ - diff --git a/OpenAuth.Mvc/Views/UserManager/Index.cshtml b/OpenAuth.Mvc/Views/UserManager/Index.cshtml index fb366d10..0b4020f4 100644 --- a/OpenAuth.Mvc/Views/UserManager/Index.cshtml +++ b/OpenAuth.Mvc/Views/UserManager/Index.cshtml @@ -20,21 +20,16 @@
    - - - - - - - - - - + + + + + diff --git a/OpenAuth.Mvc/js/users.js b/OpenAuth.Mvc/js/users.js index 01d41826..4c01ecd9 100644 --- a/OpenAuth.Mvc/js/users.js +++ b/OpenAuth.Mvc/js/users.js @@ -1,10 +1,12 @@ layui.config({ base: "/js/" -}).use(['form','ztree', 'layer', 'jquery', 'table'], function () { +}).use(['form', 'ztree', 'layer', 'jquery', 'table'], function () { var form = layui.form, layer = parent.layer === undefined ? layui.layer : parent.layer, $ = layui.jquery; + var dataurl = '/UserManager/Load'; var table = layui.table; + var ztree = function () { var url = '/OrgManager/LoadOrg'; @@ -24,14 +26,25 @@ layui.config({ }, callback: { onClick: function (event, treeId, treeNode) { - // list.reload(treeNode.Id); + table.reload('mainList', { + where: { + url:dataurl, + orgId: treeNode.Id + } + }); } } }; var load = function () { $.getJSON(url, function (json) { var zTreeObj = $.fn.zTree.init($("#tree"), setting, json); - // list.reload(); + table.reload('mainList', { + url: dataurl, + where: { + orgId: json[0].Id + } //设定异步数据接口的额外参数 + //,height: 300 + }); zTreeObj.expandAll(true); }); }; @@ -67,7 +80,7 @@ layui.config({ var checkStatus = table.checkStatus('mainList') , data = checkStatus.data; layer.alert(JSON.stringify(data)); - }, addData:function() { //添加 + }, addData: function () { //添加 var index = layui.layer.open({ title: "添加", type: 2, @@ -76,8 +89,8 @@ layui.config({ setTimeout(function () { layui.layer.tips('点击此处返回列表', '.layui-layer-setwin .layui-layer-close', { - tips: 3 - }); + tips: 3 + }); }, 500); } }); @@ -86,13 +99,13 @@ layui.config({ layui.layer.full(index); }); layui.layer.full(index); - }, search:function() { //搜索 + }, search: function () { //搜索 var key = $('#key'); table.reload('mainList', { where: { - key: key.val(), - para1:"1" + url: dataurl, + key: key.val() } }); } diff --git a/OpenAuth.Mvc/json/usersList.json b/OpenAuth.Mvc/json/usersList.json deleted file mode 100644 index 7866710e..00000000 --- a/OpenAuth.Mvc/json/usersList.json +++ /dev/null @@ -1,367 +0,0 @@ -{ - "code": 0, - "msg": "", - "count": 1000, - "data": [ - { - "id": 10000, - "username": "user-0", - "sex": "女", - "city": "城市-0", - "sign": "签名-0", - "experience": 255, - "logins": 24, - "wealth": 82830700, - "classify": "作家", - "score": 57 - }, - { - "id": 10001, - "username": "user-1", - "sex": "男", - "city": "城市-1", - "sign": "签名-1", - "experience": 884, - "logins": 58, - "wealth": 64928690, - "classify": "词人", - "score": 27 - }, - { - "id": 10002, - "username": "user-2", - "sex": "女", - "city": "城市-2", - "sign": "签名-2", - "experience": 650, - "logins": 77, - "wealth": 6298078, - "classify": "酱油", - "score": 31 - }, - { - "id": 10003, - "username": "user-3", - "sex": "女", - "city": "城市-3", - "sign": "签名-3", - "experience": 362, - "logins": 157, - "wealth": 37117017, - "classify": "诗人", - "score": 68 - }, - { - "id": 10004, - "username": "user-4", - "sex": "男", - "city": "城市-4", - "sign": "签名-4", - "experience": 807, - "logins": 51, - "wealth": 76263262, - "classify": "作家", - "score": 6 - }, - { - "id": 10005, - "username": "user-5", - "sex": "女", - "city": "城市-5", - "sign": "签名-5", - "experience": 173, - "logins": 68, - "wealth": 60344147, - "classify": "作家", - "score": 87 - }, - { - "id": 10006, - "username": "user-6", - "sex": "女", - "city": "城市-6", - "sign": "签名-6", - "experience": 982, - "logins": 37, - "wealth": 57768166, - "classify": "作家", - "score": 34 - }, - { - "id": 10007, - "username": "user-7", - "sex": "男", - "city": "城市-7", - "sign": "签名-7", - "experience": 727, - "logins": 150, - "wealth": 82030578, - "classify": "作家", - "score": 28 - }, - { - "id": 10008, - "username": "user-8", - "sex": "男", - "city": "城市-8", - "sign": "签名-8", - "experience": 951, - "logins": 133, - "wealth": 16503371, - "classify": "词人", - "score": 14 - }, - { - "id": 10009, - "username": "user-9", - "sex": "女", - "city": "城市-9", - "sign": "签名-9", - "experience": 484, - "logins": 25, - "wealth": 86801934, - "classify": "词人", - "score": 75 - }, - { - "id": 10010, - "username": "user-10", - "sex": "女", - "city": "城市-10", - "sign": "签名-10", - "experience": 1016, - "logins": 182, - "wealth": 71294671, - "classify": "诗人", - "score": 34 - }, - { - "id": 10011, - "username": "user-11", - "sex": "女", - "city": "城市-11", - "sign": "签名-11", - "experience": 492, - "logins": 107, - "wealth": 8062783, - "classify": "诗人", - "score": 6 - }, - { - "id": 10012, - "username": "user-12", - "sex": "女", - "city": "城市-12", - "sign": "签名-12", - "experience": 106, - "logins": 176, - "wealth": 42622704, - "classify": "词人", - "score": 54 - }, - { - "id": 10013, - "username": "user-13", - "sex": "男", - "city": "城市-13", - "sign": "签名-13", - "experience": 1047, - "logins": 94, - "wealth": 59508583, - "classify": "诗人", - "score": 63 - }, - { - "id": 10014, - "username": "user-14", - "sex": "男", - "city": "城市-14", - "sign": "签名-14", - "experience": 873, - "logins": 116, - "wealth": 72549912, - "classify": "词人", - "score": 8 - }, - { - "id": 10015, - "username": "user-15", - "sex": "女", - "city": "城市-15", - "sign": "签名-15", - "experience": 1068, - "logins": 27, - "wealth": 52737025, - "classify": "作家", - "score": 28 - }, - { - "id": 10016, - "username": "user-16", - "sex": "女", - "city": "城市-16", - "sign": "签名-16", - "experience": 862, - "logins": 168, - "wealth": 37069775, - "classify": "酱油", - "score": 86 - }, - { - "id": 10017, - "username": "user-17", - "sex": "女", - "city": "城市-17", - "sign": "签名-17", - "experience": 1060, - "logins": 187, - "wealth": 66099525, - "classify": "作家", - "score": 69 - }, - { - "id": 10018, - "username": "user-18", - "sex": "女", - "city": "城市-18", - "sign": "签名-18", - "experience": 866, - "logins": 88, - "wealth": 81722326, - "classify": "词人", - "score": 74 - }, - { - "id": 10019, - "username": "user-19", - "sex": "女", - "city": "城市-19", - "sign": "签名-19", - "experience": 682, - "logins": 106, - "wealth": 68647362, - "classify": "词人", - "score": 51 - }, - { - "id": 10020, - "username": "user-20", - "sex": "男", - "city": "城市-20", - "sign": "签名-20", - "experience": 770, - "logins": 24, - "wealth": 92420248, - "classify": "诗人", - "score": 87 - }, - { - "id": 10021, - "username": "user-21", - "sex": "男", - "city": "城市-21", - "sign": "签名-21", - "experience": 184, - "logins": 131, - "wealth": 71566045, - "classify": "词人", - "score": 99 - }, - { - "id": 10022, - "username": "user-22", - "sex": "男", - "city": "城市-22", - "sign": "签名-22", - "experience": 739, - "logins": 152, - "wealth": 60907929, - "classify": "作家", - "score": 18 - }, - { - "id": 10023, - "username": "user-23", - "sex": "女", - "city": "城市-23", - "sign": "签名-23", - "experience": 127, - "logins": 82, - "wealth": 14765943, - "classify": "作家", - "score": 30 - }, - { - "id": 10024, - "username": "user-24", - "sex": "女", - "city": "城市-24", - "sign": "签名-24", - "experience": 212, - "logins": 133, - "wealth": 59011052, - "classify": "词人", - "score": 76 - }, - { - "id": 10025, - "username": "user-25", - "sex": "女", - "city": "城市-25", - "sign": "签名-25", - "experience": 938, - "logins": 182, - "wealth": 91183097, - "classify": "作家", - "score": 69 - }, - { - "id": 10026, - "username": "user-26", - "sex": "男", - "city": "城市-26", - "sign": "签名-26", - "experience": 978, - "logins": 7, - "wealth": 48008413, - "classify": "作家", - "score": 65 - }, - { - "id": 10027, - "username": "user-27", - "sex": "女", - "city": "城市-27", - "sign": "签名-27", - "experience": 371, - "logins": 44, - "wealth": 64419691, - "classify": "诗人", - "score": 60 - }, - { - "id": 10028, - "username": "user-28", - "sex": "女", - "city": "城市-28", - "sign": "签名-28", - "experience": 977, - "logins": 21, - "wealth": 75935022, - "classify": "作家", - "score": 37 - }, - { - "id": 10029, - "username": "user-29", - "sex": "男", - "city": "城市-29", - "sign": "签名-29", - "experience": 647, - "logins": 107, - "wealth": 97450636, - "classify": "酱油", - "score": 27 - } - ] -} \ No newline at end of file
    ID用户名性别城市签名积分职业财富评分账号用户名所属部门创建时间ID