Files
leaudit-platform-frontend/app/styles/pages/role-permissions.css
T
LiangShiyong 3850d05bdd feat: 1. 将大部分的请求从fetch改成axios方便管理。
2. 给文档类型添加入口模块和相关数据的渲染。并且给文档类型进行功能上的角色权限区分
3. 新增角色权限管理页面
2025-11-20 20:34:31 +08:00

553 lines
8.3 KiB
CSS

/* 角色权限管理页面样式 */
.role-permissions-page {
padding: 20px;
background: #f5f7fa;
min-height: calc(100vh - 60px);
}
/* 页面头部 */
.role-permissions-page .page-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.role-permissions-page .page-title {
font-size: 24px;
font-weight: 600;
color: #303133;
display: flex;
align-items: center;
gap: 10px;
margin: 0;
}
.role-permissions-page .page-title i {
font-size: 28px;
color: var(--color-primary);
}
.role-permissions-page .page-actions {
display: flex;
gap: 12px;
}
/* 主容器布局 */
.permissions-container {
display: grid;
grid-template-columns: 380px 1fr;
gap: 20px;
align-items: start;
}
/* 左侧角色面板 */
.roles-panel {
height: calc(100vh - 140px);
overflow: hidden;
display: flex;
flex-direction: column;
}
.roles-list {
overflow-y: auto;
flex: 1;
}
/* 角色列表项 */
.role-item {
padding: 16px;
border-bottom: 1px solid #ebeef5;
cursor: pointer;
transition: all 0.2s;
display: flex;
justify-content: space-between;
align-items: flex-start;
gap: 12px;
}
.role-item:hover {
background: #f5f7fa;
}
.role-item.active {
background: var(--color-primary-light);
border-left: 3px solid var(--color-primary);
}
.role-info {
flex: 1;
min-width: 0;
}
.role-header {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 6px;
}
.role-name {
font-size: 16px;
font-weight: 600;
color: #303133;
}
.system-badge {
display: inline-block;
padding: 2px 8px;
background: #e6f7ff;
color: #1890ff;
border: 1px solid #91d5ff;
border-radius: 4px;
font-size: 12px;
font-weight: normal;
}
.role-key {
font-size: 12px;
color: #909399;
font-family: 'Courier New', monospace;
margin-bottom: 6px;
}
.role-desc {
font-size: 13px;
color: #606266;
margin-bottom: 8px;
line-height: 1.5;
}
.role-meta {
display: flex;
gap: 16px;
font-size: 12px;
color: #909399;
}
.role-meta span {
display: flex;
align-items: center;
gap: 4px;
}
.role-meta i {
font-size: 14px;
}
.role-actions {
display: flex;
gap: 4px;
opacity: 0;
transition: opacity 0.2s;
}
.role-item:hover .role-actions {
opacity: 1;
}
.btn-icon {
width: 28px;
height: 28px;
display: flex;
align-items: center;
justify-content: center;
border: none;
background: transparent;
border-radius: 4px;
cursor: pointer;
color: #606266;
transition: all 0.2s;
}
.btn-icon:hover {
background: #e6e8eb;
color: #303133;
}
.btn-icon.text-error:hover {
background: #fef0f0;
color: var(--color-error);
}
/* 右侧详情面板 */
.permissions-detail {
min-height: calc(100vh - 140px);
}
/* Tab 样式 */
.tabs-card {
overflow: hidden;
}
.tabs-header {
display: flex;
border-bottom: 2px solid #e4e7ed;
background: #fafbfc;
padding: 0 20px;
}
.tab-btn {
padding: 14px 24px;
border: none;
background: transparent;
color: #606266;
font-size: 15px;
font-weight: 500;
cursor: pointer;
border-bottom: 3px solid transparent;
margin-bottom: -2px;
transition: all 0.2s;
display: flex;
align-items: center;
gap: 8px;
}
.tab-btn i {
font-size: 18px;
}
.tab-btn:hover {
color: var(--color-primary);
}
.tab-btn.active {
color: var(--color-primary);
border-bottom-color: var(--color-primary);
background: white;
}
.tabs-content {
padding: 24px;
min-height: 500px;
}
/* 权限Tab */
.permissions-tab {
display: flex;
flex-direction: column;
gap: 20px;
}
.permissions-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16px;
border-bottom: 1px solid #e4e7ed;
}
.permissions-header h3 {
font-size: 18px;
font-weight: 600;
color: #303133;
margin: 0;
}
/* 路由树 */
.routes-tree {
max-height: 600px;
overflow-y: auto;
border: 1px solid #e4e7ed;
border-radius: 6px;
padding: 16px;
background: #fafbfc;
}
.route-item {
margin-bottom: 8px;
}
.route-item-content {
display: flex;
align-items: center;
padding: 10px 12px;
border-radius: 6px;
transition: background 0.2s;
}
.route-item-content:hover {
background: #e6e8eb;
}
.route-checkbox {
width: 18px;
height: 18px;
margin-right: 10px;
cursor: pointer;
accent-color: var(--color-primary);
}
.route-label {
display: flex;
align-items: center;
gap: 10px;
flex: 1;
cursor: pointer;
font-size: 14px;
}
.route-icon {
font-size: 18px;
color: var(--color-primary);
}
.route-title {
font-weight: 500;
color: #303133;
}
.route-path {
color: #909399;
font-size: 13px;
font-family: 'Courier New', monospace;
}
.route-children {
margin-top: 8px;
}
.permissions-summary {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 16px;
background: #ecf5ff;
border: 1px solid #b3d8ff;
border-radius: 6px;
color: #606266;
font-size: 14px;
}
.permissions-summary i {
font-size: 18px;
color: #409eff;
}
.permissions-summary strong {
color: var(--color-primary);
font-weight: 600;
}
/* 用户Tab */
.users-tab {
display: flex;
flex-direction: column;
gap: 20px;
}
.users-header {
display: flex;
justify-content: space-between;
align-items: center;
padding-bottom: 16px;
border-bottom: 1px solid #e4e7ed;
}
.users-header h3 {
font-size: 18px;
font-weight: 600;
color: #303133;
margin: 0;
}
.users-list {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 16px;
max-height: 600px;
overflow-y: auto;
}
/* 用户卡片 */
.user-card {
display: flex;
gap: 12px;
padding: 16px;
border: 1px solid #e4e7ed;
border-radius: 8px;
background: white;
transition: all 0.2s;
}
.user-card:hover {
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
border-color: var(--color-primary);
}
.user-avatar {
width: 56px;
height: 56px;
border-radius: 50%;
background: linear-gradient(135deg, var(--color-primary), #00a870);
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
}
.user-avatar i {
font-size: 28px;
color: white;
}
.user-info {
flex: 1;
min-width: 0;
}
.user-name {
font-size: 16px;
font-weight: 600;
color: #303133;
margin-bottom: 4px;
display: flex;
align-items: center;
gap: 8px;
}
.leader-badge {
display: inline-block;
padding: 2px 8px;
background: #fff7e6;
color: #fa8c16;
border: 1px solid #ffd591;
border-radius: 4px;
font-size: 12px;
font-weight: normal;
}
.user-username {
font-size: 13px;
color: #909399;
margin-bottom: 4px;
}
.user-org {
font-size: 13px;
color: #606266;
margin-bottom: 8px;
}
.user-contact {
display: flex;
flex-direction: column;
gap: 4px;
font-size: 12px;
color: #909399;
}
.user-contact span {
display: flex;
align-items: center;
gap: 4px;
}
.user-contact i {
font-size: 14px;
}
.user-actions {
display: flex;
flex-direction: column;
gap: 4px;
}
/* 空状态 */
.empty-state {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 60px 20px;
color: #909399;
text-align: center;
}
.empty-state i {
font-size: 64px;
color: #dcdfe6;
margin-bottom: 16px;
}
.empty-state p {
font-size: 14px;
margin: 0;
}
/* 加载状态 */
.loading-container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 400px;
gap: 16px;
color: #606266;
}
.loading-container i {
font-size: 48px;
color: var(--color-primary);
}
.spin {
animation: spin 1s linear infinite;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
/* 响应式布局 */
@media (max-width: 1200px) {
.permissions-container {
grid-template-columns: 320px 1fr;
}
.users-list {
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
}
@media (max-width: 992px) {
.permissions-container {
grid-template-columns: 1fr;
}
.roles-panel {
height: auto;
max-height: 400px;
}
.users-list {
grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
}
@media (max-width: 768px) {
.role-permissions-page {
padding: 12px;
}
.role-permissions-page .page-header {
flex-direction: column;
align-items: flex-start;
gap: 12px;
}
.tabs-header {
overflow-x: auto;
}
.users-list {
grid-template-columns: 1fr;
}
}