소스 검색

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

TIANYONG 4 달 전
부모
커밋
1b54891d14
1개의 변경된 파일10개의 추가작업 그리고 2개의 파일을 삭제
  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 ''
 };