Explorar el Código

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

yuanliang hace 9 meses
padre
commit
f49e18268e
Se han modificado 1 ficheros con 36 adiciones y 21 borrados
  1. 36 21
      src/views/music-library/music-sheet/modal/music-operationV2.tsx

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

@@ -432,29 +432,44 @@ export default defineComponent({
             audioPlayTypes.push("SING")
           }
 
-          if (forms.isAllSubject) {
-            if (musicSheetType == 'SINGLE' && forms.musicSheetSoundList_all_subject) {
-              audioPlayTypes.push("PLAY")
-              musicSheetSoundList.push({
-                audioFileUrl: forms.musicSheetSoundList_all_subject,
-                musicSheetId: props.data.id,
-                audioPlayType: 'PLAY'
-              })
-            }
-          } else {
-            if (musicSheetType == 'SINGLE' && forms.musicSheetSoundList_YZ.length > 0) {
-              audioPlayTypes.push("PLAY")
-              forms.musicSheetSoundList_YZ.forEach((musicSheetSound: any) => {
-                if (forms.musicalInstrumentIdList.includes(musicSheetSound.musicalInstrumentId)) {
-                  musicSheetSoundList.push({
-                    ...musicSheetSound,
-                    musicSheetId: props.data.id,
-                  })
-                }
-              })
+          if (musicSheetType == 'SINGLE') {
+            if (forms.isAllSubject) {
+              if (forms.musicSheetSoundList_all_subject) {
+                audioPlayTypes.push("PLAY")
+                musicSheetSoundList.push({
+                  audioFileUrl: forms.musicSheetSoundList_all_subject,
+                  musicSheetId: props.data.id,
+                  audioPlayType: 'PLAY'
+                })
+              }
+              if (!state.fSongFile && !state.bSongFile && !forms.musicSheetSoundList_all_subject) {
+                message.warning("请上传音频文件")
+                return
+              }
+            } else {
+              var existYzFile = false;
+              if (forms.musicSheetSoundList_YZ.length > 0) {
+                audioPlayTypes.push("PLAY")
+                forms.musicSheetSoundList_YZ.forEach((musicSheetSound: any) => {
+                  if (forms.musicalInstrumentIdList.includes(musicSheetSound.musicalInstrumentId)) {
+                    if (musicSheetSound.audioFileUrl != null) {
+                      existYzFile = true
+                    }
+                    musicSheetSoundList.push({
+                      ...musicSheetSound,
+                      musicSheetId: props.data.id,
+                    })
+                  }
+                })
+              }
+              if (!state.fSongFile && !state.bSongFile && !existYzFile) {
+                message.warning("请上传音频文件")
+                return
+              }
             }
           }
 
+
             if (musicSheetType == 'CONCERT' && forms.musicSheetSoundList_YY.length > 0) {
               audioPlayTypes.push("PLAY")
               forms.musicSheetSoundList_YY.forEach((musicSheetSound: any) => {
@@ -1889,7 +1904,7 @@ export default defineComponent({
                                 path={`musicSheetSoundList_YZ[${index}].audioFileUrl`}
                                 rule={[
                                   {
-                                    required: true,
+                                    required: false,
                                     message: `请上传乐器演奏文件`
                                   }
                                 ]}