Selaa lähdekoodia

feat: 声轨切换根据后台设置来

TIANYONG 1 vuosi sitten
vanhempi
commit
387a168a67

+ 1 - 0
src/helpers/formateMusic.ts

@@ -372,6 +372,7 @@ export const onlyVisible = (xml: string, partIndex: number): string => {
 	}
 	}
 	const visiblePartInfo = partList[partIndex];
 	const visiblePartInfo = partList[partIndex];
 	// console.log(visiblePartInfo, partIndex)
 	// console.log(visiblePartInfo, partIndex)
+	// 根据后台已选择的分轨筛选出能切换的声轨
 	state.partListNames = partListNames;
 	state.partListNames = partListNames;
 	if (visiblePartInfo) {
 	if (visiblePartInfo) {
 		const id = visiblePartInfo.getAttribute("id");
 		const id = visiblePartInfo.getAttribute("id");

+ 2 - 2
src/state.ts

@@ -275,7 +275,7 @@ const state = reactive({
   /** 重播小节集合信息 */
   /** 重播小节集合信息 */
   repeatInfo: [],  
   repeatInfo: [],  
   /** 多分轨的曲子,可支持筛选的分轨 */
   /** 多分轨的曲子,可支持筛选的分轨 */
-  canSelectTracks: "",
+  canSelectTracks: [] as any,
   /** 声部codeId,用于匹配乐器指法、声部转调、特殊声部处理等 */
   /** 声部codeId,用于匹配乐器指法、声部转调、特殊声部处理等 */
   subjectCodeId: 0 as number,
   subjectCodeId: 0 as number,
   /** 合奏曲目是否合并展示 */
   /** 合奏曲目是否合并展示 */
@@ -801,7 +801,7 @@ const setState = (data: any, index: number) => {
   state.track = track ? track.replace(/ /g, "").toLocaleLowerCase() : "";
   state.track = track ? track.replace(/ /g, "").toLocaleLowerCase() : "";
   state.enableNotation = data.isConvertibleScore === null ? true : data.isConvertibleScore;
   state.enableNotation = data.isConvertibleScore === null ? true : data.isConvertibleScore;
   state.isConcert = data.musicSheetType === "CONCERT" ? true : false;
   state.isConcert = data.musicSheetType === "CONCERT" ? true : false;
-  state.canSelectTracks = data.multiTracksSelection;
+  state.canSelectTracks = data.multiTracksSelection?.split(',');
   // 开启预备小节
   // 开启预备小节
   state.isOpenPrepare = true;
   state.isOpenPrepare = true;
   state.extStyleConfigJson = data.extStyleConfigJson || {}
   state.extStyleConfigJson = data.extStyleConfigJson || {}

+ 1 - 1
src/view/plugins/toggleMusicSheet/choosePartName/index.tsx

@@ -21,7 +21,7 @@ export default defineComponent({
     const columns = computed(() => {
     const columns = computed(() => {
       return partListNames.value
       return partListNames.value
     })
     })
-    // console.log(partListNames.value, partIndex.value, selectIndex.value, columns.value, 999999)
+    console.log(partListNames.value, partIndex.value, selectIndex.value, columns.value, 999999)
     /**
     /**
      * 默认选中的
      * 默认选中的
      * picker组件,3.x的版本可以使用defaultIndex,4.x的版本只能使用v-model传递
      * picker组件,3.x的版本可以使用defaultIndex,4.x的版本只能使用v-model传递

+ 4 - 1
src/view/plugins/toggleMusicSheet/index.tsx

@@ -23,12 +23,15 @@ export default defineComponent({
       let partList = state.partListNames || []
       let partList = state.partListNames || []
       partList = partList.filter((item: any) => !item?.toLocaleUpperCase()?.includes('COMMON'))
       partList = partList.filter((item: any) => !item?.toLocaleUpperCase()?.includes('COMMON'))
       return partList.map((item: any, index: number) => {
       return partList.map((item: any, index: number) => {
+        // 该声轨能否被选
+        const canselect = state.canSelectTracks.includes(item) ? true : false
         const instrumentName = getInstrumentName(item)
         const instrumentName = getInstrumentName(item)
         return {
         return {
           text: item + (instrumentName ? `(${instrumentName})` : ''),
           text: item + (instrumentName ? `(${instrumentName})` : ''),
           value: index,
           value: index,
+          canselect
         }
         }
-      }).filter(Boolean)
+      }).filter((item: any) => item.canselect)
     })
     })
 
 
     const switchMusic = (index: number) => {
     const switchMusic = (index: number) => {