|
@@ -89,6 +89,7 @@ function initSvgId() {
|
|
|
});
|
|
|
let textIndex = 1;
|
|
|
[...vftext].forEach((ele) => {
|
|
|
+ // console.log(ele.textContent,textIndex)
|
|
|
setEleId(ele, "text" + textIndex);
|
|
|
textIndex++;
|
|
|
});
|
|
@@ -121,10 +122,10 @@ function setEleId(ele: HTMLElement, eleId: string) {
|
|
|
if (!id) {
|
|
|
ele.setAttribute("id", eleId);
|
|
|
}
|
|
|
- createModelBox(ele as any);
|
|
|
+ createModelBox(ele as any, eleId as any);
|
|
|
}
|
|
|
|
|
|
-function createModelBox(ele: SVGAElement) {
|
|
|
+function createModelBox(ele: SVGAElement, eleId?: any) {
|
|
|
const musicContainer = document.getElementById("musicAndSelection")?.getBoundingClientRect() || { x: 0, y: 0 };
|
|
|
const parentLeft = musicContainer.x || 0;
|
|
|
const parentTop = musicContainer.y || 0;
|
|
@@ -137,7 +138,7 @@ function createModelBox(ele: SVGAElement) {
|
|
|
};
|
|
|
const type = ele.getAttribute("class");
|
|
|
moveData.modelList.push({
|
|
|
- id: ele.getAttribute("id"),
|
|
|
+ id: eleId || ele.getAttribute("id"),
|
|
|
bbox,
|
|
|
type,
|
|
|
isMove: false,
|
|
@@ -173,6 +174,7 @@ const switchMoveState = () => {
|
|
|
// 如果编辑过,没有保存,点击取消状态,需要提醒用户是否取消
|
|
|
if (moveData.open && undoData.undoList.length) {
|
|
|
showConfirmDialog({
|
|
|
+ className: "noSaveModal",
|
|
|
title: "温馨提示",
|
|
|
message: "您有新的修改还未保存,取消后本次编辑的内容将不会保存",
|
|
|
}).then(() => {
|
|
@@ -541,7 +543,7 @@ export const renderForMoveData = () => {
|
|
|
// index = targetIndex + 1
|
|
|
// item.id = `text${index}`
|
|
|
index = targetIndex
|
|
|
- item.id = `text${targetIndex+1}`
|
|
|
+ item.id = `text${targetIndex}`
|
|
|
}
|
|
|
// console.log(66666666,index)
|
|
|
if (index > -1) {
|