de2bd2f9
“wangming”
项目初始化
|
1
|
<template>
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
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
|
<div class="login-container">
<!-- 背景装饰 -->
<div class="bg-decoration">
<div class="circle circle-1"></div>
<div class="circle circle-2"></div>
<div class="circle circle-3"></div>
</div>
<!-- 主要内容区域 -->
<div class="main-content">
<!-- 左侧品牌区域 -->
<div class="brand-section">
<div class="brand-content">
<h1 class="brand-title">自助无人机租赁</h1>
<h2 class="brand-subtitle">管理后台</h2>
<p class="brand-desc">智能化无人机租赁管理平台</p>
</div>
</div>
<!-- 右侧登录表单 -->
<div class="login-section">
<div class="login-card">
<div class="login-header">
<h3>欢迎登录</h3>
<p>请输入您的账号信息</p>
</div>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<div class="form-group">
<div class="input-wrapper">
<div class="input-icon">
<img src="../../assets/images/1.png" alt="用户" />
</div>
|
de2bd2f9
“wangming”
项目初始化
|
35
36
37
38
39
40
|
<input
type="text"
name="account"
v-model="loginForm.account"
ref="account"
tabindex="1"
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
41
42
|
placeholder="请输入用户名"
class="form-input"
|
de2bd2f9
“wangming”
项目初始化
|
43
|
/>
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
44
45
46
47
48
49
50
51
|
</div>
</div>
<div class="form-group">
<div class="input-wrapper">
<div class="input-icon">
<img src="../../assets/images/2.png" alt="密码" />
</div>
|
de2bd2f9
“wangming”
项目初始化
|
52
53
54
55
56
57
58
|
<input
type="password"
name="password"
v-model="loginForm.password"
ref="password"
tabindex="2"
:placeholder="$t('login.password')"
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
59
|
class="form-input"
|
de2bd2f9
“wangming”
项目初始化
|
60
|
/>
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
61
62
63
64
|
</div>
</div>
<div class="form-actions">
|
de2bd2f9
“wangming”
项目初始化
|
65
66
67
|
<el-button
:loading="loading"
type="primary"
|
de2bd2f9
“wangming”
项目初始化
|
68
|
@click.native.prevent="handleLogin"
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
69
|
class="login-btn"
|
de2bd2f9
“wangming”
项目初始化
|
70
|
>
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
71
72
73
74
75
76
77
|
{{ $t("login.logIn") }}
</el-button>
</div>
</el-form>
</div>
</div>
</div>
|
de2bd2f9
“wangming”
项目初始化
|
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
224
225
226
227
228
|
</div>
</template>
<script>
export default {
name: "Login",
data: function () {
return {
loginForm: {
account: "",
password: "",
hospitalname:"",
},
loginRules: {
account: [
{
required: true,
trigger: "blur",
message: this.$t("login.accountTip"),
},
],
password: [
{
required: true,
trigger: "blur",
message: this.$t("login.passwordTip"),
},
],
},
capsTooltip: false,
loading: false,
showDialog: false,
redirect: undefined,
otherQuery: {},
};
},
computed: {
loginLoading() {
return this.$store.state.user.loginLoading;
},
},
watch: {
loginLoading(val) {
if (!val) this.loading = false;
},
$route: {
handler: function (route) {
const query = route.query;
if (query) {
this.redirect = query.redirect;
// this.otherQuery = this.getOtherQuery(query)
}
},
immediate: true,
},
},
created() {
const _this = this;
// const _this = this;
// document.onkeydown = function (e) {
// const { keyCode } = e;
// if (keyCode === 13) {
// _this.handleLogin();
// }
// };
},
mounted() {
this.handlemyLogin();
// if (this.loginForm.account == "") {
// this.$refs.account.focus();
// } else if (this.loginForm.password == "") {
// this.$refs.password.focus();
// }
// this.$store.commit("user/SET_LOGIN_LOADING", false);
},
destroyed() {
document.onkeydown = function (e) {
const { keyCode } = e;
if (keyCode === 13) {
}
};
},
methods: {
checkCapslock(e) {
const { key } = e;
this.capsTooltip = key && key.length === 1 && key >= "A" && key <= "Z";
},
handleLogin() {
if (this.loading) return;
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.loading = true;
this.$store.commit("user/SET_LOGIN_LOADING", true);
this.$store
.dispatch("user/login", this.loginForm)
.then(() => {
this.$router.push({
path: this.redirect || "/home",
query: this.otherQuery,
});
})
.catch(() => {
this.$store.commit("user/SET_LOGIN_LOADING", false);
});
} else {
return false;
}
});
},
handlemyLogin() {
//this.$store.dispatch('user/logout')
console.log("开始执行单点登录!");
if (this.loading) return;
let username = this.$route.query.username;
let hospitalname=this.$route.query.hospitalname;
console.log("username:"+username);
if (username != null && username != "") {
this.loginForm.account = username;
this.loginForm.hospitalname =hospitalname;
this.loading = true;
this.$store.commit("user/SET_LOGIN_LOADING", true);
this.$store
.dispatch("user/pislogin", this.loginForm)
.then(() => {
this.$router.push({
path: this.redirect || "/home",
query: this.otherQuery,
});
})
.catch(() => {
this.$store.commit("user/SET_LOGIN_LOADING", false);
});
}
},
},
getOtherQuery(query) {
return Object.keys(query).reduce((acc, cur) => {
if (cur !== "redirect") {
acc[cur] = query[cur];
}
return acc;
}, {});
},
};
</script>
<style lang="scss" scoped>
* {
margin: 0;
padding: 0;
|
de2bd2f9
“wangming”
项目初始化
|
229
230
|
box-sizing: border-box;
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
|
.login-container {
width: 100vw;
height: 100vh;
background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
background-image: url(../../assets/images/4.jpg);
background-size: cover;
background-position: center;
background-blend-mode: overlay;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
// 背景装饰圆圈
.bg-decoration {
position: absolute;
top: 0;
left: 0;
|
de2bd2f9
“wangming”
项目初始化
|
252
253
|
width: 100%;
height: 100%;
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
|
pointer-events: none;
z-index: 1;
}
.circle {
position: absolute;
border-radius: 50%;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(20px);
animation: float 6s ease-in-out infinite;
}
.circle-1 {
width: 200px;
height: 200px;
top: 10%;
left: 10%;
animation-delay: 0s;
|
de2bd2f9
“wangming”
项目初始化
|
272
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
|
.circle-2 {
width: 150px;
height: 150px;
top: 60%;
right: 15%;
animation-delay: 2s;
}
.circle-3 {
width: 100px;
height: 100px;
bottom: 20%;
left: 20%;
animation-delay: 4s;
}
@keyframes float {
0%, 100% { transform: translateY(0px) rotate(0deg); }
50% { transform: translateY(-20px) rotate(180deg); }
}
// 主要内容区域
.main-content {
|
de2bd2f9
“wangming”
项目初始化
|
297
|
width: 100%;
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
|
max-width: 1200px;
height: 600px;
display: flex;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(20px);
border-radius: 24px;
border: 1px solid rgba(255, 255, 255, 0.2);
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
overflow: hidden;
position: relative;
z-index: 2;
}
// 左侧品牌区域
.brand-section {
flex: 1;
background: linear-gradient(135deg, rgba(79, 70, 229, 0.8) 0%, rgba(6, 182, 212, 0.8) 100%);
display: flex;
align-items: center;
justify-content: center;
position: relative;
overflow: hidden;
|
de2bd2f9
“wangming”
项目初始化
|
320
321
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
322
323
324
325
326
327
328
329
330
|
.brand-section::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
opacity: 0.3;
|
de2bd2f9
“wangming”
项目初始化
|
331
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
332
333
|
.brand-content {
|
de2bd2f9
“wangming”
项目初始化
|
334
|
text-align: center;
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
|
color: white;
z-index: 1;
position: relative;
}
.logo {
margin-bottom: 30px;
}
.logo-icon {
font-size: 80px;
margin-bottom: 20px;
filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
.brand-title {
font-size: 36px;
font-weight: 700;
margin-bottom: 10px;
letter-spacing: 2px;
text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
|
de2bd2f9
“wangming”
项目初始化
|
356
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
357
358
359
360
361
362
363
|
.brand-subtitle {
font-size: 24px;
font-weight: 500;
margin-bottom: 20px;
opacity: 0.9;
letter-spacing: 1px;
|
de2bd2f9
“wangming”
项目初始化
|
364
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
|
.brand-desc {
font-size: 16px;
opacity: 0.8;
font-weight: 300;
letter-spacing: 1px;
}
// 右侧登录区域
.login-section {
flex: 1;
background: rgba(255, 255, 255, 0.95);
display: flex;
align-items: center;
justify-content: center;
padding: 60px 40px;
}
.login-card {
|
de2bd2f9
“wangming”
项目初始化
|
384
|
width: 100%;
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
385
|
max-width: 400px;
|
de2bd2f9
“wangming”
项目初始化
|
386
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
387
388
389
390
391
392
393
394
395
|
.login-header {
text-align: center;
margin-bottom: 40px;
}
.login-header h3 {
font-size: 28px;
color: #333;
|
de2bd2f9
“wangming”
项目初始化
|
396
|
margin-bottom: 10px;
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
397
398
399
400
401
402
403
404
405
406
407
408
|
font-weight: 600;
}
.login-header p {
color: #666;
font-size: 14px;
font-weight: 400;
}
// 表单样式
.login-form {
width: 100%;
|
de2bd2f9
“wangming”
项目初始化
|
409
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
410
411
412
|
.form-group {
margin-bottom: 24px;
|
de2bd2f9
“wangming”
项目初始化
|
413
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
414
415
416
417
418
419
420
421
422
423
424
|
.input-wrapper {
position: relative;
display: flex;
align-items: center;
background: #f8f9fa;
border: 2px solid #e9ecef;
border-radius: 12px;
padding: 0 16px;
height: 56px;
transition: all 0.3s ease;
|
de2bd2f9
“wangming”
项目初始化
|
425
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
426
427
428
429
430
|
.input-wrapper:focus-within {
border-color: #4f46e5;
background: #fff;
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
|
de2bd2f9
“wangming”
项目初始化
|
431
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
432
433
434
435
436
|
.input-icon {
margin-right: 12px;
display: flex;
align-items: center;
|
de2bd2f9
“wangming”
项目初始化
|
437
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
438
439
440
441
442
443
|
.input-icon img {
width: 20px;
height: 20px;
opacity: 0.6;
filter: brightness(0) saturate(100%) invert(27%) sepia(51%) saturate(2878%) hue-rotate(346deg) brightness(104%) contrast(97%);
|
de2bd2f9
“wangming”
项目初始化
|
444
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
445
446
447
|
.form-input {
flex: 1;
|
de2bd2f9
“wangming”
项目初始化
|
448
449
|
border: none;
outline: none;
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
450
|
background: transparent;
|
de2bd2f9
“wangming”
项目初始化
|
451
|
font-size: 16px;
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
452
453
454
455
456
457
458
459
|
color: #333;
font-weight: 400;
height: 100%;
}
.form-input::placeholder {
color: #999;
font-weight: 400;
|
de2bd2f9
“wangming”
项目初始化
|
460
|
}
|
69379643
“wangming”
新增获取客户端ID功能,区分生产环...
|
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
|
.form-actions {
margin-top: 32px;
}
.login-btn {
width: 100%;
height: 56px;
background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
border: none;
border-radius: 12px;
color: white;
font-size: 16px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}
.login-btn:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(79, 70, 229, 0.6);
}
.login-btn:active {
transform: translateY(0);
}
// 响应式设计
@media (max-width: 768px) {
.main-content {
flex-direction: column;
height: auto;
margin: 20px;
max-width: none;
}
.brand-section {
min-height: 200px;
}
.brand-title {
font-size: 24px;
}
.brand-subtitle {
font-size: 18px;
}
.logo-icon {
font-size: 60px;
}
.login-section {
padding: 40px 20px;
}
|
de2bd2f9
“wangming”
项目初始化
|
517
518
|
}
</style>
|