请选择 进入手机版 | 继续访问电脑版

马上加入IBC程序猿 各种源码随意下,各种教程随便看! 注册 每日签到 加入编程讨论群

C#教程 ASP.NET教程 C#视频教程程序源码享受不尽 C#问题入口 ASP.NET问题入口

【C#问题提交】 社群合作 申请版主 程序开发 【远程协助】 每天乐一乐 每日签到 【承接毕业设计】 面试-葵花宝典下载

官方一群:

官方二群:

查看: 107|回复: 0

1. mvc 树形控件tree + 表格jqgrid 显示界面

[复制链接]
  • TA的每日心情
    开心
    前天 08:53
  • 签到天数: 1448 天

    [LV.10]以坛为家III

    934

    主题

    2836

    帖子

    9万

    积分

    管理员

    IBC编程社区-原道楠

    Rank: 9Rank: 9Rank: 9

    积分
    92251

    推广达人突出贡献优秀版主荣誉管理论坛元老

    发表于 2019-8-13 17:41:22 | 显示全部楼层 |阅读模式

    马上加入IBC,查看更多教程

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x

    1.界面显示效果

    174510qi6b9lvkiiggbg0k.png

    2.资源下载 地址

    1. jstree https://www.jstree.com/ 2.表格jqgrid https://blog.mn886.net/jqGrid/ 3.界面布局 https://cloud.tencent.com/developer/section/1489925

    3.前端代码

    174511feppolbbrponwkbl.gif
    174511z4dw3lgt828y7wzg.gif
    1. @{
    2. ViewBag.Title = "系统功能";
    3. Layout = "~/Views/Shared/_Index.cshtml";
    4. }
    5. <script>
    6. $(function () {
    7. InitialPage();
    8. GetTree();
    9. GetGrid();
    10. });
    11. //初始化页面
    12. function InitialPage() {
    13. //layout布局
    14. $('#layout').layout({
    15. applyDemoStyles: true,
    16. onresize: function () {
    17. $(window).resize()
    18. }
    19. });
    20. //resize重设(表格、树形)宽高
    21. $(window).resize(function (e) {
    22. window.setTimeout(function () {
    23. $('#gridTable').setGridWidth(($('.gridPanel').width()));
    24. $("#gridTable").setGridHeight($(window).height() - 141.5);
    25. $("#itemTree").setTreeHeight($(window).height() - 52);
    26. }, 200);
    27. e.stopPropagation();
    28. });
    29. }
    30. //加载树
    31. var _parentId = "";
    32. function GetTree() {
    33. var item = {
    34. height: $(window).height() - 52,
    35. url: "../../SystemManager/Module/GetTreeJson",
    36. onnodeclick: function (item) {
    37. _parentId = item.id;
    38. $('#btn_Search').trigger("click");
    39. }
    40. };
    41. //初始化
    42. $("#itemTree").treeview(item);
    43. }
    44. //加载表格
    45. function GetGrid() {
    46. var selectedRowIndex = 0;
    47. var $gridTable = $('#gridTable');
    48. $gridTable.jqGrid({
    49. url: "../../SystemManager/Module/GetListJson?parentid=0",
    50. datatype: "json",
    51. height: $(window).height() - 141.5,
    52. autowidth: true,
    53. colModel: [
    54. { label: "主键", name: "ModuleId", index: "ModuleId", hidden: true },
    55. { label: "编号", name: "EnCode", index: "EnCode", width: 150, align: "left" },
    56. { label: "名称", name: "FullName", index: "FullName", width: 150, align: "left" },
    57. { label: "地址", name: "UrlAddress", index: "UrlAddress", width: 350, align: "left" },
    58. { label: "目的", name: "Target", index: "Target", width: 60, align: "center" },
    59. {
    60. label: "菜单", name: "IsMenu", index: "IsMenu", width: 50, align: "center",
    61. formatter: function (cellvalue, options, rowObject) {
    62. return cellvalue == 1 ? "<i value=" + cellvalue + " class="fa fa-toggle-on"></i>" : "<i value=" + cellvalue + " class="fa fa-toggle-off"></i>";
    63. }
    64. },
    65. {
    66. label: "展开", name: "AllowExpand", index: "AllowExpand", width: 50, align: "center",
    67. formatter: function (cellvalue, options, rowObject) {
    68. return cellvalue == 1 ? "<i class="fa fa-toggle-on"></i>" : "<i class="fa fa-toggle-off"></i>";
    69. }
    70. },
    71. {
    72. label: "公共", name: "IsPublic", index: "IsPublic", width: 50, align: "center",
    73. formatter: function (cellvalue, options, rowObject) {
    74. return cellvalue == 1 ? "<i class="fa fa-toggle-on"></i>" : "<i class="fa fa-toggle-off"></i>";
    75. }
    76. },
    77. {
    78. label: "有效", name: "EnabledMark", index: "EnabledMark", width: 50, align: "center",
    79. formatter: function (cellvalue, options, rowObject) {
    80. return cellvalue == 1 ? "<i class="fa fa-toggle-on"></i>" : "<i class="fa fa-toggle-off"></i>";
    81. }
    82. },
    83. { label: "描述", name: "Description", index: "Description", width: 100, align: "left" }
    84. ],
    85. pager: false,
    86. rowNum: "1000",
    87. rownumbers: true,
    88. shrinkToFit: false,
    89. gridview: true,
    90. onSelectRow: function () {
    91. selectedRowIndex = $("#" + this.id).getGridParam('selrow');
    92. },
    93. gridComplete: function () {
    94. $("#" + this.id).setSelection(selectedRowIndex, false);
    95. }
    96. });
    97. //查询条件
    98. $("#queryCondition .dropdown-menu li").click(function () {
    99. var text = $(this).find('a').html();
    100. var value = $(this).find('a').attr('data-value');
    101. $("#queryCondition .dropdown-text").html(text).attr('data-value', value)
    102. });
    103. //查询变乱
    104. $("#btn_Search").click(function () {
    105. $gridTable.jqGrid('setGridParam', {
    106. url: "../../SystemManager/Module/GetListJson",
    107. postData: {
    108. parentid: _parentId,
    109. condition: $("#queryCondition").find('.dropdown-text').attr('data-value'),
    110. keyword: $("#txt_Keyword").val()
    111. }
    112. }).trigger('reloadGrid');
    113. });
    114. //查询回车
    115. $('#txt_Keyword').bind('keypress', function (event) {
    116. if (event.keyCode == "13") {
    117. $('#btn_Search').trigger("click");
    118. }
    119. });
    120. }
    121. //新增
    122. function btn_add() {
    123. dialogOpen({
    124. id: "Form",
    125. title: '添加功能',
    126. url: '/SystemManager/Module/Form?parentId=' + _parentId,
    127. width: "700px",
    128. height: "430px",
    129. btn: null
    130. });
    131. };
    132. //编辑
    133. function btn_edit() {
    134. var keyValue = $("#gridTable").jqGridRowValue("ModuleId");
    135. if (checkedRow(keyValue)) {
    136. dialogOpen({
    137. id: "Form",
    138. title: '编辑功能',
    139. url: '/SystemManager/Module/Form?keyValue=' + keyValue,
    140. width: "700px",
    141. height: "430px",
    142. btn: null
    143. });
    144. }
    145. }
    146. //删除
    147. function btn_delete() {
    148. var keyValue = $("#gridTable").jqGridRowValue("ModuleId");
    149. if (keyValue) {
    150. $.RemoveForm({
    151. url: "../../SystemManager/Module/RemoveForm",
    152. param: { keyValue: keyValue },
    153. success: function (data) {
    154. $("#gridTable").trigger("reloadGrid");
    155. }
    156. })
    157. } else {
    158. dialogMsg('请选择需要删除的数据项!', 0);
    159. }
    160. }
    161. </script>
    162. <div class="ui-layout" id="layout" style="height: 100%; width: 100%;">
    163. <div class="ui-layout-west">
    164. <div class="west-Panel">
    165. <div class="panel-Title">功能目录</div>
    166. <div id="itemTree"></div>
    167. </div>
    168. </div>
    169. <div class="ui-layout-center">
    170. <div class="center-Panel">
    171. <div class="panel-Title">功能信息</div>
    172. <div class="titlePanel">
    173. <div class="title-search">
    174. <table>
    175. <tr>
    176. <td>
    177. <div id="queryCondition" class="btn-group">
    178. <a class="btn btn-default dropdown-text" data-toggle="dropdown">选择条件</a>
    179. <a class="btn btn-default dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></a>
    180. <ul class="dropdown-menu">
    181. <li><a data-value="EnCode">编号</a></li>
    182. <li><a data-value="FullName">名称</a></li>
    183. <li><a data-value="UrlAddress">地址</a></li>
    184. </ul>
    185. </div>
    186. </td>
    187. <td style="padding-left: 2px;">
    188. <input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字" style="width: 200px;" />
    189. </td>
    190. <td style="padding-left: 5px;">
    191. <a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
    192. </td>
    193. </tr>
    194. </table>
    195. </div>
    196. <div class="toolbar">
    197. <div class="btn-group">
    198. <a id="lr-replace" class="btn btn-default" onclick="reload();"><i class="fa fa-refresh"></i>&nbsp;刷新</a>
    199. <a id="lr-add" class="btn btn-default" onclick="btn_add()"><i class="fa fa-plus"></i>&nbsp;新增</a>
    200. <a id="lr-edit" class="btn btn-default" onclick="btn_edit()"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
    201. <a id="lr-delete" class="btn btn-default" onclick="btn_delete()"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
    202. </div>
    203. <script>$('.toolbar').authorizeButton()</script>
    204. </div>
    205. </div>
    206. <div class="gridPanel">
    207. <table id="gridTable"></table>
    208. </div>
    209. </div>
    210. </div>
    211. </div>
    复制代码
    View Code

    4后端代码

    4.1 control

    174512hbbv9saq0jys46ba.gif
    174512qyrps1ppqq1xpyij.gif
    1. /// <summary>
    2. /// 功能列表
    3. /// </summary>
    4. /// <param name="parentid">节点Id</param>
    5. /// <param name="condition">查询条件</param>
    6. /// <param name="keyword">关键字</param>
    7. /// <returns>返回列表Json</returns>
    8. [HttpGet]
    9. public ActionResult GetListJson(string parentid, string condition, string keyword)
    10. {
    11. var data = NewObject<ModuleLogic>().GetListByCondition(parentid).datas;
    12. if (!string.IsNullOrEmpty(condition) && !string.IsNullOrEmpty(keyword))
    13. {
    14. #region 多条件查询
    15. switch (condition)
    16. {
    17. case "EnCode": //编号
    18. data = data.FindAll(t => t.EnCode.Contains(keyword));
    19. break;
    20. case "FullName": //名称
    21. data = data.FindAll(t => t.FullName.Contains(keyword));
    22. break;
    23. case "UrlAddress": //地址
    24. data = data.FindAll(t => t.UrlAddress.Contains(keyword));
    25. break;
    26. default:
    27. break;
    28. }
    29. #endregion
    30. }
    31. return Content(JsonHelper.ToJson(data));
    32. }
    33. /// <summary>
    34. /// 功能列表
    35. /// </summary>
    36. /// <param name="keyword">关键字</param>
    37. /// <returns>返回树形Json</returns>
    38. [HttpGet]
    39. public ActionResult GetTreeJson(string keyword)
    40. {
    41. var data = NewObject<ModuleLogic>().GetListByCache().datas;
    42. if (!string.IsNullOrEmpty(keyword))
    43. {
    44. data = data.TreeWhere(t => t.FullName.Contains(keyword), "");
    45. }
    46. var treeList = new List<TreeEntity>();
    47. foreach (ModuleEntity item in data)
    48. {
    49. TreeEntity tree = new TreeEntity();
    50. bool hasChildren = data.Count(t => t.ParentId == item.ModuleId) == 0 ? false : true;
    51. tree.id = item.ModuleId.ToConvertString();
    52. tree.text = item.FullName;
    53. tree.value = item.ModuleId.ToConvertString();
    54. tree.isexpand = true;
    55. tree.complete = true;
    56. tree.hasChildren = hasChildren;
    57. tree.parentId = item.ParentId.ToConvertString();
    58. // tree.img = item.Icon;
    59. treeList.Add(tree);
    60. }
    61. return Content(treeList.TreeToJson());
    62. }
    复制代码
    View Code

    4.2 逻辑层

    174512lygfvvmvvtvg0e7m.gif
    174512nm9m5xgsixcxc52z.gif
    1. /*
    2. * ==============================================================================
    3. * File name: ModuleLogic
    4. * Description:
    5. * Version: 1.0
    6. * Created: 2017/07/26 15:30:50
    7. * Author: 蔡創捷
    8. * ==============================================================================
    9. */
    10. using System;
    11. using CommonLibrary.Log;
    12. using CommonContract.Base;
    13. using CommonContract.Entity;
    14. using CommonContract.Condition;
    15. using System.Collections.Generic;
    16. using MIT.Application.Dao.BaseManager;
    17. using CommonLibrary.Serializer;
    18. using System.Linq;
    19. using CommonContract.Result;
    20. using CommonLibrary.Base;
    21. namespace MIT.Application.Logic.BaseManager
    22. {
    23. public class ModuleLogic : BaseLogic<ModuleEntity, ModuleDao>
    24. {
    25. public Results<List<ModuleEntity>> GetListByCondition(string parentid)
    26. {
    27. Results<List<ModuleEntity>> result = new Results<List<ModuleEntity>>();
    28. result.datas = NewObject<ModuleDao>().GetListByCondition(true, it => it.ParentId == parentid, it => it.SortCode);
    29. return result;
    30. }
    31. #region 通過條件獲取所有數據
    32. public Results<int> GetSortCode()
    33. {
    34. Results<int> result = new Results<int>();
    35. int SortCode = 0;
    36. SortCode = NewObject<ModuleDao>().GetSortCode();
    37. result.datas = SortCode;
    38. return result;
    39. }
    40. #endregion
    41. #region 保存數據(新增、修改)
    42. public Results SaveForm(string keyValue, ModuleEntity moduleEntity, string moduleButtonListJson, string moduleColumnListJson)
    43. {
    44. Results result = new Results();
    45. var moduleButtonList = JsonHelper.ToObject<List<ModuleButtonEntity>>(moduleButtonListJson);
    46. var moduleColumnList = JsonHelper.ToObject<List<ModuleColumnEntity>>(moduleColumnListJson);
    47. int res = NewObject<ModuleDao>().SaveForm(keyValue, moduleEntity, moduleButtonList, moduleColumnList);
    48. result.isSuccess =(res > 0);
    49. return result;
    50. }
    51. #endregion
    52. #region 获取授权菜單
    53. public Results<List<ModuleEntity>> GetModuleList(string userId)
    54. {
    55. Results<List<ModuleEntity>> result = new Results<List<ModuleEntity>>();
    56. List<ModuleEntity> list = null;
    57. if (userId == "System")
    58. {
    59. list = NewObject<ModuleDao>().GetList();
    60. }
    61. else
    62. {
    63. list = NewObject<ModuleDao>().GetModuleList(userId);
    64. }
    65. list = list.OrderBy(it => it.SortCode).ToList() ;
    66. result.datas = list;
    67. return result;
    68. }
    69. #endregion
    70. }
    71. }
    复制代码
    View Code

    4.3数据层

    174512gr3elv14pip69qzl.gif
    174512qiyjy2t6zgwqrg72.gif
    1. /*
    2. * ==============================================================================
    3. * File name: ModuleDao
    4. * Description:
    5. * Version: 1.0
    6. * Created: 2017/07/26 15:28:10
    7. * Author: 蔡創捷
    8. * ==============================================================================
    9. */
    10. using System;
    11. using System.Collections.Generic;
    12. using CommonLibrary.Serializer;
    13. using CommonContract.Condition;
    14. using CommonContract.Entity;
    15. using CommonLibrary.Cache;
    16. using CommonLibrary.SqlDB;
    17. using CommonLibrary.ExtendsMethod;
    18. using CommonLibrary.Log;
    19. using SqlSugar;
    20. using System.Text;
    21. namespace MIT.Application.Dao.BaseManager
    22. {
    23. //系统功能表
    24. public class ModuleDao : BaseDao<ModuleEntity>
    25. {
    26. public ModuleDao()
    27. {
    28. base.CacheKey = "ModuleCacheKey";
    29. }
    30. /// <summary>
    31. /// 获取最大编号
    32. /// </summary>
    33. /// <returns></returns>
    34. public int GetSortCode()
    35. {
    36. var db = SqlSugarHelper.GetInstance();
    37. int sortCode = db.Queryable<ModuleEntity>().Max(it => it.SortCode).ToInt();
    38. if (!string.IsNullOrEmpty(sortCode.ToString()))
    39. {
    40. return sortCode + 1;
    41. }
    42. return 100001;
    43. }
    44. /// <summary>
    45. /// 通過分页獲取數據
    46. /// </summary>
    47. public List<ModuleEntity> GetListByPage(PageInfo pageInfo, string queryJson)
    48. {
    49. var db = SqlSugarHelper.GetInstance();
    50. int totalCount = 0;
    51. var queryParam = JsonHelper.ToJObject(queryJson);
    52. string parentid = queryParam["parentid"].ToConvertString();
    53. string condition = queryParam["condition"].ToConvertString();
    54. string keyword = queryParam["keyword"].ToConvertString();
    55. List<ModuleEntity> list = db.Queryable<ModuleEntity>()
    56. .WhereIF(!parentid.IsEmpty(), it => it.ParentId == parentid)
    57. .WhereIF(!keyword.IsEmpty() && condition == "EnCode", it => it.EnCode.Contains(keyword))
    58. .WhereIF(!keyword.IsEmpty() && condition == "FullName", it => it.FullName.Contains(keyword))
    59. .WhereIF(!keyword.IsEmpty() && condition == "UrlAddress", it => it.UrlAddress.Contains(keyword))
    60. .OrderBy(it => it.SortCode)
    61. .ToPageList(pageInfo.page, pageInfo.limit, ref totalCount);
    62. pageInfo.records = totalCount;
    63. return list;
    64. }
    65. /// <summary>
    66. /// 删除功能
    67. /// </summary>
    68. /// <param name="keyValue">主键</param>
    69. public new int RemoveForm(string keyValue)
    70. {
    71. var db = SqlSugarHelper.GetInstance();
    72. db.Ado.BeginTran();
    73. try
    74. {
    75. int count = db.Queryable<ModuleEntity>().Where(t => t.ParentId == keyValue).Count();
    76. if (count > 0)
    77. {
    78. throw new Exception("当前所选数据有子节点数据!");
    79. }
    80. db.DeleteableEx<ModuleEntity>(keyValue);
    81. db.DeleteableEx<ModuleButtonEntity>(t => t.ModuleId == keyValue);
    82. db.DeleteableEx<ModuleColumnEntity>(t => t.ModuleId == keyValue);
    83. db.Ado.CommitTran();
    84. return 1;
    85. }
    86. catch (Exception ex)
    87. {
    88. db.Ado.RollbackTran();
    89. LogHelper.WriteError(ex, "删除菜單失敗");
    90. throw;
    91. }
    92. }
    93. /// <summary>
    94. /// 保存數據(新增、修改)
    95. /// </summary>
    96. /// <param name="keyValue">主键值</param>
    97. /// <param name="Entity">实体</param>
    98. /// <returns></returns>
    99. public int SaveForm(string keyValue, ModuleEntity moduleEntity, List<ModuleButtonEntity> moduleButtonList, List<ModuleColumnEntity> moduleColumnList)
    100. {
    101. var db = SqlSugarHelper.GetInstance();
    102. PageCacheManager.Current.RemoveCache(base.CacheKey);
    103. int resVal = 0;
    104. try
    105. {
    106. db.Ado.BeginTran();
    107. if (!string.IsNullOrEmpty(keyValue))
    108. {
    109. moduleEntity.Modify(keyValue);
    110. resVal = db.UpdateableEx(moduleEntity);
    111. }
    112. else
    113. {
    114. moduleEntity.Create();
    115. resVal = db.InsertableEx(moduleEntity);
    116. }
    117. db.DeleteableEx<ModuleButtonEntity>(it => it.ModuleId == keyValue);
    118. if (moduleButtonList != null && moduleButtonList.Count !=0)
    119. {
    120. foreach (var item in moduleButtonList)
    121. {
    122. item.Create();
    123. item.ModuleId = moduleEntity.ModuleId;
    124. item.ParentId = "0";
    125. }
    126. db.InsertableEx(moduleButtonList.ToArray());
    127. }
    128. db.DeleteableEx<ModuleColumnEntity>(it => it.ModuleId == keyValue);
    129. if (moduleColumnList != null && moduleColumnList.Count != 0)
    130. {
    131. foreach (var item in moduleColumnList)
    132. {
    133. item.Create();
    134. item.ModuleId = moduleEntity.ModuleId;
    135. item.ParentId = "0";
    136. }
    137. db.InsertableEx(moduleColumnList.ToArray());
    138. }
    139. db.Ado.CommitTran();
    140. return resVal;
    141. }
    142. catch (Exception)
    143. {
    144. db.Ado.RollbackTran();
    145. throw;
    146. }
    147. }
    148. /// <summary>
    149. /// 获取授权菜單
    150. /// </summary>
    151. /// <param name="userId">用户Id</param>
    152. /// <returns></returns>
    153. public List<ModuleEntity> GetModuleList(string userId)
    154. {
    155. var db = SqlSugarHelper.GetInstance();
    156. StringBuilder strSql = new StringBuilder();
    157. strSql.Append(@"SELECT *
    158. FROM Base_Module
    159. WHERE ModuleId IN (
    160. SELECT ItemId
    161. FROM Base_Authorize
    162. WHERE ItemType = 1
    163. AND ( ObjectId IN (
    164. SELECT ObjectId
    165. FROM Base_UserRelation
    166. WHERE UserId = @UserId ) )
    167. OR (ItemType = 1 and ObjectId = @UserId) )
    168. AND EnabledMark = 1 AND DeleteMark = 0 Order By SortCode");
    169. var dt = db.Ado.SqlQuery<ModuleEntity>(strSql.ToString(), new { UserId = userId });
    170. return dt;
    171. }
    172. }
    173. }
    复制代码
    View Code

    5.數據格式

    5.1表格jqgrid-json

    174512mrt412n42ngq8z5g.gif
    174512mna3qr43m3k4qrqj.gif
    1. [{"ModuleId":"1","ParentId":"0","EnCode":"SysManage","FullName":"系统管理","Icon":"fa fa-desktop","UrlAddress":null,"Target":"expand","IsMenu":0,"AllowExpand":1,"IsPublic":0,"AllowEdit":null,"AllowDelete":null,"SortCode":1,"DeleteMark":0,"EnabledMark":1,"Description":null,"CreateDate":null,"CreateUserId":null,"CreateUserName":null,"ModifyDate":"2015-11-17 11:22:46","ModifyUserId":"System","ModifyUserName":"超级管理员"},{"ModuleId":"2","ParentId":"0","EnCode":"BaseManage","FullName":"单位组织","Icon":"fa fa-coffee","UrlAddress":null,"Target":"expand","IsMenu":0,"AllowExpand":1,"IsPublic":0,"AllowEdit":null,"AllowDelete":null,"SortCode":2,"DeleteMark":0,"EnabledMark":1,"Description":null,"CreateDate":null,"CreateUserId":null,"CreateUserName":null,"ModifyDate":"2016-03-11 11:02:06","ModifyUserId":"0f36148c-719f-41e0-8c8c-16ffbc40d0e0","ModifyUserName":"佘赐雄"},{"ModuleId":"5","ParentId":"0","EnCode":"FlowManage","FullName":"工作流程","Icon":"fa fa-share-alt","UrlAddress":null,"Target":"expand","IsMenu":0,"AllowExpand":1,"IsPublic":0,"AllowEdit":null,"AllowDelete":null,"SortCode":3,"DeleteMark":0,"EnabledMark":1,"Description":null,"CreateDate":null,"CreateUserId":null,"CreateUserName":null,"ModifyDate":"2016-04-11 10:21:44","ModifyUserId":"System","ModifyUserName":"超级管理员"},{"ModuleId":"6","ParentId":"0","EnCode":"ReportManage","FullName":"报表中央","Icon":"fa fa-area-chart","UrlAddress":null,"Target":"expand","IsMenu":0,"AllowExpand":1,"IsPublic":0,"AllowEdit":null,"AllowDelete":null,"SortCode":4,"DeleteMark":0,"EnabledMark":1,"Description":null,"CreateDate":null,"CreateUserId":null,"CreateUserName":null,"ModifyDate":"2016-04-11 10:21:54","ModifyUserId":"System","ModifyUserName":"超级管理员"},{"ModuleId":"4","ParentId":"0","EnCode":"CommonInfo","FullName":"公共信息","Icon":"fa fa-globe","UrlAddress":null,"Target":"expand","IsMenu":0,"AllowExpand":1,"IsPublic":0,"AllowEdit":null,"AllowDelete":null,"SortCode":5,"DeleteMark":0,"EnabledMark":1,"Description":null,"CreateDate":null,"CreateUserId":null,"CreateUserName":null,"ModifyDate":"2016-04-11 10:21:59","ModifyUserId":"System","ModifyUserName":"超级管理员"},{"ModuleId":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","ParentId":"0","EnCode":"CustomerManage","FullName":"客户关系","Icon":"fa fa-briefcase","UrlAddress":null,"Target":"expand","IsMenu":0,"AllowExpand":1,"IsPublic":0,"AllowEdit":null,"AllowDelete":null,"SortCode":6,"DeleteMark":0,"EnabledMark":1,"Description":"客户关系管理","CreateDate":"2016-03-11 10:53:05","CreateUserId":"0f36148c-719f-41e0-8c8c-16ffbc40d0e0","CreateUserName":"佘赐雄","ModifyDate":"2016-04-21 16:00:07","ModifyUserId":"System","ModifyUserName":"超级管理员"},{"ModuleId":"7","ParentId":"0","EnCode":"DemoManage","FullName":"常用示例","Icon":"fa fa-tags","UrlAddress":null,"Target":"expand","IsMenu":0,"AllowExpand":1,"IsPublic":0,"AllowEdit":null,"AllowDelete":null,"SortCode":7,"DeleteMark":0,"EnabledMark":0,"Description":null,"CreateDate":null,"CreateUserId":null,"CreateUserName":null,"ModifyDate":"2016-04-26 14:58:24","ModifyUserId":"System","ModifyUserName":"超级管理员"}]
    复制代码
    View Code

    5.2 jstree -json

    174513ln1ns03mlncrs3er.gif
    174513alodqlqmyoskm2nl.gif
    1. [{"id":"1","text":"系统管理","value":"1","parentnodes":"0","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"4efd37bf-e3ef-4ced-8248-58eba046d78b","text":"通用字典","value":"4efd37bf-e3ef-4ced-8248-58eba046d78b","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"7ae94059-9aa5-48eb-8330-4e2a6565b193","text":"行政区域","value":"7ae94059-9aa5-48eb-8330-4e2a6565b193","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"7adc5a16-54a4-408e-a101-2ddab8117d67","text":"单据编码","value":"7adc5a16-54a4-408e-a101-2ddab8117d67","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"7cec0a0f-7204-4240-b009-312fa0c11cbf","text":"数据管理","value":"7cec0a0f-7204-4240-b009-312fa0c11cbf","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"34e362f4-c220-4fb7-b3f0-288c83417cb3","text":"数据库连接","value":"34e362f4-c220-4fb7-b3f0-288c83417cb3","parentnodes":"7cec0a0f-7204-4240-b009-312fa0c11cbf","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"2f820f6e-ae2e-472f-82cc-0129a2a57597","text":"数据表管理","value":"2f820f6e-ae2e-472f-82cc-0129a2a57597","parentnodes":"7cec0a0f-7204-4240-b009-312fa0c11cbf","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"c4d7ce1f-72de-4651-b495-6c466261e9af","text":"数据库备份","value":"c4d7ce1f-72de-4651-b495-6c466261e9af","parentnodes":"7cec0a0f-7204-4240-b009-312fa0c11cbf","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"f21fa3a0-c523-4d02-99ca-fd8dd3ae3d59","text":"系统日志","value":"f21fa3a0-c523-4d02-99ca-fd8dd3ae3d59","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"21","text":"系统功能","value":"21","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"b9f9df92-8ac5-46e2-90ac-68c5c2e034c3","text":"微信管理","value":"b9f9df92-8ac5-46e2-90ac-68c5c2e034c3","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"a977d91e-77b7-4d60-a7ad-dfbc138f7c0a","text":"企业号设置","value":"a977d91e-77b7-4d60-a7ad-dfbc138f7c0a","parentnodes":"b9f9df92-8ac5-46e2-90ac-68c5c2e034c3","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"5cc9d2d9-e097-4b51-9b9e-84ca9f1a0ab5","text":"企业号部分","value":"5cc9d2d9-e097-4b51-9b9e-84ca9f1a0ab5","parentnodes":"b9f9df92-8ac5-46e2-90ac-68c5c2e034c3","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"4d0f2e44-f68f-41fd-a55c-40ac67453ef4","text":"企业号成员","value":"4d0f2e44-f68f-41fd-a55c-40ac67453ef4","parentnodes":"b9f9df92-8ac5-46e2-90ac-68c5c2e034c3","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"aa844d70-7211-41d9-907a-f9a10f4ac801","text":"企业号应用","value":"aa844d70-7211-41d9-907a-f9a10f4ac801","parentnodes":"b9f9df92-8ac5-46e2-90ac-68c5c2e034c3","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"cfa631fe-e7f8-42b5-911f-7172f178a811","text":"快速开发","value":"cfa631fe-e7f8-42b5-911f-7172f178a811","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"b0261df5-7be0-4c8e-829c-15836e200af0","text":"系统表单","value":"b0261df5-7be0-4c8e-829c-15836e200af0","parentnodes":"1","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"2","text":"单位组织","value":"2","parentnodes":"0","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"8","text":"机构管理","value":"8","parentnodes":"2","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"9","text":"部分管理","value":"9","parentnodes":"2","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"10","text":"用户管理","value":"10","parentnodes":"2","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"11","text":"角色管理","value":"11","parentnodes":"2","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"12","text":"职位管理","value":"12","parentnodes":"2","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"13","text":"岗位管理","value":"13","parentnodes":"2","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"14","text":"用户组管理","value":"14","parentnodes":"2","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"4","text":"公共信息","value":"4","parentnodes":"0","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"23713d3a-810f-422d-acd5-39bec28ce47e","text":"日程管理","value":"23713d3a-810f-422d-acd5-39bec28ce47e","parentnodes":"4","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"e35d24ce-8a6a-46b9-8b3f-6dc864a8f342","text":"新闻中央","value":"e35d24ce-8a6a-46b9-8b3f-6dc864a8f342","parentnodes":"4","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"6252983c-52f5-402c-991b-ad19a9cb1f94","text":"通知公告","value":"6252983c-52f5-402c-991b-ad19a9cb1f94","parentnodes":"4","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"04b88c96-8d99-45ec-956c-444efa630020","text":"文件资料","value":"04b88c96-8d99-45ec-956c-444efa630020","parentnodes":"4","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"c6b80ed5-b0cb-4844-ba1a-725d2cb4f935","text":"邮件中央","value":"c6b80ed5-b0cb-4844-ba1a-725d2cb4f935","parentnodes":"4","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"5","text":"工作流程","value":"5","parentnodes":"0","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"1b642904-d674-495f-a1e1-4814cc543870","text":"发起流程","value":"1b642904-d674-495f-a1e1-4814cc543870","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"b5cb98f6-fb41-4a0f-bc11-469ff117a411","text":"流程管理","value":"b5cb98f6-fb41-4a0f-bc11-469ff117a411","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"27b6c487-a2d9-4a3a-a40d-dbba27a53d26","text":"流程监控","value":"27b6c487-a2d9-4a3a-a40d-dbba27a53d26","parentnodes":"b5cb98f6-fb41-4a0f-bc11-469ff117a411","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"c0544bfd-a557-45fc-a856-a678a1e88bfc","text":"流程指派","value":"c0544bfd-a557-45fc-a856-a678a1e88bfc","parentnodes":"b5cb98f6-fb41-4a0f-bc11-469ff117a411","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"691f3810-a602-4523-8518-ce5856482d48","text":"草稿流程","value":"691f3810-a602-4523-8518-ce5856482d48","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"0d296398-bc0e-4f38-996a-6e24bc88cc53","text":"待办流程","value":"0d296398-bc0e-4f38-996a-6e24bc88cc53","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"923f7d65-e307-45f7-8f96-73ecbf23b324","text":"已办流程","value":"923f7d65-e307-45f7-8f96-73ecbf23b324","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"6a67a67f-ef07-41e7-baa5-00bc5f662a76","text":"工作委托","value":"6a67a67f-ef07-41e7-baa5-00bc5f662a76","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"021a59b0-2589-4f9e-8140-6052177a967c","text":"我的流程","value":"021a59b0-2589-4f9e-8140-6052177a967c","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"458113c6-b0be-4d6f-acce-7524f4bc3e88","text":"流程配置","value":"458113c6-b0be-4d6f-acce-7524f4bc3e88","parentnodes":"5","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"08dfd779-92d5-4cd8-9982-a76176af0f7c","text":"流程种别","value":"08dfd779-92d5-4cd8-9982-a76176af0f7c","parentnodes":"458113c6-b0be-4d6f-acce-7524f4bc3e88","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"f63a252b-975f-4832-a5be-1ce733bc8ece","text":"流程设计","value":"f63a252b-975f-4832-a5be-1ce733bc8ece","parentnodes":"458113c6-b0be-4d6f-acce-7524f4bc3e88","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"a57993fa-5a94-44a8-a330-89196515c1d9","text":"表单设计","value":"a57993fa-5a94-44a8-a330-89196515c1d9","parentnodes":"458113c6-b0be-4d6f-acce-7524f4bc3e88","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"00ae31cf-b340-4c17-9ee7-6dd08943df02","text":"表单种别","value":"00ae31cf-b340-4c17-9ee7-6dd08943df02","parentnodes":"458113c6-b0be-4d6f-acce-7524f4bc3e88","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]}]},{"id":"6","text":"报表中央","value":"6","parentnodes":"0","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"affacee1-41a3-4c7b-8804-f1c1926babbd","text":"采购报表","value":"affacee1-41a3-4c7b-8804-f1c1926babbd","parentnodes":"6","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"ff1823b5-a966-4e6c-83de-807854f4f0fb","text":"销售报表","value":"ff1823b5-a966-4e6c-83de-807854f4f0fb","parentnodes":"6","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"92a535c9-4d4b-4500-968d-a142e671c09b","text":"报表管理","value":"92a535c9-4d4b-4500-968d-a142e671c09b","parentnodes":"6","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"ddce0dc1-3345-41b7-9716-22641fbbfaed","text":"销售日报表","value":"ddce0dc1-3345-41b7-9716-22641fbbfaed","parentnodes":"6","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"901e6122-985d-4c84-8d8c-56560520f6ed","text":"仓存报表","value":"901e6122-985d-4c84-8d8c-56560520f6ed","parentnodes":"6","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"9db71a92-2ecb-496c-839f-7a82bc22905d","text":"对账报表","value":"9db71a92-2ecb-496c-839f-7a82bc22905d","parentnodes":"6","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"7","text":"常用示例","value":"7","parentnodes":"0","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","text":"客户关系","value":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","parentnodes":"0","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","text":"基础设置","value":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":true,"ChildNodes":[{"id":"6be31cc9-4aee-4279-8435-4b266cec33f0","text":"客户行业","value":"6be31cc9-4aee-4279-8435-4b266cec33f0","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"c30310a7-d0a5-4bf6-8655-c3834a8cc73d","text":"客户种别","value":"c30310a7-d0a5-4bf6-8655-c3834a8cc73d","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"aed02ee7-322f-47f0-8ad6-ab0a2172628f","text":"客户程度","value":"aed02ee7-322f-47f0-8ad6-ab0a2172628f","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"52fe82f8-41ba-433e-9351-ef67e5b35217","text":"客户级别","value":"52fe82f8-41ba-433e-9351-ef67e5b35217","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"be9cbe61-265f-4ddd-851e-d5a1cef6011b","text":"商机来源","value":"be9cbe61-265f-4ddd-851e-d5a1cef6011b","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"80620d6f-55bd-492b-9c21-1b04ca268e75","text":"商机阶段","value":"80620d6f-55bd-492b-9c21-1b04ca268e75","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"62af0605-4558-47b1-9530-bc3515036b37","text":"收支账户","value":"62af0605-4558-47b1-9530-bc3515036b37","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"3b03806d-98d8-40fe-9895-01633119458c","text":"产品信息","value":"3b03806d-98d8-40fe-9895-01633119458c","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"77f13de5-32ad-4226-9e24-f1db507e78cb","text":"收支方式","value":"77f13de5-32ad-4226-9e24-f1db507e78cb","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"eab4a37f-d976-42b7-9589-489ed0678151","text":"付出种类","value":"eab4a37f-d976-42b7-9589-489ed0678151","parentnodes":"16d4e2d5-d154-455f-94f7-63bf80ab26aa","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]},{"id":"66f6301c-1789-4525-a7d2-2b83272aafa6","text":"商机管理","value":"66f6301c-1789-4525-a7d2-2b83272aafa6","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"1d3797f6-5cd2-41bc-b769-27f2513d61a9","text":"客户管理","value":"1d3797f6-5cd2-41bc-b769-27f2513d61a9","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"b352f049-4331-4b19-ac22-e379cb30bd55","text":"客户订单","value":"b352f049-4331-4b19-ac22-e379cb30bd55","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"5f1fa264-cc9b-4146-b49e-743e4633bb4c","text":"客户开票","value":"5f1fa264-cc9b-4146-b49e-743e4633bb4c","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"535d92e9-e066-406c-b2c2-697150a5bdff","text":"收款管理","value":"535d92e9-e066-406c-b2c2-697150a5bdff","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"1ef31fba-7f0a-46f7-b533-49dd0c2e51e0","text":"收款报表","value":"1ef31fba-7f0a-46f7-b533-49dd0c2e51e0","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"9fc384f5-efb7-439e-9fe1-3e50807e6399","text":"付出管理","value":"9fc384f5-efb7-439e-9fe1-3e50807e6399","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]},{"id":"dec79ca7-3b54-432a-be1e-c96e7a2c7150","text":"现金银行报表","value":"dec79ca7-3b54-432a-be1e-c96e7a2c7150","parentnodes":"ad147f6d-613f-4d2d-8c84-b749d0754f3b","showcheck":false,"isexpand":true,"complete":true,"hasChildren":false,"ChildNodes":[]}]}]
    复制代码
    View Code


    来源:https://www.cnblogs.com/chuangjie1988/p/11284201.html
    免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则