parent
63d472ca55
commit
d8025e3dff
@ -0,0 +1,134 @@
|
|||||||
|
<div id="app" v-cloak>
|
||||||
|
<div class="frame">
|
||||||
|
<div class="login-box">
|
||||||
|
<div class="login-title">系统登录</div>
|
||||||
|
|
||||||
|
<el-form :model="form" :rules="rules" ref="form" class="form">
|
||||||
|
<el-form-item prop="name">
|
||||||
|
<el-input placeholder="用户名" v-model="form.name">
|
||||||
|
<template slot="prepend"><i class="icon iconfont icon-dengluzhanghao"></i></template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item prop="password">
|
||||||
|
<el-input placeholder="密码" v-model="form.password" type="password">
|
||||||
|
<template slot="prepend"><i class="icon iconfont icon-guanbi"></i></template>
|
||||||
|
</el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" style="width: 100%" :loading="isLogin" :disabled="isLogin"
|
||||||
|
@click="submitForm('form')">登录
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<a class="tip">登录</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<style>
|
||||||
|
#app {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
padding: 0;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
background: #001d3a;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.frame {
|
||||||
|
width: 50%;
|
||||||
|
height: 50%;
|
||||||
|
background: #42424263;
|
||||||
|
border-radius: 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
box-shadow: 0 0 10px 0 #afafaf52;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-box {
|
||||||
|
display: inline-block;
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 5px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-title {
|
||||||
|
line-height: 50px;
|
||||||
|
border-bottom: 1px solid #e8e8e8;
|
||||||
|
font-weight: bold;
|
||||||
|
text-align: left;
|
||||||
|
padding-left: 20px;
|
||||||
|
font-size: 15px;
|
||||||
|
height: 50px;
|
||||||
|
color: #757575;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form {
|
||||||
|
width: 300px;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 20px;
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form .el-input-group__prepend {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tip {
|
||||||
|
padding: 5px;
|
||||||
|
display: inline-block;
|
||||||
|
text-align: center;
|
||||||
|
color: #b7b7b7;
|
||||||
|
width: 100%;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
var app = new Vue({
|
||||||
|
el: "#app",
|
||||||
|
data: {
|
||||||
|
form: {
|
||||||
|
name: '',
|
||||||
|
password: ''
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
name: [
|
||||||
|
{required: true, message: '请输入用户名', trigger: 'blur'}
|
||||||
|
],
|
||||||
|
password: [
|
||||||
|
{required: true, message: '请输入密码', trigger: 'change'}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
isLogin: false
|
||||||
|
},
|
||||||
|
mounted: function () {
|
||||||
|
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submitForm: function (formName) {
|
||||||
|
this.$refs[formName].validate(function (valid) {
|
||||||
|
if (valid) {
|
||||||
|
this.isLogin = true;
|
||||||
|
setTimeout(function(){
|
||||||
|
nav.i("登录成功!", function () {
|
||||||
|
location.href = "/index.htm"
|
||||||
|
});
|
||||||
|
},1000)
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}.bind(this));
|
||||||
|
},
|
||||||
|
resetForm: function (formName) {
|
||||||
|
this.$refs[formName].resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
|
</script>
|
Loading…
Reference in new issue