mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-08-23 22:11:35 +08:00
优化代码结构,完成分类处理
This commit is contained in:
parent
f79e5c08fa
commit
aab16e28aa
@ -54,8 +54,13 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<<%=GetModelName()%>> LoadAll()
|
||||||
|
{
|
||||||
|
return _repository.Find(null).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个部门及子部门全部<%=GetModelName()%>s
|
/// 加载一个节点下面的一个或全部<%=GetModelName()%>s
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public dynamic Load(int orgId, int pageindex, int pagesize)
|
public dynamic Load(int orgId, int pageindex, int pagesize)
|
||||||
{
|
{
|
||||||
@ -90,7 +95,7 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取当前组织的所有下级组织
|
/// 获取当前节点的所有下级节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private int[] GetSubOrgIds(int orgId)
|
private int[] GetSubOrgIds(int orgId)
|
||||||
{
|
{
|
||||||
@ -114,7 +119,9 @@ namespace OpenAuth.App
|
|||||||
|
|
||||||
public void AddOrUpdate(<%=GetModelName()%> model)
|
public void AddOrUpdate(<%=GetModelName()%> model)
|
||||||
{
|
{
|
||||||
<%=ModuleName%> <%=ModuleName.ToLower()%> = model;
|
<%=ModuleName%> <%=ModuleName.ToLower()%> = new <%=ModuleName%>();
|
||||||
|
model.CopyTo(<%=ModuleName.ToLower()%>);
|
||||||
|
|
||||||
if (<%=ModuleName.ToLower()%>.Id == 0)
|
if (<%=ModuleName.ToLower()%>.Id == 0)
|
||||||
{
|
{
|
||||||
_repository.Add(<%=ModuleName.ToLower()%>);
|
_repository.Add(<%=ModuleName.ToLower()%>);
|
||||||
|
@ -35,7 +35,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public <%=ModuleName%>ManagerController()
|
public <%=ModuleName%>ManagerController()
|
||||||
{
|
{
|
||||||
_app = (<%=ModuleName%>ManagerApp)DependencyResolver.Current.GetService(typeof(<%=ModuleName%>ManagerApp));
|
_app = AutofacExt.GetFromFac<<%=ModuleName%>ManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -9,7 +9,9 @@
|
|||||||
// <copyright file="ObjectHelper.cs" company="">
|
// <copyright file="ObjectHelper.cs" company="">
|
||||||
// Copyright (c) . All rights reserved.
|
// Copyright (c) . All rights reserved.
|
||||||
// </copyright>
|
// </copyright>
|
||||||
// <summary>对象COPY/初始化帮助</summary>
|
// <summary>
|
||||||
|
//对象COPY/初始化帮助,通常是防止从视图中传过来的对象属性为空,这其赋初始值
|
||||||
|
//</summary>
|
||||||
// ***********************************************************************
|
// ***********************************************************************
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
using System;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
using OpenAuth.Domain.Interface;
|
using OpenAuth.Domain.Interface;
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Infrastructure;
|
||||||
|
|
||||||
namespace OpenAuth.App
|
namespace OpenAuth.App
|
||||||
{
|
{
|
||||||
@ -31,6 +31,11 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Category> LoadAll()
|
||||||
|
{
|
||||||
|
return _repository.Find(null).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加载一个部门及子部门全部Categorys
|
/// 加载一个部门及子部门全部Categorys
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -45,7 +50,7 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Categorys = _repository.LoadInOrgs(pageindex, pagesize,GetSubOrgIds(orgId));
|
Categorys = _repository.LoadInOrgs(pageindex, pagesize, GetSubOrgIds(orgId));
|
||||||
total = _repository.GetCategoryCntInOrgs(orgId);
|
total = _repository.GetCategoryCntInOrgs(orgId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,18 +87,53 @@ namespace OpenAuth.App
|
|||||||
|
|
||||||
public void AddOrUpdate(Category model)
|
public void AddOrUpdate(Category model)
|
||||||
{
|
{
|
||||||
Category category = model;
|
Category category = new Category();
|
||||||
|
model.CopyTo(category);
|
||||||
if (category.Id == 0)
|
if (category.Id == 0)
|
||||||
{
|
{
|
||||||
|
ChangeModuleCascade(category);
|
||||||
_repository.Add(category);
|
_repository.Add(category);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_repository.Update(category);
|
_repository.Update(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#region 私有方法
|
||||||
|
|
||||||
|
//修改对象的级联ID,生成类似XXX.XXX.X.XX
|
||||||
|
private void ChangeModuleCascade(Category org)
|
||||||
|
{
|
||||||
|
string cascadeId;
|
||||||
|
int currentCascadeId = 1; //当前结点的级联节点最后一位
|
||||||
|
var sameLevels = _repository.Find(o => o.ParentId == org.ParentId && o.Id != org.Id);
|
||||||
|
foreach (var obj in sameLevels)
|
||||||
|
{
|
||||||
|
int objCascadeId = int.Parse(obj.CascadeId.Split('.').Last());
|
||||||
|
if (currentCascadeId <= objCascadeId) currentCascadeId = objCascadeId + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (org.ParentId != 0)
|
||||||
|
{
|
||||||
|
var parentOrg = _repository.FindSingle(o => o.Id == org.ParentId);
|
||||||
|
if (parentOrg != null)
|
||||||
|
{
|
||||||
|
cascadeId = parentOrg.CascadeId + "." + currentCascadeId;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("未能找到该组织的父节点信息");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cascadeId = "0." + currentCascadeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
org.CascadeId = cascadeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion 私有方法
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -38,6 +38,8 @@ namespace OpenAuth.App
|
|||||||
|
|
||||||
public void AddOrUpdate(ModuleElement model)
|
public void AddOrUpdate(ModuleElement model)
|
||||||
{
|
{
|
||||||
|
var newbtn = new ModuleElement();
|
||||||
|
model.CopyTo(newbtn);
|
||||||
if (model.Id == 0)
|
if (model.Id == 0)
|
||||||
{
|
{
|
||||||
_repository.Add(model);
|
_repository.Add(model);
|
||||||
|
@ -40,6 +40,7 @@ namespace OpenAuth.Mvc
|
|||||||
builder.RegisterType<RoleManagerApp>();
|
builder.RegisterType<RoleManagerApp>();
|
||||||
builder.RegisterType<ModuleManagerApp>();
|
builder.RegisterType<ModuleManagerApp>();
|
||||||
builder.RegisterType<ModuleElementManagerApp>();
|
builder.RegisterType<ModuleElementManagerApp>();
|
||||||
|
builder.RegisterType<CategoryManagerApp>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -63,5 +64,14 @@ namespace OpenAuth.Mvc
|
|||||||
var container = builder.Build();
|
var container = builder.Build();
|
||||||
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
|
DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从依赖容器里面获取
|
||||||
|
/// </summary>
|
||||||
|
/// <typeparam name="T"></typeparam>
|
||||||
|
public static T GetFromFac<T>()
|
||||||
|
{
|
||||||
|
return (T)DependencyResolver.Current.GetService(typeof(T));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -13,7 +13,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public CategoryManagerController()
|
public CategoryManagerController()
|
||||||
{
|
{
|
||||||
_app = (CategoryManagerApp)DependencyResolver.Current.GetService(typeof(CategoryManagerApp));
|
_app = AutofacExt.GetFromFac<CategoryManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
@ -23,6 +23,28 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 加载组织下面的所有用户
|
||||||
|
/// </summary>
|
||||||
|
public string Load(int orgId, int pageCurrent = 1, int pageSize = 30)
|
||||||
|
{
|
||||||
|
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
||||||
|
}
|
||||||
|
|
||||||
|
public string LoadForTree()
|
||||||
|
{
|
||||||
|
var models = _app.LoadAll();
|
||||||
|
//添加根节点
|
||||||
|
models.Add(new Category
|
||||||
|
{
|
||||||
|
Id = 0,
|
||||||
|
ParentId = -1,
|
||||||
|
Name = "根结点",
|
||||||
|
CascadeId = "0"
|
||||||
|
});
|
||||||
|
return JsonHelper.Instance.Serialize(models);
|
||||||
|
}
|
||||||
|
|
||||||
public ActionResult Add(int id = 0)
|
public ActionResult Add(int id = 0)
|
||||||
{
|
{
|
||||||
return View(_app.Find(id));
|
return View(_app.Find(id));
|
||||||
@ -45,14 +67,6 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 加载组织下面的所有用户
|
|
||||||
/// </summary>
|
|
||||||
public string Load(int orgId, int pageCurrent = 1, int pageSize = 30)
|
|
||||||
{
|
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(orgId, pageCurrent, pageSize));
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Delete(int Id)
|
public string Delete(int Id)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -12,7 +12,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public HomeController()
|
public HomeController()
|
||||||
{
|
{
|
||||||
_app = (ModuleManagerApp)DependencyResolver.Current.GetService(typeof(ModuleManagerApp));
|
_app = AutofacExt.GetFromFac<ModuleManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetModules(int parentId = 0)
|
public string GetModules(int parentId = 0)
|
||||||
|
@ -14,7 +14,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public LoginController()
|
public LoginController()
|
||||||
{
|
{
|
||||||
_app = (LoginApp)DependencyResolver.Current.GetService(typeof(LoginApp));
|
_app = AutofacExt.GetFromFac<LoginApp>();
|
||||||
}
|
}
|
||||||
// GET: Login
|
// GET: Login
|
||||||
public ActionResult Index()
|
public ActionResult Index()
|
||||||
|
@ -32,7 +32,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public ModuleElementManagerController()
|
public ModuleElementManagerController()
|
||||||
{
|
{
|
||||||
_app = (ModuleElementManagerApp) DependencyResolver.Current.GetService(typeof (ModuleElementManagerApp));
|
_app = AutofacExt.GetFromFac<ModuleElementManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActionResult Index(int id = 0)
|
public ActionResult Index(int id = 0)
|
||||||
@ -46,9 +46,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var newbtn = new ModuleElement();
|
_app.AddOrUpdate(button);
|
||||||
button.CopyTo(newbtn);
|
|
||||||
_app.AddOrUpdate(newbtn);
|
|
||||||
}
|
}
|
||||||
catch (DbEntityValidationException e)
|
catch (DbEntityValidationException e)
|
||||||
{
|
{
|
||||||
|
@ -15,7 +15,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public ModuleManagerController()
|
public ModuleManagerController()
|
||||||
{
|
{
|
||||||
_app = (ModuleManagerApp)DependencyResolver.Current.GetService(typeof(ModuleManagerApp));
|
_app = AutofacExt.GetFromFac<ModuleManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -13,7 +13,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public OrgManagerController()
|
public OrgManagerController()
|
||||||
{
|
{
|
||||||
_orgApp = (OrgManagerApp)DependencyResolver.Current.GetService(typeof(OrgManagerApp));
|
_orgApp = AutofacExt.GetFromFac<OrgManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -13,7 +13,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public RoleManagerController()
|
public RoleManagerController()
|
||||||
{
|
{
|
||||||
_app = (RoleManagerApp)DependencyResolver.Current.GetService(typeof(RoleManagerApp));
|
_app = AutofacExt.GetFromFac<RoleManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -13,7 +13,7 @@ namespace OpenAuth.Mvc.Controllers
|
|||||||
|
|
||||||
public UserManagerController()
|
public UserManagerController()
|
||||||
{
|
{
|
||||||
_app = (UserManagerApp)DependencyResolver.Current.GetService(typeof(UserManagerApp));
|
_app = AutofacExt.GetFromFac<UserManagerApp>();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
@model OpenAuth.Domain.Category
|
@model OpenAuth.Domain.Category
|
||||||
@{
|
@{
|
||||||
ViewBag.Title = "Category编辑界面";
|
ViewBag.Title = "Category编辑界面";
|
||||||
Layout = null;
|
Layout = null;
|
||||||
@ -10,77 +10,48 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
@Html.HiddenFor(m =>m.Id)
|
@Html.HiddenFor(m => m.Id)
|
||||||
|
@Html.HiddenFor(m => m.ParentId)
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="CascadeId" class="control-label x90">节点语义ID:</label>
|
<label for="Name" class="control-label x120">名称:</label>
|
||||||
<input type="text" name="CascadeId" id="CascadeId" value="@Model.CascadeId"
|
|
||||||
data-rule="required" size="20">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<label for="Name" class="control-label x90">名称:</label>
|
|
||||||
<input type="text" name="Name" id="Name" value="@Model.Name"
|
<input type="text" name="Name" id="Name" value="@Model.Name"
|
||||||
data-rule="required" size="20">
|
data-rule="required" size="20">
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<label for="ParentId" class="control-label x85">父节点流水号:</label>
|
|
||||||
<input id="ParentId" name="ParentId" value="" style="display: none"/>
|
|
||||||
<input type="text" name="ParentName" id="ParentName"
|
|
||||||
data-toggle="selectztree" size="20" data-tree="#j_select_tree1" value="@Model.ParentName">
|
|
||||||
<ul id="j_select_tree1" class="ztree hide" data-toggle="ztree"></ul>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="Status" class="control-label x85">当前状态:</label>
|
<label for="Status" class="control-label x120">当前状态:</label>
|
||||||
<select name="Status" id="Status" data-toggle="selectpicker" data-rule="required">
|
<select name="Status" id="Status" data-toggle="selectpicker" data-rule="required">
|
||||||
<option value="0" @if (Model.Status == 0) { <text> selected="selected" </text> }>默认</option>
|
<option value="0" @if (Model.Status == 0) { <text> selected="selected" </text> }>默认</option>
|
||||||
<option value="1" @if (Model.Status == 1) { <text> selected="selected" </text> }>状态1</option>
|
<option value="1" @if (Model.Status == 1) { <text> selected="selected" </text> }>禁用</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="SortNo" class="control-label x85">排序号:</label>
|
<label for="SortNo" class="control-label x120">排序号:</label>
|
||||||
<select name="SortNo" id="SortNo" data-toggle="selectpicker" data-rule="required">
|
<select name="SortNo" id="SortNo" data-toggle="selectpicker" data-rule="required">
|
||||||
<option value="0" @if (Model.SortNo == 0) { <text> selected="selected" </text> }>默认</option>
|
<option value="0" @if (Model.SortNo == 0) { <text> selected="selected" </text> }>默认</option>
|
||||||
<option value="1" @if (Model.SortNo == 1) { <text> selected="selected" </text> }>状态1</option>
|
<option value="1" @if (Model.SortNo == 1) { <text> selected="selected" </text> }>状态1</option>
|
||||||
</select>
|
</select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@if (Model.Id == 0) //添加
|
||||||
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<label for="RootKey" class="control-label x90">资源分类标识:</label>
|
<label for="ParentName" class="control-label x120">父节点流水号:</label>
|
||||||
<input type="text" name="RootKey" id="RootKey" value="@Model.RootKey"
|
<input type="text" name="ParentName" id="ParentName"
|
||||||
data-rule="required" size="20">
|
data-toggle="selectztree" size="20" data-tree="#j_select_tree1" value="">
|
||||||
|
<ul id="j_select_tree1" class="ztree hide" data-toggle="ztree"></ul>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<script type="text/javascript">
|
||||||
<td>
|
|
||||||
<label for="RootName" class="control-label x90">资源分类:</label>
|
|
||||||
<input type="text" name="RootName" id="RootName" value="@Model.RootName"
|
|
||||||
data-rule="required" size="20">
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<div class="bjui-pageFooter">
|
|
||||||
<ul>
|
|
||||||
<li><button type="button" class="btn-close">关闭</button></li>
|
|
||||||
<li><button type="submit" class="btn-green">保存</button></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
Init();
|
Init();
|
||||||
});
|
});
|
||||||
@ -91,8 +62,8 @@
|
|||||||
},
|
},
|
||||||
check: {
|
check: {
|
||||||
enable: true,
|
enable: true,
|
||||||
chkStyle: "checkbox",
|
chkStyle: "radio",
|
||||||
chkboxType: { "Y": "", "N": "" } //去掉勾选时级联
|
radioType: "all"
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
key: {
|
key: {
|
||||||
@ -111,7 +82,7 @@
|
|||||||
onCheck: zTreeCheck
|
onCheck: zTreeCheck
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$.getJSON('OrgManager/LoadOrg', function (json) {
|
$.getJSON('CategoryManager/LoadForTree', function (json) {
|
||||||
var zTreeObj = $.fn.zTree.init($('#j_select_tree1'), setting, json);
|
var zTreeObj = $.fn.zTree.init($('#j_select_tree1'), setting, json);
|
||||||
zTreeObj.expandAll(true);
|
zTreeObj.expandAll(true);
|
||||||
});
|
});
|
||||||
@ -140,4 +111,40 @@
|
|||||||
zTree.checkNode(treeNode, !treeNode.checked, true, true);
|
zTree.checkNode(treeNode, !treeNode.checked, true, true);
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
}
|
||||||
|
else //编辑
|
||||||
|
{
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="CascadeId" class="control-label x90">节点语义ID:</label>
|
||||||
|
<input type="text" name="CascadeId" id="CascadeId" value="@Model.CascadeId"
|
||||||
|
data-rule="required" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
|
||||||
|
@*<tr>
|
||||||
|
<td>
|
||||||
|
<label for="RootKey" class="control-label x90">根节点标识:</label>
|
||||||
|
<input type="text" name="RootKey" id="RootKey" value="@Model.RootKey"
|
||||||
|
data-rule="required" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<label for="RootName" class="control-label x90">根节点名称:</label>
|
||||||
|
<input type="text" name="RootName" id="RootName" value="@Model.RootName"
|
||||||
|
data-rule="required" size="20">
|
||||||
|
</td>
|
||||||
|
</tr>*@
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<div class="bjui-pageFooter">
|
||||||
|
<ul>
|
||||||
|
<li><button type="button" class="btn-close">关闭</button></li>
|
||||||
|
<li><button type="submit" class="btn-green">保存</button></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
@ -118,7 +118,7 @@
|
|||||||
},
|
},
|
||||||
callback: {onClick: zTreeOnClick}
|
callback: {onClick: zTreeOnClick}
|
||||||
};
|
};
|
||||||
$.getJSON('CategoryManager/LoadModuleWithRoot', function (json) {
|
$.getJSON('CategoryManager/LoadForTree', function (json) {
|
||||||
var zTreeObj = $.fn.zTree.init($('#@_treeId'), setting, json);
|
var zTreeObj = $.fn.zTree.init($('#@_treeId'), setting, json);
|
||||||
zTreeObj.expandAll(true);
|
zTreeObj.expandAll(true);
|
||||||
});
|
});
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
service="OpenAuth.Domain.Interface.IRoleRepository,OpenAuth.Domain" />
|
service="OpenAuth.Domain.Interface.IRoleRepository,OpenAuth.Domain" />
|
||||||
<component type=" OpenAuth.Repository.ModuleRepository" service="OpenAuth.Domain.Interface.IModuleRepository,OpenAuth.Domain" />
|
<component type=" OpenAuth.Repository.ModuleRepository" service="OpenAuth.Domain.Interface.IModuleRepository,OpenAuth.Domain" />
|
||||||
<component type=" OpenAuth.Repository.RelevanceRepository" service="OpenAuth.Domain.Interface.IRelevanceRepository,OpenAuth.Domain" />
|
<component type=" OpenAuth.Repository.RelevanceRepository" service="OpenAuth.Domain.Interface.IRelevanceRepository,OpenAuth.Domain" />
|
||||||
|
<component type=" OpenAuth.Repository.CategoryRepository" service="OpenAuth.Domain.Interface.ICategoryRepository,OpenAuth.Domain" />
|
||||||
</components>
|
</components>
|
||||||
</autofac>
|
</autofac>
|
||||||
|
|
||||||
|
BIN
建表&初始化数据.sql
BIN
建表&初始化数据.sql
Binary file not shown.
Loading…
Reference in New Issue
Block a user