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

File diff suppressed because it is too large Load Diff

View File

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