forked from click33/Sa-Admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
203 lines (168 loc) · 7.43 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
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html>
<html>
<head>
<title>sa-admin后台模板</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/lib/theme-chalk/index.css">
<link rel="stylesheet" href="sa-resources/index.css">
<link rel="stylesheet" href="sa-resources/theme.css">
</head>
<body>
<!-- style="display: none;" 防止 初始花屏 -->
<div class="app" :class="['theme-0', 'theme-' + themeV, (is_fold ? 'fold' : '')]" style="display: none;" :style="'display: block;'">
<!-- 左 -->
<div class="nav-left">
<!-- 左上 -->
<div class="nav-left-top" :title="title" @click="nativePage = pageList[0]">
<img src="sa-resources/admin-logo.png" class="admin-logo">
<span class="nav-title" style="font-size: 1.1em;">{{title}}</span>
</div>
<!-- 左下 -->
<div class="nav-left-bottom">
<div class="menu-box-1">
<div class="menu-box-2">
<!-- 菜单 -->
<el-menu default-active="2"
class="el-menu-style-1"
:unique-opened="true"
:default-active="default_active"
:collapse="is_fold"
@select="selectMenu"
>
<div v-for="(menu, index) in menuList" :key="index">
<!-- 1 子菜单 -->
<el-menu-item v-if="menu.childList == null" :index="menu.id + '' ">
<i :class="menu.icon" :title="menu.name"></i>
<span class="menu-name">{{menu.name}}</span>
</el-menu-item>
<!-- 1 父菜单 -->
<el-submenu v-else :index="menu.id + '' ">
<template slot="title">
<i :class="menu.icon" :title="menu.name"></i>
<span class="menu-name">{{menu.name}}</span>
</template>
<!-- 遍历其子项 -->
<div v-for="(menu2, index) in menu.childList" :key="index">
<!-- 2 如果是子菜单 -->
<el-menu-item v-if="menu2.childList == null" :index="menu2.id + '' ">
{{menu2.name}}
</el-menu-item>
<!-- 2 如果是父菜单 -->
<el-submenu v-else :index="menu2.id + '' ">
<template slot="title">
{{menu2.name}}
</template>
<el-menu-item v-for="(menu3, index3) in menu2.childList" :index="menu3.id + '' " :key="index3" >
{{menu3.name}}
</el-menu-item>
</el-submenu>
</div>
</el-submenu>
</div>
</el-menu>
</div>
</div>
</div>
</div>
<!-- 右边 -->
<div class="nav-right">
<div class="nav-right-1">
<div class="tools-left">
<span title="折叠菜单" class="tool-fox" v-if="is_fold == false" @click="is_fold = true">
<i class="el-icon-s-fold"></i>
</span>
<span title="展开菜单" class="tool-fox" v-if="is_fold == true" @click="is_fold = false">
<i class="el-icon-s-unfold"></i>
</span>
<span title="刷新" class="tool-fox" @click="rightPage = nativePage; right_f5();">
<i class="el-icon-refresh-right" style="font-weight: bold;"></i>
</span>
<span title="当前时间" class="tool-fox">
<span style="font-size: 0.90em;">{{now_time}}</span>
</span>
</div>
<div class="tools-right">
<span title="点击登录" class="tool-fox" onclick="location.href='login.html'" v-if="user == null">
<span style="font-size: 0.8em; font-weight: bold; position: relative; top: -2px;">未登录</span>
</span>
<span title="我的信息" class="tool-fox" class="user-info" style="padding: 0;" v-if="user != null">
<el-dropdown @command="handleCommand" trigger="click" size="medium">
<span class="el-dropdown-link user-name" style="height: 100%; padding: 0 1em; display: inline-block;">
<img :src="user.avatar" class="user-avatar">
{{user.username}}
<i class="el-icon-arrow-down el-icon--right"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-for="drop in dropList" :command="drop.name" :key="drop.name">{{drop.name}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
<span title="主题" class="tool-fox user-info" style="padding: 0;">
<el-dropdown @command="toggleTheme" trigger="click" size="medium">
<span class="el-dropdown-link" style="height: 100%; padding: 0 1em; display: inline-block;">
<i class="el-icon-price-tag" style="font-weight: bold;"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="t.value" v-for="t in themeList" :key="t.name">
<span :style=" themeV == t.value ? 'color: blue' : '' ">{{t.name}} </span>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</span>
<span title="全屏" class="tool-fox" v-if="is_full_screen == false" @click="is_full_screen = true">
<i class="el-icon-rank" style="font-weight: bold; transform: rotate(45deg)"></i>
</span>
<span title="退出全屏" class="tool-fox" v-if="is_full_screen == true" @click="is_full_screen = false">
<i class="el-icon-bottom-left" style="font-weight: bold; "></i>
</span>
</div>
</div>
<!-- 第二杠 -->
<div class="nav-right-2">
<div class="towards-left" @click="scrollToLeft" title="向左滑">
<i class="el-icon-arrow-left"></i>
</div>
<div class="towards-middle">
<div class="page-title-box" :style="{left: scrollX + 'px'}">
<div class="page-title" :class=" (page == nativePage ? 'page-native' : '') "
v-for="page in pageList"
@click="showPage(page)"
@contextmenu.prevent="right_click(page, $event)"
>
<i class="el-icon-caret-right"></i>
<span>{{page.name}}</span>
<i class="el-icon-close" v-if="!page.hide_close" @click.stop="closePage(page)"></i>
</div>
</div>
</div>
<div class="towards-right" @click="scrollToRight" title="向右滑">
<i class="el-icon-arrow-right"></i>
</div>
</div>
<!-- 第三杠 -->
<div class="nav-right-3">
<span v-for="page in pageList" :key="page.id">
<!-- <iframe :src="page.url" :class=" 'iframe' + page.id " v-show="page == nativePage"></iframe> 用v-show会造成每次切换卡片进度条归零的bug -->
<iframe :src="page.url" :id=" 'iframe' + page.id " class="iframe" :class="page == nativePage ? 'iframe-native' : null"></iframe>
</span>
</div>
<!-- 右键盒子 -->
<div class="right-box" :style="{left: rightZB.x + 'px', top: rightZB.y + 'px'}" v-if="rightShow">
<div @click="right_f5">刷新</div>
<div @click="right_close">关闭</div>
<div @click="right_close_other">关闭其它</div>
<div @click="right_close_all">关闭所有</div>
<div @click="right_window_open">新窗口打开</div>
<div @click="right_menu_close">取消</div>
</div>
</div>
</div>
<script src="https://cdn.bootcss.com/vue/2.6.10/vue.js"></script>
<script src="https://unpkg.com/[email protected]/lib/index.js"></script>
<script src="sa-resources/admin-util.js"></script>
<script src="sa-resources/menu-list.js"></script>
<script src="sa-resources/index.js"></script>
<script src="sa-resources/my-code.js"></script>
</body>
</html>