|
@@ -552,10 +552,10 @@ export default defineComponent({
|
|
|
// 老师端,加上乐器id
|
|
|
const instrumentIds = staffData.instrumentId // appState.instrumentId || appState.user?.instrumentId || route.query.instrumentId
|
|
|
if (instrumentIds) {
|
|
|
- const { code } = musicalInstruments.find((item: any) => {
|
|
|
- return instrumentIds == item.id
|
|
|
+ const { track } = musicalInstruments.find((item: any) => {
|
|
|
+ return instrumentIds == item.musicalInstrumentId
|
|
|
}) || {}
|
|
|
- return code
|
|
|
+ return track
|
|
|
}
|
|
|
return null
|
|
|
}
|
|
@@ -617,8 +617,8 @@ export default defineComponent({
|
|
|
|
|
|
|
|
|
let defaultShowStaff: any
|
|
|
- if(staffData.details?.musicalInstruments) {
|
|
|
- const soundCodes = filterSoundCodes(staffData.details?.musicalInstruments)
|
|
|
+ if(staffData.details?.musicSheetSoundList) {
|
|
|
+ const soundCodes = filterSoundCodes(staffData.details?.musicSheetSoundList)
|
|
|
if (soundCodes) {
|
|
|
const soundCodesArr = soundCodes.split(",").map((code: string) => {
|
|
|
return code
|
|
@@ -658,7 +658,8 @@ export default defineComponent({
|
|
|
name: "总谱",
|
|
|
});
|
|
|
// 如果是总谱则默认选中,否则选择
|
|
|
- staffData.selectedPartIndex = row.defaultScoreRender? 0 : defaultShowStaff ? defaultShowStaff.value : 1
|
|
|
+ // staffData.selectedPartIndex = row.defaultScoreRender ? 0 : defaultShowStaff ? defaultShowStaff.value : 1
|
|
|
+ staffData.selectedPartIndex = defaultShowStaff ? defaultShowStaff.value : 1
|
|
|
let pdfUrl = ''
|
|
|
if(row.defaultScoreRender) {
|
|
|
pdfUrl = getCurrentPdf(row, row.scoreType)
|
|
@@ -678,28 +679,28 @@ export default defineComponent({
|
|
|
|
|
|
// 通过isScoreRender判断是否合并渲染
|
|
|
// 多声轨, 不是单声部多声轨, 不是老师布置作业选择曲谱
|
|
|
- if (row.musicSheetType === "SINGLE") {
|
|
|
- staffData.isConcert = false;
|
|
|
- const musicSheetSoundList = staffData.details?.musicSheetSoundList || []
|
|
|
- const songs = filterSoundInfo(musicSheetSoundList)
|
|
|
- if(songs) {
|
|
|
- staffData.metronomeMp3Url = songs.audioFileUrl
|
|
|
- } else {
|
|
|
- // 为了处理节奏练习
|
|
|
- if(musicSheetSoundList.length > 0) {
|
|
|
- staffData.metronomeMp3Url = musicSheetSoundList[0].audioFileUrl
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- staffData.isConcert = true;
|
|
|
- const { audioFileUrl } = row.musicSheetAccompanimentList.find((item: any) => item.audioPlayType == 'PLAY')
|
|
|
- staffData.metronomeUrl = audioFileUrl
|
|
|
- }
|
|
|
+ // if (row.musicSheetType === "SINGLE") {
|
|
|
+ // staffData.isConcert = false;
|
|
|
+ // const musicSheetSoundList = staffData.details?.musicSheetSoundList || []
|
|
|
+ // const songs = filterSoundInfo(musicSheetSoundList)
|
|
|
+ // if(songs) {
|
|
|
+ // staffData.metronomeMp3Url = songs.audioFileUrl
|
|
|
+ // } else {
|
|
|
+ // // 为了处理节奏练习
|
|
|
+ // if(musicSheetSoundList.length > 0) {
|
|
|
+ // staffData.metronomeMp3Url = musicSheetSoundList[0].audioFileUrl
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // staffData.isConcert = true;
|
|
|
+ // const { audioFileUrl } = row.musicSheetAccompanimentList.find((item: any) => item.audioPlayType == 'PLAY')
|
|
|
+ // staffData.metronomeUrl = audioFileUrl
|
|
|
+ // }
|
|
|
+ audioFileUrl.value = row.mp3Url
|
|
|
if (
|
|
|
- (staffData.isConcert && staffData.metronomeUrl) ||
|
|
|
- (!staffData.isConcert && staffData.metronomeMp3Url)
|
|
|
+ audioFileUrl.value
|
|
|
) {
|
|
|
- audioFileUrl.value = staffData.isConcert ? staffData.metronomeUrl : staffData.metronomeMp3Url
|
|
|
+ // audioFileUrl.value = staffData.isConcert ? staffData.metronomeUrl : staffData.metronomeMp3Url
|
|
|
nextTick(async () => {
|
|
|
initAudio();
|
|
|
});
|
|
@@ -713,7 +714,7 @@ export default defineComponent({
|
|
|
const Authorization = sessionStorage.getItem("Authorization") || "";
|
|
|
const musicScorePath = "/klx-music-score/";
|
|
|
const musicScoreUrl = getHttpOrigin() + musicScorePath;
|
|
|
- // const musicScoreUrl = "https://dev.colexiu.com" + musicScorePath;
|
|
|
+ // const musicScoreUrl = "https://test.colexiu.com" + musicScorePath;
|
|
|
// const musicScoreUrl = 'http://192.168.3.68:3000/instrument.html';
|
|
|
let href = `${musicScoreUrl}?t=${Date.now()}#/?id=${musicId}&Authorization=${Authorization}&isPreView=true&zoom=0.5&downPng=A4`;
|
|
|
// // 老师端加上systemType=teacher
|
|
@@ -1390,6 +1391,7 @@ export default defineComponent({
|
|
|
>
|
|
|
<Picker
|
|
|
columns={partColumns.value}
|
|
|
+ defaultIndex={staffData.selectedPartIndex}
|
|
|
onConfirm={value => {
|
|
|
staffData.open = false;
|
|
|
staffData.selectedPartIndex = value.value;
|