/** * 现代化页面布局公共样式 * 用于统一的卡片式布局和表格样式 * * 使用方法: * @import '/@/assets/styles/modern-page.scss'; * * 然后在模板中使用以下类名: * - .modern-page-container: 页面容器 * - .page-wrapper: 页面包装器 * - .search-card: 搜索表单卡片 * - .content-card: 内容卡片 * - .modern-table: 现代化表格 * - .search-form: 搜索表单 */ // 页面容器 .modern-page-container { padding: 20px; background: #f5f7fa; min-height: calc(100vh - 84px); } // 页面包装器 .page-wrapper { display: flex; flex-direction: column; gap: 20px; } // 搜索卡片 .search-card { border-radius: 12px; border: none; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.04); transition: all 0.3s ease; &:hover { box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.08); } :deep(.el-card__header) { padding: 16px 20px; border-bottom: 1px solid #f0f2f5; background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); } :deep(.el-card__body) { padding: 20px; } } // 内容卡片 .content-card { border-radius: 12px; border: none; box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.04); transition: all 0.3s ease; &:hover { box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.08); } :deep(.el-card__header) { padding: 16px 20px; border-bottom: 1px solid #f0f2f5; background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%); } :deep(.el-card__body) { padding: 20px; } } // 卡片头部 .card-header { display: flex; justify-content: space-between; align-items: center; width: 100%; } .card-title { display: flex; align-items: center; font-size: 16px; font-weight: 600; color: #303133; .title-icon { margin-right: 8px; color: var(--el-color-primary); font-size: 18px; } } .header-actions { display: flex; align-items: center; gap: 10px; } // 搜索表单 - 保持原有宽度 .search-form { :deep(.el-form-item) { margin-bottom: 18px; margin-right: 20px; } :deep(.el-form-item__label) { font-weight: 500; color: #606266; } // 确保表单项宽度保持200px :deep(.el-select), :deep(.el-input) { width: 200px !important; } } // 现代化表格 .modern-table { border-radius: 8px; overflow: hidden; :deep(.el-table__header) { th { background: linear-gradient(135deg, #fafbfc 0%, #f5f7fa 100%); color: #606266; font-weight: 600; border-bottom: 2px solid #e4e7ed; padding: 14px 0; } } :deep(.el-table__body) { tr { transition: all 0.2s ease; &:hover { background-color: #f5f7ff; transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); } } td { border-bottom: 1px solid #f0f2f5; padding: 16px 0; } } :deep(.el-table__row) { &:nth-child(even) { background-color: #fafbfc; } } } // 分页包装器 .pagination-wrapper { margin-top: 20px; display: flex; justify-content: flex-end; padding-top: 16px; border-top: 1px solid #f0f2f5; } // 响应式设计 @media (max-width: 768px) { .modern-page-container { padding: 12px; } .page-wrapper { gap: 12px; } .search-card, .content-card { :deep(.el-card__header) { padding: 12px 16px; } :deep(.el-card__body) { padding: 16px; } } .card-header { flex-direction: column; align-items: flex-start; gap: 12px; } .header-actions { width: 100%; justify-content: space-between; } // 移动端保持表单宽度 .search-form { :deep(.el-form-item) { margin-right: 0; width: 100%; } :deep(.el-select), :deep(.el-input) { width: 100% !important; } } } // 动画效果 @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .search-card, .content-card { animation: fadeIn 0.3s ease-out; } // 按钮样式优化 :deep(.el-button) { border-radius: 6px; transition: all 0.2s ease; &:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); } &:active { transform: translateY(0); } } // 表格空状态优化 :deep(.el-empty) { padding: 40px 0; }