This commit is contained in:
2025-12-09 16:42:38 +08:00
parent 89a1391b40
commit 4f8d37483e
9 changed files with 403 additions and 4 deletions

View File

@@ -396,6 +396,138 @@
.filter-buttons {
justify-content: center;
}
/* ===== 移动端表格优化 ===== */
/* 表格容器允许横向滚动 */
.table-wrapper {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
/* 隐藏滚动条但保持滚动功能 */
scrollbar-width: thin;
}
/* 移除固定列效果 - 通过覆盖 Element Plus 的固定列样式 */
.list-page-container .el-table .el-table__fixed,
.list-page-container .el-table .el-table__fixed-right {
position: static !important;
box-shadow: none !important;
background-color: transparent !important;
}
/* 固定列的表头和表体都改为静态定位 */
.list-page-container .el-table .el-table__fixed-header-wrapper,
.list-page-container .el-table .el-table__fixed-body-wrapper,
.list-page-container .el-table .el-table__fixed-footer-wrapper {
position: static !important;
}
/* 表格单元格在移动端优化 */
.list-page-container .el-table th,
.list-page-container .el-table td {
padding: 12px 8px !important;
font-size: 13px;
}
/* 操作按钮组在移动端改为紧凑布局 */
.list-page-container .el-table .el-table__cell .flex.gap-2,
.list-page-container .el-table .el-table__cell .flex.items-center,
.list-page-container .el-table .el-table__cell .flex.space-x-2 {
flex-wrap: wrap;
gap: 6px !important;
}
/* 操作按钮在移动端缩小 */
.list-page-container .el-table .el-button--small {
padding: 6px 10px;
font-size: 12px;
min-width: auto;
}
/* 表格列宽度优化 - 允许更灵活的宽度 */
.list-page-container .el-table .el-table__cell {
min-width: 80px;
}
/* 操作列宽度自适应,不设置最小宽度 */
.list-page-container .el-table .el-table__cell[data-label="操作"],
.list-page-container .el-table th:last-child,
.list-page-container .el-table td:last-child {
min-width: auto !important;
width: auto !important;
}
/* 隐藏部分次要列在移动端 - 通过类名控制 */
.list-page-container .el-table .el-table__cell.hidden-mobile {
display: none;
}
/* 操作按钮在移动端自动换行,避免溢出 */
.list-page-container .el-table .el-table__cell .el-button + .el-button {
margin-left: 0;
}
/* 表格在移动端允许横向滚动 */
.list-page-container .el-table {
min-width: 600px;
}
/* 操作列在移动端不设置最小宽度,允许换行 */
.list-page-container .el-table .el-table__cell[data-label="操作"] {
white-space: normal;
word-break: break-word;
}
/* 操作按钮组在移动端更紧凑 */
.list-page-container .el-table .el-table__cell .flex {
justify-content: flex-start;
}
/* 下拉菜单按钮在移动端优化 */
.list-page-container .el-table .el-dropdown .el-button {
padding: 6px 10px;
}
}
/* 超小屏幕进一步优化 */
@media (max-width: 480px) {
.list-page-container {
padding: 12px;
}
.list-page-header {
padding: 16px 12px 12px;
}
.list-page-title {
font-size: 20px;
}
.list-page-filters {
padding: 16px 12px;
}
.list-page-table {
padding: 0 12px 12px;
}
/* 表格单元格进一步缩小 */
.list-page-container .el-table th,
.list-page-container .el-table td {
padding: 10px 6px !important;
font-size: 12px;
}
/* 操作按钮更紧凑 */
.list-page-container .el-table .el-button--small {
padding: 4px 8px;
font-size: 11px;
}
/* 操作按钮组更紧凑 */
.list-page-container .el-table .el-table__cell .flex.gap-2,
.list-page-container .el-table .el-table__cell .flex.items-center {
gap: 4px !important;
}
}
/* 动画效果 */