TIANYONG hai 1 ano
pai
achega
a2e01ab375
Modificáronse 5 ficheiros con 92 adicións e 28 borrados
  1. 8 18
      dev-dist/sw.js
  2. 1 1
      public/version.json
  3. 73 1
      src/utils/index.ts
  4. 8 6
      src/views/xiaoku-music/index.tsx
  5. 2 2
      vite.config.ts

+ 8 - 18
dev-dist/sw.js

@@ -22,7 +22,7 @@ if (!self.define) {
   const singleRequire = (uri, parentUri) => {
     uri = new URL(uri + ".js", parentUri).href;
     return registry[uri] || (
-
+      
         new Promise(resolve => {
           if ("document" in self) {
             const script = document.createElement("script");
@@ -35,7 +35,7 @@ if (!self.define) {
             resolve();
           }
         })
-
+      
       .then(() => {
         let promise = registry[uri];
         if (!promise) {
@@ -82,21 +82,11 @@ define(['./workbox-5357ef54'], (function (workbox) { 'use strict';
     "revision": "3ca0b8505b4bec776b69afdba2768812"
   }, {
     "url": "index.html",
-    "revision": "0.k9m6fls6u18"
+    "revision": "0.usf6gnl94f"
   }], {});
   workbox.cleanupOutdatedCaches();
-  workbox.registerRoute(
-    new workbox.NavigationRoute(workbox.createHandlerBoundToURL('index.html'), {
-      allowlist: [/^\/$/]
-    }),
-    workbox.strategies.networkOnly()
-  );
-  workbox.routing.registerRoute(
-    new RegExp('.*.html|css'),
-    workbox.strategies.networkFirst()
-  );
-  workbox.routing.registerRoute(
-    new RegExp('|js'),
-    workbox.strategies.networkOnly()
-  );
-});
+  workbox.registerRoute(new workbox.NavigationRoute(workbox.createHandlerBoundToURL("index.html"), {
+    allowlist: [/^\/$/]
+  }));
+
+}));

+ 1 - 1
public/version.json

@@ -1 +1 @@
-{"version":1712560616043}
+{"version":1712573473265}

+ 73 - 1
src/utils/index.ts

@@ -647,4 +647,76 @@ export const sortMusical = (name: string, index: number) => {
       break;
   }
   return sortId;
-};
+};
+
+// 课堂乐器声轨名称集合
+const trackNames: any = {
+  "Piccolo": "Tenor Recorder",
+  "flute": "Flute",
+  "Flute": "Flute",
+  "Flute 1": "Flute",
+  "Flute 2": "Flute",
+  "Oboe": "Clarinet",
+  "oboe": "Clarinet",
+  "clarinet": "Clarinet",
+  "Clarinet in Bb": "Clarinet",
+  "Clarinet in Bb 1": "Clarinet",
+  "Clarinet in Bb 2": "Clarinet",
+  "Alto Clarinet in Eb": "Clarinet",
+  "Bass Clarinet in Bb": "Clarinet",
+  "Bassoon": "Bassoon",
+  "Alto Saxophone": "Alto Saxophone",
+  "Tenor Saxophone": "Alto Saxophone",
+  "Baritone Saxophone": "Alto Saxophone",
+  "altosaxophone": "Alto Saxophone",
+  "tenorsaxophone": "Alto Saxophone",
+  "saxophone": "Alto Saxophone",
+  "Trumpet in Bb 1": "Trumpet",
+  "Trumpet in Bb 2": "Trumpet",
+  "trumpet": "Trumpet",
+  "Horn in F": "Horn",
+  "Horn in F 1": "Horn",
+  "Horn in F 2": "Horn",
+  "horn": "Horn",
+  "trombone": "Trombone",
+  "Trombone 1": "Trombone",
+  "Trombone 2": "Trombone",
+  "Trombone 3": "Trombone",
+  "Euphonium": "Baritone",
+  "upbasshorn": "Baritone",
+  "Tuba": "Tuba",
+  "tuba": "Tuba",
+  "Chimes": "Chimes",
+  "Bells": "Bells",
+  "Xylophone": "Xylophone",
+  "Snare Drum": "Snare Drum",
+  "Bass Drum": "Bass Drum",
+  "Triangle": "Triangle",
+  "Suspended Cymbal": "Suspended Cymbal",
+  "Crash Cymbals": "Crash Cymbals",
+  "Concert Toms": "Concert Toms",
+  "Timpani": "Timpani",
+  "Drum Set": "Drum Set",
+  "Marimba": "Marimba",
+  "Vibraphone": "Vibraphone",
+  "Tubular Bells": "Tubular Bells",
+  "Mallets": "Mallets",
+  "recorder": "Piccolo",
+  "tenorrecorder": "piccolo",
+  "melodica": "melodica",
+  "hulusiFlute": "hulusiFlute",
+  "panflute": "panflute",
+  "ukulele": "ukulele",
+  "mouthorgan": "mouthorgan",
+  "piano": "piano",
+  "woodwind": "Woodwind",
+  "panpipes": "Panpipes",
+  "ocarina": "Ocarina",
+  "nai": "Nai",
+  "BaroqueRecorder": "Baroque Recorder",
+};
+
+/** 声轨track转换成乐器code */
+export const trackToCode = (track: any) => {
+  return trackNames[track] || track
+}

+ 8 - 6
src/views/xiaoku-music/index.tsx

@@ -53,7 +53,7 @@ import TheEmpty from '/src/components/TheEmpty';
 import { state } from '/src/state';
 import { useResizeObserver } from '@vueuse/core';
 import { vaildMusicScoreUrl } from '/src/utils/urlUtils';
-import { getInstrumentName, sortMusical } from '/src/utils';
+import { getInstrumentName, sortMusical, trackToCode } from '/src/utils';
 
 export default defineComponent({
   name: 'XiaokuMusic',
@@ -456,14 +456,15 @@ export default defineComponent({
       let track = arr.find(
         (item: any) => item.value === data.musicInstrumentIndex
       )?.track;
-      track = track
-        .replace(/[0-9]+/g, '')
-        .replace(/\s/g, '')
-        .toLocaleLowerCase();
+      // track = track
+      //   .replace(/[0-9]+/g, '')
+      //   .replace(/\s/g, '')
+      //   .toLocaleLowerCase();
+      track = trackToCode(track);
       let musicRenderType: 'staff' | 'first' | 'fixed' = 'staff';
       let canTrans = true;
       data.list[data.listActive]?.musicalInstruments.forEach((item: any) => {
-        if (item.code.toLocaleLowerCase() === track) {
+        if (item.code.toLocaleLowerCase() === track.toLocaleLowerCase()) {
           musicRenderType =
             item.defaultScore === 'STAVE'
               ? 'staff'
@@ -811,6 +812,7 @@ export default defineComponent({
                       trigger="hover"
                       v-model:value={data.musicInstrumentIndex}
                       onUpdate:value={async (val: any) => {
+                        await analyzeXml();
                         //
                       }}
                       // key={item.id}

+ 2 - 2
vite.config.ts

@@ -23,8 +23,8 @@ function resolve(dir: string) {
 }
 // https://vitejs.dev/config/
 // https://github.com/vitejs/vite/issues/1930 .env
-const proxyUrl = 'https://dev.kt.colexiu.com/';
-// const proxyUrl = 'https://test.kt.colexiu.com';
+// const proxyUrl = 'https://dev.kt.colexiu.com/';
+const proxyUrl = 'https://test.kt.colexiu.com';
 // const proxyUrl = 'http://192.168.3.14:7989';
 const now = new Date().getTime();
 export default defineConfig(() => {