mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-04-05 17:38:01 +08:00
在内部实现ztree调用
确定LOGO
This commit is contained in:
parent
4e7f9ad0b3
commit
153f263d34
@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenAuth.Domain;
|
||||
using OpenAuth.Domain.Interface;
|
||||
|
||||
@ -23,11 +24,20 @@ namespace OpenAuth.App
|
||||
public int AddOrg(Org org)
|
||||
{
|
||||
string cascadeId;
|
||||
//根据同一级个数计算ID
|
||||
int currentCascadeId = _repository.GetCount(o => o.ParentId == 0) + 1;
|
||||
int currentCascadeId = 1;
|
||||
|
||||
|
||||
if (org.ParentId != 0)
|
||||
{
|
||||
//根据同一级中最大的语义ID
|
||||
var maxCascadeIdOrg = _repository.Find(o => o.ParentId == org.ParentId)
|
||||
.OrderByDescending(o =>o.CascadeId).FirstOrDefault();
|
||||
if (maxCascadeIdOrg != null)
|
||||
{
|
||||
var cascades = maxCascadeIdOrg.CascadeId.Split('.');
|
||||
currentCascadeId = int.Parse(cascades[cascades.Length - 1]) + 1;
|
||||
}
|
||||
|
||||
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||
if (parentOrg != null)
|
||||
{
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.2 KiB |
@ -147,7 +147,7 @@ td[align=right] input{text-align:right;}
|
||||
.table.nowrap th{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
|
||||
/* Main */
|
||||
#bjui-window{margin:0 auto; overflow:hidden;}
|
||||
#bjui-header{position:relative; margin-bottom:0; height:70px; overflow:visible; border-width:0; border-radius:0;}
|
||||
#bjui-header{position:relative; margin-bottom:0; height:80px; overflow:visible; border-width:0; border-radius:0;}
|
||||
#bjui-header > .bjui-navbar-header{float:left;}
|
||||
#bjui-header > .bjui-navbar-header > .bjui-navbar-logo{display:block; padding-left:6px; padding-top:1px;}
|
||||
#bjui-header > .bjui-navbar-header > .bjui-navbar-toggle{display:none; position:absolute; top:5px; right:5px;}
|
||||
@ -180,7 +180,7 @@ td[align=right] input{text-align:right;}
|
||||
#bjui-header > #bjui-navbar-collapse > .bjui-navbar-right > li > .dropdown-menu > li > a.theme_blue{color:blue;}
|
||||
#bjui-header > #bjui-navbar-collapse > .bjui-navbar-right > li > .dropdown-menu > li > a.theme_red{color:#fc5555;}
|
||||
#bjui-header > #bjui-navbar-collapse > .bjui-navbar-right > li > .dropdown-menu > li > a.theme_green{color:green;}
|
||||
#bjui-hnav{position:absolute; top:38px; width:100%; height:32px; overflow:visible;}
|
||||
#bjui-hnav{position:absolute; top:47px; height:32px; overflow:visible;}
|
||||
#bjui-hnav > .bjui-hnav-more-left{position:absolute; left:0; top:0; z-index:1; display:none;}
|
||||
#bjui-hnav > .bjui-hnav-more-right{position:absolute; right:0; top:0; z-index:1; display:none;}
|
||||
#bjui-hnav > .bjui-hnav-more-left,
|
||||
|
@ -29,5 +29,16 @@ namespace OpenAuth.Mvc.Controllers
|
||||
var orgs = _orgApp.GetAll();
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
}
|
||||
|
||||
public JsonResult LoadTree()
|
||||
{
|
||||
return Json(_orgApp.GetAll().Select(o =>new
|
||||
{
|
||||
id = o.Id,
|
||||
pId = o.ParentId,
|
||||
name = o.Name,
|
||||
text = o.Name
|
||||
}), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
}
|
@ -178,6 +178,7 @@
|
||||
<Content Include="BJUI\js\jquery-1.7.2.min.js" />
|
||||
<Content Include="BJUI\js\jquery.cookie.js" />
|
||||
<Content Include="BJUI\js\sha256.js" />
|
||||
<Content Include="BJUI\myextension.js" />
|
||||
<Content Include="BJUI\other\html5shiv.min.js" />
|
||||
<Content Include="BJUI\other\jquery.iframe-transport.js" />
|
||||
<Content Include="BJUI\other\respond.min.js" />
|
||||
|
@ -3,9 +3,9 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>B-JUI 客户端框架</title>
|
||||
<meta name="Keywords" content="B-JUI,Bootstrap,DWZ,jquery,ui,前端,框架,开源,OSC,开源框架,knaan" />
|
||||
<meta name="Description" content="B-JUI, Bootstrap for DWZ富客户端框架,基于DWZ富客户端框架修改。主要针对皮肤,编辑器,表单验证等方面进行了大量修改,引入了Bootstrap,Font Awesome,KindEditor,jquery.validationEngine,iCheck等众多开源项目。交流QQ群:232781006。" />
|
||||
<title>OpenAuth.net 基于经典DDD框架的权限管理</title>
|
||||
<meta name="Keywords" content="OpenAuth,DDD权限管理,yubaolee" />
|
||||
<meta name="Description" content="OpenAuth,DDD权限管理,yubaolee" />
|
||||
<!-- bootstrap - css -->
|
||||
<link href="~/BJUI/themes/css/bootstrap.css" rel="stylesheet">
|
||||
<!-- core - css -->
|
||||
@ -17,6 +17,7 @@
|
||||
<link href="~/BJUI/plugins/niceValidator/jquery.validator.css" rel="stylesheet">
|
||||
<link href="~/BJUI/plugins/bootstrapSelect/bootstrap-select.css" rel="stylesheet">
|
||||
<link href="~/BJUI/themes/css/FA/css/font-awesome.min.css" rel="stylesheet">
|
||||
<link href="~/BJUI/plugins/styles/zTreeStyle/zTreeStyle.css" />
|
||||
<!--[if lte IE 7]>
|
||||
<link href="~/BJUI/themes/css/ie7.css" rel="stylesheet">
|
||||
<![endif]-->
|
||||
@ -33,7 +34,7 @@
|
||||
<![endif]-->
|
||||
<!-- BJUI.all 分模块压缩版 -->
|
||||
<script src="~/BJUI/js/bjui-all.js"></script>
|
||||
|
||||
|
||||
<!-- plugins -->
|
||||
<!-- swfupload for uploadify && kindeditor -->
|
||||
<script src="~/BJUI/plugins/swfupload/swfupload.js"></script>
|
||||
@ -55,17 +56,14 @@
|
||||
<script src="~/BJUI/plugins/icheck/icheck.min.js"></script>
|
||||
<!-- dragsort -->
|
||||
<script src="~/BJUI/plugins/dragsort/jquery.dragsort-0.5.1.min.js"></script>
|
||||
<!-- HighCharts -->
|
||||
<script src="~/BJUI/plugins/highcharts/highcharts.js"></script>
|
||||
<script src="~/BJUI/plugins/highcharts/highcharts-3d.js"></script>
|
||||
<script src="~/BJUI/plugins/highcharts/themes/gray.js"></script>
|
||||
<!-- ECharts -->
|
||||
<script src="~/BJUI/plugins/echarts/echarts.js"></script>
|
||||
<!-- other plugins -->
|
||||
<script src="~/BJUI/plugins/other/jquery.autosize.js"></script>
|
||||
<link href="~/BJUI/plugins/uploadify/css/uploadify.css" rel="stylesheet">
|
||||
<script src="~/BJUI/plugins/uploadify/scripts/jquery.uploadify.min.js"></script>
|
||||
<script src="~/BJUI/plugins/download/jquery.fileDownload.js"></script>
|
||||
|
||||
<!---本项目扩展的JS代码-->
|
||||
<script src="~/BJUI/myextension.js"></script>
|
||||
<!-- init -->
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
@ -203,23 +201,10 @@
|
||||
<li class="active">
|
||||
<a href="javascript:;" data-toggle="slidebar"><i class="fa fa-check-square-o"></i> 应用管理</a>
|
||||
<div class="items hide" data-noinit="true">
|
||||
<ul id="bjui-doc-tree-base" class="ztree ztree_main" data-toggle="ztree" data-on-click="MainMenuClick"
|
||||
<ul id="bjui-doc-tree-base" class="ztree ztree_main" data-toggle="ztree" data-on-click="MainMenuClick"
|
||||
data-expand-all="true" data-faicon="star-o" data-tit="基本设置">
|
||||
<li data-id="99" data-pid="0" data-faicon="folder-open-o" data-faicon-close="folder-o">文件列表</li>
|
||||
<li data-id="100" data-pid="99" data-url="OrgManager/Index" data-tabid="doc-file" data-faicon="caret-right">机构管理</li>
|
||||
<li data-id="1" data-pid="0" data-faicon="folder-open-o" data-faicon-close="folder-o" data-faicon="caret-right">框架介绍</li>
|
||||
<li data-id="10" data-pid="1" data-url="doc/base/structure.html" data-tabid="doc-base" data-faicon="caret-right">页面结构</li>
|
||||
<li data-id="11" data-pid="1" data-url="doc/base/init.html" data-tabid="doc-base" data-faicon="caret-right">框架初始化</li>
|
||||
<li data-id="12" data-pid="1" data-url="doc/base/hnav.html" data-tabid="doc-base" data-faicon="caret-right">横向导航菜单</li>
|
||||
<li data-id="13" data-pid="1" data-url="doc/base/navtab.html" data-tabid="doc-base" data-faicon="caret-right">标签工作区(navtab)</li>
|
||||
<li data-id="14" data-pid="1" data-url="doc/base/dialog.html" data-tabid="doc-base" data-faicon="caret-right">弹窗工作区(dialog)</li>
|
||||
<li data-id="15" data-pid="1" data-url="doc/base/idname.html" data-tabid="doc-base" data-faicon="caret-right">元素ID命名规范</li>
|
||||
<li data-id="16" data-pid="1" data-url="doc/base/data.html" data-tabid="doc-base" data-faicon="caret-right">data属性</li>
|
||||
<li data-id="17" data-pid="1" data-url="doc/base/api.html" data-tabid="doc-base" data-faicon="caret-right">jQuery API调用</li>
|
||||
<li data-id="18" data-pid="1" data-url="doc/base/event.html" data-tabid="doc-base" data-faicon="caret-right">事件</li>
|
||||
<li data-id="19" data-pid="1" data-url="doc/base/url.html" data-tabid="doc-base" data-update="true" data-faicon="caret-right">URL动态赋值</li>
|
||||
<li data-id="9" data-pid="0" data-faicon="folder-open-o" data-faicon-close="folder-o" data-faicon="caret-right">框架皮肤</li>
|
||||
<li data-id="90" data-pid="9" data-url="doc/theme/color.html" data-tabid="doc-theme" data-faicon="caret-right">颜色值</li>
|
||||
</ul>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -1,58 +1,66 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$('#test-datagrid-array').datagrid({
|
||||
gridTitle: '机构列表显示',
|
||||
showToolbar: true,
|
||||
toolbarItem: 'all',
|
||||
addLocation: 'first',
|
||||
local: 'local',
|
||||
dataUrl: 'OrgManager/LoadOrg',
|
||||
dataType: 'json',
|
||||
columns: [
|
||||
{
|
||||
name: 'Type',
|
||||
label: '类型',
|
||||
type: 'select',
|
||||
items: [ { '0': '默认' }],
|
||||
align: 'center',
|
||||
width: 80,
|
||||
render: $.datagrid.renderItem
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
label: '机构名称',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
rule: 'required'
|
||||
},
|
||||
|
||||
|
||||
|
||||
{
|
||||
name: 'CreateTime',
|
||||
label: '登记日期',
|
||||
type: 'date',
|
||||
pattern: 'yyyy-MM-dd HH:mm'
|
||||
}
|
||||
],
|
||||
hiddenFields: ['Id'],
|
||||
editUrl: 'ajaxDone1.html',
|
||||
delUrl: 'ajaxDone1.html',
|
||||
paging: { total: 30, pageSize: 5 },
|
||||
showTfoot: true,
|
||||
editMode: 'dialog',
|
||||
fullGrid: true,
|
||||
showLinenumber: true,
|
||||
showCheckboxcol: true
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
<div class="bjui-pageContent">
|
||||
<div style="padding:15px; height:100%; width:100%;">
|
||||
|
||||
<table id="test-datagrid-array" data-width="100%" data-height="280" class="table table-bordered"></table>
|
||||
|
||||
<div class="bjui-pageContent">
|
||||
<div class="clearfix">
|
||||
<div style="float: left; width: 220px; height: 240px; overflow: auto;" class="table table-bordered">
|
||||
<ul id="orgTree" class="ztree"></ul>
|
||||
</div>
|
||||
<div id="ztree-detail" style="margin-left: 225px; width: auto;">
|
||||
<table id="test-datagrid-array" data-width="100%" data-height="100%" class="table table-bordered"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$.getJSON("OrgManager/LoadTree", function (json) {
|
||||
zTreeObj = initTree("#orgTree", json);
|
||||
|
||||
});
|
||||
|
||||
$('#test-datagrid-array').datagrid({
|
||||
gridTitle: '机构列表显示',
|
||||
showToolbar: true,
|
||||
toolbarItem: 'all',
|
||||
addLocation: 'first',
|
||||
local: 'local',
|
||||
dataUrl: 'OrgManager/LoadOrg',
|
||||
dataType: 'json',
|
||||
columns: [
|
||||
{
|
||||
name: 'Type',
|
||||
label: '类型',
|
||||
type: 'select',
|
||||
items: [{ '0': '默认' }],
|
||||
align: 'center',
|
||||
width: 80,
|
||||
render: $.datagrid.renderItem
|
||||
},
|
||||
{
|
||||
name: 'Name',
|
||||
label: '机构名称',
|
||||
align: 'center',
|
||||
width: 100,
|
||||
rule: 'required'
|
||||
},
|
||||
{
|
||||
name: 'CreateTime',
|
||||
label: '登记日期',
|
||||
type: 'date',
|
||||
pattern: 'yyyy-MM-dd HH:mm'
|
||||
}
|
||||
],
|
||||
hiddenFields: ['Id'],
|
||||
editUrl: 'ajaxDone1.html',
|
||||
delUrl: 'ajaxDone1.html',
|
||||
paging: { total: 30, pageSize: 5 },
|
||||
showTfoot: true,
|
||||
editMode: 'dialog',
|
||||
fullGrid: true,
|
||||
showLinenumber: true,
|
||||
showCheckboxcol: true
|
||||
});
|
||||
|
||||
});
|
||||
//@@ sourceURL=orgIndex.js
|
||||
</script>
|
@ -79,7 +79,6 @@
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -65,16 +65,26 @@ namespace OpenAuth.UnitTest
|
||||
[TestMethod]
|
||||
public void TestAddOrg()
|
||||
{
|
||||
int id = _app.AddOrg(new Org
|
||||
int rootId = _app.AddOrg(new Org
|
||||
{
|
||||
Name = "集团总部",
|
||||
ParentId = 0
|
||||
});
|
||||
Assert.IsTrue(id != 0);
|
||||
id = _app.AddOrg(new Org
|
||||
Assert.IsTrue(rootId != 0);
|
||||
int id = _app.AddOrg(new Org
|
||||
{
|
||||
Name = "一分公司",
|
||||
ParentId = id
|
||||
ParentId = rootId
|
||||
});
|
||||
id = _app.AddOrg(new Org
|
||||
{
|
||||
Name = "二分公司",
|
||||
ParentId = rootId
|
||||
});
|
||||
id = _app.AddOrg(new Org
|
||||
{
|
||||
Name = "三分公司",
|
||||
ParentId = rootId
|
||||
});
|
||||
|
||||
Assert.IsTrue(id != 0);
|
||||
|
Loading…
Reference in New Issue
Block a user