|
@@ -370,6 +370,8 @@ const state = reactive({
|
|
track: "",
|
|
track: "",
|
|
/** 当前显示声部索引 */
|
|
/** 当前显示声部索引 */
|
|
partIndex: 0,
|
|
partIndex: 0,
|
|
|
|
+ /** 总谱渲染时候 只显示部分声部的值 */
|
|
|
|
+ combinePartIndexs:[],
|
|
/** 演奏是否需要节拍器 */
|
|
/** 演奏是否需要节拍器 */
|
|
needTick: false,
|
|
needTick: false,
|
|
/** 演唱模式是否需要节拍器 */
|
|
/** 演唱模式是否需要节拍器 */
|
|
@@ -1386,13 +1388,26 @@ const getMusicInfo = async (res: any) => {
|
|
state.defaultScoreRender = res.data?.defaultScoreRender
|
|
state.defaultScoreRender = res.data?.defaultScoreRender
|
|
// 是否显示节拍器
|
|
// 是否显示节拍器
|
|
state.isMixBeat = res.data?.isMixBeat
|
|
state.isMixBeat = res.data?.isMixBeat
|
|
- let partIndex = query["part-index"] ? parseInt(query["part-index"]) : -1 // -1为partIndex没有值的时候
|
|
|
|
|
|
+ /* 设置partIndex */
|
|
|
|
+ let partIndexs = query["part-index"] ? query["part-index"].split(",") : ["-1"] // -1为partIndex没有值的时候
|
|
|
|
+ partIndexs = partIndexs.map((indexStr:string) => {
|
|
|
|
+ return parseInt(indexStr)
|
|
|
|
+ })
|
|
|
|
+ let partIndex = partIndexs[0]
|
|
|
|
+ // 当partIndexs 大于1个的时候,代表用户自己选择了多个声部,用总谱渲染的逻辑
|
|
|
|
+ if(partIndexs.length > 1){
|
|
|
|
+ partIndex = 999
|
|
|
|
+ state.combinePartIndexs = partIndexs
|
|
|
|
+ }
|
|
// 如果是评测报告,会有默认的分轨index
|
|
// 如果是评测报告,会有默认的分轨index
|
|
if (state.isEvaluatReport) {
|
|
if (state.isEvaluatReport) {
|
|
partIndex = state.partIndex;
|
|
partIndex = state.partIndex;
|
|
}
|
|
}
|
|
// 布置作业 取作业的乐器id
|
|
// 布置作业 取作业的乐器id
|
|
let workRecordInstrumentId:undefined | string
|
|
let workRecordInstrumentId:undefined | string
|
|
|
|
+ // multiTracksSelection 返回为空,默认代表全部分轨
|
|
|
|
+ state.canSelectTracks = res.data.multiTracksSelection === "null" || res.data.multiTracksSelection === "" || res.data.multiTracksSelection === null ? [] : res.data.multiTracksSelection?.split(',');
|
|
|
|
+ state.canSelectTracks = state.canSelectTracks.map((item: any)=>item.trim())
|
|
/* 获取声轨列表 */
|
|
/* 获取声轨列表 */
|
|
let xmlString = await fetch(res.data.xmlFileUrl).then((response) => response.text());
|
|
let xmlString = await fetch(res.data.xmlFileUrl).then((response) => response.text());
|
|
xmlString = xmlAddPartName(xmlString);
|
|
xmlString = xmlAddPartName(xmlString);
|
|
@@ -1459,10 +1474,9 @@ function initMusicSource(data: any, tracks: string[], partIndex: number, workRec
|
|
} else {
|
|
} else {
|
|
/* 合奏 */
|
|
/* 合奏 */
|
|
// 支持总谱 并且当前是总谱。partIndex是999时候,或者默认是总谱并且partIndex为-1时候 -1就是partIndex没有值
|
|
// 支持总谱 并且当前是总谱。partIndex是999时候,或者默认是总谱并且partIndex为-1时候 -1就是partIndex没有值
|
|
- if(state.isScoreRender && (partIndex===999 || (state.defaultScoreRender && partIndex===-1))){
|
|
|
|
|
|
+ if((state.isScoreRender && (partIndex===999 || (state.defaultScoreRender && partIndex===-1))) || state.combinePartIndexs.length > 1){
|
|
// 总谱渲染
|
|
// 总谱渲染
|
|
state.isCombineRender = true
|
|
state.isCombineRender = true
|
|
- state.partListNames = tracks
|
|
|
|
banSongObj = musicSheetAccompanimentList.find((item: any) => {
|
|
banSongObj = musicSheetAccompanimentList.find((item: any) => {
|
|
return item.audioPlayType === "SING"
|
|
return item.audioPlayType === "SING"
|
|
})
|
|
})
|
|
@@ -1482,8 +1496,8 @@ function initMusicSource(data: any, tracks: string[], partIndex: number, workRec
|
|
index = 999
|
|
index = 999
|
|
musicalInstrumentId = ''
|
|
musicalInstrumentId = ''
|
|
}else{
|
|
}else{
|
|
- // 合奏只显示一个声轨
|
|
|
|
- track = tracks[partIndex===-1?0:partIndex]
|
|
|
|
|
|
+ // 合奏只显示一个声轨 当为-1时候,取tracks中 后端勾选了的第一个值
|
|
|
|
+ track = partIndex === -1 ? tracks.find(value => state.canSelectTracks.includes(value))! : tracks[partIndex]
|
|
// 根据当前的声轨 取数据
|
|
// 根据当前的声轨 取数据
|
|
musicObj = musicSheetSoundList.find((item: any) => {
|
|
musicObj = musicSheetSoundList.find((item: any) => {
|
|
return item.audioPlayType === "PLAY" && item.track === track
|
|
return item.audioPlayType === "PLAY" && item.track === track
|
|
@@ -1502,6 +1516,7 @@ function initMusicSource(data: any, tracks: string[], partIndex: number, workRec
|
|
})
|
|
})
|
|
musicalInstrumentId = musicObj?.musicalInstrumentId
|
|
musicalInstrumentId = musicObj?.musicalInstrumentId
|
|
}
|
|
}
|
|
|
|
+ state.partListNames = tracks
|
|
}
|
|
}
|
|
// 当没有任何曲目的时候报错
|
|
// 当没有任何曲目的时候报错
|
|
if (!musicObj?.audioFileUrl && !accompanyObj?.audioFileUrl && !fanSongObj?.audioFileUrl && !banSongObj?.audioFileUrl && !fanSongObj?.solmizationFileUrl && !fanSongObj?.femaleSolmizationFileUrl) {
|
|
if (!musicObj?.audioFileUrl && !accompanyObj?.audioFileUrl && !fanSongObj?.audioFileUrl && !banSongObj?.audioFileUrl && !fanSongObj?.solmizationFileUrl && !fanSongObj?.femaleSolmizationFileUrl) {
|
|
@@ -1678,9 +1693,6 @@ const setState = (data: any, index: number) => {
|
|
state.enableEvaluation = state.accompany || state.music ? true : false
|
|
state.enableEvaluation = state.accompany || state.music ? true : false
|
|
}
|
|
}
|
|
state.isConcert = data.musicSheetType === "CONCERT" ? true : false;
|
|
state.isConcert = data.musicSheetType === "CONCERT" ? true : false;
|
|
- // multiTracksSelection 返回为空,默认代表全部分轨
|
|
|
|
- state.canSelectTracks = data.multiTracksSelection === "null" || data.multiTracksSelection === "" || data.multiTracksSelection === null ? [] : data.multiTracksSelection?.split(',');
|
|
|
|
- state.canSelectTracks = state.canSelectTracks.map((item: any)=>item.trim())
|
|
|
|
// 开启预备小节
|
|
// 开启预备小节
|
|
state.isOpenPrepare = true;
|
|
state.isOpenPrepare = true;
|
|
state.extStyleConfigJson = data.extStyleConfigJson || {}
|
|
state.extStyleConfigJson = data.extStyleConfigJson || {}
|
|
@@ -2036,7 +2048,7 @@ watch(
|
|
measureNum = nextMeasureNum
|
|
measureNum = nextMeasureNum
|
|
}
|
|
}
|
|
if (measureNum >= 0 && (measureNum === state.activeMeasureIndex || (measureNum < state.activeMeasureIndex && nextMeasureNum > state.activeMeasureIndex))) {
|
|
if (measureNum >= 0 && (measureNum === state.activeMeasureIndex || (measureNum < state.activeMeasureIndex && nextMeasureNum > state.activeMeasureIndex))) {
|
|
- item.querySelector('.vf-custom-bg')?.setAttribute("fill", "rgba(1, 193, 181, 0.2)")
|
|
|
|
|
|
+ item.querySelector('.vf-custom-bg')?.setAttribute("fill", state.isSimplePage ? "rgba(45, 199, 170, 0.3)" : "rgba(1, 193, 181, 0.2)")
|
|
// 预备小节
|
|
// 预备小节
|
|
if(state.sectionFirst && measureNum === state.sectionFirst.MeasureNumberXML && state.section.length === 2){
|
|
if(state.sectionFirst && measureNum === state.sectionFirst.MeasureNumberXML && state.section.length === 2){
|
|
item?.querySelector('.vf-custom-bg')?.setAttribute("fill", "rgba(255, 193, 48, 0.15)")
|
|
item?.querySelector('.vf-custom-bg')?.setAttribute("fill", "rgba(255, 193, 48, 0.15)")
|