浏览代码

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 ''
 };