-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB0002_admin.html
More file actions
223 lines (218 loc) · 6.75 KB
/
B0002_admin.html
File metadata and controls
223 lines (218 loc) · 6.75 KB
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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>工作打卡系统 - 后台管理</title>
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: Arial, sans-serif;
line-height: 1.6;
background-color: #f0f2f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30px;
padding-bottom: 20px;
border-bottom: 1px solid #ddd;
}
.header h1 {
color: #1890ff;
}
.user-info {
text-align: right;
}
.logout-btn {
background-color: #ff4d4f;
color: white;
border: none;
padding: 8px 16px;
border-radius: 4px;
cursor: pointer;
}
.logout-btn:hover {
background-color: #ff7875;
}
.nav-tabs {
display: flex;
margin-bottom: 20px;
border-bottom: 1px solid #ddd;
}
.nav-tab {
padding: 10px 20px;
cursor: pointer;
border: none;
background: none;
font-size: 16px;
color: #666;
}
.nav-tab.active {
color: #1890ff;
border-bottom: 2px solid #1890ff;
}
.tab-content {
display: none;
background-color: white;
padding: 20px;
border-radius: 4px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.tab-content.active {
display: block;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
color: #333;
}
.form-group input {
width: 100%;
padding: 8px;
border: 1px solid #ddd;
border-radius: 4px;
}
.btn {
padding: 8px 16px;
border: none;
border-radius: 4px;
cursor: pointer;
margin-right: 10px;
}
.btn-primary {
background-color: #1890ff;
color: white;
}
.btn-primary:hover {
background-color: #40a9ff;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 10px;
}
th, td {
border: 1px solid #ddd;
padding: 12px;
text-align: left;
}
th {
background-color: #fafafa;
font-weight: 500;
}
.action-btn {
padding: 4px 8px;
border: none;
border-radius: 4px;
cursor: pointer;
margin-right: 5px;
}
.edit-btn {
background-color: #52c41a;
color: white;
}
.delete-btn {
background-color: #ff4d4f;
color: white;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>工作打卡系统 - 后台管理</h1>
<div class="user-info">
管理员:<span id="adminName"></span>
<button class="logout-btn" onclick="logout()">退出登录</button>
</div>
</div>
<div class="nav-tabs">
<button class="nav-tab active" onclick="showTab('users')">用户管理</button>
<button class="nav-tab" onclick="showTab('attendance')">考勤管理</button>
<button class="nav-tab" onclick="showTab('settings')">系统设置</button>
</div>
<!-- 用户管理 -->
<div id="usersTab" class="tab-content active">
<button class="btn btn-primary" onclick="showAddUserForm()">添加用户</button>
<div id="userForm" style="display: none; margin-top: 20px;">
<h3>添加/编辑用户</h3>
<div class="form-group">
<label for="editUsername">用户名</label>
<input type="text" id="editUsername">
</div>
<div class="form-group">
<label for="editPassword">密码</label>
<input type="password" id="editPassword">
</div>
<div class="form-group">
<label for="editName">姓名</label>
<input type="text" id="editName">
</div>
<button class="btn btn-primary" onclick="saveUser()">保存</button>
<button class="btn" onclick="cancelEdit()">取消</button>
</div>
<table id="usersTable">
<thead>
<tr>
<th>用户名</th>
<th>姓名</th>
<th>操作</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- 考勤管理 -->
<div id="attendanceTab" class="tab-content">
<div class="form-group" style="max-width: 200px;">
<label for="userFilter">选择用户</label>
<select id="userFilter" onchange="filterAttendance()">
<option value="">全部用户</option>
</select>
</div>
<table id="attendanceTable">
<thead>
<tr>
<th>用户名</th>
<th>姓名</th>
<th>日期</th>
<th>上班时间</th>
<th>下班时间</th>
<th>工作时长</th>
<th>状态</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<!-- 系统设置 -->
<div id="settingsTab" class="tab-content">
<h3>工作时间设置</h3>
<div class="form-group">
<label for="workStartTime">规定上班时间</label>
<input type="time" id="workStartTime">
</div>
<div class="form-group">
<label for="workEndTime">规定下班时间</label>
<input type="time" id="workEndTime">
</div>
<button class="btn btn-primary" onclick="saveSettings()">保存设置</button>
</div>
</div>
<script src="B0002_admin.js"></script>
</body>
</html>