样式和图片修改

This commit is contained in:
jiutianzhiyu 2021-03-21 14:44:45 +08:00
parent d5c1aca4d8
commit ca7dfeedaa
8 changed files with 294 additions and 285 deletions

View File

@ -3,3 +3,6 @@ ENV = 'development'
# base api # base api
VUE_APP_BASE_API = '/api' VUE_APP_BASE_API = '/api'
# 服务器开发的端口
port = 8888

View File

@ -1,11 +1,16 @@
<template> <template>
<div id="app"> <div id="app">
<router-view /> <router-view />
</div> </div>
</template> </template>
<script> <script>
export default { export default {
name: 'App' name: 'App'
} }
</script> </script>
<style type="scss" scoped>
* {
filter:hue-rotate(200deg);
}
</style>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

View File

@ -4,8 +4,8 @@
<!-- <breadcrumb class="breadcrumb-container" /> --> <!-- <breadcrumb class="breadcrumb-container" /> -->
<div class="app-breadcrumb"> <div class="app-breadcrumb">
江苏传智播客教育科技股份有限公司 XXX股份有限公司
<span class="breadBtn">体验</span> <span class="breadBtn">测试</span>
</div> </div>
<div class="right-menu"> <div class="right-menu">

View File

@ -2,7 +2,7 @@
<div class="sidebar-logo-container" :class="{'collapse':collapse}"> <div class="sidebar-logo-container" :class="{'collapse':collapse}">
<transition name="sidebarLogoFade"> <transition name="sidebarLogoFade">
<router-link key="collapse" class="sidebar-logo-link" to="/"> <router-link key="collapse" class="sidebar-logo-link" to="/">
<img src="~@/assets/common/logo.png" class="sidebar-logo "> <img src="@/assets/common/logo.png" class="sidebar-logo" style="height:100%; width:30%">
</router-link> </router-link>
</transition> </transition>
</div> </div>

View File

