liushengqiang há 1 ano atrás
pai
commit
fd90de051c
1 ficheiros alterados com 14 adições e 3 exclusões
  1. 14 3
      src/pc/home/index.tsx

+ 14 - 3
src/pc/home/index.tsx

@@ -199,7 +199,12 @@ export default defineComponent({
 			.filter(Boolean);
 		const barTypes = ABC_DATA.bar.map((item) => item.value).filter(Boolean);
 		console.log("🚀 ~ noteTypes:", noteTypes, accidentals, clefs, playTypes, dynamics);
-
+		const setNoteColor = () => {
+			const gs = document.querySelectorAll(`#paper svg g[fill="#0f81ff"]`);
+			Array.from(gs).forEach((g) => {
+				g.setAttribute('fill', 'currentColor')
+			})
+		}
 		/** 点击音符 */
 		const clickListener = (
 			abcElem: AbcElem,
@@ -208,7 +213,8 @@ export default defineComponent({
 			analysis: ClickListenerAnalysis,
 			drag: ClickListenerDrag
 		) => {
-			// console.log("🚀 ~ data.select.state:", data.select.state);
+			setNoteColor();
+			console.log("🚀 ~ data.select.state:", abcData.visualObj);
 			let indexStr: any = abcElem.chord?.find((n) => n.position === "left")?.name || "";
 			indexStr = indexStr.split(".").map((n: string) => Number(n));
 			const active = {
@@ -217,6 +223,11 @@ export default defineComponent({
 				noteIndex: indexStr[1],
 				isFirstChecked: true,
 			};
+			if (abcElem){
+				if (abcElem.startChar && abcElem.endChar){
+					abcData.visualObj.engraver.rangeHighlight(abcElem.startChar, abcElem.endChar);
+				}
+			}
 
 			// 选择范围模式
 			if (data.select.state) {
@@ -2684,7 +2695,7 @@ export default defineComponent({
 						)}
 						{data.saveLoadingText && (
 							<div class={styles.loading}>
-								<NSpin description="保存中..."></NSpin>
+								<NSpin></NSpin>
 							</div>
 						)}
 					</div>