diff --git a/OpenAuth.App/OpenAuth.App.csproj b/OpenAuth.App/OpenAuth.App.csproj index b14a4433..97ca2bb9 100644 --- a/OpenAuth.App/OpenAuth.App.csproj +++ b/OpenAuth.App/OpenAuth.App.csproj @@ -105,6 +105,8 @@ + + diff --git a/OpenAuth.App/ResourceApp.cs b/OpenAuth.App/ResourceApp.cs index db4ddf6d..2e4eeed0 100644 --- a/OpenAuth.App/ResourceApp.cs +++ b/OpenAuth.App/ResourceApp.cs @@ -33,7 +33,7 @@ namespace OpenAuth.App } - public TableData All(QueryResourcesReq request) + public TableData Load(QueryResourcesReq request) { var result = new TableData(); var resources = UnitWork.Find(null) ; diff --git a/OpenAuth.App/Response/TableData.cs b/OpenAuth.App/Response/TableData.cs index 85c0b66a..3f88f7cb 100644 --- a/OpenAuth.App/Response/TableData.cs +++ b/OpenAuth.App/Response/TableData.cs @@ -1,23 +1,23 @@ -// *********************************************************************** -// Assembly : FundationAdmin -// Author : yubaolee -// Created : 03-09-2016 -// -// Last Modified By : yubaolee -// Last Modified On : 03-09-2016 -// *********************************************************************** -// -// 版权所有(C) Microsoft 2015 -// -// layui datatable数据返回 -// *********************************************************************** - -namespace OpenAuth.App.Response -{ - /// - /// table的返回数据 - /// - public class TableData +// *********************************************************************** +// Assembly : FundationAdmin +// Author : yubaolee +// Created : 03-09-2016 +// +// Last Modified By : yubaolee +// Last Modified On : 03-09-2016 +// *********************************************************************** +// +// 版权所有(C) Microsoft 2015 +// +// layui datatable数据返回 +// *********************************************************************** + +namespace OpenAuth.App.Response +{ + /// + /// table的返回数据 + /// + public class TableData { /// /// 状态码 @@ -26,16 +26,16 @@ namespace OpenAuth.App.Response /// /// 操作消息 /// - public string msg; - - /// - /// 总记录条数 - /// - public int count; - - /// - /// 数据内容 - /// - public dynamic data; - } + public string msg; + + /// + /// 总记录条数 + /// + public int count; + + /// + /// 数据内容 + /// + public dynamic data; + } } \ No newline at end of file diff --git a/OpenAuth.Mvc/Controllers/ResourcesController.cs b/OpenAuth.Mvc/Controllers/ResourcesController.cs index 3282c574..bc0cdcf2 100644 --- a/OpenAuth.Mvc/Controllers/ResourcesController.cs +++ b/OpenAuth.Mvc/Controllers/ResourcesController.cs @@ -20,11 +20,9 @@ namespace OpenAuth.Mvc.Controllers return View(); } - public string All([FromUri]QueryResourcesReq request) + public string Load([FromUri]QueryResourcesReq request) { - TableData data = new TableData(); - data = App.All(request); - return JsonHelper.Instance.Serialize(data); + return JsonHelper.Instance.Serialize(App.Load(request)); } [System.Web.Mvc.HttpPost] diff --git a/OpenAuth.Mvc/OpenAuth.Mvc.csproj b/OpenAuth.Mvc/OpenAuth.Mvc.csproj index 1bdf4008..c8bbb870 100644 --- a/OpenAuth.Mvc/OpenAuth.Mvc.csproj +++ b/OpenAuth.Mvc/OpenAuth.Mvc.csproj @@ -143,6 +143,7 @@ + diff --git a/OpenAuth.Mvc/Views/Categories/Index.cshtml b/OpenAuth.Mvc/Views/Categories/Index.cshtml index 849d8ea2..a696aca8 100644 --- a/OpenAuth.Mvc/Views/Categories/Index.cshtml +++ b/OpenAuth.Mvc/Views/Categories/Index.cshtml @@ -31,7 +31,7 @@ - + 类型标识 diff --git a/OpenAuth.Mvc/Views/Resources/Index.cshtml b/OpenAuth.Mvc/Views/Resources/Index.cshtml index 67ac8dfe..27443cd7 100644 --- a/OpenAuth.Mvc/Views/Resources/Index.cshtml +++ b/OpenAuth.Mvc/Views/Resources/Index.cshtml @@ -4,54 +4,33 @@ } - - - - - + + - 资源表ID - 节点语义ID - 资源英文唯一标识 + 资源标识 名称 当前状态 排序号 描述 - 父节点流水号 - 资源所属应用 分类名称 - 分类ID - - + - - - - + + - 节点语义ID - - - - - - 资源英文唯一标识 + 资源标识 @@ -64,20 +43,7 @@ placeholder="名称" autocomplete="off" class="layui-input"> - - 当前状态 - - - - - - - 排序号 - - - - - + 描述 @@ -85,36 +51,19 @@ placeholder="描述" autocomplete="off" class="layui-input"> + - 父节点流水号 + 所属应用 - + + + + + + + - - 资源所属应用 - - - - - - 分类名称 - - - - - - 分类ID - - - - - - diff --git a/OpenAuth.Mvc/userJs/resources.js b/OpenAuth.Mvc/userJs/resources.js index 0bf52628..39fb0748 100644 --- a/OpenAuth.Mvc/userJs/resources.js +++ b/OpenAuth.Mvc/userJs/resources.js @@ -7,61 +7,25 @@ var table = layui.table; var openauth = layui.openauth; var toplayer = (top == undefined || top.layer === undefined) ? layer : top.layer; //顶层的LAYER - //layui.droptree("/UserSession/GetOrgs", "#Organizations", "#OrganizationIds"); $("#menus").loadMenus("Resource"); + layui.droptree("/Applications/GetList", "#AppName", "#AppId", false); + //主列表加载,可反复调用进行刷新 var config = {}; //table的参数,如搜索key,点击tree的id - var mainList = function (options) { + var mainList = function(options) { if (options != undefined) { $.extend(config, options); } - table.reload('mainList', { - url: '/Resources/Load', - where: config - }); - } - //左边树状机构列表 - var ztree = function () { - var url = '/UserSession/GetOrgs'; - var zTreeObj; - var setting = { - view: { selectedMulti: false }, - data: { - key: { - name: 'Name', - title: 'Name' - }, - simpleData: { - enable: true, - idKey: 'Id', - pIdKey: 'ParentId', - rootPId: 'null' - } - }, - callback: { - onClick: function (event, treeId, treeNode) { - mainList({ orgId: treeNode.Id }); - } - } - }; - var load = function () { - $.getJSON(url, function (json) { - zTreeObj = $.fn.zTree.init($("#tree"), setting); - var newNode = { Name: "根节点", Id: null, ParentId: "" }; - json.push(newNode); - zTreeObj.addNodes(null, json); - mainList({ orgId: "" }); - zTreeObj.expandAll(true); + table.reload('mainList', + { + url: '/Resources/Load', + where: config }); - }; - load(); - return { - reload: load - } - }(); - + }; + mainList(); + //添加(编辑)对话框 var editDlg = function () { var vm = new Vue({ diff --git a/OpenAuth.Repository/Core/TreeEntity.cs b/OpenAuth.Repository/Core/TreeEntity.cs index 9ffa7a96..1412ef25 100644 --- a/OpenAuth.Repository/Core/TreeEntity.cs +++ b/OpenAuth.Repository/Core/TreeEntity.cs @@ -1,30 +1,30 @@ -using OpenAuth.Repository.Domain; - -namespace OpenAuth.Repository.Core -{ +using OpenAuth.Repository.Domain; + +namespace OpenAuth.Repository.Core +{ /// /// 树状结构实体 - /// - public abstract class TreeEntity: Entity - { - /// - /// 父节点名称 - /// - public string ParentId { get; set; } - /// - /// 父节点名称 - /// - public string ParentName { get; set; } - - /// - /// 节点语义ID - /// - public string CascadeId { get; set; } - - /// - /// 名称 - /// - public string Name { get; set; } - } - -} + /// + public abstract class TreeEntity: Entity + { + /// + /// 父节点名称 + /// + public string ParentId { get; set; } + /// + /// 父节点名称 + /// + public string ParentName { get; set; } + + /// + /// 节点语义ID + /// + public string CascadeId { get; set; } + + /// + /// 名称 + /// + public string Name { get; set; } + } + +} diff --git a/README.md b/README.md index a8bc21a1..8aac7a40 100644 --- a/README.md +++ b/README.md @@ -20,9 +20,7 @@ `演示直达` -* 联通:http://113.204.18.84:1802 - -* 电信:http://222.178.90.18:1802 +* http://demo.openauth.me:1802 ####当前版本 @@ -34,7 +32,7 @@ * 前端采用 vue + layui + ztree + gooflow + leipiformdesign -* 后端采用 asp.net mvc + EF + autofac + swagger + json.net +* 后端采用 asp.net mvc + Web API + EF + autofac + swagger + json.net * 代码生成工具 CodeSmith