Jelajahi Sumber

Merge branch 'feature/0429-musicV2' into test-online

lex-xin 11 bulan lalu
induk
melakukan
584be80c84

+ 6 - 6
src/views/music-library/music-sheet/modal/music-operationV2.tsx

@@ -277,7 +277,7 @@ export const getXmlInfo = (xml: string): FormatXMLInfo => {
   const measures = xmlParse.getElementsByTagName('measure')
 
   for (const item of Array.from(xmlParse.getElementsByTagName('part-name'))) {
-    if (item.textContent) {
+    if (item.textContent?.trim()) {
       data.partNames.push(item.textContent)
     }
   }
@@ -975,7 +975,7 @@ export default defineComponent({
           }
         } else {
           // 优先解析声轨,没有就取id值
-          if (part) {
+          if (part && part.textContent?.trim()) {
             track = part.textContent || ''
           } else {
             let id = item.getAttribute('id')
@@ -1139,13 +1139,13 @@ export default defineComponent({
         state.ownerName = app[0].appName
       }
       if (forms.sourceType == 'ORG') {
-        state.ownerName += '-' + forms.musicSheetExtend.organizationRole
+        state.ownerName = state.ownerName ? state.ownerName + '-' + forms.musicSheetExtend.organizationRole : forms.musicSheetExtend.organizationRole
       } else if (forms.sourceType == 'PERSON') {
-        state.ownerName +=
+        state.ownerName = state.ownerName ? state.ownerName +
           '-' +
-          getMapValueByKey(forms.musicSheetExtend.clientType, new Map(Object.entries(clientType)))
+          getMapValueByKey(forms.musicSheetExtend.clientType, new Map(Object.entries(clientType))) : getMapValueByKey(forms.musicSheetExtend.clientType, new Map(Object.entries(clientType)))
         if (forms.musicSheetExtend.userName) {
-          state.ownerName += '-' + forms.musicSheetExtend.userName
+          state.ownerName = state.ownerName ? state.ownerName + '-' + forms.musicSheetExtend.userName : forms.musicSheetExtend.userName
         }
         if (forms.musicSheetExtend.phone) {
           state.ownerName += '(' + forms.musicSheetExtend.phone + ')'