-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathside-more.html
executable file
·175 lines (159 loc) · 6.42 KB
/
side-more.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" href="./assets/images/favicon.ico"/>
<title>EasyWeb后台开发框架</title>
<link rel="stylesheet" href="./assets/libs/layui/css/layui.css"/>
<link rel="stylesheet" href="./assets/module/admin.css?v=307"/>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
<!-- 头部 -->
<div class="layui-header">
<div class="layui-logo">
<img src="assets/images/logo.png"/>
<cite> EasyWeb Pro </cite>
</div>
<ul class="layui-nav layui-layout-left">
<li class="layui-nav-item" lay-unselect>
<a ew-event="flexible" title="侧边伸缩"><i class="layui-icon layui-icon-shrink-right"></i></a>
</li>
<li class="layui-nav-item" lay-unselect>
<a ew-event="refresh" title="刷新"><i class="layui-icon layui-icon-refresh-3"></i></a>
</li>
</ul>
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item" lay-unselect>
<a>
<img src="assets/images/head.png" class="layui-nav-img">
<cite id="huName"></cite>
</a>
</li>
</ul>
</div>
<!-- 侧边栏 -->
<div class="layui-side">
<div class="layui-side-scroll">
</div>
</div>
<!-- 主体部分 -->
<div class="layui-body"></div>
<!-- 底部 -->
<div class="layui-footer">
copyright © 2019 easyweb.vip all rights reserved. <span class="pull-right">Version 3.0.8</span>
</div>
</div>
<!-- 加载动画 -->
<div class="page-loading">
<div class="ball-loader">
<span></span><span></span><span></span><span></span>
</div>
</div>
<!-- 侧边栏渲染模板 -->
<script id="sideNav" type="text/html">
{{# layui.each(d, function(index, item){ }}
<li class="layui-nav-item">
<a href="{{item.url}}"><i class="layui-icon {{item.icon}}"></i> <cite>{{ item.name}}</cite></a>
{{# if(item.subMenus&&item.subMenus.length>0){ }}
<dl class="layui-nav-child">
{{# layui.each(item.subMenus, function(index, subItem){ }}
<dd>
<a href="{{ subItem.url }}">{{ subItem.name }}</a>
{{# if(subItem.subMenus&&subItem.subMenus.length>0){ }}
<dl class="layui-nav-child">
{{# layui.each(subItem.subMenus, function(index, thrItem){ }}
<dd>
<a href="{{ thrItem.url }}">{{ thrItem.name }}</a>
{{# if(thrItem.subMenus&&thrItem.subMenus.length>0){ }}
<dl class="layui-nav-child">
{{# layui.each(thrItem.subMenus, function(index, fourItem){ }}
<dd>
<a href="{{ fourItem.url }}">{{ fourItem.name }}</a>
{{# if(fourItem.subMenus&&fourItem.subMenus.length>0){ }}
<dl class="layui-nav-child">
{{# layui.each(fourItem.subMenus, function(index, fiveItem){ }}
<dd>
<a href="{{ fiveItem.url }}">{{ fiveItem.name }}</a>
</dd>
{{# }); }}
</dl>
{{# } }}
</dd>
{{# }); }}
</dl>
{{# } }}
</dd>
{{# }); }}
</dl>
{{# } }}
</dd>
{{# }); }}
</dl>
{{# } }}
</li>
{{# }); }}
</script>
<!-- js部分 -->
<script type="text/javascript" src="./assets/libs/layui/layui.js"></script>
<script>
layui.config({
base: 'assets/module/'
}).extend({
formSelects: 'formSelects/formSelects-v4',
treetable: 'treetable-lay/treetable',
dropdown: 'dropdown/dropdown',
notice: 'notice/notice',
step: 'step-lay/step',
dtree: 'dtree/dtree',
citypicker: 'city-picker/city-picker',
tableSelect: 'tableSelect/tableSelect'
}).use(['layer', 'element', 'config', 'index', 'admin', 'laytpl'], function () {
var $ = layui.jquery;
var layer = layui.layer;
var element = layui.element;
var config = layui.config;
var index = layui.index;
var admin = layui.admin;
var laytpl = layui.laytpl;
// 获取用户信息
admin.req('userInfo.json', {}, function (res) {
if (200 == res.code) {
config.putUser(res.user);
admin.renderPerm(); // 移除没有权限的元素
$('#huName').text(res.user.nickName);
} else {
layer.msg('获取用户失败', {icon: 2});
}
}, 'get');
// 加载侧边栏
admin.req('menus-more.json?v=307', {}, function (res) {
var headerHtml = '';
for (var i = 0; i < res.length; i++) {
laytpl(sideNav.innerHTML).render(res[i].subMenus, function (html) {
html = '<ul nav-id="' + res[i].id + '" class="layui-nav layui-nav-tree" lay-accordion="true" lay-filter="admin-side-nav">' + html;
html += '</ul>';
$('.layui-layout-admin .layui-side .layui-side-scroll').append(html);
});
headerHtml += '<li class="layui-nav-item" lay-unselect><a nav-bind="' + res[i].id + '">' + res[i].name + '</a></li>';
}
var $header = $('.layui-layout-admin .layui-header .layui-layout-left');
$header.find('.layui-nav-bar').remove();
$header.append(headerHtml);
element.render('nav');
index.regRouter(res); // 注册路由
index.loadHome({ // 加载主页
url: '#/console/console1',
name: '<i class="layui-icon layui-icon-home"></i>'
});
}, 'get');
// 移除loading动画
setTimeout(function () {
admin.removeLoading();
}, 300);
});
</script>
</body>
</html>