|
@@ -534,39 +534,41 @@ export const resetFormate = () => {
|
|
|
};
|
|
|
|
|
|
// 给小节添加背景色
|
|
|
- staves.forEach((stave: any) => {
|
|
|
- const list = [
|
|
|
- Array.from(stave?.querySelectorAll(".vf-StaveSection") || []),
|
|
|
- Array.from(stave?.querySelectorAll(".vf-Volta") || []),
|
|
|
- Array.from(stave?.querySelectorAll(".vf-clef") || []),
|
|
|
- Array.from(stave?.querySelectorAll(".vf-keysignature") || []),
|
|
|
- Array.from(stave?.querySelectorAll(".vf-Repetition") || []),
|
|
|
- Array.from(stave?.getElementsByTagName("text") || []),
|
|
|
- ].flat();
|
|
|
- try {
|
|
|
- if (list.length) {
|
|
|
- list.forEach((_el: any) => {
|
|
|
- stave?.removeChild(_el)
|
|
|
- _el?.style?.setProperty("display", "none");
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (error) {}
|
|
|
- const bbox = stave?.getBBox() || {};
|
|
|
- const rect = `<rect class="vf-custom-bg" x="${bbox.x}" y="${bbox.y}" width="${bbox.width}" height="${bbox.height}" fill="#609FCF" />`
|
|
|
- const rectBottom = `<rect class="vf-custom-bot" x="${bbox.x}" y="${bbox.y+bbox.height}" width="${bbox.width}" height="12" fill="#2B70A5" />`
|
|
|
- const customG = `<g>${rect}${rectBottom}</g>`
|
|
|
- try {
|
|
|
- if (list.length) {
|
|
|
- list.forEach((_el: any) => {
|
|
|
- stave?.appendChild(_el)
|
|
|
- _el?.style?.removeProperty("display");
|
|
|
- });
|
|
|
- }
|
|
|
- } catch (error) {}
|
|
|
- stave.innerHTML = customG + stave.innerHTML;
|
|
|
- });
|
|
|
-
|
|
|
- state.vfmeasures = state.vfmeasures.concat(vfmeasures);
|
|
|
+ if (!state.isCreateImg) {
|
|
|
+ staves.forEach((stave: any) => {
|
|
|
+ const list = [
|
|
|
+ Array.from(stave?.querySelectorAll(".vf-StaveSection") || []),
|
|
|
+ Array.from(stave?.querySelectorAll(".vf-Volta") || []),
|
|
|
+ Array.from(stave?.querySelectorAll(".vf-clef") || []),
|
|
|
+ Array.from(stave?.querySelectorAll(".vf-keysignature") || []),
|
|
|
+ Array.from(stave?.querySelectorAll(".vf-Repetition") || []),
|
|
|
+ Array.from(stave?.getElementsByTagName("text") || []),
|
|
|
+ ].flat();
|
|
|
+ try {
|
|
|
+ if (list.length) {
|
|
|
+ list.forEach((_el: any) => {
|
|
|
+ stave?.removeChild(_el)
|
|
|
+ _el?.style?.setProperty("display", "none");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ const bbox = stave?.getBBox() || {};
|
|
|
+ const rect = `<rect class="vf-custom-bg" x="${bbox.x}" y="${bbox.y}" width="${bbox.width}" height="${bbox.height}" fill="#609FCF" />`
|
|
|
+ const rectBottom = `<rect class="vf-custom-bot" x="${bbox.x}" y="${bbox.y+bbox.height}" width="${bbox.width}" height="12" fill="#2B70A5" />`
|
|
|
+ const customG = `<g>${rect}${rectBottom}</g>`
|
|
|
+ try {
|
|
|
+ if (list.length) {
|
|
|
+ list.forEach((_el: any) => {
|
|
|
+ stave?.appendChild(_el)
|
|
|
+ _el?.style?.removeProperty("display");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ } catch (error) {}
|
|
|
+ stave.innerHTML = customG + stave.innerHTML;
|
|
|
+ });
|
|
|
+ state.vfmeasures = state.vfmeasures.concat(vfmeasures);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
// setTimeout(() => this.resetGlobalText());
|