把以前的页面全部干掉

This commit is contained in:
yubaolee 2017-12-11 17:49:59 +08:00
parent 5e6445cbc9
commit 8158f6c413
18 changed files with 159 additions and 458 deletions

View File

@ -59,8 +59,11 @@ layui.config({
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting, json);
mainList({ orgId: json[0].Id });
zTreeObj = $.fn.zTree.init($("#tree"), setting);
var newNode = { Name: "根节点", Id: null, ParentId: "" };
json.push(newNode);
zTreeObj.addNodes(null, json);
mainList({ orgId: "" });
zTreeObj.expandAll(true);
});
};
@ -90,7 +93,7 @@ layui.config({
});
var url = "/<%=ModuleName%>Manager/Add";
if (update) {
url = "/<%=ModuleName%>Manager/Update"; //暂时和添加一个地址
url = "/<%=ModuleName%>Manager/Update";
}
//提交数据
form.on('submit(formSubmit)',

View File

@ -1,21 +1,20 @@
using System.Collections.Generic;
using OpenAuth.Repository.Domain;
using OpenAuth.Repository.Interface;
namespace OpenAuth.App
{
public class ModuleManagerApp
public class ModuleManagerApp :BaseApp<Module>
{
public IUnitWork _unitWork { get; set; }
public void Delete(string id)
public void Add(Module model)
{
// _unitWork.Delete<Module>(id);
ChangeModuleCascade(model);
Repository.Add(model);
}
public void AddOrUpdate(Module vm)
public void Update(Module model)
{
// _moduleManService.AddOrUpdate(vm);
ChangeModuleCascade(model);
Repository.Update(u =>u.Id, model);
}
#region /
@ -40,6 +39,5 @@ namespace OpenAuth.App
}
#endregion /
}
}

View File

@ -12,6 +12,11 @@ namespace OpenAuth.App.Response
/// <returns></returns>
public string Id { get; set; }
/// <summary>
/// 节点语义ID
/// </summary>
public string CascadeId { get; set; }
/// <summary>
/// 名称
/// </summary>
@ -30,6 +35,12 @@ namespace OpenAuth.App.Response
/// <returns></returns>
public string ParentId { get; set; }
/// <summary>
/// 父节点流水号
/// </summary>
/// <returns></returns>
public string ParentName { get; set; }
/// <summary>
/// 节点图标文件名称
/// </summary>
@ -39,6 +50,11 @@ namespace OpenAuth.App.Response
public bool Checked { get; set; }
/// <summary>
/// 排序号
/// </summary>
public int SortNo { get; set; }
/// <summary>
/// 模块中的元素
/// </summary>

View File

