This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user