perf: 样式调整
1.登录页 2.一些小细节包括table、btn
This commit is contained in:
@@ -1,27 +1,45 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class='login-right'>
|
||||
<div class="login-content">
|
||||
<div class="login-title">
|
||||
<h1>NeZha</h1>
|
||||
<div></div>
|
||||
</div>
|
||||
<div class="login-input" style="margin-top: 20px;">
|
||||
<input v-model="loginData.username" class="inputL" placeholder="username" ></input>
|
||||
</div>
|
||||
|
||||
<div class="login-input">
|
||||
<input v-model="loginData.password" type="password" class="inputL" @keyup.enter="login" placeholder="password" ></input>
|
||||
</div>
|
||||
<div class="login-button">
|
||||
<button @click="login">登录</button>
|
||||
</div>
|
||||
<div class="login">
|
||||
<div class="model">
|
||||
<div class='login-right'>
|
||||
<div class="login-content">
|
||||
<div class="login-title">NEZHA</div>
|
||||
<div class="login-label" style="padding-top: 35px;">User Name</div>
|
||||
<div class="login-input">
|
||||
<input v-model="loginData.username" class="inputL"></input>
|
||||
</div>
|
||||
<div class="login-label">Password</div>
|
||||
<div class="login-input">
|
||||
<input v-model="loginData.password" type="password" class="inputL" @keyup.enter="login"></input>
|
||||
</div>
|
||||
<div class="login-button">
|
||||
<button @click="login">Login</button>
|
||||
</div>
|
||||
<div class="login-foot">
|
||||
<div class="login-foot-remember"></div>
|
||||
<div class="login-foot-langs">
|
||||
<div @click="changeLang('en')" class="login-foot-lang" :class="{'login-foot-lang-active': lang == 'en'}">
|
||||
<img v-if="lang == 'en'" src="../../assets/img/lang-box-active.svg"/>
|
||||
<img v-if="lang != 'en'" src="../../assets/img/lang-box.svg"/>
|
||||
<span class="lang-name lang-name-en">EN</span>
|
||||
<div v-if="lang == 'en'" class="lang-active-model"></div>
|
||||
</div>
|
||||
<div @click="changeLang('cn')" class="login-foot-lang" :class="{'login-foot-lang-active': lang == 'cn'}">
|
||||
<img v-if="lang == 'cn'" src="../../assets/img/lang-box-active.svg"/>
|
||||
<img v-if="lang != 'cn'" src="../../assets/img/lang-box.svg"/>
|
||||
<span class="lang-name">中</span>
|
||||
<div v-if="lang == 'cn'" class="lang-active-model"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
name: "login",
|
||||
data() {
|
||||
@@ -29,14 +47,17 @@ export default {
|
||||
loginData: {
|
||||
username: '',
|
||||
password: '',
|
||||
remember: false
|
||||
},
|
||||
lang: localStorage.getItem("nz-language") ? localStorage.getItem("nz-language") : 'en'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
login() {
|
||||
this.$post('sys/login', (this.loginData)).then(res => {
|
||||
if (res.code == 200) {
|
||||
sessionStorage.setItem("token", res.data.token);
|
||||
sessionStorage.setItem("nz-token", res.data.token);
|
||||
sessionStorage.setItem("nz-username", this.loginData.username);
|
||||
this.$router.push({
|
||||
path: "/dashboard",
|
||||
query: {
|
||||
@@ -46,81 +67,130 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
changeLang(lang) {
|
||||
if (this.lang == lang) {
|
||||
return;
|
||||
} else {
|
||||
localStorage.setItem("nz-language", lang);
|
||||
this.lang = lang;
|
||||
this.$i18n.locale = lang;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login {
|
||||
background-image: url("../../assets/img/login-background.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.model {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: rgba(0, 0, 0, 0.737);
|
||||
}
|
||||
button {
|
||||
width:180px;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 12px;
|
||||
background: #17558e !important;
|
||||
border-radius: 5px;
|
||||
font-size: 18px;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
border: none;
|
||||
color: #fff;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-top: 50px;
|
||||
width: 80%;
|
||||
padding-top: 10px;
|
||||
padding-bottom: 12px;
|
||||
background: #31759c;
|
||||
border-radius: 270px;
|
||||
font-size: 18px;
|
||||
box-shadow: none;
|
||||
outline: none;
|
||||
border: none;
|
||||
color: #fff;
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
margin-top: 50px;
|
||||
cursor: pointer;
|
||||
}
|
||||
button:hover {
|
||||
background-color: #5c9fc4;
|
||||
}
|
||||
|
||||
.login-right {
|
||||
width: 400px;
|
||||
height: 330px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-60%);
|
||||
right: 42%;
|
||||
background: #356b9d;
|
||||
overflow: hidden;
|
||||
padding: 2px;
|
||||
position: relative;
|
||||
width: 500px;
|
||||
height: 475px;
|
||||
margin: auto;
|
||||
overflow: hidden;
|
||||
padding: 250px 0 0 0;
|
||||
}
|
||||
.login-title {
|
||||
position: absolute;
|
||||
font-size: 90px;
|
||||
font-weight: 400;
|
||||
color: white;
|
||||
top: 60px;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
}
|
||||
.login-label {
|
||||
margin-left: 10%;
|
||||
font-size: 14px;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.login-input {
|
||||
height: 40px;
|
||||
margin-bottom: 20px;
|
||||
padding: 0 20px;
|
||||
height: 30px;
|
||||
margin: 28px 0 16px 10%;
|
||||
width: 80%;
|
||||
border-bottom: 2px solid rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
.login-foot {
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
width: 100%;
|
||||
}
|
||||
.login-foot>div {
|
||||
display: inline-block;
|
||||
}
|
||||
.login-foot-langs {
|
||||
float: right;
|
||||
padding-right: 10%;
|
||||
}
|
||||
.login-foot-lang {
|
||||
display: inline-block;
|
||||
margin-left: 8px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
}
|
||||
.lang-active-model {
|
||||
width: 19px;
|
||||
height: 16px;
|
||||
position: absolute;
|
||||
border-radius: 2px;
|
||||
background-color: rgba(49, 117, 156, 0.27);
|
||||
top: 8px;
|
||||
left: 9px;
|
||||
}
|
||||
.lang-name {
|
||||
position: absolute;
|
||||
left: 6px;
|
||||
top: 7px;
|
||||
font-size: 13px;
|
||||
font-weight: bold;
|
||||
color: #656565;
|
||||
}
|
||||
.lang-name-en {
|
||||
left: 4px;
|
||||
}
|
||||
.login-foot-lang-active .lang-name {
|
||||
color: #31759c;
|
||||
}
|
||||
|
||||
.login-input input {
|
||||
outline: none;
|
||||
border: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
outline: none;
|
||||
border: none;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.login-content {
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.login-content .login-title{
|
||||
text-align: center;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.login-content .login-title h1{
|
||||
color: rgb(23, 85, 142);
|
||||
font-size: 26px;
|
||||
}
|
||||
.login-content .login-title div{
|
||||
width: 260px;
|
||||
margin: 0 auto;
|
||||
margin-top: 25px;
|
||||
margin-bottom: 20px;
|
||||
height: 1px;
|
||||
background: #507faa;
|
||||
}
|
||||
.login-content .login-content{
|
||||
text-align: center;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.login-input{
|
||||
border: 2px solid #507faa;
|
||||
width: 70%;
|
||||
margin-left: 10%;
|
||||
border-radius: 5px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user