mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 05:13:25 +08:00
RoutineUpdate
This commit is contained in:
parent
dd9c401a1e
commit
d4482a2a72
@ -1,9 +1,8 @@
|
||||
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
using Infrastructure;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.Domain;
|
||||
using System;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
@ -23,6 +22,12 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
//用于选择模块时使用
|
||||
public ActionResult LookUpMulti()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载模块下面的所有模块
|
||||
/// </summary>
|
||||
@ -34,7 +39,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
/// <summary>
|
||||
/// 加载tree结构
|
||||
/// </summary>
|
||||
public string LoadForTree(bool bAll=false)
|
||||
public string LoadForTree(bool bAll = false)
|
||||
{
|
||||
var orgs = _app.LoadForTree(bAll);
|
||||
//添加根节点
|
||||
@ -48,7 +53,6 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(orgs);
|
||||
}
|
||||
|
||||
|
||||
public ActionResult Add(int id = 0)
|
||||
{
|
||||
return View(_app.Find(id));
|
||||
@ -61,7 +65,6 @@ namespace OpenAuth.Mvc.Controllers
|
||||
try
|
||||
{
|
||||
_app.AddOrUpdate(model);
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -617,6 +617,7 @@
|
||||
<ItemGroup>
|
||||
<Content Include="Views\ModuleManager\Index.cshtml" />
|
||||
<Content Include="Views\ModuleManager\Add.cshtml" />
|
||||
<Content Include="Views\ModuleManager\LookupMulti.cshtml" />
|
||||
<None Include="Views\OrgManager\AddOrg.cshtml" />
|
||||
<Content Include="Views\OrgManager\LookupParent.cshtml" />
|
||||
<Content Include="Views\UserManager\Index.cshtml" />
|
||||
|
86
OpenAuth.Mvc/Views/ModuleManager/LookupMulti.cshtml
Normal file
86
OpenAuth.Mvc/Views/ModuleManager/LookupMulti.cshtml
Normal file
@ -0,0 +1,86 @@
|
||||
@model dynamic
|
||||
|
||||
@{
|
||||
ViewBag.Title = "title";
|
||||
Layout = null;
|
||||
}
|
||||
<div class="bjui-pageContent">
|
||||
<div style="float: left; width: 100%; height: 240px; overflow: auto;" class="table table-bordered">
|
||||
<ul id="lookupTree" class="ztree"></ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bjui-pageFooter">
|
||||
<ul>
|
||||
<li><button type="button" class="btn-close" data-icon="close">关闭</button></li>
|
||||
|
||||
<li>
|
||||
<a href="javascript:;" id="btnSelected" data-toggle="lookupback"
|
||||
data-args=""
|
||||
class="btn btn-blue" title="选择本项" data-icon="check">选择</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
//function zTreeOnClick(event, treeId, treeNode) {
|
||||
// var selected = "{ParentName:'" + treeNode.Name + "', ParentId:" + treeNode.Id + "}";
|
||||
// $("#btnSelected").attr("data-args",selected);
|
||||
//}
|
||||
|
||||
$(document).ready(function () {
|
||||
Init();
|
||||
});
|
||||
function Init() {
|
||||
var setting = {
|
||||
view: {
|
||||
selectedMulti: false
|
||||
},
|
||||
check: {
|
||||
enable: true,
|
||||
chkStyle: "checkbox"
|
||||
},
|
||||
data: {
|
||||
key: {
|
||||
name: 'Name',
|
||||
title: 'Name'
|
||||
},
|
||||
simpleData: {
|
||||
enable: true,
|
||||
idKey: 'Id',
|
||||
pIdKey: 'ParentId',
|
||||
rootPId: 'null'
|
||||
}
|
||||
},
|
||||
callback: {
|
||||
onClick: zTreeOnClick,
|
||||
onCheck: zTreeCheck
|
||||
}
|
||||
};
|
||||
$.getJSON('ModuleManager/LoadForTree?bAll=true', function (json) {
|
||||
var zTreeObj = $.fn.zTree.init($('#lookupTree'), setting, json);
|
||||
zTreeObj.expandAll(true);
|
||||
});
|
||||
}
|
||||
|
||||
function zTreeCheck(e, treeId, treeNode) {
|
||||
var zTree = $.fn.zTree.getZTreeObj(treeId),
|
||||
nodes = zTree.getCheckedNodes(true);
|
||||
var ids = '';
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
ids += ',' + nodes[i].Id;
|
||||
}
|
||||
if (ids.length > 0) { //去掉第一个逗号
|
||||
ids = ids.substr(1);
|
||||
}
|
||||
|
||||
$("#btnSelected").attr("data-args", ids);
|
||||
}
|
||||
function zTreeOnClick(event, treeId, treeNode) {
|
||||
var zTree = $.fn.zTree.getZTreeObj(treeId);
|
||||
zTree.checkNode(treeNode, !treeNode.checked, true, true);
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
//@@ sourceURL=lookupMulti.js
|
||||
</script>
|
@ -174,14 +174,14 @@
|
||||
|
||||
}
|
||||
|
||||
//自定义的编辑按钮
|
||||
//授权按钮
|
||||
function accessMenu() {
|
||||
var selected = getSelected(2);
|
||||
if (selected == null) return;
|
||||
|
||||
$(this).dialog({
|
||||
id: 'editDialog',
|
||||
url: '/UserManager/Add?id=' + selected,
|
||||
id: 'accessMenuDialog',
|
||||
url: '/ModuleManager/LookupMulti?id=' + selected,
|
||||
title: '编辑',
|
||||
onClose: function () {
|
||||
refreshGrid();
|
||||
|
Loading…
Reference in New Issue
Block a user