123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>菜单预览</title>
- <meta charset="utf-8">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <!-- 所有的 css & js 资源 -->
- <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="../../static/kj/vue.min.js"></script>
- <script src="../../static/kj/element-ui/index.js"></script>
- <script src="../../static/kj/jquery.min.js"></script>
- <script src="../../static/kj/layer/layer.js"></script>
- <script src="../../static/sa.js"></script>
- <style>
- body,
- .el-tree {
- background-color: #eee;
- }
- .el-tree-node {
- margin: 0.15em 0 !important;
- }
- /* 悬浮时颜色更深一点 */
- .el-tree-node__content:hover {
- background-color: #CFE8FC !important;
- }
- </style>
- </head>
- <body>
- <div class="vue-box" style="display: none;" :style="'display: block;'">
- <!-- 表格 -->
- <div style="padding: 0 1em;">
- <div class="c-title">菜单预览</div>
- <!-- 树插件 -->
- <el-tree ref="tree" :data="dataList" node-key="id" :default-expand-all="true">
- <span class="custom-tree-node" slot-scope="s">
- <span style="color: #2D8CF0;"
- v-if="s.data.isShow == undefined || s.data.isShow == true">{{ s.data.name }}</span>
- <span style="color: #999;" v-if="s.data.isShow == false">{{ s.data.name }} (隐藏)</span>
- <span style="color: #999;" v-if="s.data.info"> ———— {{s.data.info}} </span>
- </span>
- </el-tree>
- <br><br><br>
- </div>
- </div>
- <script src="../../sa-frame/menu-list.js"></script>
- <script src="../../sa-frame/menu-list-sp.js"></script>
- <script src="../../sa-frame/index/admin-util.js"></script>
- <script>
- var app = new Vue({
- el: '.vue-box',
- data: {
- dataList: [], // 数据集合
- },
- created: function() {
- // 全部
- sa.ajax2('/SysMenu/getList', function(res) {
- menuList = sa_admin_code_util.arrayToTree(menuList); // 一维转tree
- menuList = sa_admin_code_util.refMenuList(menuList); // 属性处理
- this.dataList = menuList; // 数据
- }.bind(this));
- }
- })
- </script>
- </body>
- </html>
|