-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
124 lines (111 loc) · 3.61 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="Keywords" content="">
<meta name="Description" content="">
<title>后台管理系统</title>
<link rel="stylesheet" href="layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="layui/css/style.css"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
</head>
<body>
<!-- 布局容器 -->
<div class="layui-layout layui-layout-admin">
<!-- 头部 -->
<div class="layui-header">
<div class="layui-main">
<!-- logo -->
<a href="/" style="color: #c2c2c2; font-size: 18px; line-height: 60px;">后台管理系统</a>
<!-- 水平导航 -->
<ul class="layui-nav" style="position: absolute; top: 0; right: 0; background: none;">
<li class="layui-nav-item">
<a href="javascript:;">
</a>
</li>
<li class="layui-nav-item">
<a href="javascript:;">
琴歌,欢迎你!
</a>
<dl class="layui-nav-child">
<dd>
<a href="javascript:;">
退出系统
</a>
</dd>
</dl>
</li>
</ul>
</div>
</div>
<!-- 侧边栏 -->
<div class="layui-side layui-bg-black">
<div class="layui-side-scroll">
<ul class="layui-nav layui-nav-tree" lay-filter="left-nav" style="border-radius: 0;">
</ul>
</div>
</div>
<!-- 主体 -->
<div class="layui-body">
<!-- 顶部切换卡 -->
<div class="layui-tab layui-tab-brief" lay-filter="top-tab" lay-allowClose="true" style="margin: 0;">
<ul class="layui-tab-title"></ul>
<div class="layui-tab-content"></div>
</div>
</div>
<!-- 底部 -->
<div class="layui-footer" style="text-align: center; line-height: 44px;">
Copyright © 2012-2016 All Rights Reserved. 前端网(w3cvip.com).保留所有权利 蜀ICP备14031517号-2
</div>
</div>
<script src="js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="layui/layui.js"></script>
<script type="text/javascript">
/**
* 对layui进行全局配置
*/
layui.config({
base: 'js/'
});
layui.use('form', function() {
var $ = layui.jquery,
form = layui.form();
});
/**
* 初始化整个系统骨架
*/
layui.use(['cms'], function() {
var cms = layui.cms('left-nav', 'top-tab');
cms.addNav([
{ id: 1, pid: 0, node: '主页', url: 'main.html' },
{ id: 2, pid: 0, node: '文章管理', url: '' },
{ id: 3, pid: 2, node: '文章列表', url: 'articlelist.html' },
{ id: 4, pid: 2, node: '添加文章', url: 'https://www.baidu.com/' },
{ id: 5, pid: 0, node: '人员管理', url: '' },
{ id: 6, pid: 5, node: '人员列表', url: 'https://www.baidu.com/' },
{ id: 7, pid: 5, node: '添加人员', url: 'https://www.baidu.com/' }
], 0, 'id', 'pid', 'node', 'url');
cms.bind(60 + 41 + 20 + 44); //头部高度 + 顶部切换卡标题高度 + 顶部切换卡内容padding + 底部高度
cms.clickLI(0);
});
function addTab(title, src, id,closeId){
if(closeId){
// debugger;
closeTab(closeId);
}
layui.use(['cms'], function() {
var cms = layui.cms('left-nav', 'top-tab');
cms.addTab(title,src,id);
});
}
function closeTab(id,refreshId){
layui.use(['cms'], function() {
var cms = layui.cms('left-nav', 'top-tab');
cms.closeTab(id,refreshId);
});
}
</script>
</body>
</html>