Files
leaudit-platform-frontend/app/styles/pages/role-permissions.css
T
LiangShiyong b97d0e1a0b 1. 登录返回总公司,分公司,部门信息。
2. 修改角色权限管理的分配用户的数据渲染和接口。
3. 交叉评查任务的创建的组织架构组件的重构。
2026-01-21 10:04:04 +08:00

1162 lines
19 KiB
CSS

/* 角色权限管理页面样式 */
.role-permissions-page {
/* padding: 20px; */
padding:0 1rem;
/* background: #f5f7fa; */
min-height: calc(100vh - 60px);
}
/* 页面头部 */
.role-permissions-page .page-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0;
margin-bottom: 10px;
}
.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 - 100px);
overflow: auto;
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 {
height: calc(100vh - 100px);
}
/* Tab 样式 */
.tabs-card {
height: calc(100vh - 100px);
display: flex;
flex-direction: column;
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;
flex: 1;
overflow: hidden;
display: flex;
flex-direction: column;
height: calc(100vh - 170px);
}
/* 权限Tab */
.permissions-tab {
display: flex;
flex-direction: column;
height: 100%;
overflow: hidden;
}
/* v3.8: 固定头部区域 */
.permissions-tab-header {
flex-shrink: 0;
background: white;
padding-bottom: 16px;
border-bottom: 1px solid #e4e7ed;
margin-bottom: 16px;
}
.permissions-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.permissions-header h3 {
font-size: 18px;
font-weight: 600;
color: #303133;
margin: 0;
}
/* v3.9: 折叠控制栏 */
.collapse-controls {
display: flex;
gap: 8px;
margin-bottom: 12px;
flex-shrink: 0;
}
.collapse-control-btn {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 6px 12px;
font-size: 12px;
color: #606266;
background: white;
border: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s ease;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.collapse-control-btn:hover {
color: var(--color-primary);
background: rgba(0, 104, 74, 0.04);
}
.collapse-control-btn i {
font-size: 14px;
}
/* 路由树容器 */
.routes-tree-container {
flex: 1;
overflow-y: auto;
min-height: 0;
padding: 4px;
margin: -4px;
}
/* 路由树 */
.routes-tree {
display: flex;
flex-direction: column;
gap: 10px;
}
/* 一级路由卡片 - 使用柔和阴影效果 */
.route-card {
background: white;
border: none;
padding: 0 10px;
border-radius: 10px;
overflow: hidden;
transition: all 0.25s ease;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.route-card:hover {
box-shadow: 0 4px 12px rgba(0, 104, 74, 0.1), 0 2px 4px rgba(0, 0, 0, 0.04);
transform: translateY(-1px);
}
.route-card.checked {
background: linear-gradient(to right, rgba(0, 104, 74, 0.03), rgba(255, 255, 255, 0.98));
box-shadow: 0 2px 8px rgba(0, 104, 74, 0.12), 0 1px 3px rgba(0, 0, 0, 0.04);
border-left: 2px solid var(--color-primary);
}
/* 路由项内容 */
.route-item-content {
display: flex;
align-items: center;
padding: 14px 16px;
cursor: pointer;
transition: background 0.2s;
}
.route-item-content:hover {
background: #f5f7fa;
}
.route-checkbox {
width: 18px;
height: 18px;
margin-right: 12px;
cursor: pointer;
accent-color: var(--color-primary);
flex-shrink: 0;
}
.route-label {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
cursor: pointer;
font-size: 14px;
min-width: 0;
}
.route-icon {
font-size: 20px;
color: var(--color-primary);
width: 24px;
text-align: center;
flex-shrink: 0;
}
.route-title {
font-weight: 500;
color: #303133;
white-space: nowrap;
}
.route-path {
color: #909399;
font-size: 12px;
font-family: 'Consolas', 'Monaco', monospace;
background: #f5f7fa;
padding: 2px 8px;
border-radius: 4px;
white-space: nowrap;
}
/* 权限展开按钮 */
.permission-expand-btn {
margin-left: auto;
padding: 4px 10px;
font-size: 12px;
border-radius: 4px;
cursor: pointer;
display: inline-flex;
align-items: center;
gap: 4px;
transition: all 0.2s;
flex-shrink: 0;
}
.permission-expand-btn:hover {
filter: brightness(0.95);
}
/* v3.9: 折叠按钮 */
.collapse-btn {
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border: none;
background: transparent;
border-radius: 4px;
cursor: pointer;
color: #909399;
transition: all 0.2s ease;
flex-shrink: 0;
margin-right: 4px;
}
.collapse-btn:hover {
background: rgba(0, 0, 0, 0.05);
color: var(--color-primary);
}
.collapse-btn i {
font-size: 16px;
transition: transform 0.2s ease;
}
/* 子路由数量标签 */
.children-count {
font-size: 11px;
color: #909399;
background: rgba(0, 0, 0, 0.04);
padding: 2px 8px;
border-radius: 10px;
margin-left: 4px;
}
/* 子路由容器 */
.route-children {
margin-left: 0;
padding: 3px 1px 12px 44px;
display: flex;
flex-direction: column;
gap: 4px;
/* v3.9: 折叠动画 */
max-height: 2000px;
overflow: hidden;
transition: max-height 0.3s ease-out, opacity 0.2s ease, padding 0.3s ease;
opacity: 1;
}
/* v3.9: 折叠状态 */
.route-children.collapsed {
max-height: 0;
opacity: 0;
padding-top: 0;
padding-bottom: 0;
}
/* 子路由项 - 柔和的背景效果 */
.route-children .route-item-content {
padding: 10px 12px;
border-radius: 6px;
background: rgba(0, 0, 0, 0.015);
border: none;
transition: all 0.2s ease;
}
.route-children .route-item-content:hover {
background: rgba(0, 0, 0, 0.035);
}
.route-children .route-item-content.checked {
background: rgba(0, 104, 74, 0.05);
border-left: 2px solid var(--color-primary);
padding-left: 10px;
}
/* API权限列表 - 柔和背景 */
.permissions-list {
margin-top: 8px;
margin-left: 44px;
margin-right: 16px;
margin-bottom: 12px;
padding: 12px 16px;
background: rgba(0, 0, 0, 0.02);
border-radius: 8px;
border: none;
}
.permission-item {
display: flex;
align-items: flex-start;
gap: 10px;
padding: 8px 10px;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s;
margin: -2px -10px;
}
.permission-item:hover {
background: rgba(0, 0, 0, 0.02);
}
.permission-item.shared {
background: rgba(24, 144, 255, 0.06);
border-left: 2px solid rgba(24, 144, 255, 0.5);
margin-left: -12px;
padding-left: 10px;
border-radius: 0 6px 6px 0;
}
.permission-item.shared:hover {
background: rgba(24, 144, 255, 0.1);
}
/* 权限方法标签 */
.method-tag {
padding: 2px 8px;
border-radius: 4px;
font-size: 11px;
font-weight: 600;
min-width: 52px;
text-align: center;
flex-shrink: 0;
}
.method-tag.get { background: #e6f7ed; color: #52c41a; border: 1px solid #b7eb8f; }
.method-tag.post { background: #e6f0ff; color: #1890ff; border: 1px solid #91caff; }
.method-tag.put { background: #fff7e6; color: #faad14; border: 1px solid #ffd591; }
.method-tag.delete { background: #fff1f0; color: #f5222d; border: 1px solid #ffa39e; }
.method-tag.patch { background: #f0f5ff; color: #722ed1; border: 1px solid #d3adf7; }
/* 通用权限标签 */
.shared-badge {
display: inline-block;
padding: 1px 6px;
font-size: 11px;
background: #e6f7ff;
border: 1px solid #91d5ff;
border-radius: 3px;
color: #1890ff;
font-weight: 500;
flex-shrink: 0;
}
/* 关联路由显示 */
.related-routes {
margin-top: 4px;
font-size: 11px;
color: #8c8c8c;
display: flex;
align-items: center;
gap: 6px;
flex-wrap: wrap;
}
.related-routes i {
font-size: 12px;
}
.related-route-tag {
padding: 2px 8px;
background: #f0f0f0;
border-radius: 4px;
font-size: 11px;
color: #666;
}
/* 权限统计 - 固定底部 */
.permissions-summary {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 8px;
padding: 12px 16px;
margin-top: 16px;
background: linear-gradient(to right, #ecf5ff, #f0f7ff);
border: 1px solid #b3d8ff;
border-radius: 8px;
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: 10px;
height: 100%;
overflow: hidden;
}
.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;
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);
}
}
/* ==================== 表单样式 ==================== */
.role-form {
display: flex;
flex-direction: column;
gap: 20px;
}
.form-group {
display: flex;
flex-direction: column;
gap: 8px;
}
.form-group label {
font-size: 14px;
font-weight: 500;
color: #303133;
}
.form-group label.required::after {
content: ' *';
color: var(--color-error);
}
.form-input,
.form-textarea,
.form-select {
padding: 10px 12px;
border: 1px solid #dcdfe6;
border-radius: 4px;
font-size: 14px;
color: #303133;
transition: border-color 0.2s;
}
.form-input:focus,
.form-textarea:focus,
.form-select:focus {
outline: none;
border-color: var(--color-primary);
box-shadow: 0 0 0 2px rgba(0, 104, 74, 0.1);
}
.form-input.error,
.form-textarea.error,
.form-select.error {
border-color: var(--color-error);
}
.form-input:disabled,
.form-textarea:disabled,
.form-select:disabled {
background: #f5f7fa;
cursor: not-allowed;
color: #909399;
}
.form-hint {
font-size: 12px;
color: #909399;
line-height: 1.5;
}
.form-error {
font-size: 12px;
color: var(--color-error);
line-height: 1.5;
}
.form-notice {
display: flex;
align-items: center;
gap: 8px;
padding: 12px 16px;
border-radius: 4px;
font-size: 14px;
background: #ecf5ff;
border: 1px solid #b3d8ff;
color: #606266;
}
.form-notice.warning {
background: #fef0f0;
border-color: #fbc4c4;
color: #606266;
}
.form-notice i {
font-size: 18px;
color: #409eff;
}
.form-notice.warning i {
color: var(--color-error);
}
/* 分配用户模态框 */
.assign-user-modal {
display: flex;
flex-direction: column;
gap: 16px;
}
/* 全选栏 */
.select-all-bar {
padding: 12px 16px;
background: #f5f7fa;
border-radius: 6px;
border: 1px solid #e4e7ed;
}
.select-all-bar .user-checkbox-item {
padding: 0;
margin: 0;
}
.select-all-bar .user-checkbox-item:hover {
background: transparent;
}
.select-all-bar .user-name {
font-weight: 600;
color: #303133;
}
/* 用户复选框列表 */
.users-checkbox-list {
max-height: 400px;
overflow-y: auto;
border: 1px solid #e4e7ed;
border-radius: 6px;
padding: 12px;
background: #fafbfc;
}
.user-checkbox-item {
display: flex;
align-items: center;
gap: 12px;
padding: 12px;
border-radius: 6px;
cursor: pointer;
transition: background 0.2s;
}
.user-checkbox-item:hover {
background: #e6e8eb;
}
.user-checkbox-item input[type="checkbox"] {
width: 18px;
height: 18px;
cursor: pointer;
accent-color: var(--color-primary);
}
.user-checkbox-item .user-info {
flex: 1;
min-width: 0;
}
.user-checkbox-item .user-name {
font-size: 14px;
font-weight: 500;
color: #303133;
margin-bottom: 4px;
}
.user-checkbox-item .user-meta {
font-size: 12px;
color: #909399;
}
/* 搜索框 */
.search-box {
display: flex;
align-items: center;
gap: 10px;
padding: 10px 12px;
border: 1px solid #dcdfe6;
border-radius: 6px;
background: white;
margin-bottom: 16px;
position: relative;
}
.search-box i {
font-size: 18px;
color: #909399;
}
.search-box input {
flex: 1;
border: none;
outline: none;
font-size: 14px;
color: #303133;
}
.search-box input::placeholder {
color: #c0c4cc;
}
/* 搜索清除按钮 */
.search-box .search-clear {
width: 20px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
border: none;
background: transparent;
cursor: pointer;
color: #909399;
border-radius: 50%;
transition: all 0.2s;
padding: 0;
}
.search-box .search-clear:hover {
background: #e6e8eb;
color: #606266;
}
.search-box .search-clear i {
font-size: 16px;
}
/* 分页信息 */
.select-all-bar .page-info {
margin-left: auto;
font-size: 13px;
color: #909399;
}
/* 分页容器 */
.pagination-container {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
padding: 16px 0 8px;
border-top: 1px solid #e4e7ed;
margin-top: 12px;
}
.pagination-btn {
width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #dcdfe6;
background: white;
border-radius: 4px;
cursor: pointer;
color: #606266;
transition: all 0.2s;
padding: 0;
}
.pagination-btn:hover:not(:disabled) {
border-color: var(--color-primary);
color: var(--color-primary);
}
.pagination-btn:disabled {
cursor: not-allowed;
opacity: 0.4;
background: #f5f7fa;
}
.pagination-btn i {
font-size: 18px;
}
.pagination-page {
min-width: 32px;
height: 32px;
padding: 0 8px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #dcdfe6;
background: white;
border-radius: 4px;
cursor: pointer;
color: #606266;
font-size: 14px;
font-weight: 500;
transition: all 0.2s;
}
.pagination-page:hover {
border-color: var(--color-primary);
color: var(--color-primary);
}
.pagination-page.active {
background: var(--color-primary);
border-color: var(--color-primary);
color: white;
}
.pagination-ellipsis {
min-width: 32px;
height: 32px;
display: flex;
align-items: center;
justify-content: center;
color: #909399;
font-size: 14px;
user-select: none;
}
/* 无权限卡片 */
.no-permission-card {
max-width: 800px;
margin: 60px auto;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.no-permission-card .empty-state {
text-align: center;
}
.no-permission-card h2 {
margin: 0;
}
.no-permission-card p {
margin: 0;
}
/* ==================== 响应式布局 ==================== */
/* 响应式布局 */
@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;
}
}