|
@@ -27,7 +27,7 @@ import {
|
|
} from "@/api/cloudPractice.api"
|
|
} from "@/api/cloudPractice.api"
|
|
import axios from "axios"
|
|
import axios from "axios"
|
|
import { getInstrumentName } from "@/libs/instruments"
|
|
import { getInstrumentName } from "@/libs/instruments"
|
|
-import { formatXML, getCustomInfo, onlyVisible } from "./instrument"
|
|
|
|
|
|
+import { formatXML, getCustomInfo, onlyMutVisible, onlyVisible } from "./instrument"
|
|
import { useFunction } from "./useData"
|
|
import { useFunction } from "./useData"
|
|
import userStore from "@/store/modules/user"
|
|
import userStore from "@/store/modules/user"
|
|
import PlayLoading from "./component/play-loading"
|
|
import PlayLoading from "./component/play-loading"
|
|
@@ -41,7 +41,7 @@ export default defineComponent({
|
|
name: "cloudPractice",
|
|
name: "cloudPractice",
|
|
setup() {
|
|
setup() {
|
|
const userStoreHook = userStore()
|
|
const userStoreHook = userStore()
|
|
- const { goToCloud, isPracticeShow, practiceUrl, handlePracticeClose } = useFunction()
|
|
|
|
|
|
+ const { goToCloud, getPreViewCloud, isPracticeShow, practiceUrl, handlePracticeClose } = useFunction()
|
|
const navs = [
|
|
const navs = [
|
|
{
|
|
{
|
|
name: "主页",
|
|
name: "主页",
|
|
@@ -102,7 +102,8 @@ export default defineComponent({
|
|
musicSheetType: item?.musicSheetType,
|
|
musicSheetType: item?.musicSheetType,
|
|
audioFileUrl,
|
|
audioFileUrl,
|
|
// titleImg: list?.titleImg,
|
|
// titleImg: list?.titleImg,
|
|
- isComberRender: item?.isScoreRender,
|
|
|
|
|
|
+ isScoreRender: item?.isScoreRender,
|
|
|
|
+ defaultScoreRender: item?.defaultScoreRender,
|
|
musicPdfUrl: item?.musicPdfUrl // 独奏使用PDF
|
|
musicPdfUrl: item?.musicPdfUrl // 独奏使用PDF
|
|
}
|
|
}
|
|
} else if (userStoreHook.roles === "GYT") {
|
|
} else if (userStoreHook.roles === "GYT") {
|
|
@@ -114,7 +115,8 @@ export default defineComponent({
|
|
musicSheetType: list?.musicSheetType,
|
|
musicSheetType: list?.musicSheetType,
|
|
audioFileUrl: list?.audioFileUrl,
|
|
audioFileUrl: list?.audioFileUrl,
|
|
titleImg: list?.titleImg,
|
|
titleImg: list?.titleImg,
|
|
- isComberRender: list?.musicSubjectId === "1",
|
|
|
|
|
|
+ isScoreRender: list?.isScoreRender,
|
|
|
|
+ defaultScoreRender: list?.defaultScoreRender,
|
|
musicPdfUrl: list?.musicPdfUrl
|
|
musicPdfUrl: list?.musicPdfUrl
|
|
}
|
|
}
|
|
} else if (userStoreHook.roles === "KLX") {
|
|
} else if (userStoreHook.roles === "KLX") {
|
|
@@ -127,7 +129,8 @@ export default defineComponent({
|
|
musicSheetType: list?.musicSheetType,
|
|
musicSheetType: list?.musicSheetType,
|
|
audioFileUrl: item?.audioFileUrl,
|
|
audioFileUrl: item?.audioFileUrl,
|
|
titleImg: list?.titleImg,
|
|
titleImg: list?.titleImg,
|
|
- isComberRender: false,
|
|
|
|
|
|
+ isScoreRender: false,
|
|
|
|
+ defaultScoreRender: false,
|
|
musicPdfUrl: list?.musicPdfUrl
|
|
musicPdfUrl: list?.musicPdfUrl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -751,12 +754,28 @@ export default defineComponent({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
// 初始化数据
|
|
// 初始化数据
|
|
|
|
+ // 是否显示总谱
|
|
|
|
+ console.log(row, "rows")
|
|
|
|
+ if (row.isScoreRender) {
|
|
|
|
+ partColumns.value.unshift({
|
|
|
|
+ label: "总谱",
|
|
|
|
+ instrumentName: null,
|
|
|
|
+ track: null,
|
|
|
|
+ musicPdfUrl: "",
|
|
|
|
+ xmlIndex: 999,
|
|
|
|
+ value: 999
|
|
|
|
+ })
|
|
|
|
+
|
|
|
|
+ if (row.defaultScoreRender) {
|
|
|
|
+ state.selectedPartIndex = 999
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
- const defaultShowStaff = partColumns.value[state.selectedPartIndex]
|
|
|
|
|
|
+ const defaultShowStaff = partColumns.value.find((item: any) => item.value === state.selectedPartIndex)
|
|
state.selectedPartName = defaultShowStaff?.instrumentName
|
|
state.selectedPartName = defaultShowStaff?.instrumentName
|
|
state.selectedTrack = defaultShowStaff?.track
|
|
state.selectedTrack = defaultShowStaff?.track
|
|
state.partXmlIndex = defaultShowStaff?.xmlIndex
|
|
state.partXmlIndex = defaultShowStaff?.xmlIndex
|
|
- if (row.isComberRender) {
|
|
|
|
|
|
+ if (row.isScoreRender && row.defaultScoreRender) {
|
|
state.musicPdfUrl = row?.musicPdfUrl || ""
|
|
state.musicPdfUrl = row?.musicPdfUrl || ""
|
|
} else {
|
|
} else {
|
|
state.musicPdfUrl = defaultShowStaff?.musicPdfUrl || ""
|
|
state.musicPdfUrl = defaultShowStaff?.musicPdfUrl || ""
|
|
@@ -780,32 +799,40 @@ export default defineComponent({
|
|
}
|
|
}
|
|
|
|
|
|
const musicIframeLoad = async () => {
|
|
const musicIframeLoad = async () => {
|
|
|
|
+ if (userStoreHook.roles === "GYM") return
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
- if (iframeRef && iframeRef.contentWindow.renderXml) {
|
|
|
|
|
|
+ if (iframeRef && iframeRef.contentWindow?.renderXml) {
|
|
staffLoading.value = true
|
|
staffLoading.value = true
|
|
const res: any = await axios.get(activeItem.value.xmlUrl)
|
|
const res: any = await axios.get(activeItem.value.xmlUrl)
|
|
const parseXmlInfo = getCustomInfo(res.data)
|
|
const parseXmlInfo = getCustomInfo(res.data)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
- if (activeItem.value.isComberRender) {
|
|
|
|
- iframeRef.contentWindow.renderXml(xml, state.partXmlIndex, activeItem.value.isComberRender)
|
|
|
|
|
|
+ console.log(activeItem.value, "activeItem.value")
|
|
|
|
+ if (activeItem.value.isScoreRender) {
|
|
|
|
+ const canSelectTracks: any = []
|
|
|
|
+ const background = activeItem.value.background || []
|
|
|
|
+ background.forEach((item: any) => {
|
|
|
|
+ canSelectTracks.push(item.track)
|
|
|
|
+ })
|
|
|
|
+ iframeRef.contentWindow.renderXml(xml, activeItem.value.isScoreRender)
|
|
} else {
|
|
} else {
|
|
const currentXml = onlyVisible(xml, state.partXmlIndex)
|
|
const currentXml = onlyVisible(xml, state.partXmlIndex)
|
|
- iframeRef.contentWindow.renderXml(currentXml, state.partXmlIndex, activeItem.value.isComberRender)
|
|
|
|
|
|
+ iframeRef.contentWindow.renderXml(currentXml)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
const resetRender = async () => {
|
|
const resetRender = async () => {
|
|
|
|
+ if (userStoreHook.roles === "GYM") return
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
const iframeRef: any = document.getElementById("staffIframeRef")
|
|
- if (iframeRef && iframeRef.contentWindow.renderXml) {
|
|
|
|
|
|
+ if (iframeRef && iframeRef.contentWindow?.renderXml) {
|
|
staffLoading.value = true
|
|
staffLoading.value = true
|
|
const res: any = await axios.get(activeItem.value.xmlUrl)
|
|
const res: any = await axios.get(activeItem.value.xmlUrl)
|
|
const parseXmlInfo = getCustomInfo(res.data)
|
|
const parseXmlInfo = getCustomInfo(res.data)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
const xml = formatXML(parseXmlInfo.parsedXML)
|
|
- if (activeItem.value.isComberRender) {
|
|
|
|
- iframeRef.contentWindow.renderXml(xml, state.partXmlIndex, activeItem.value.isComberRender)
|
|
|
|
|
|
+ if (activeItem.value.isScoreRender) {
|
|
|
|
+ iframeRef.contentWindow.renderXml(xml, activeItem.value.isScoreRender)
|
|
} else {
|
|
} else {
|
|
const currentXml = onlyVisible(xml, state.partXmlIndex)
|
|
const currentXml = onlyVisible(xml, state.partXmlIndex)
|
|
- iframeRef.contentWindow.renderXml(currentXml, 0, activeItem.value.isComberRender)
|
|
|
|
|
|
+ iframeRef.contentWindow.renderXml(currentXml)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -818,7 +845,11 @@ export default defineComponent({
|
|
// https://cdn.oss.dayaedu.com/daya202409/UOFVK2A.pdf
|
|
// https://cdn.oss.dayaedu.com/daya202409/UOFVK2A.pdf
|
|
// https://cdn.oss.dayaedu.com/daya202409/UODQffO.pdf
|
|
// https://cdn.oss.dayaedu.com/daya202409/UODQffO.pdf
|
|
} else {
|
|
} else {
|
|
- state.iframeSrc = `/osmd/index.html`
|
|
|
|
|
|
+ if (userStoreHook.roles === "GYM") {
|
|
|
|
+ state.iframeSrc = getPreViewCloud(activeItem.value.id, state.partXmlIndex)
|
|
|
|
+ } else {
|
|
|
|
+ state.iframeSrc = `/osmd/index.html`
|
|
|
|
+ }
|
|
}
|
|
}
|
|
} catch (error) {
|
|
} catch (error) {
|
|
//
|
|
//
|
|
@@ -1264,7 +1295,7 @@ export default defineComponent({
|
|
state.partXmlIndex = item.xmlIndex
|
|
state.partXmlIndex = item.xmlIndex
|
|
nextTick(() => {
|
|
nextTick(() => {
|
|
let tempPdf = ""
|
|
let tempPdf = ""
|
|
- if (activeItem.value?.isComberRender) {
|
|
|
|
|
|
+ if (activeItem.value?.isScoreRender) {
|
|
if (activeItem.value?.musicPdfUrl) {
|
|
if (activeItem.value?.musicPdfUrl) {
|
|
tempPdf = activeItem.value?.musicPdfUrl
|
|
tempPdf = activeItem.value?.musicPdfUrl
|
|
}
|
|
}
|