jQuery MiniUI

 找回密码
 立即注册
查看: 2656|回复: 1
打印 上一主题 下一主题

如何设置mainMenu的自定义字段? [复制链接]

Rank: 6Rank: 6

跳转到指定楼层
楼主
发表于 2021-7-25 12:37:22 |只看该作者 |倒序浏览
测试使用新的导航框架:http://miniui.com/frame/frame2/index.html其中上面的菜单栏代码如下:
  1. <div class="nav navbar-nav top-menu">
  2.         <div id="mainMenu"></div>
  3.     </div>
复制代码
从服务器返回的顶部菜单json数据如下:

  1. {"code":0,"data":[{"id":1,"pid":0,"title":"系统配置","icon":"system","condition":"","remark":"Admin tips","menuType":0,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/config","name":"Config","menuName":"系统配置","component":"Layout","path":"/config","meta":{"icon":"system","title":"系统配置"},"hidden":false,"alwaysShow":true,"children":[{"id":5,"pid":1,"title":"字典管理","icon":"dict","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/config/dict/type/list","name":"Dict/list","menuName":"字典管理","component":"system/config/dict/list","path":"dict/list","meta":{"icon":"dict","title":"字典管理"},"hidden":false,"alwaysShow":false,"children":[]},{"id":6,"pid":1,"title":"参数管理","icon":"date-range","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/config/sysConfig/list","name":"Params/list","menuName":"参数管理","component":"system/config/params/list","path":"params/list","meta":{"icon":"date-range","title":"参数管理"},"hidden":false,"alwaysShow":false,"children":[]},{"id":86,"pid":1,"title":"站点设置","icon":"system","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/config/sysWebSet","name":"/webSet","menuName":"站点设置","component":"system/config/webSet","path":"/webSet","meta":{"icon":"system","title":"站点设置"},"hidden":false,"alwaysShow":false,"children":[]}]},{"id":2,"pid":0,"title":"权限管理","icon":"peoples","condition":"","remark":"","menuType":0,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/auth","name":"System/auth","menuName":"权限管理","component":"Layout","path":"/system/auth","meta":{"icon":"peoples","title":"权限管理"},"hidden":false,"alwaysShow":true,"children":[{"id":8,"pid":2,"title":"菜单管理","icon":"nested","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/auth/menuList","name":"MenuList","menuName":"菜单管理","component":"system/auth/menuList","path":"menuList","meta":{"icon":"nested","title":"菜单管理"},"hidden":false,"alwaysShow":false,"children":[]},{"id":26,"pid":2,"title":"角色管理","icon":"logininfor","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/auth/roleList","name":"Role","menuName":"角色管理","component":"system/auth/roleList","path":"role","meta":{"icon":"logininfor","title":"角色管理"},"hidden":false,"alwaysShow":false,"children":[]},{"id":28,"pid":2,"title":"部门管理","icon":"peoples","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/auth/deptList","name":"Dept","menuName":"部门管理","component":"system/auth/dept","path":"dept","meta":{"icon":"peoples","title":"部门管理"},"hidden":false,"alwaysShow":false,"children":[]},{"id":33,"pid":2,"title":"岗位管理","icon":"tab","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/auth/postList","name":"Post","menuName":"岗位管理","component":"system/auth/post","path":"post","meta":{"icon":"tab","title":"岗位管理"},"hidden":false,"alwaysShow":false,"children":[]},{"id":40,"pid":2,"title":"用户管理","icon":"user","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/auth/userList","name":"User","menuName":"用户管理","component":"system/auth/userList","path":"user","meta":{"icon":"user","title":"用户管理"},"hidden":false,"alwaysShow":false,"children":[]}]},{"id":3,"pid":0,"title":"系统监控","icon":"monitor","condition":"","remark":"","menuType":0,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/monitor","name":"Monitor","menuName":"系统监控","component":"Layout","path":"/monitor","meta":{"icon":"monitor","title":"系统监控"},"hidden":false,"alwaysShow":true,"children":[{"id":34,"pid":3,"title":"在线用户","icon":"cascader","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/monitor/online/list","name":"Online","menuName":"在线用户","component":"system/monitor/online/list","path":"online","meta":{"icon":"cascader","title":"在线用户"},"hidden":false,"alwaysShow":false,"children":[]},{"id":36,"pid":3,"title":"定时任务","icon":"clipboard","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/monitor/job","name":"Job","menuName":"定时任务","component":"system/monitor/job","path":"job","meta":{"icon":"clipboard","title":"定时任务"},"hidden":false,"alwaysShow":false,"children":[]},{"id":37,"pid":3,"title":"服务监控","icon":"dict","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/monitor/server/info","name":"Server","menuName":"服务监控","component":"system/monitor/server","path":"server","meta":{"icon":"dict","title":"服务监控"},"hidden":false,"alwaysShow":false,"children":[]},{"id":38,"pid":3,"title":"登录日志","icon":"chart","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/monitor/loginLog","name":"Logininfor","menuName":"登录日志","component":"system/monitor/logininfor","path":"logininfor","meta":{"icon":"chart","title":"登录日志"},"hidden":false,"alwaysShow":false,"children":[]},{"id":39,"pid":3,"title":"操作日志","icon":"dashboard","condition":"","remark":"","menuType":1,"weigh":0,"status":1,"jumpPath":"","isFrame":0,"moduleType":"sys_admin","modelId":0,"index":"system/monitor/operLog","name":"Operlog","menuName":"操作日志","component":"system/monitor/operlog","path":"operlog","meta":{"icon":"dashboard","title":"操作日志"},"hidden":false,"alwaysShow":false,"children":[]}]}],"msg":"success"}
复制代码
我在mainMenu上设置了显示属性textField和值属性idField
  1. <div class="nav navbar-nav top-menu">
  2.         <div id="mainMenu" title="/api/system/user/getRouters" textField='title' idField='id'></div>
  3.     </div>
复制代码
但是还是没有效果,请教一下我应该如何自定义菜单属性,才能达到效果啊?

Rank: 8Rank: 8

沙发
发表于 2021-7-26 10:19:48 |只看该作者
这是个自定义的js控件,我们开放了源代码,可以自行完善功能

Archiver|普加软件

GMT+8, 2024-11-26 10:26 , Processed in 1.066869 second(s), 9 queries .

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

回顶部