webtree

功能描述

移动端Tree树型权限选择器

快速使用

  1. // api.ajax对应的案例数据:
  2. [{
  3. "id": "1",
  4. "text": "我的公司",
  5. "spread": true,
  6. "checked": false,
  7. "childs": [{
  8. "id": "11",
  9. "text": "公司管理",
  10. "rules": "D"
  11. },
  12. {
  13. "id": "12",
  14. "text": "部门管理",
  15. "rules": "CUD"
  16. }]
  17. },
  18. {
  19. "id": "2",
  20. "text": "租赁业务",
  21. "spread": true,
  22. "checked": false,
  23. "childs": [{
  24. "id": "21",
  25. "text": "仓库管理",
  26. "rules": "CD"
  27. },
  28. {
  29. "id": "22",
  30. "text": "库存管理",
  31. "rules": "CU"
  32. }]
  33. },
  34. {
  35. "id": "3",
  36. "text": "物流业务",
  37. "spread": true,
  38. "checked": false,
  39. "childs": []
  40. },
  41. {
  42. "id": "4",
  43. "text": "婚庆服务",
  44. "spread": true,
  45. "checked": false,
  46. "childs": []
  47. },
  48. {
  49. "id": "5",
  50. "text": "中介服务",
  51. "spread": true,
  52. "checked": false,
  53. "childs": []
  54. }];

特别说明

  1. 插件封装在了groupRule.js,后续也可根据自己的需要进行扩展。
  2. 此插件可通过api.ajax接收json数据实现动态加载移动端权限树的功能。