|
@@ -15,6 +15,7 @@ import {
|
|
|
onUnmounted,
|
|
|
reactive,
|
|
|
ref,
|
|
|
+ toRaw,
|
|
|
watch
|
|
|
} from 'vue'
|
|
|
import umiRequest from 'umi-request'
|
|
@@ -549,9 +550,35 @@ export default defineComponent({
|
|
|
partIndex: 0,
|
|
|
partXmlIndex: 0,
|
|
|
partList: [] as any[],
|
|
|
+ tempPartList: [] as any[],
|
|
|
xmlPartList: [] as any[]
|
|
|
})
|
|
|
/** 渲染五线谱 */
|
|
|
+ // 长笛、单簧管、萨克斯、小号、长号、圆号、大号、上低音号
|
|
|
+ const sortList = {
|
|
|
+ 长笛: 1,
|
|
|
+ 单簧管: 2,
|
|
|
+ 中音单簧管: 3,
|
|
|
+ 低音单簧管: 4,
|
|
|
+ 高音萨克斯管: 5,
|
|
|
+ 中音萨克斯管: 6,
|
|
|
+ 次中音萨克斯管: 7,
|
|
|
+ 低音萨克斯管: 8,
|
|
|
+ 小号: 9,
|
|
|
+ 长号: 10,
|
|
|
+ 圆号: 11,
|
|
|
+ 大号: 12,
|
|
|
+ 上低音号: 13
|
|
|
+ }
|
|
|
+ const instrumentSort = (list: Array<any>) => {
|
|
|
+ list.sort((a, b) => {
|
|
|
+ return (
|
|
|
+ (sortList[getInstrumentName(a.track)] || 20) -
|
|
|
+ (sortList[getInstrumentName(b.track)] || 20)
|
|
|
+ )
|
|
|
+ })
|
|
|
+ return list
|
|
|
+ }
|
|
|
const renderStaff = async () => {
|
|
|
try {
|
|
|
if (musicDetail.value?.xmlFileUrl) {
|
|
@@ -589,6 +616,8 @@ export default defineComponent({
|
|
|
part.index = item.value
|
|
|
}
|
|
|
})
|
|
|
+ staffData.tempPartList = JSON.parse(JSON.stringify(staffData.partList))
|
|
|
+ staffData.partList = instrumentSort(staffData.partList)
|
|
|
staffData.partXmlIndex = staffData.partList[0].index || 0
|
|
|
|
|
|
staffData.instrumentName = getInstrumentName(
|
|
@@ -598,6 +627,7 @@ export default defineComponent({
|
|
|
//
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
const musicIframeLoad = () => {
|
|
|
const iframeRef: any = document.getElementById('staffIframeRef')
|
|
|
if (iframeRef && iframeRef.contentWindow.renderXml) {
|
|
@@ -622,7 +652,8 @@ export default defineComponent({
|
|
|
return {
|
|
|
text: item.track + (instrumentName ? `(${instrumentName})` : ''),
|
|
|
value: index,
|
|
|
- xmlValue: item.index
|
|
|
+ xmlValue: item.index,
|
|
|
+ track: item.track
|
|
|
}
|
|
|
})
|
|
|
})
|
|
@@ -858,8 +889,14 @@ export default defineComponent({
|
|
|
color="linear-gradient(270deg, #FF3C81 0%, #FF76A6 100%)"
|
|
|
onClick={() => {
|
|
|
player.value && player.value.stop()
|
|
|
+ const item: any = partColumns.value.find(
|
|
|
+ (c: any) => c.value === staffData.partIndex
|
|
|
+ )
|
|
|
+ const index = staffData.tempPartList.findIndex(
|
|
|
+ (i: any) => i.track === item?.track
|
|
|
+ )
|
|
|
musicBuy(musicDetail.value, () => {}, {
|
|
|
- 'part-index': staffData.partIndex || 0,
|
|
|
+ 'part-index': index || 0,
|
|
|
sett: staff.radio
|
|
|
})
|
|
|
}}
|