menu-list.html 2.5 KB

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