music(ui): 统一命名 — 和弦谱(字母版) / 简谱(级数版)
deploy music / build-and-deploy (push) Successful in 1m54s

This commit is contained in:
Fam Zheng
2026-05-10 16:09:56 +01:00
parent 5c0d860666
commit e5f3a95aa9
2 changed files with 22 additions and 16 deletions
+11 -12
View File
@@ -146,8 +146,8 @@
class="auto-fetch"
>
<p v-if="chordStateOf(activeTab) === 'idle'" class="hint-line">
<span v-if="activeTab === 'chord'"> yopu.co <b>弹唱字母 G/Em/C</b></span>
<span v-else> yopu.co <b>功能数字 1/4/5/6m</b></span>
<span v-if="activeTab === 'chord'"> yopu.co <b>和弦字母 G/Em/C + 六线谱</b></span>
<span v-else> yopu.co <b>数字 1/4/5/6m 级数</b></span>
</p>
<p v-else-if="['pending','processing'].includes(chordStateOf(activeTab))" class="hint-line">
正在抓取 30-60s
@@ -161,15 +161,15 @@
@click="startChordFetch(modeForTab(activeTab))"
>
<span v-if="['pending','processing'].includes(chordStateOf(activeTab))" class="spin"></span>
<span v-else>🎸 自动抓取{{ activeTab === 'chord' ? '弹唱' : '功能' }}</span>
<span v-else>🎸 自动抓取{{ activeTab === 'chord' ? '和弦' : '' }}</span>
</button>
</div>
</div>
<!-- 简谱 / 五线谱手动上传的图 -->
<div v-show="['numbered', 'staff'].includes(activeTab)" class="sheet-box">
<!-- 五线谱手动上传的图 -->
<div v-show="activeTab === 'staff'" class="sheet-box">
<img
v-for="att in roleAttachments(activeTab)"
v-for="att in roleAttachments('staff')"
:key="att.id"
:src="attachmentUrl(att.id)"
:alt="att.filename"
@@ -524,11 +524,12 @@ function roleAttachments(role) {
)
}
// chord 兼容:吉他谱 tab 显示历史 role='chord' + 新 role='chord_letters';功能谱 tab 显示 role='chord_functional'
// 和弦谱 tab = 字母版 (chord_letters + 历史 chord)
// 简谱 tab = 数字级数版 (chord_functional) + 用户手动上传 numbered
function chordTabAttachments(tab) {
const set = tab === 'chord'
? new Set(['chord', 'chord_letters'])
: new Set(['chord_functional'])
: new Set(['chord_functional', 'numbered'])
return (selected.value?.attachments || []).filter(
a => a.kind === 'image' && set.has(a.role),
)
@@ -542,10 +543,8 @@ const tabs = computed(() => {
if (!selected.value) return []
const list = []
if (selected.value.lyrics) list.push({ key: 'lyrics', label: '歌词', count: 0 })
list.push({ key: 'chord', label: '吉他谱', count: chordTabAttachments('chord').length })
list.push({ key: 'functional', label: '功能谱', count: chordTabAttachments('functional').length })
const num = roleAttachments('numbered').length
if (num) list.push({ key: 'numbered', label: '简谱', count: num })
list.push({ key: 'chord', label: '和弦谱', count: chordTabAttachments('chord').length })
list.push({ key: 'functional', label: '谱', count: chordTabAttachments('functional').length })
const staff = roleAttachments('staff').length
if (staff) list.push({ key: 'staff', label: '五线谱', count: staff })
if (pdfAttachments.value.length) list.push({ key: 'pdf', label: '乐谱 PDF', count: pdfAttachments.value.length })