feat: 更新 SongList 组件,增强分页功能和样式优化

- 添加了每页大小的动态设置,支持用户自定义分页。
- 优化了 OpenLiveLayout 组件的侧边栏样式,提升了用户体验。
- 改进了 OpenLiveIndex 组件的卡片布局,增强了视觉效果。
- 更新了 OpenQueue 组件,增加了辅助函数以改善队列状态显示。
This commit is contained in:
2025-04-20 15:01:21 +08:00
parent 94a315a906
commit f9417870ce
4 changed files with 256 additions and 171 deletions

View File

@@ -62,6 +62,7 @@ const songsInternal = ref<SongsInfo[]>([]) // 内部维护的歌曲列表,避
const playingSong = ref<SongsInfo>() // 当前正在试听的歌曲
const isLrcLoading = ref<string>() // 歌词加载状态(存储歌曲 key
const isLoading = ref(false) // 通用加载状态 (用于 API 请求)
const pageSize = ref(25) // 每页大小
// --- 搜索与筛选状态 ---
const searchMusicKeyword = ref('') // 歌曲名称搜索关键词
@@ -743,22 +744,16 @@ onMounted(() => {
v-model:checked-row-keys="selectedColumn"
:columns="columns"
:data="songsComputed"
:row-key="(row: SongsInfo) => row.key"
size="small"
:bordered="false"
:single-line="false"
flex-height
style="height: 60vh;"
:pagination="{
// itemCount: songsComputed.length, // 根据筛选结果分页或总数分页?取决于需求
pageSize: 25, // 默认每页大小
pageSizes: [10, 25, 50, 100, 200], // 可选的每页大小
itemCount: songsInternal.length,
defaultPageSize: pageSize,
pageSizes: [10, 25, 50, 100, 200],
showSizePicker: true,
showQuickJumper: true, // 显示快速跳转
// size: 'small', // 已在 NDataTable 设置 size
showQuickJumper: true,
}"
:loading="isLoading && songsComputed.length === 0"
remote
striped
/>