Browse Source

feat: 声轨名称匹配规则修改

TIANYONG 4 months ago
parent
commit
1b54891d14
1 changed files with 10 additions and 2 deletions
  1. 10 2
      src/constant/instruments.ts

+ 10 - 2
src/constant/instruments.ts

@@ -438,18 +438,26 @@ export let instruments: any = {}
 export const getInstrumentName = (name = '') => {
   name = name.toLocaleLowerCase().replace(/ /g, '')
   if (!name) return ''
+  // 全匹配声轨名称
   for(let key in instruments){
     const _key = key.toLocaleLowerCase().replace(/ /g, '')
-    if (_key.includes(name)){
+    if (_key === name){
       return instruments[key]
     }
   }
+  // 用返回的code模糊匹配传入的xml声轨名称name
   for(let key in instruments){
     const _key = key.toLocaleLowerCase().replace(/ /g, '')
-    if (name.includes(_key)){
+    if (_key.includes(name)){
       return instruments[key]
     }
   }
+//   for(let key in instruments){
+//     const _key = key.toLocaleLowerCase().replace(/ /g, '')
+//     if (name.includes(_key)){
+//       return instruments[key]
+//     }
+//   }
   return ''
 };