@ -35,7 +35,7 @@ namespace OpenAuth.Mvc.Controllers
{
sb.Append("<button "
+ " data-type='" + element.DomId + "' "
+ " class='layui-btn " + element.Class + "' "
+ " class='layui-btn layui-btn-small " + element.Class + "' "
+ element.Attr
+ ">");
if (!string.IsNullOrEmpty(element.Icon))

View File

@ -129,11 +129,27 @@ namespace OpenAuth.Mvc.Controllers
//添加或修改模块
[HttpPost]
public string AddOrUpdate(Module model)
public string Add(Module model)
{
try
{
App.AddOrUpdate(model);
App.Add(model);
}
catch (Exception ex)
{
Result.Code = 500;
Result.Message = ex.Message;
}
return JsonHelper.Instance.Serialize(Result);
}
//添加或修改模块
[HttpPost]
public string Update(Module model)
{
try
{
App.Update(model);
}
catch (Exception ex)
{
@ -148,10 +164,7 @@ namespace OpenAuth.Mvc.Controllers
{
try
{
foreach (var obj in ids)
{
App.Delete(obj);
}
App.Delete(ids);
}
catch (Exception e)
{
@ -163,5 +176,24 @@ namespace OpenAuth.Mvc.Controllers
}
#endregion
/// <summary>
/// 加载模块的菜单
/// </summary>
/// <param name="moduleId">The module identifier.</param>
/// <returns>System.String.</returns>
public string LoadMenus(string moduleId)
{
var user = AuthUtil.GetCurrentUser();
var module = user.Modules.Single(u => u.Id == moduleId);
var data = new TableData
{
data = module.Elements,
count = module.Elements.Count(),
};
return JsonHelper.Instance.Serialize(data);
}
}
}

View File

@ -342,10 +342,6 @@
<Content Include="Views\Web.config" />
<Content Include="Views\_ViewStart.cshtml" />
<Content Include="Views\Home\Index.cshtml" />
<Content Include="Views\ResourceManager\Index.cshtml" />
<Content Include="Views\RoleManager\LookupMulti.cshtml" />
<Content Include="Views\ResourceManager\AssignRes.cshtml" />
<Content Include="Views\StockManager\Index.cshtml" />
<Content Include="Areas\FlowManage\Views\FlowInstances\Index.cshtml" />
<Content Include="Views\Shared\_FlowForm.cshtml" />
<Content Include="Views\Shared\_Form.cshtml" />
@ -357,7 +353,6 @@
<ItemGroup>
<Folder Include="Areas\FlowManage\Models\" />
<Folder Include="Areas\FlowManage\Views\Shared\" />
<Folder Include="Views\UserSession\" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config">
@ -386,11 +381,9 @@
</ItemGroup>
<ItemGroup>
<Content Include="Views\ModuleManager\Index.cshtml" />
<Content Include="Views\ModuleManager\Assign.cshtml" />
<Content Include="Views\ModuleElementManager\Index.cshtml" />
<Content Include="Views\ModuleElementManager\AssignModuleElement.cshtml" />
<Content Include="Views\UserManager\Index.cshtml" />
<Content Include="Views\RoleManager\Index.cshtml" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

View File

@ -3,24 +3,14 @@
<link rel="stylesheet" href="/css/treetable.css" />
}
<blockquote class="layui-elem-quote news_search toolList">
<div class="layui-inline">
<div class="layui-input-inline">
<input class="layui-input" placeholder="请输入关键字"
name="key" id="key" autocomplete="off">
</div>
<button class="layui-btn" data-type="search">搜索</button>
</div>
<button class="layui-btn " data-type="refresh">刷新</button>
<button class="layui-btn " data-type="btnAdd">添加</button>
<button class="layui-btn " data-type="btnEdit">编辑</button>
<button class="layui-btn layui-btn-danger" data-type="btnDel">批量删除</button>
@Html.Action("MenuHeader", "Home")
</blockquote>
<div style="display: flex;">
<ul id="tree" class="ztree" style="display: inline-block; width: 180px; padding: 10px; border: 1px solid #ddd; overflow: auto;"></ul>
<table class="layui-table"
lay-data="{height: 'full-80', page:true, id:'mainList'}"
lay-filter="list">
lay-filter="list" lay-size="sm">
<thead>
<tr>
<th lay-data="{checkbox:true, fixed: true}"></th>

View File

@ -1,19 +0,0 @@
@{
Layout = null;
}
<link href="~/Content/scripts/layui/css/layui.css" rel="stylesheet"/>
<link href="~/Content/mylayer.css" rel="stylesheet" />
<script src="~/Content/scripts/layui/layui.js"></script>
<script src="~/Content/scripts/jquery/jQuery-2.1.4.min.js"></script>
<script src="~/Content/scripts/layui/lay/modules/form.js"></script>
<form class="layui-form " action="">
<input style="display: none" id="firstId" value="@ViewBag.FirstId"/>
<input style="display: none" id="moduleType" , value="@ViewBag.ModuleType"/>
@Html.Raw(ViewBag.Modules)
</form>
<script src="~/BllScripts/assignModule.js"></script>

View File

@ -3,13 +3,6 @@
<link rel="stylesheet" href="/css/treetable.css" />
}
<blockquote class="layui-elem-quote news_search toolList">
<div class="layui-inline">
<div class="layui-input-inline">
<input class="layui-input" placeholder="请输入关键字"
name="key" id="key" autocomplete="off">
</div>
<button class="layui-btn" data-type="search">搜索</button>
</div>
@Html.Action("MenuHeader", "Home")
</blockquote>
@ -17,26 +10,55 @@
<ul id="tree" class="ztree" style="display: inline-block; width: 180px; padding: 10px; border: 1px solid #ddd; overflow: auto;"></ul>
<table class="layui-table"
lay-data="{height: 'full-80', page:true, id:'mainList'}"
lay-filter="list">
lay-filter="list" lay-size="sm">
<thead>
<tr>
<th lay-data="{checkbox:true, fixed: true}"></th>
<th lay-data="{field:'Name', width:150, sort: true, fixed: true}">模块名称</th>
<th lay-data="{field:'Url', width:150}">Url</th>
<th lay-data="{field:'IconName', width:150}">IconName</th>
<th lay-data="{field:'ParentName', width:135}">父节点名称</th>
<th lay-data="{field:'SortNo', width:180}">排序号</th>
<th lay-data="{field:'Id', width:180}">ID</th>
<th lay-data="{fixed: 'right', width:160, align:'center', toolbar: '#barList'}"></th>
</tr>
<tr>
<th lay-data="{checkbox:true, fixed: true}"></th>
<th lay-data="{field:'Name', width:120, sort: true, fixed: true}">模块名称</th>
<th lay-data="{field:'CascadeId', width:80}">层级ID</th>
<th lay-data="{field:'Url', width:200}">Url</th>
<th lay-data="{field:'IconName', width:60,templet: '#iconTpl'}">图标</th>
<th lay-data="{field:'ParentName', width:135}">父节点名称</th>
<th lay-data="{field:'SortNo', width:80}">排序号</th>
<th lay-data="{fixed: 'right', width:100, toolbar: '#barList'}"></th>
</tr>
</thead>
</table>
<!--列表右边的按钮-->
<script type="text/html" id="barList">
<a class="layui-btn layui-btn-primary layui-btn-mini" lay-event="detail">查看菜单</a>
</script>
<script type="text/html" id="iconTpl">
{{# if( d.IconName != null && d.IconName != ''){ }}
<i class="layui-icon">{{ d.IconName }}</i>
{{# } else { }}
{{ d.IconName }}
{{# } }}
</script>
<!--菜单列表-->
<table class="layui-table"
lay-data="{height: 'full-80', id:'menuList'}"
lay-filter="menulist" lay-size="sm">
<thead>
<tr>
<th lay-data="{field:'Name', width:120, sort: true, fixed: true}">名称</th>
<th lay-data="{field:'DomId', width:80}">DomId</th>
<th lay-data="{field:'Class', width:80}">样式</th>
<th lay-data="{field:'IconName', width:60,templet: '#iconTpl'}">图标</th>
<th lay-data="{field:'SortNo', width:80}">排序号</th>
<th lay-data="{fixed: 'right', width:80, align:'center', toolbar: '#menuBar'}"></th>
</tr>
</thead>
</table>
<!--列表右边的按钮-->
<script type="text/html" id="menuBar">
<a class="layui-btn layui-btn-primary layui-btn-mini" lay-event="del">删除</a>
</script>
</div>
<!--列表右边的按钮-->
<script type="text/html" id="barList">
<a class="layui-btn layui-btn-primary layui-btn-mini" lay-event="detail">查看</a>
</script>
<!--用户添加/编辑窗口-->
<div id="divEdit" style="display: none">
@ -51,6 +73,21 @@
placeholder="请输入部门名称" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">URL地址</label>
<div class="layui-input-block">
<input type="text" name="Url" v-model="Url" required lay-verify="required"
placeholder="请输入URL" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">图标</label>
<div class="layui-input-block">
<input type="text" name="IconName" v-model="IconName"
placeholder="请选择图标" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">排序号</label>
<div class="layui-input-block">
@ -62,8 +99,8 @@
<div class="layui-form-item">
<label class="layui-form-label">所属模块</label>
<div class="layui-input-block">
<input id="ParentName" name="ParentName" v-model="ParentName" required lay-verify="required" class="layui-input" />
<input id="ParentId" name="ParentId" v-model="ParentId" required lay-verify="required" type="hidden" />
<input id="ParentName" name="ParentName" v-model="ParentName" class="layui-input" />
<input id="ParentId" name="ParentId" v-model="ParentId" type="hidden" />
<div id="menuContent" class="menuContent" style="display: none;">
<ul id="org" class="ztree"></ul>
</div>

View File

@ -3,13 +3,6 @@
<link rel="stylesheet" href="/css/treetable.css" />
}
<blockquote class="layui-elem-quote news_search toolList">
<div class="layui-inline">
<div class="layui-input-inline">
<input class="layui-input" placeholder="请输入关键字"
name="key" id="key" autocomplete="off">
</div>
<button class="layui-btn" data-type="search">搜索</button>
</div>
@Html.Action("MenuHeader", "Home")
</blockquote>
@ -17,7 +10,7 @@
<ul id="tree" class="ztree" style="display: inline-block; width: 180px; padding: 10px; border: 1px solid #ddd; overflow: auto;"></ul>
<table class="layui-table"
lay-data="{height: 'full-80', page:true, id:'mainList'}"
lay-filter="list">
lay-filter="list" lay-size="sm">
<thead>
<tr>
<th lay-data="{checkbox:true, fixed: true}"></th>

View File

@ -1,26 +0,0 @@

@{
Layout = null;
}
<link href="~/Content/scripts/layui/css/layui.css" rel="stylesheet" />
<link href="~/Content/mylayer.css" rel="stylesheet" />
<script src="~/Content/scripts/layui/layui.js"></script>
<script src="~/Content/scripts/jquery/jQuery-2.1.4.min.js"></script>
<script src="~/Content/scripts/zTree/js/jquery.ztree.core.js"></script>
<link href="/Content/scripts/zTree/css/metroStyle/metroStyle.css" rel="stylesheet" />
<div style="display: inline-block; width: 180px; height: 210px; padding: 10px; border: 1px solid #ddd; overflow: auto;">
<input style="display: none" id="firstId" value="@ViewBag.FirstId" />
<input style="display: none" id="moduleType" , value="@ViewBag.ModuleType" />
<ul id="orgtree" class="ztree" style="width: 100%"></ul>
</div>
<div class="site-tips" style="display: inline-block; height: 210px; width: 340px; padding: 10px;vertical-align: top;" id="demo2-view">
<form class="layui-form " action="" id="resources"></form>
</div>
<script src="~/BllScripts/grid.js"></script>
<script src="~/BllScripts/assignRes.js"></script>

View File

@ -1,96 +0,0 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
<!-- #section:basics/content.breadcrumbs -->
<div class="breadcrumbs" id="breadcrumbs">
<ul class="breadcrumb">
<li>
<i class="ace-icon fa fa-home home-icon"></i>
<a href="#">资源管理</a>
</li>
<li class="active">列表</li>
</ul><!-- /.breadcrumb -->
</div>
<!-- /section:basics/content.breadcrumbs -->
<div class="page-content">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div class="widget-box widget-color-blue">
<div class="widget-header">
</div>
<div class="widget-body">
<div class="widget-main">
<ul id="orgtree" class="ztree" style="width: 100%"></ul>
</div>
</div>
</div>
</div>
<div class="col-md-9">
<div class="widget-box widget-color-blue">
<div class="widget-header">
@Html.Action("MenuHeader", "Home")
</div>
<div class="widget-body gridwidth">
<div class="widget-main">
<div class="row">
<div class="col-md-12 ">
<table id="maingrid"></table>
<div id="grid-pager"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- /.page-content -->
<!--编辑对话框-->
<div id="editDlg" style="display: none">
<div class="col-xs-12">
<form class="form-horizontal" id="editForm">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 资源标识 </label>
<div class="col-sm-9">
<input type="text" id="Key" check-type="required" v-model="Key"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 名称 </label>
<div class="col-sm-9">
<input type="text" id="Name" check-type="required" v-model="Name"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 排序号 </label>
<div class="col-sm-9">
<input type="text" id="SortNo" check-type="required" v-model="SortNo"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 资源分类</label>
<div class="col-sm-9">
<input id="CategoryName" type="text" v-model="CategoryName"/>
<input id="CategoryId" type="hidden" v-model="CategoryId"/>
<div id="menuContent" class="menuContent" style="display: none;">
<ul id="org" class="ztree"></ul>
</div>
</div>
</div>
</form>
</div>
</div>
<script src="~/BllScripts/grid.js"></script>
<script src="~/BllScripts/parentTree.js"></script>
<script src="~/BllScripts/ResourceManager.js"></script>
<script src="~/BllScripts/jqEvent.js"></script>

View File

@ -1,82 +0,0 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
<!-- #section:basics/content.breadcrumbs -->
<div class="breadcrumbs" id="breadcrumbs">
<ul class="breadcrumb">
<li>
<i class="ace-icon fa fa-home home-icon"></i>
<a href="#">角色管理</a>
</li>
<li class="active">列表</li>
</ul><!-- /.breadcrumb -->
</div>
<!-- /section:basics/content.breadcrumbs -->
<div class="page-content">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div class="widget-box widget-color-blue">
<div class="widget-header">
</div>
<div class="widget-body">
<div class="widget-main">
<ul id="orgtree" class="ztree" style="width: 100%"></ul>
</div>
</div>
</div>
</div>
<div class="col-md-9">
<div class="widget-box widget-color-blue">
<div class="widget-header">
@Html.Action("MenuHeader", "Home")
</div>
<div class="widget-body gridwidth">
<div class="widget-main">
<div class="row">
<div class="col-md-12 ">
<table id="maingrid"></table>
<div id="grid-pager"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- /.page-content -->
<!--编辑对话框-->
<div id="editDlg" style="display: none">
<div class="col-xs-12">
<form class="form-horizontal" id="editForm">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 名称 </label>
<div class="col-sm-9">
<input type="text" id="Name" v-model="Name" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 所属机构</label>
<div class="col-sm-9">
<input id="Organizations" type="text" v-model="Organizations" />
<input id="OrganizationIds" type="hidden" v-model="OrganizationIds" />
<div id="menuContent" class="menuContent" style="display: none;">
<ul id="org" class="ztree"></ul>
</div>
</div>
</div>
</form>
</div>
</div>
<script src="~/Content/scripts/zTree/js/jquery.ztree.excheck.js"></script>
<script src="~/BllScripts/grid.js"></script>
<script src="~/BllScripts/parentTreeMultiple.js"></script>
<script src="~/BllScripts/RoleManager.js"></script>
<script src="~/BllScripts/jqEvent.js"></script>

View File

@ -1,26 +0,0 @@

@{
Layout = null;
}
<link href="~/Content/scripts/layui/css/layui.css" rel="stylesheet" />
<link href="~/Content/mylayer.css" rel="stylesheet" />
<script src="~/Content/scripts/layui/layui.js"></script>
<script src="~/Content/scripts/jquery/jQuery-2.1.4.min.js"></script>
<script src="~/Content/scripts/zTree/js/jquery.ztree.core.js"></script>
<link href="/Content/scripts/zTree/css/metroStyle/metroStyle.css" rel="stylesheet" />
<div style="display: inline-block; width: 180px; height: 210px; padding: 10px; border: 1px solid #ddd; overflow: auto;">
<input style="display: none" id="firstId" value="@ViewBag.FirstId" />
<input style="display: none" id="moduleType" , value="@ViewBag.ModuleType" />
<ul id="orgtree" class="ztree" style="width: 100%"></ul>
</div>
<div class="site-tips" style="display: inline-block; height: 210px; width: 340px; padding: 10px; vertical-align: top;" id="demo2-view">
<form class="layui-form " action="" id="roles"></form>
</div>
<script src="~/BllScripts/grid.js"></script>
<script src="~/BllScripts/userRoleManager.js"></script>

View File

@ -1,101 +0,0 @@
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
<!-- #section:basics/content.breadcrumbs -->
<div class="breadcrumbs" id="breadcrumbs">
<ul class="breadcrumb">
<li>
<i class="ace-icon fa fa-home home-icon"></i>
<a href="#">进出库管理</a>
</li>
<li class="active">列表</li>
</ul><!-- /.breadcrumb -->
</div>
<!-- /section:basics/content.breadcrumbs -->
<div class="page-content">
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
<div class="widget-box widget-color-blue">
<div class="widget-header">
</div>
<div class="widget-body">
<div class="widget-main">
<ul id="orgtree" class="ztree" style="width: 100%"></ul>
</div>
</div>
</div>
</div>
<div class="col-md-9">
<div class="widget-box widget-color-blue">
<div class="widget-header">
@Html.Action("MenuHeader", "Home")
</div>
<div class="widget-body gridwidth">
<div class="widget-main">
<div class="row">
<div class="col-md-12 ">
<table id="maingrid"></table>
<div id="grid-pager"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- /.page-content -->
<!--编辑对话框-->
<div id="editDlg" style="display: none">
<div class="col-xs-12">
<form class="form-horizontal" id="editForm">
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 产品名称 </label>
<div class="col-sm-9">
<input type="text" id="Name" check-type="required" v-model="Name" />
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 产品数量 </label>
<div class="col-sm-9">
<input type="text" id="Number" check-type="required" v-model="Number"/>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 可见范围 </label>
<div class="col-sm-9">
<select name="User" id="User" v-model="User">
<option value="" selected="selected">全部可见</option>
<option value="ADMIN">管理员可见</option>
<option value="DEV">开发可见</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label no-padding-right" for=""> 申请部门</label>
<div class="col-sm-9">
<input id="ParentName" type="text" v-model="ParentName" />
<input id="OrgId" type="hidden" v-model="OrgId" />
<div id="menuContent" class="menuContent" style="display: none;">
<ul id="org" class="ztree"></ul>
</div>
</div>
</div>
</form>
</div>
</div>
<script src="~/BllScripts/grid.js"></script>
<script src="~/BllScripts/parentTree.js"></script>
<script src="~/BllScripts/StockManager.js"></script>
<script src="~/BllScripts/jqEvent.js"></script>

View File

@ -3,25 +3,14 @@
<link rel="stylesheet" href="/css/treetable.css" />
}
<blockquote class="layui-elem-quote news_search toolList">
<div class="layui-inline">
<div class="layui-input-inline">
<input class="layui-input" placeholder="请输入关键字"
name="key" id="key" autocomplete="off">
</div>
<button class="layui-btn" data-type="search">搜索</button>
</div>
@Html.Action("MenuHeader", "Home")
@*<button class="layui-btn " data-type="refresh">刷新</button>
<button class="layui-btn " data-type="addData">添加用户</button>
<button class="layui-btn layui-btn-danger" data-type="del">批量删除</button>
<button class="layui-btn layui-btn-danger" data-type="assignModule">为用户分配模块/菜单</button>*@
</blockquote>
<div style="display: flex;">
<ul id="tree" class="ztree" style="display: inline-block; width: 180px; padding: 10px; border: 1px solid #ddd; overflow: auto;"></ul>
<table class="layui-table"
lay-data="{height: 'full-80', page:true, id:'mainList'}"
lay-filter="list">
lay-filter="list" lay-size="sm">
<thead>
<tr>
<th lay-data="{checkbox:true, fixed: true}"></th>

View File

@ -20,6 +20,19 @@ layui.config({
where: config
});
}
//菜单列表
var menucon = {}; //table的参数如搜索key点击tree的id
var menuList = function (options) {
if (options != undefined) {
$.extend(menucon, options);
}
table.reload('menuList', {
url: '/ModuleManager/LoadMenus',
where: menucon
});
}
//左边树状机构列表
var ztree = function () {
var url = '/ModuleManager/LoadModule';
@ -46,7 +59,10 @@ layui.config({
};
var load = function () {
$.getJSON(url, function (json) {
zTreeObj = $.fn.zTree.init($("#tree"), setting, json);
zTreeObj = $.fn.zTree.init($("#tree"), setting);
var newNode = { Name: "根节点", Id: null, ParentId: "" };
json.push(newNode);
zTreeObj.addNodes(null, json);
mainList({ pId: "" });
zTreeObj.expandAll(true);
});
@ -75,9 +91,9 @@ layui.config({
},
end: mainList
});
var url = "/moduleManager/AddOrUpdate";
var url = "/moduleManager/Add";
if (update) {
url = "/moduleManager/AddOrUpdate"; //暂时和添加一个地址
url = "/moduleManager/Update";
}
//提交数据
form.on('submit(formSubmit)',
@ -95,7 +111,8 @@ layui.config({
add: function() { //弹出添加
update = false;
show({
Id: ''
Id: "",
SortNo:1
});
},
update: function(data) { //弹出编辑框
@ -109,7 +126,8 @@ layui.config({
table.on('tool(list)', function (obj) {
var data = obj.data;
if (obj.event === 'detail') { //查看
layer.msg('ID' + data.Id + ' 的查看操作');
//layer.msg('ID' + data.Id + ' 的查看操作');
menuList({moduleId:data.Id});
}
});

View File

@ -10,36 +10,25 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenAuth.Repository.Core;
namespace OpenAuth.Repository.Domain
{
/// <summary>
/// 功能模块表
/// </summary>
public partial class Module : Entity
public partial class Module : TreeEntity
{
public Module()
{
this.CascadeId= string.Empty;
this.Name= string.Empty;
this.Url= string.Empty;
this.HotKey= string.Empty;
this.IconName= string.Empty;
this.Status= 0;
this.ParentName= string.Empty;
this.Vector= string.Empty;
this.SortNo= 0;
this.ParentId= string.Empty;
}
/// <summary>
/// 节点语义ID
/// </summary>
public string CascadeId { get; set; }
/// <summary>
/// 功能模块名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 主页面URL
/// </summary>
@ -64,10 +53,7 @@ namespace OpenAuth.Repository.Domain
/// 当前状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 父节点名称
/// </summary>
public string ParentName { get; set; }
/// <summary>
/// 矢量图标
/// </summary>
@ -76,10 +62,6 @@ namespace OpenAuth.Repository.Domain
/// 排序号
/// </summary>
public int SortNo { get; set; }
/// <summary>
/// 父节点流水号
/// </summary>
public string ParentId { get; set; }
}
}