@ -1,6 +1,6 @@
module.exports = { module.exports = {
title: '人力资源管理平台', title: '后台管理系统',
/** /**
* @type {boolean} true | false * @type {boolean} true | false

View File

@ -1,270 +1,271 @@
<template> <template>
<div class="login-container"> <div class="login-container">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" auto-complete="on" label-position="left">
<div class="title-container"> <div class="title-container">
<h3 class="title"> <h3 class="title" style="font-size: 34px">
<img src="@/assets/common/login-logo.png" alt=""> <!-- <img src="@/assets/common/login-logo.png" alt=""> -->
</h3> 登录后台管理系统
</div> </h3>
</div>
<el-form-item prop="mobile">
<span class="svg-container"> <el-form-item prop="mobile">
<svg-icon icon-class="user" /> <span class="svg-container">
</span> <svg-icon icon-class="user" />
<el-input </span>
ref="username" <el-input
v-model="loginForm.mobile" ref="username"
placeholder="用户名" v-model="loginForm.mobile"
name="username" placeholder="用户名"
type="text" name="username"
tabindex="1" type="text"
auto-complete="on" tabindex="1"
/> auto-complete="on"
</el-form-item> />
</el-form-item>
<el-form-item prop="password">
<span class="svg-container"> <el-form-item prop="password">
<svg-icon icon-class="password" /> <span class="svg-container">
</span> <svg-icon icon-class="password" />
<el-input </span>
:key="passwordType" <el-input
ref="password" :key="passwordType"
v-model="loginForm.password" ref="password"
:type="passwordType" v-model="loginForm.password"
placeholder="密码" :type="passwordType"
name="password" placeholder="密码"
tabindex="2" name="password"
auto-complete="on" tabindex="2"
@keyup.enter.native="handleLogin" auto-complete="on"
/> @keyup.enter.native="handleLogin"
<span class="show-pwd" @click="showPwd"> />
<svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" /> <span class="show-pwd" @click="showPwd">
</span> <svg-icon :icon-class="passwordType === 'password' ? 'eye' : 'eye-open'" />
</el-form-item> </span>
</el-form-item>
<el-button class="loginBtn" :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
<!-- .native监听原生事件 --> <el-button class="loginBtn" :loading="loading" type="primary" style="width:100%;margin-bottom:30px;" @click.native.prevent="handleLogin">登录</el-button>
<!-- .native监听原生事件 -->
<div class="tips">
<span style="margin-right:20px;">账号: 13800000002</span> <div class="tips">
<span> 密码: 123456</span> <span style="margin-right:20px;">账号: 13800000002</span>
</div> <span> 密码: 123456</span>
</div>
</el-form>
</div> </el-form>
</template> </div>
</template>
<script>
import { validMobile } from '@/utils/validate' <script>
import { mapActions } from 'vuex' import { validMobile } from '@/utils/validate'
import { mapActions } from 'vuex'
export default {
name: 'Login', export default {
data() { name: 'Login',
const validateUsername = (rule, value, callback) => { data() {
// , const validateUsername = (rule, value, callback) => {
// 1. // ,
// 2. // 1.
// 3. // 2.
// , // 3.
// 1. callback() // ,
// 2. (js ) new Error() callback // 1. callback()
if (validMobile(value)) { // 2. (js ) new Error() callback
callback() if (validMobile(value)) {
} else { callback()
callback(new Error('请输入合法手机号')) } else {
} callback(new Error('请输入合法手机号'))
} }
// const validatePassword = (rule, value, callback) => { }
// if (value.length < 6) { // const validatePassword = (rule, value, callback) => {
// callback(new Error('The password can not be less than 6 digits')) // if (value.length < 6) {
// } else { // callback(new Error('The password can not be less than 6 digits'))
// callback() // } else {
// } // callback()
// } // }
return { // }
loginForm: { return {
mobile: '13800000002', loginForm: {
password: '123456' mobile: '13800000002',
}, password: '123456'
loginRules: { },
mobile: [ loginRules: {
// { required: true, trigger: 'blur', validator: validateUsername } mobile: [
// // { required: true, trigger: 'blur', validator: validateUsername }
{ required: true, trigger: 'blur', message: '手机号不能为空' }, //
{ validator: validateUsername, trigger: 'blur' } { required: true, trigger: 'blur', message: '手机号不能为空' },
], { validator: validateUsername, trigger: 'blur' }
// password: [{ required: true, trigger: 'blur', validator: validatePassword }] ],
password: [ // password: [{ required: true, trigger: 'blur', validator: validatePassword }]
{ required: true, trigger: 'blur', message: '密码不能为空' }, password: [
{ min: 6, max: 16, trigger: 'blur', message: '密码必须在6到16位之间' } { required: true, trigger: 'blur', message: '密码不能为空' },
] { min: 6, max: 16, trigger: 'blur', message: '密码必须在6到16位之间' }
}, ]
loading: false, },
passwordType: 'password', loading: false,
redirect: undefined passwordType: 'password',
} redirect: undefined
}, }
watch: { },
$route: { watch: {
handler: function(route) { $route: {
this.redirect = route.query && route.query.redirect handler: function(route) {
}, this.redirect = route.query && route.query.redirect
immediate: true },
} immediate: true
}, }
methods: { },
...mapActions(['user/login']), methods: {
showPwd() { ...mapActions(['user/login']),
if (this.passwordType === 'password') { showPwd() {
this.passwordType = '' if (this.passwordType === 'password') {
} else { this.passwordType = ''
this.passwordType = 'password' } else {
} this.passwordType = 'password'
this.$nextTick(() => { }
this.$refs.password.focus() this.$nextTick(() => {
}) this.$refs.password.focus()
}, })
async handleLogin() { },
this.loading = true async handleLogin() {
try { this.loading = true
await this.$refs.loginForm.validate() // try {
// await this.$store.dispatch('user/login', this.loginForm) // await await this.$refs.loginForm.validate() //
// 使 mapActions methods store.dispatch // await this.$store.dispatch('user/login', this.loginForm) // await
await this['user/login'](this.loginForm) // 使 mapActions methods store.dispatch
this.$router.push('/') await this['user/login'](this.loginForm)
} catch (error) { this.$router.push('/')
console.log('捕获错误') } catch (error) {
console.log(error) console.log('捕获错误')
} finally { console.log(error)
this.loading = false } finally {
} this.loading = false
} }
} }
} }
</script> }
</script>
<style lang="scss">
/* 修复input 背景不协调 和光标变色 */ <style lang="scss">
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */ /* 修复input 背景不协调 和光标变色 */
/* Detail see https://github.com/PanJiaChen/vue-element-admin/pull/927 */
$bg:#283443;
$light_gray:#68b0fe; $bg:#283443;
$cursor: #fff; $light_gray:#68b0fe;
$cursor: #fff;
@supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
.login-container .el-input input { @supports (-webkit-mask: none) and (not (cater-color: $cursor)) {
color: $cursor; .login-container .el-input input {
} color: $cursor;
} }
}
/* reset element-ui css */
.login-container { /* reset element-ui css */
.el-input { .login-container {
display: inline-block; .el-input {
height: 47px; display: inline-block;
width: 85%; height: 47px;
width: 85%;
input {
background: transparent; input {
border: 0px; background: transparent;
-webkit-appearance: none; border: 0px;
border-radius: 0px; -webkit-appearance: none;
padding: 12px 5px 12px 15px; border-radius: 0px;
color: $light_gray; padding: 12px 5px 12px 15px;
height: 47px; color: $light_gray;
caret-color: $cursor; height: 47px;
caret-color: $cursor;
&:-webkit-autofill {
box-shadow: 0 0 0px 1000px $bg inset !important; &:-webkit-autofill {
-webkit-text-fill-color: $cursor !important; box-shadow: 0 0 0px 1000px $bg inset !important;
} -webkit-text-fill-color: $cursor !important;
} }
} }
}
.el-form-item {
border: 1px solid rgba(255, 255, 255, 0.1); .el-form-item {
background: rgba(255, 255, 255, 0.7); // border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 5px; background: rgba(255, 255, 255, 0.7); //
color: #454545; border-radius: 5px;
} color: #454545;
}
.loginBtn {
background: #407ffe; .loginBtn {
height: 64px; background: #407ffe;
line-height: 32px; height: 64px;
font-size: 24px; line-height: 32px;
} font-size: 24px;
}
.el-form-item__error {
color: #fff .el-form-item__error {
} color: #fff
} }
</style> }
</style>
<style lang="scss" scoped>
$bg:#2d3a4b; <style lang="scss" scoped>
$dark_gray:#889aa4; $bg:#2d3a4b;
$light_gray:#eee; $dark_gray:#889aa4;
$light_gray:#eee;
.login-container {
background-image: url('~@/assets/common/login.jpg'); .login-container {
background-position: center; background-image: url('~@/assets/common/login.jpg');
min-height: 100%; background-position: center;
width: 100%; min-height: 100%;
background-color: $bg; width: 100%;
overflow: hidden; background-color: $bg;
overflow: hidden;
.login-form {
position: relative; .login-form {
width: 520px; position: relative;
max-width: 100%; width: 520px;
padding: 160px 35px 0; max-width: 100%;
margin: 0 auto; padding: 160px 35px 0;
overflow: hidden; margin: 0 auto;
} overflow: hidden;
}
.tips {
font-size: 14px; .tips {
color: #fff; font-size: 14px;
margin-bottom: 10px; color: #fff;
margin-bottom: 10px;
span {
&:first-of-type { span {
margin-right: 16px; &:first-of-type {
} margin-right: 16px;
} }
} }
}
.svg-container {
padding: 6px 5px 6px 15px; .svg-container {
color: $dark_gray; padding: 6px 5px 6px 15px;
vertical-align: middle; color: $dark_gray;
width: 30px; vertical-align: middle;
display: inline-block; width: 30px;
} display: inline-block;
}
.title-container {
position: relative; .title-container {
position: relative;
.title {
font-size: 26px; .title {
color: $light_gray; font-size: 26px;
margin: 0px auto 40px auto; color: $light_gray;
text-align: center; margin: 0px auto 40px auto;
font-weight: bold; text-align: center;
} font-weight: bold;
} }
}
.show-pwd {
position: absolute; .show-pwd {
right: 10px; position: absolute;
top: 7px; right: 10px;
font-size: 16px; top: 7px;
color: $dark_gray; font-size: 16px;
cursor: pointer; color: $dark_gray;
user-select: none; cursor: pointer;
} user-select: none;
} }
</style> }
</style>