|
@@ -1,4 +1,4 @@
|
|
|
-import { computed, defineComponent, onMounted, reactive, Transition, nextTick } from "vue";
|
|
|
+import { computed, defineComponent, onMounted, reactive, Transition, nextTick, watch } from "vue";
|
|
|
import state, { EnumMusicRenderType, handleSelection, skipNotePlay, IPlatform } from "/src/state";
|
|
|
import styles from "./index.module.less";
|
|
|
import { metronomeData } from "/src/helpers/metronome";
|
|
@@ -176,46 +176,12 @@ export default defineComponent({
|
|
|
const showClass = computed(() => {
|
|
|
return (item: any) => {
|
|
|
if (state.sectionStatus) {
|
|
|
- if (state.section.length === 1) {
|
|
|
- if (item.MeasureNumberXML == state.section[0].MeasureNumberXML) {
|
|
|
- return styles.leftStaveBox;
|
|
|
- }
|
|
|
- }
|
|
|
if (state.section.length === 2) {
|
|
|
- // 实际的结束位置
|
|
|
- const actualEndIndex = state.userChooseEndIndex > state.section[1].MeasureNumberXML ? state.userChooseEndIndex : state.section[1].MeasureNumberXML
|
|
|
// 选段预备拍背景
|
|
|
if (state.sectionFirst && item.MeasureNumberXML === state.sectionFirst.MeasureNumberXML) {
|
|
|
item.staveBox.height = selectData.measureHeight + 'px';
|
|
|
return styles.prepareStaveBox;
|
|
|
}
|
|
|
- if (
|
|
|
- item.MeasureNumberXML >= state.section[0].MeasureNumberXML &&
|
|
|
- item.MeasureNumberXML <= actualEndIndex
|
|
|
- ) {
|
|
|
- if (
|
|
|
- item.MeasureNumberXML == state.section[0].MeasureNumberXML &&
|
|
|
- item.MeasureNumberXML == actualEndIndex
|
|
|
- ) {
|
|
|
- return styles.centerStaveBox;
|
|
|
- }
|
|
|
- if (item.MeasureNumberXML == state.section[0].MeasureNumberXML) {
|
|
|
- return styles.leftStaveBox;
|
|
|
- }
|
|
|
- if (item.MeasureNumberXML == actualEndIndex) {
|
|
|
- if (!item.staveBox?.height) {
|
|
|
- item.staveBox.height = selectData.measureHeight + 'px'
|
|
|
- }
|
|
|
- return styles.rightStaveBox;
|
|
|
- }
|
|
|
- return "";
|
|
|
- }
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (state.activeMeasureIndex == item.MeasureNumberXML && !state.isReport) {
|
|
|
- // console.log('当前的小节',state.activeMeasureIndex,item.MeasureNumberXML)
|
|
|
- item.staveBox.height = selectData.measureHeight + 'px';
|
|
|
- return "";
|
|
|
}
|
|
|
}
|
|
|
};
|
|
@@ -231,9 +197,10 @@ export default defineComponent({
|
|
|
return currItem && {
|
|
|
left: currItem.staveBox.left,
|
|
|
top: currItem.staveBox.top,
|
|
|
- height: selectData.measureHeight + 'px'
|
|
|
+ height: selectData.measureHeight + 'px' // 小节的高度
|
|
|
}
|
|
|
} else {
|
|
|
+ // 实际的结束位置
|
|
|
const actualEndIndex = state.userChooseEndIndex > item.MeasureNumberXML ? state.userChooseEndIndex : item.MeasureNumberXML
|
|
|
const currItem = selectData.staves.find(stave => {
|
|
|
return stave.MeasureNumberXML === actualEndIndex
|
|
@@ -353,8 +320,10 @@ export default defineComponent({
|
|
|
{
|
|
|
sectionPosData.value.map((item,index) =>{
|
|
|
return (
|
|
|
- <div class={styles.selectBox} style={item}>
|
|
|
- <div class={[styles.selectHandle,index>0&&styles.selectHandleRight]}></div>
|
|
|
+ item && <div class={styles.selectBox} style={item}>
|
|
|
+ <div class={[styles.selectHandle,index>0&&styles.selectHandleRight,state.playState==="play"&&styles.playIng]} onClick={()=>{
|
|
|
+ state.section.splice(index,1)
|
|
|
+ }}></div>
|
|
|
</div>
|
|
|
)
|
|
|
})
|