lex 9 bulan lalu
induk
melakukan
bd0347f88a

File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/auth-login-legacy.b067c01c.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/auth-login.f5e2f244.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/create-legacy.635964aa.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/create.5c7c5f29.js


+ 1 - 0
dist/assets/home-layout-center-legacy.0e0b22cf.js

@@ -0,0 +1 @@
+!function(){function e(e,t,n,r,o,s,u){try{var a=e[s](u),c=a.value}catch(i){return void n(i)}a.done?t(c):Promise.resolve(c).then(r,o)}System.register(["./ResizeObserver.es-legacy.eb2579c3.js","./index-legacy.89d63063.js","./auth-legacy.3d68a276.js","./routes-common-legacy.946dfee5.js"],(function(t){"use strict";var n,r,o,s,u,a,c,i,f,l;return{setters:[function(e){n=e.d,r=e.g,o=e.u,s=e.p,u=e.i,a=e.j,c=e.C,i=e.F},function(e){f=e.a,l=e.b},function(){},function(){}],execute:function(){t("default",n({name:"home-layout-center",data:function(){return{status:!1}},mounted:function(){this.getUserInfo()},methods:{getUserInfo:function(){var t,n=this;return(t=regeneratorRuntime.mark((function e(){var t,a,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,f.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:r.orchestraInfo.phone,token:r.orchestraInfo.token,isSurportRegister:!0}});case 3:return t=e.sent,a=t.data.authentication,o(a.token_type+" "+a.access_token),s({api:"setCache",content:{key:"h5-colexiu-token",value:a.token_type+" "+a.access_token}}),e.next=9,f.get("/api-student/student/queryUserInfo",{initRequest:!0});case 9:c=e.sent,u(c.data),n.$router.push("/home"),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),n.status=!0;case 17:case"end":return e.stop()}}),e,null,[[0,14]])})),function(){var n=this,r=arguments;return new Promise((function(o,s){var u=t.apply(n,r);function a(t){e(u,o,s,a,c,"next",t)}function c(t){e(u,o,s,a,c,"throw",t)}a(void 0)}))})()}},render:function(){return a(i,null,[this.status?a("div",{class:l.error},[a(c,{type:"notFond",classImgSize:"CERT",tips:"加载失败,请稍后重试",buttonText:"重新加载",plain:!0,onClick:this.getUserInfo},null)]):a("div",null,null)])}}))}}}))}();

+ 1 - 0
dist/assets/home-layout-center.36d27a1f.js

