menu-list.html 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>菜单预览</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <style>
  17. body,.el-tree{background-color: #eee;}
  18. .el-tree-node{margin: 0.15em 0 !important;}
  19. /* 悬浮时颜色更深一点 */
  20. .el-tree-node__content:hover{background-color: #CFE8FC !important;}
  21. </style>
  22. </head>
  23. <body>
  24. <div class="vue-box" style="display: none;" :style="'display: block;'">
  25. <!-- 表格 -->
  26. <div style="padding: 0 1em;">
  27. <div class="c-title">菜单预览</div>
  28. <!-- 树插件 -->
  29. <el-tree
  30. ref="tree"
  31. :data="dataList"
  32. node-key="id"
  33. :default-expand-all="true"
  34. >
  35. <span class="custom-tree-node" slot-scope="s">
  36. <span style="color: #2D8CF0;" v-if="s.data.isShow == undefined || s.data.isShow == true">{{ s.data.name }}</span>
  37. <span style="color: #999;" v-if="s.data.isShow == false">{{ s.data.name }} (隐藏)</span>
  38. <span style="color: #999;" v-if="s.data.info">&emsp;———— {{s.data.info}} </span>
  39. </span>
  40. </el-tree>
  41. <br><br><br>
  42. </div>
  43. </div>
  44. <script src="../../sa-frame/menu-list.js"></script>
  45. <script src="../../sa-frame/menu-list-sp.js"></script>
  46. <script src="../../sa-frame/index/admin-util.js"></script>
  47. <script>
  48. var app = new Vue({
  49. el: '.vue-box',
  50. data: {
  51. dataList: [], // 数据集合
  52. },
  53. created: function(){
  54. // 全部
  55. sa.ajax2('/sp-admin/SysMenu/getList', function(res){
  56. menuList = sa_admin_code_util.arrayToTree(menuList); // 一维转tree
  57. menuList = sa_admin_code_util.refMenuList(menuList); // 属性处理
  58. this.dataList = menuList; // 数据
  59. }.bind(this));
  60. }
  61. })
  62. </script>
  63. </body>
  64. </html>