|
|
@@ -351,7 +351,7 @@ const pageSizeIndex = computed(() => {
|
|
|
const visiblePages = computed(() => {
|
|
|
const totalPages = pagination.value.pages
|
|
|
const currentPage = pagination.value.current
|
|
|
- const maxVisible = 4 // 显示的页码数量(包括第一页和最后一页)
|
|
|
+ const maxVisible = 6
|
|
|
|
|
|
if (totalPages <= maxVisible) {
|
|
|
return Array.from({ length: totalPages }, (_, i) => i + 1)
|
|
|
@@ -359,16 +359,12 @@ const visiblePages = computed(() => {
|
|
|
|
|
|
let pages = []
|
|
|
|
|
|
- if (currentPage <= 2) {
|
|
|
- // 当前页靠前:[1, 2, '...', 最后一页]
|
|
|
- pages = [1, 2, '...', totalPages]
|
|
|
- } else if (currentPage >= totalPages - 1) {
|
|
|
- // 当前页靠后:[1, '...', 倒数第二页, 最后一页]
|
|
|
- pages = [1, '...', totalPages - 1, totalPages]
|
|
|
+ if (currentPage <= 3) {
|
|
|
+ pages = [1, 2, 3, 4, '...', totalPages]
|
|
|
+ } else if (currentPage >= totalPages - 2) {
|
|
|
+ pages = [1, '...', totalPages - 3, totalPages - 2, totalPages - 1, totalPages]
|
|
|
} else {
|
|
|
- // 当前页在中间:由于只显示4个,去掉后面的...直接紧凑展示:[1, '...', 当前页, 最后一页]
|
|
|
- // 或者:[1, 当前页, '...', 最后一页] 以确保当前页能点到
|
|
|
- pages = [1, '...', currentPage, totalPages]
|
|
|
+ pages = [1, '...', currentPage, currentPage + 1, '...', totalPages]
|
|
|
}
|
|
|
|
|
|
return pages
|
|
|
@@ -793,6 +789,7 @@ defineExpose({
|
|
|
&.is-empty,
|
|
|
&.is-loading {
|
|
|
:deep(.uni-table-scroll) {
|
|
|
+ min-height: px2rpx(45);
|
|
|
flex-shrink: 0;
|
|
|
overflow: visible;
|
|
|
}
|
|
|
@@ -841,7 +838,7 @@ defineExpose({
|
|
|
:deep(.uni-table-scroll) {
|
|
|
width: 100%;
|
|
|
max-height: calc(100vh - 375px);
|
|
|
- min-height: px2rpx(300);
|
|
|
+ min-height: px2rpx(600);
|
|
|
overflow-y: auto;
|
|
|
overflow-x: auto;
|
|
|
|
|
|
@@ -949,7 +946,7 @@ defineExpose({
|
|
|
}
|
|
|
|
|
|
.uni-table-td {
|
|
|
- padding: px2rpx(16) px2rpx(15);
|
|
|
+ padding: px2rpx(15) px2rpx(15);
|
|
|
color: var(--bs-emphasis-color) !important;
|
|
|
border-bottom: 1px solid var(--bs-light-bg-subtle) !important;
|
|
|
box-sizing: border-box;
|
|
|
@@ -1080,7 +1077,7 @@ defineExpose({
|
|
|
padding: 0 px2rpx(4);
|
|
|
background-color: rgba(var(--bs-body-bg-rgb), var(--bs-bg-opacity)) !important;
|
|
|
border-radius: px2rpx(4);
|
|
|
- font-size: px2rpx(12);
|
|
|
+ font-size: px2rpx(16);
|
|
|
color: #606266;
|
|
|
cursor: pointer;
|
|
|
transition: all 0.3s;
|