feat: redesign login page, dashboard, fix logo and avatar

- Login: split-screen design with blue gradient branding panel
- Dashboard: replace RuoYi default page with bid system stats & quick actions
- Logo: add object-fit contain for full logo display
- Avatar: replace with blue/gray person silhouette
This commit is contained in:
2026-05-22 10:07:56 +08:00
parent 85a3f5f788
commit 9055d34484
4 changed files with 593 additions and 1526 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 467 B

View File

@@ -1,95 +1,46 @@
<template>
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' && navType !== 3 ? variables.menuBackground : variables.menuLightBackground }">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' && navType !== 3 ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' && navType !== 3 ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
</router-link>
</transition>
</div>
</template>
<script>
import logoImg from '@/assets/logo/logo.png'
import variables from '@/assets/styles/variables.scss'
export default {
name: 'SidebarLogo',
props: {
collapse: {
type: Boolean,
required: true
}
},
computed: {
variables() {
return variables
},
sideTheme() {
return this.$store.state.settings.sideTheme
},
navType() {
return this.$store.state.settings.navType
}
},
data() {
return {
title: process.env.VUE_APP_TITLE,
logo: logoImg
}
}
}
</script>
<style lang="scss" scoped>
.sidebarLogoFade-enter-active {
transition: opacity 1.5s;
}
.sidebarLogoFade-enter,
.sidebarLogoFade-leave-to {
opacity: 0;
}
.sidebar-logo-container {
position: relative;
height: 50px;
line-height: 50px;
background: #2b2f3a;
text-align: center;
overflow: hidden;
& .sidebar-logo-link {
height: 100%;
width: 100%;
& .sidebar-logo {
width: 32px;
height: 32px;
vertical-align: middle;
margin-right: 12px;
}
& .sidebar-title {
display: inline-block;
margin: 0;
color: #fff;
font-weight: 600;
line-height: 50px;
font-size: 14px;
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
vertical-align: middle;
}
}
&.collapse {
.sidebar-logo {
margin-right: 0px;
}
}
}
</style>
<template>
<div class="sidebar-logo-container" :class="{ collapse: collapse }" :style="{ backgroundColor: sideTheme === 'theme-dark' && navType !== 3 ? variables.menuBackground : variables.menuLightBackground }">
<transition name="sidebarLogoFade">
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' && navType !== 3 ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
</router-link>
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
<img v-if="logo" :src="logo" class="sidebar-logo" />
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' && navType !== 3 ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }}</h1>
</router-link>
</transition>
</div>
</template>
<script>
import logoImg from "@/assets/logo/logo.png"
import variables from "@/assets/styles/variables.scss"
export default {
name: "SidebarLogo",
props: { collapse: { type: Boolean, required: true } },
computed: {
variables() { return variables },
sideTheme() { return this.$store.state.settings.sideTheme },
navType() { return this.$store.state.settings.navType }
},
data() { return { title: process.env.VUE_APP_TITLE, logo: logoImg } }
}
</script>
<style lang="scss" scoped>
.sidebarLogoFade-enter-active { transition: opacity 1.5s; }
.sidebarLogoFade-enter, .sidebarLogoFade-leave-to { opacity: 0; }
.sidebar-logo-container {
position: relative; height: 50px; line-height: 50px;
background: #2b2f3a; text-align: center; overflow: hidden;
.sidebar-logo-link {
height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; text-decoration: none;
.sidebar-logo { width: 34px; height: 34px; object-fit: contain; margin-right: 10px; flex-shrink: 0; }
.sidebar-title { display: inline-block; margin: 0; color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
}
.sidebar-logo-container.collapse .sidebar-logo-link { justify-content: center; }
.sidebar-logo-container.collapse .sidebar-logo { margin-right: 0 !important; }
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -1,223 +1,368 @@
<template>
<div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">{{title}}</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="账号"
>
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="密码"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
style="width: 63%"
@keyup.enter.native="handleLogin"
>
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
</el-input>
<div class="login-code">
<img :src="codeUrl" @click="getCode" class="login-code-img"/>
</div>
</el-form-item>
<el-checkbox v-model="loginForm.rememberMe" style="margin:0px 0px 25px 0px;">记住密码</el-checkbox>
<el-form-item style="width:100%;">
<el-button
:loading="loading"
size="medium"
type="primary"
style="width:100%;"
@click.native.prevent="handleLogin"
>
<span v-if="!loading"> </span>
<span v-else> 中...</span>
</el-button>
<div style="float: right;" v-if="register">
<router-link class="link-type" :to="'/register'">立即注册</router-link>
</div>
</el-form-item>
</el-form>
<!-- 底部 -->
<div class="el-login-footer">
<span>{{ footerContent }}</span>
</div>
</div>
</template>
<script>
import { getCodeImg } from "@/api/login"
import Cookies from "js-cookie"
import { encrypt, decrypt } from '@/utils/jsencrypt'
import defaultSettings from '@/settings'
export default {
name: "Login",
data() {
return {
title: process.env.VUE_APP_TITLE,
footerContent: defaultSettings.footerContent,
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
rememberMe: false,
code: "",
uuid: ""
},
loginRules: {
username: [
{ required: true, trigger: "blur", message: "请输入您的账号" }
],
password: [
{ required: true, trigger: "blur", message: "请输入您的密码" }
],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
},
loading: false,
// 验证码开关
captchaEnabled: true,
// 注册开关
register: false,
redirect: undefined
}
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
created() {
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img
this.loginForm.uuid = res.uuid
}
})
},
getCookie() {
const username = Cookies.get("username")
const password = Cookies.get("password")
const rememberMe = Cookies.get('rememberMe')
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 })
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 })
Cookies.set('rememberMe', this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove("username")
Cookies.remove("password")
Cookies.remove('rememberMe')
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{})
}).catch(() => {
this.loading = false
if (this.captchaEnabled) {
this.getCode()
}
})
}
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.login {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-image: url("../assets/images/login-background.jpg");
background-size: cover;
}
.title {
margin: 0px auto 30px auto;
text-align: center;
color: #707070;
}
.login-form {
border-radius: 6px;
background: #ffffff;
width: 400px;
padding: 25px 25px 5px 25px;
z-index: 1;
.el-input {
height: 38px;
input {
height: 38px;
}
}
.input-icon {
height: 39px;
width: 14px;
margin-left: 2px;
}
}
.login-tip {
font-size: 13px;
text-align: center;
color: #bfbfbf;
}
.login-code {
width: 33%;
height: 38px;
float: right;
img {
cursor: pointer;
vertical-align: middle;
}
}
.el-login-footer {
height: 40px;
line-height: 40px;
position: fixed;
bottom: 0;
width: 100%;
text-align: center;
color: #fff;
font-family: Arial;
font-size: 12px;
letter-spacing: 1px;
}
.login-code-img {
height: 38px;
}
</style>
<template>
<div class="login-container">
<!-- Left branding panel -->
<div class="login-left">
<div class="brand-wrap">
<div class="brand-logo-box">
<img src="@/assets/logo/logo.png" class="brand-logo-img" alt="logo" />
</div>
<h1 class="brand-name">福安德智慧报价平台</h1>
<p class="brand-slogan">高效 · 精准 · 智能采购管理</p>
<div class="brand-features">
<div class="feature-row">
<i class="el-icon-price-tag"></i>
<span>智慧比价一键找最优报价</span>
</div>
<div class="feature-row">
<i class="el-icon-s-cooperation"></i>
<span>全流程供应商协同管理</span>
</div>
<div class="feature-row">
<i class="el-icon-data-analysis"></i>
<span>采购数据可视化分析</span>
</div>
</div>
</div>
<div class="brand-circles">
<div class="circle c1"></div>
<div class="circle c2"></div>
<div class="circle c3"></div>
</div>
</div>
<!-- Right form panel -->
<div class="login-right">
<div class="form-card">
<div class="form-header">
<h2 class="form-title">欢迎登录</h2>
<p class="form-subtitle">福安德智慧报价系统</p>
</div>
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form" autocomplete="on">
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
placeholder="请输入账号"
size="medium"
>
<i slot="prefix" class="el-input__icon el-icon-user" />
</el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
placeholder="请输入密码"
size="medium"
@keyup.enter.native="handleLogin"
>
<i slot="prefix" class="el-input__icon el-icon-lock" />
</el-input>
</el-form-item>
<el-form-item prop="code" v-if="captchaEnabled">
<div class="code-row">
<el-input
v-model="loginForm.code"
auto-complete="off"
placeholder="验证码"
size="medium"
@keyup.enter.native="handleLogin"
>
<i slot="prefix" class="el-input__icon el-icon-key" />
</el-input>
<div class="code-img-box" @click="getCode">
<img :src="codeUrl" class="code-img" />
</div>
</div>
</el-form-item>
<el-form-item>
<el-checkbox v-model="loginForm.rememberMe">记住密码</el-checkbox>
</el-form-item>
<el-form-item>
<el-button
:loading="loading"
type="primary"
size="medium"
style="width: 100%;"
@click.native.prevent="handleLogin"
>
<span v-if="!loading">&nbsp;&nbsp;</span>
<span v-else>登录中...</span>
</el-button>
</el-form-item>
</el-form>
</div>
<div class="right-footer">{{ footerContent }}</div>
</div>
</div>
</template>
<script>
import { getCodeImg } from "@/api/login"
import Cookies from "js-cookie"
import { encrypt, decrypt } from "@/utils/jsencrypt"
import defaultSettings from "@/settings"
export default {
name: "Login",
data() {
return {
title: process.env.VUE_APP_TITLE,
footerContent: defaultSettings.footerContent,
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
rememberMe: false,
code: "",
uuid: ""
},
loginRules: {
username: [{ required: true, trigger: "blur", message: "请输入您的账号" }],
password: [{ required: true, trigger: "blur", message: "请输入您的密码" }],
code: [{ required: true, trigger: "change", message: "请输入验证码" }]
},
loading: false,
captchaEnabled: true,
register: false,
redirect: undefined
}
},
watch: {
$route: {
handler: function(route) {
this.redirect = route.query && route.query.redirect
},
immediate: true
}
},
created() {
this.getCode()
this.getCookie()
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaEnabled = res.captchaEnabled === undefined ? true : res.captchaEnabled
if (this.captchaEnabled) {
this.codeUrl = "data:image/gif;base64," + res.img
this.loginForm.uuid = res.uuid
}
})
},
getCookie() {
const username = Cookies.get("username")
const password = Cookies.get("password")
const rememberMe = Cookies.get("rememberMe")
this.loginForm = {
username: username === undefined ? this.loginForm.username : username,
password: password === undefined ? this.loginForm.password : decrypt(password),
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
}
},
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
this.loading = true
if (this.loginForm.rememberMe) {
Cookies.set("username", this.loginForm.username, { expires: 30 })
Cookies.set("password", encrypt(this.loginForm.password), { expires: 30 })
Cookies.set("rememberMe", this.loginForm.rememberMe, { expires: 30 })
} else {
Cookies.remove("username")
Cookies.remove("password")
Cookies.remove("rememberMe")
}
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(() => {})
}).catch(() => {
this.loading = false
if (this.captchaEnabled) {
this.getCode()
}
})
}
})
}
}
}
</script>
<style lang="scss" scoped>
.login-container {
display: flex;
height: 100vh;
overflow: hidden;
}
/* ---- Left panel ---- */
.login-left {
flex: 0 0 55%;
position: relative;
background: linear-gradient(135deg, #0d2b6b 0%, #1171c4 55%, #22a4ff 100%);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}
.brand-wrap {
position: relative;
z-index: 2;
text-align: center;
padding: 40px;
}
.brand-logo-box {
width: 90px;
height: 90px;
background: rgba(255, 255, 255, 0.15);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 24px;
backdrop-filter: blur(4px);
}
.brand-logo-img {
width: 60px;
height: 60px;
object-fit: contain;
}
.brand-name {
color: #ffffff;
font-size: 28px;
font-weight: 700;
margin: 0 0 10px;
letter-spacing: 2px;
text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.brand-slogan {
color: rgba(255, 255, 255, 0.8);
font-size: 15px;
margin: 0 0 40px;
letter-spacing: 4px;
}
.brand-features {
display: flex;
flex-direction: column;
gap: 16px;
text-align: left;
display: inline-block;
}
.feature-row {
color: rgba(255, 255, 255, 0.9);
font-size: 14px;
display: flex;
align-items: center;
gap: 10px;
margin-bottom: 14px;
i {
font-size: 18px;
color: #a8d8ff;
}
}
/* Decorative circles */
.brand-circles {
position: absolute;
inset: 0;
pointer-events: none;
}
.circle {
position: absolute;
border-radius: 50%;
background: rgba(255, 255, 255, 0.06);
}
.c1 { width: 400px; height: 400px; bottom: -120px; left: -100px; }
.c2 { width: 250px; height: 250px; top: -60px; right: -60px; }
.c3 { width: 150px; height: 150px; top: 40%; right: 10%; background: rgba(255,255,255,0.04); }
/* ---- Right panel ---- */
.login-right {
flex: 1;
background: #f5f7fa;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
position: relative;
}
.form-card {
width: 400px;
background: #ffffff;
border-radius: 12px;
padding: 40px 40px 32px;
box-shadow: 0 8px 32px rgba(17, 113, 196, 0.10);
}
.form-header {
text-align: center;
margin-bottom: 32px;
}
.form-title {
font-size: 24px;
font-weight: 700;
color: #1a2c4e;
margin: 0 0 6px;
}
.form-subtitle {
font-size: 13px;
color: #8c97a8;
margin: 0;
}
.login-form {
.el-form-item {
margin-bottom: 20px;
}
.el-input__inner {
height: 42px;
border-radius: 8px;
}
}
.code-row {
display: flex;
gap: 12px;
align-items: center;
.el-form-item, .el-input {
flex: 1;
}
}
.code-img-box {
flex-shrink: 0;
cursor: pointer;
border-radius: 6px;
overflow: hidden;
height: 42px;
display: flex;
align-items: center;
}
.code-img {
height: 42px;
width: 120px;
object-fit: cover;
display: block;
}
.right-footer {
position: absolute;
bottom: 20px;
font-size: 12px;
color: #b0bac6;
letter-spacing: 0.5px;
}
</style>