优化选中逻辑

2.1
咬轮猫 4 years ago
parent 14fed45e20
commit 2b24e7212f

@ -63,6 +63,7 @@
v-for="(item,index) in svgLists"
:key="item"
:id=item.id
:class="selectSvgInfo.id==item.id?'topo-layer-view-selected':''"
@mousedown="MousedownSvg(item.id,index,item.svgPositionX,item.svgPositionY,$event)"
:title=item.title
:transform="'translate('+(item.svgPositionX)+','+(item.svgPositionY)+')' +'rotate('+item.angle+')' +'scale('+item.size+')'">
@ -203,12 +204,7 @@ export default {
this.selectSvg.pointY = pointY;
this.selectSvgInfo = this.svgLists[index];
//g
let gAnyList = document.querySelectorAll('g');
gAnyList.forEach(g => {
g.classList.remove("topo-layer-view-selected")
});
document.getElementById(id).classList.add("topo-layer-view-selected");
},
MouseupCanvas () {
this.guideX.style.display = 'none';
@ -236,11 +232,6 @@ export default {
}
},
DblClick () {
//g
let gAnyList = document.querySelectorAll('g');
gAnyList.forEach(g => {
g.classList.remove("topo-layer-view-selected")
});
this.selectSvgInfo = '';
},
testD () {
@ -325,15 +316,7 @@ export default {
//translate:`translate(${this.mousePosition.positionX},${this.mousePosition.positionY})`
};
_this.svgLists.push(svgItem);
setTimeout(function () {
//g
let gAnyList = document.querySelectorAll('g');
gAnyList.forEach(g => {
g.classList.remove("topo-layer-view-selected")
});
document.getElementById(svgItem.id).classList.add("topo-layer-view-selected");
_this.selectSvgInfo = svgItem;
}, 100);
}, false);
},
created () {
@ -371,14 +354,6 @@ export default {
copySvgInfo.svgPositionY = selectSvgInfo.svgPositionY + 10;
_this.svgLists.push(copySvgInfo);
_this.selectSvgInfo = copySvgInfo;
setTimeout(function () {
//g
let gAnyList = document.querySelectorAll('g');
gAnyList.forEach(g => {
g.classList.remove("topo-layer-view-selected")
});
document.getElementById(copySvgInfo.id).classList.add("topo-layer-view-selected");
}, 100);
}
//deleted
else if (e1 && e1.keyCode == 46) {

Loading…
Cancel
Save