feat(login): 添加租户名称获取功能并优化前端布局

- 在登录控制器中注入租户服务并获取租户名称信息
- 添加租户名称到登录响应结果中
- 更新样式变量定义侧边栏宽度和Logo高度
- 重构公告面板组件统一公告通知显示逻辑
- 简化公告类型图标和样式映射关系
- 更新侧边栏为垂直菜单布局并添加折叠功能
- 优化Logo组件显示租户名称和系统标题
- 调整导航栏布局结构和响应式样式
- 重构主应用容器样式和标签页显示逻辑
This commit is contained in:
2025-12-31 10:28:52 +08:00
parent 10e738edd9
commit 4d4828ea71
54 changed files with 3510 additions and 754 deletions

View File

@@ -1,287 +1,154 @@
<template>
<div class="container">
<div class="awaitingBtn">
<el-button @click="awaitingMedicineBtn">
效期预警
<span>{{ total }}</span>
</el-button>
<!-- <el-select v-model="selectValue" @change="handelChange" @keyup.enter="handelEnter">
<el-option label="测试1" value="1"/>
<el-option label="测试2" value="2 "/>
</el-select> -->
<!-- 首页内容为空只显示欢迎信息 -->
<div class="welcome-content">
<div class="welcome-card">
<h1 class="welcome-title">欢迎使用</h1>
<p class="welcome-subtitle">医院管理系统</p>
<div class="quick-actions">
<div class="action-item" @click="handleExpiryWarning">
<el-icon :size="32" color="#e6a23c">
<Warning />
</el-icon>
<span>效期预警</span>
</div>
</div>
</div>
</div>
<!-- <div class="logo">
<img src="/src/assets/images/jlau.jpg" />
</div> -->
</div>
</template>
<script setup name="Index">
import {getproductReturnPage} from './medicationmanagement/statisticalManagement/statisticalManagent';
import {useStore} from '@/store/store';
import {Warning} from '@element-plus/icons-vue';
import {useRouter} from 'vue-router';
const store = useStore();
const router = useRouter();
const version = ref('3.8.7');
const total = ref(0);
const selectValue = ref('');
function awaitingMedicineBtn() {
store.setRemainingDays(180);
console.log(store.remainingDays);
function handleExpiryWarning() {
store.setRemainingDays(180);
router.push({
path: '/medicationmanagement/statisticalManagement/statisticalManagement',
});
}
function goTarget(url) {
window.open(url, '__blank');
}
function handelEnter() {
console.log('enter');
}
// function handelChange(val) {
// console.log(val);
// }
function getExpirationWarningCount() {
getproductReturnPage({ pageNo: 1, pageSize: 10, remainingDays: 180 }).then((res) => {
total.value = res.data.total || 0;
});
}
getExpirationWarningCount();
</script>
<style scoped lang="scss">
.dashboard-container {
.container {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.welcome-content {
width: 100%;
max-width: 1200px;
padding: 40px 20px;
display: flex;
justify-content: center;
align-items: center;
}
.welcome-card {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-radius: 16px;
padding: 60px 80px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
text-align: center;
animation: fadeIn 0.6s ease-out;
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.welcome-title {
font-size: 42px;
font-weight: 600;
color: #303133;
margin: 0 0 20px 0;
letter-spacing: 2px;
}
.welcome-subtitle {
font-size: 24px;
color: #909399;
margin: 0 0 50px 0;
font-weight: 300;
}
.quick-actions {
display: flex;
justify-content: center;
gap: 30px;
margin-top: 40px;
}
.action-item {
display: flex;
flex-direction: column;
height: 100vh;
background-color: #f5f7fa;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
padding: 0;
}
.awaitingBtn {
.el-button {
border: 1px #166773 solid;
span {
color: red;
margin-left: 5px;
}
}
.el-button:hover {
border: 1px #166773 solid;
color: #166773;
span {
color: red;
margin-left: 5px;
}
}
position: absolute;
top: 20px;
left: 20px;
}
.section-title {
font-size: 24px;
margin-bottom: 20px;
color: #333;
font-weight: 600;
}
.card {
background-color: #fff;
border-radius: 8px;
padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
transition: all 0.3s ease;
}
.card:hover {
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
.card-title {
font-size: 14px;
color: #606266;
margin-bottom: 12px;
}
.card-value {
font-size: 32px;
font-weight: 600;
color: #303133;
margin-bottom: 8px;
}
.card-stats {
display: flex;
align-items: center;
font-size: 12px;
color: #67c23a;
}
.card-stats.down {
color: #f56c6c;
}
.stats-icon {
margin-right: 4px;
}
.dashboard-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 30px;
}
.chart-container {
background-color: #fff;
border-radius: 8px;
padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
margin-bottom: 30px;
height: 300px;
canvas {
width: 100% !important;
height: 100% !important;
}
}
.bottom-content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 20px;
margin-bottom: 30px;
}
.notification-container,
.todo-container {
background-color: #fff;
border-radius: 8px;
padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.notification-title,
.todo-title {
font-size: 18px;
font-weight: 600;
color: #303133;
margin-bottom: 16px;
}
.notification-list {
list-style: none;
padding: 0;
margin: 0;
}
.notification-item {
padding: 12px 0;
border-bottom: 1px solid #ebeef5;
&:last-child {
border-bottom: none;
}
}
.todo-list {
list-style: none;
padding: 0;
margin: 0;
margin-bottom: 20px;
}
.todo-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 12px 0;
border-bottom: 1px solid #ebeef5;
&:last-child {
border-bottom: none;
}
}
.todo-count {
color: #606266;
font-size: 14px;
}
.table-container {
background-color: #fff;
border-radius: 8px;
padding: 24px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
table {
width: 100%;
border-collapse: collapse;
}
th, td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ebeef5;
}
th {
background-color: #f5f7fa;
font-weight: 600;
color: #303133;
}
tr:last-child td {
border-bottom: none;
}
.btn {
padding: 6px 12px;
border-radius: 4px;
font-size: 14px;
padding: 30px;
background: #fff;
border-radius: 12px;
cursor: pointer;
transition: all 0.3s ease;
border: none;
outline: none;
}
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
min-width: 160px;
.btn-primary {
background-color: #1890ff;
color: #fff;
}
&:hover {
transform: translateY(-5px);
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
.btn-primary:hover {
background-color: #40a9ff;
}
span {
color: #409eff;
}
}
.btn-outline {
background-color: transparent;
border: 1px solid #dcdfe6;
color: #606266;
}
.btn-outline:hover {
border-color: #c6e2ff;
color: #40a9ff;
background-color: #ecf5ff;
span {
margin-top: 12px;
font-size: 16px;
color: #303133;
font-weight: 500;
transition: color 0.3s;
}
}
@media (max-width: 768px) {
.bottom-content {
grid-template-columns: 1fr;
.welcome-card {
padding: 40px 30px;
margin: 20px;
}
.dashboard-grid {
grid-template-columns: 1fr;
.welcome-title {
font-size: 32px;
}
.welcome-subtitle {
font-size: 20px;
}
.quick-actions {
flex-direction: column;
gap: 15px;
margin-top: 30px;
}
.action-item {
min-width: 100%;
padding: 20px;
}
}
</style>
</style>