From f9417870ce2aee9729ffc80e6c4f6e75b6e9ecd9 Mon Sep 17 00:00:00 2001 From: Megghy Date: Sun, 20 Apr 2025 15:01:21 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=20SongList=20?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=BC=BA=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=92=8C=E6=A0=B7=E5=BC=8F=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加了每页大小的动态设置,支持用户自定义分页。 - 优化了 OpenLiveLayout 组件的侧边栏样式,提升了用户体验。 - 改进了 OpenLiveIndex 组件的卡片布局,增强了视觉效果。 - 更新了 OpenQueue 组件,增加了辅助函数以改善队列状态显示。 --- src/components/SongList.vue | 17 +- src/views/OpenLiveLayout.vue | 92 ++++------ src/views/open_live/OpenLiveIndex.vue | 84 +++++---- src/views/open_live/OpenQueue.vue | 234 ++++++++++++++++++-------- 4 files changed, 256 insertions(+), 171 deletions(-) diff --git a/src/components/SongList.vue b/src/components/SongList.vue index 8b7f142..14f4419 100644 --- a/src/components/SongList.vue +++ b/src/components/SongList.vue @@ -62,6 +62,7 @@ const songsInternal = ref([]) // 内部维护的歌曲列表,避 const playingSong = ref() // 当前正在试听的歌曲 const isLrcLoading = ref() // 歌词加载状态(存储歌曲 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 /> diff --git a/src/views/OpenLiveLayout.vue b/src/views/OpenLiveLayout.vue index e3cd0ec..6d3ee1a 100644 --- a/src/views/OpenLiveLayout.vue +++ b/src/views/OpenLiveLayout.vue @@ -272,84 +272,62 @@ onMounted(async () => { - - - +
- - - - {{ danmakuClient.authInfo.anchor_info.uname }} - -
- -
- + + + + {{ danmakuClient.authInfo?.anchor_info?.uname }} + + +
- - - - - + - 遇到问题或有建议? + 有更多功能建议请 - 点此反馈 + 反馈 diff --git a/src/views/open_live/OpenLiveIndex.vue b/src/views/open_live/OpenLiveIndex.vue index 5c29bec..8dfbefd 100644 --- a/src/views/open_live/OpenLiveIndex.vue +++ b/src/views/open_live/OpenLiveIndex.vue @@ -13,13 +13,17 @@ const accountInfo = useAccount()