@@ -0,0 +1 @@
+import{d as r,g as s,u,p as i,i as c,j as e,C as l,F as p}from"./ResizeObserver.es.78a052b8.js";import{a,b as h}from"./index.1b0b1c0c.js";import"./auth.d46848d0.js";import"./routes-common.83a2afd0.js";var g=r({name:"home-layout-center",data(){return{status:!1}},mounted(){this.getUserInfo()},methods:{async getUserInfo(){try{const o=await a.post("/api-auth/smsLogin",{requestType:"form",data:{clientId:"student",clientSecret:"student",phone:s.orchestraInfo.phone,token:s.orchestraInfo.token,isSurportRegister:!0}}),{authentication:t}=o.data;u(t.token_type+" "+t.access_token),i({api:"setCache",content:{key:"h5-colexiu-token",value:t.token_type+" "+t.access_token}});const n=await a.get("/api-student/student/queryUserInfo",{initRequest:!0});c(n.data),this.$router.push("/home")}catch{this.status=!0}}},render(){return e(p,null,[this.status?e("div",{class:h.error},[e(l,{type:"notFond",classImgSize:"CERT",tips:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5",buttonText:"\u91CD\u65B0\u52A0\u8F7D",plain:!0,onClick:this.getUserInfo},null)]):e("div",null,null)])}});export{g as default};

File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/index-legacy.311682cd.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/index-legacy.89d63063.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/index.1b0b1c0c.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/index.f2467ea3.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/live-detail-legacy.782e6a69.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/live-detail.a5116045.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/login-legacy.483bc9d8.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/login.10e0d635.js


File diff ditekan karena terlalu besar
+ 1 - 0
dist/assets/routes-common.83a2afd0.js


+ 0 - 0
dist/assets/organ-search.133b8c72.css → dist/assets/select-subject.5e7efcef.css


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/teacher-legacy.35d3e017.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/teacher.137a5be4.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/video-detail-legacy.a18b470b.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/assets/video-detail.96fb3cd9.js


+ 8 - 0
dist/index.html

@@ -52,7 +52,11 @@
             _T_));
     })(Object);
   </script>
+<<<<<<< HEAD
   <script type="module" crossorigin src="./assets/index.6ff0745a.js"></script>
+=======
+  <script type="module" crossorigin src="./assets/index.1b0b1c0c.js"></script>
+>>>>>>> iteration-20240618
   <link rel="modulepreload" href="./assets/ResizeObserver.es.78a052b8.js">
   <link rel="modulepreload" href="./assets/auth.d46848d0.js">
   <link rel="modulepreload" href="./assets/routes-common.83a2afd0.js">
@@ -68,7 +72,11 @@
   <!-- <script type="module" src="/src/teacher/main.ts"></script> -->
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule id="vite-legacy-polyfill" src="./assets/polyfills-legacy.d15f7bf4.js"></script>
+<<<<<<< HEAD
   <script nomodule id="vite-legacy-entry" data-src="./assets/index-legacy.52ae321b.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+=======
+  <script nomodule id="vite-legacy-entry" data-src="./assets/index-legacy.89d63063.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+>>>>>>> iteration-20240618
 </body>
 
 </html>

+ 8 - 0
dist/teacher.html

@@ -52,7 +52,11 @@
             _T_));
     })(Object);
   </script>
+<<<<<<< HEAD
   <script type="module" crossorigin src="./assets/teacher.350f82fa.js"></script>
+=======
+  <script type="module" crossorigin src="./assets/teacher.137a5be4.js"></script>
+>>>>>>> iteration-20240618
   <link rel="modulepreload" href="./assets/ResizeObserver.es.78a052b8.js">
   <link rel="modulepreload" href="./assets/routes-common.83a2afd0.js">
   <link rel="stylesheet" href="./assets/ResizeObserver.es.6e083b37.css">
@@ -65,7 +69,11 @@
   
   <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
   <script nomodule id="vite-legacy-polyfill" src="./assets/polyfills-legacy.d15f7bf4.js"></script>
+<<<<<<< HEAD
   <script nomodule id="vite-legacy-entry" data-src="./assets/teacher-legacy.c822a773.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+=======
+  <script nomodule id="vite-legacy-entry" data-src="./assets/teacher-legacy.35d3e017.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
+>>>>>>> iteration-20240618
 </body>
 
 </html>

+ 137 - 47
src/views/music/music-detail/index.tsx

@@ -68,6 +68,11 @@ import { getInstrumentName } from '@/constant/instruments'
 import { getUploadSign, onOnlyFileUpload } from '@/helpers/oss-file-upload'
 import { svgtopng } from '@/tenant/music/music-detail/formatSvgToImg'
 import { useThrottleFn } from '@vueuse/core'
+import {
+  formatXML,
+  getCustomInfo,
+  onlyVisible
+} from '@/tenant/music/music-detail/instrument'
 
 export const getAssetsHomeFile = (fileName: string) => {
   const path = `../component/images/${fileName}`
@@ -94,6 +99,12 @@ export default defineComponent({
     const firstList = ref<Array<any>>([])
     const fixedList = ref<Array<any>>([])
     const staffList = ref<Array<any>>([])
+
+    const defaultImgs = ref({
+      first: false,
+      fixed: false,
+      staff: false
+    })
     const accompanyUrl = ref<string>('')
     const downloadStatus = ref<boolean>(false)
     const staff = reactive({
@@ -120,6 +131,18 @@ export default defineComponent({
     const onChangeStaff = (type: string) => {
       staff.radio = type
       staff.status = false
+      if (type == 'first' && !defaultImgs.value.first) {
+        loading.value = false
+        resetRenderPage('first', staffData.musicXml)
+      } else if (type == 'fixed' && !defaultImgs.value.fixed) {
+        loading.value = false
+        resetRenderPage('fixed', staffData.musicXml)
+      } else {
+        if (!defaultImgs.value.staff) {
+          loading.value = false
+          resetRenderPage('staff', staffData.musicXml)
+        }
+      }
     }
     watch(
       () => staff.radio,
@@ -145,7 +168,7 @@ export default defineComponent({
             state.platformType === 'TEACHER' ? '/api-teacher' : '/api-student'
         })
         musicDetail.value = res.data
-        console.log(musicDetail.value.notation, 'musicDetail')
+        // console.log(musicDetail.value.notation, 'musicDetail')
         // 取原音,如果有多个则默认第一个
         const background = res.data.background
         audioFileUrl.value =
@@ -173,6 +196,17 @@ export default defineComponent({
         //   false
         // )
         // }
+        // 初始化默认数据是否有值
+        if (firstList.value.length > 0) {
+          defaultImgs.value.first = true
+        }
+        if (fixedList.value.length > 0) {
+          defaultImgs.value.fixed = true
+        }
+        if (staffList.value.length > 0) {
+          defaultImgs.value.staff = true
+        }
+
         nextTick(() => {
           renderStaff()
         })
@@ -372,7 +406,7 @@ export default defineComponent({
           imgs.push(imgurl)
         }
         showImg.value = imgs
-        console.log(showImg.value, 'showImg.value')
+        // console.log(showImg.value, 'showImg.value', e.data)
 
         loading.value = e.data.loading
       }
@@ -423,7 +457,7 @@ export default defineComponent({
             userId: state.user.data?.userId
           }
         })
-        console.log(res)
+        // console.log(res)
         setTimeout(() => {
           musicDetail.value.coursewareId = res.data.id || ''
           Toast('添加成功')
@@ -599,10 +633,10 @@ export default defineComponent({
       单簧管: 2,
       中音单簧管: 3,
       低音单簧管: 4,
-      高音萨克斯: 5,
-      中音萨克斯: 6,
-      次中音萨克斯: 7,
-      低音萨克斯: 8,
+      高音萨克斯: 5,
+      中音萨克斯: 6,
+      次中音萨克斯: 7,
+      低音萨克斯: 8,
       小号: 9,
       长号: 10,
       圆号: 11,
@@ -625,68 +659,113 @@ export default defineComponent({
           const res = await umiRequest.get(musicDetail.value?.xmlFileUrl, {
             mode: 'cors'
           })
-          const xmlParse = new DOMParser().parseFromString(res, 'text/xml')
-          const parts = xmlParse.getElementsByTagName('score-part')
-
-          const partList: any = []
-          for (let i = 0; i < parts.length; i++) {
-            const childDom = parts[i].children
-            for (let j = 0; j < childDom.length; j++) {
-              if (childDom[j].nodeName === 'part-name') {
-                partList.push({
-                  name: childDom[j].textContent,
-                  value: i
-                })
-              }
+          let partNames: string[] = []
+          const xml: any = new DOMParser().parseFromString(res, 'text/xml')
+          for (const item of xml.getElementsByTagName('part-name')) {
+            if (item.textContent) {
+              partNames.push(item.textContent)
             }
           }
+          partNames = partNames.filter(
+            (item: any) => !item?.toLocaleUpperCase()?.includes('COMMON')
+          )
+          const partList: any = []
+          for (let j = 0; j < partNames.length; j++) {
+            partList.push({
+              name: partNames[j],
+              value: j
+            })
+          }
           staffData.xmlPartList = partList
         }
 
         // staffData.iframeSrc = `${location.origin}/osmd/index.html`
         staffData.iframeSrc = `${location.origin}${location.pathname}osmd/index.html`
         staffData.musicXml = musicDetail.value?.xmlFileUrl || ''
-        staffData.partList = musicDetail.value?.background || []
-        staffData.partList.forEach((part: any) => {
-          const item = staffData.xmlPartList.find(
-            item => item.name === part.track
-          )
+        const tempList = musicDetail.value?.background || []
+        const tempPartList = [] as any
+        staffData.xmlPartList.forEach((part: any) => {
+          const item = tempList.find((item: any) => item.track === part.name)
           if (item) {
-            part.index = item.value
+            tempPartList.push({
+              ...item,
+              index: part.value
+            })
           }
         })
+
+        staffData.partList = tempPartList
+
         staffData.tempPartList = JSON.parse(JSON.stringify(staffData.partList))
         staffData.partList = instrumentSort(staffData.partList)
         staffData.partXmlIndex = staffData.partList[0].index || 0
 
-        staffData.instrumentName = getInstrumentName(
-          staffData.partList[staffData.partIndex]?.track
-        )
+        staffData.instrumentName =
+          musicDetail.value?.musicSheetType === 'CONCERT'
+            ? getInstrumentName(staffData.partList[staffData.partIndex]?.track)
+            : ''
       } catch (error) {
         //
       }
     }
-    const musicIframeLoad = () => {
+    const musicIframeLoad = async () => {
       const iframeRef: any = document.getElementById('staffIframeRef')
       if (iframeRef && iframeRef.contentWindow.renderXml) {
-        iframeRef.contentWindow.renderXml(
-          staffData.musicXml,
-          staffData.partXmlIndex
-        )
+        const res = await umiRequest.get(staffData.musicXml, {
+          mode: 'cors'
+        })
+        const parseXmlInfo = getCustomInfo(res)
+        const xml = formatXML(parseXmlInfo.parsedXML)
+
+        const currentXml = onlyVisible(xml, staffData.partXmlIndex)
+        iframeRef.contentWindow.renderXml(currentXml, 0)
+
+        // iframeRef.contentWindow.renderXml(
+        //   staffData.musicXml,
+        //   staffData.partXmlIndex
+        // )
       }
     }
-    const resetRender = () => {
+    const resetRender = async () => {
       const iframeRef: any = document.getElementById('staffIframeRef')
       if (iframeRef && iframeRef.contentWindow.renderXml) {
-        iframeRef.contentWindow.resetRender(staffData.partXmlIndex)
+        loading.value = true
+        // iframeRef.contentWindow.resetRender(staffData.partXmlIndex)
+        const res = await umiRequest.get(staffData.musicXml, {
+          mode: 'cors'
+        })
+        const parseXmlInfo = getCustomInfo(res)
+        const xml = formatXML(parseXmlInfo.parsedXML)
+
+        const currentXml = onlyVisible(xml, staffData.partXmlIndex)
+        iframeRef.contentWindow.renderXml(currentXml, 0)
+
         staffData.instrumentName = getInstrumentName(
           staffData.partList[staffData.partIndex]?.track
         )
       }
     }
+
+    const resetRenderPage = async (type: string, xmlUrl: string) => {
+      const iframeRef: any = document.getElementById('staffIframeRef')
+      if (iframeRef && iframeRef.contentWindow.renderXml) {
+        loading.value = true
+        const res = await umiRequest.get(staffData.musicXml, {
+          mode: 'cors'
+        })
+        const parseXmlInfo = getCustomInfo(res)
+        const xml = formatXML(parseXmlInfo.parsedXML)
+
+        const currentXml = onlyVisible(xml, staffData.partXmlIndex)
+        iframeRef.contentWindow.resetRenderPage(type, currentXml)
+      }
+    }
     const partColumns = computed(() => {
       return staffData.partList.map((item: any, index: number) => {
-        const instrumentName = getInstrumentName(item.track)
+        const instrumentName =
+          musicDetail.value?.musicSheetType === 'CONCERT'
+            ? getInstrumentName(item.track)
+            : ''
         return {
           text: item.track + (instrumentName ? `(${instrumentName})` : ''),
           value: index,
@@ -698,7 +777,7 @@ export default defineComponent({
     return () => {
       return (
         <div class={styles.detail}>
-          <Sticky position="top">
+          <ColSticky position="top">
             <div ref={headers}>
               <ColHeader
                 background="transparent"
@@ -723,7 +802,7 @@ export default defineComponent({
                 }}
               />
             </div>
-          </Sticky>
+          </ColSticky>
 
           <img class={styles.bgImg} src={musicDetail.value?.titleImg} />
           <div class={styles.bgContent}></div>
@@ -731,7 +810,7 @@ export default defineComponent({
             class={styles.musicContainer}
             style={{
               marginTop: '16px',
-              height: `calc(100vh - ${heightInfo.value + 16 + 'px'})`
+              height: `calc(100vh - var(--header-height) - var(--bottom-height) - 16px)`
             }}
           >
             <Cell
@@ -849,7 +928,8 @@ export default defineComponent({
                     ? `(${staffData.instrumentName})`
                     : '')}
               </p>
-              {musicDetail.value?.musicSheetType === 'CONCERT' ? (
+              {musicDetail.value?.musicSheetType === 'CONCERT' ||
+              !defaultImgs.value[staff.radio] ? (
                 <>
                   {loading.value && (
                     <>
@@ -866,7 +946,13 @@ export default defineComponent({
                       opacity: loading.value ? 0 : 1
                     }}
                     src={staffData.iframeSrc}
-                    onLoad={musicIframeLoad}
+                    onLoad={() => {
+                      if (!defaultImgs.value[staff.radio]) {
+                        onChangeStaff(staff.radio)
+                      } else {
+                        musicIframeLoad()
+                      }
+                    }}
                   ></iframe>
                 </>
               ) : (
@@ -998,7 +1084,11 @@ export default defineComponent({
           </div>
 
           {musicDetail.value?.id && (
-            <ColSticky position="bottom" background="white">
+            <ColSticky
+              position="bottom"
+              background="white"
+              varName="--bottom-height"
+            >
               <div ref={footers}>
                 {/* 判断是否是免费的,或者已经购买过,是否从专辑过来的 */}
                 {buyState.value.play ||
@@ -1015,11 +1105,11 @@ export default defineComponent({
                         const item: any = partColumns.value.find(
                           (c: any) => c.value === staffData.partIndex
                         )
-                        const index = staffData.tempPartList.findIndex(
-                          (i: any) => i.track === item?.track
-                        )
+                        // const index = staffData.tempPartList.findIndex(
+                        //   (i: any) => i.track === item?.track
+                        // )
                         musicBuy(musicDetail.value, () => {}, {
-                          'part-index': index || 0,
+                          'part-index': item?.xmlValue || 0,
                           sett: staff.radio
                         })
                       }, 500)

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini