diff --git a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue index d8bd3c60c..3774bec57 100644 --- a/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue +++ b/nezha-fronted/src/components/common/honeycomb/hexagonFigureSvg.vue @@ -452,10 +452,12 @@ }, hexagonSvgScale(center,item1,data,group,e){ window.event? window.event.cancelBubble = true:e.stopPropagation(); + if(this.timer){ + clearTimeout(this.timer); + this.timer=null; + } this.group=group; - setTimeout(()=>{ - this.group.on('dblclick',this.hexagonSvgClearScale); - },300); + this.group.on('dblclick',this.hexagonSvgClearScale); if(!this.pan&&this.isClickRate){ getHexagon(this.hexagonSvgID).hexagonSvg.animate(300).zoom(this.magnifyRate,{x:center[0],y:center[1]}); if(this.infoShow){ @@ -479,7 +481,9 @@ if(this.infoHide){ this.infoHide(getHexagon(this.hexagonSvgID).allHexagonRect,getHexagon(this.hexagonSvgID).allHexagonText) } - this.isShowHover=true; + this.timer=setTimeout(()=>{ + this.isShowHover=true; + },100) window.getSelection().empty();//取消选中文字 } }, @@ -516,9 +520,9 @@ setTimeout(()=>{ // 设置延时 解决移动后的缩放问题 this.pan=false; },100) - if(this.isShowHover&&getHexagon(this.hexagonSvgID).hexagonSvg){ - this.viewBox=getHexagon(this.hexagonSvgID).hexagonSvg.attr('viewBox'); - } + // if(this.isShowHover&&getHexagon(this.hexagonSvgID).hexagonSvg){ // 记录移动位置 对双击事件有一定影响 暂时关闭 后续优化 + // this.viewBox=getHexagon(this.hexagonSvgID).hexagonSvg.attr('viewBox'); + // } }, borderHex(){//外层边框 数组点 let length=this.allHexagon.length; diff --git a/nezha-fronted/src/components/common/overView/messageAsset.vue b/nezha-fronted/src/components/common/overView/messageAsset.vue index 998d86ce8..269a4ecf0 100644 --- a/nezha-fronted/src/components/common/overView/messageAsset.vue +++ b/nezha-fronted/src/components/common/overView/messageAsset.vue @@ -112,13 +112,13 @@ if(str.length>=10){ str=str.slice(0,6)+"..." } - let text0=group.text(str).attr({x:0,y:0}).font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600}); + let text0=group.text(str).attr({x:0,y:0,style:'cursor:text'}).font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600,cursor:'text'}); textPaddingWidth=(that.hexagonEdge+20)-(text0.bbox().width); textPaddingHeight=(that.hexagonEdge/3)-(text0.bbox().height); text0.attr({ x: data.center[0]-that.hexagonEdge/2-10 +textPaddingWidth/2, y: data.center[1]-that.hexagonEdge + textPaddingHeight/2-4, - }).hide() + }).hide(); allHexagonRect.push(rect0); allHexagonText.push(text0); text0.on('mousedown',textMouseDown); @@ -135,13 +135,13 @@ if(str.length>=10){ str=str.slice(0,6)+"..." } - let text1=group.text(str).attr({x:0,y:0}).font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600}); + let text1=group.text(str).attr({x:0,y:0,style:'cursor:default'}).font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600,cursor:'default'}); textPaddingWidth=(that.hexagonEdge+20)-(text1.bbox().width); textPaddingHeight=(that.hexagonEdge/3)-(text1.bbox().height); text1.attr({ x: data.center[0]-that.hexagonEdge/2-10 +textPaddingWidth/2, y: data.center[1]-that.hexagonEdge/2-7.5 +textPaddingHeight/2-4, - }).hide() + }).hide(); @@ -159,13 +159,13 @@ if(str.length>=10){ str=str.slice(0,6)+"..." } - let text2=group.text(str).attr({x:0,y:0}).font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600}); + let text2=group.text(str).attr({x:0,y:0,style:'cursor:default'}).font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600,cursor:'default'}); textPaddingWidth=(that.hexagonEdge+20)-(text2.bbox().width); textPaddingHeight=(that.hexagonEdge/3)-(text2.bbox().height); text2.attr({ x: data.center[0]-that.hexagonEdge/2-10 +textPaddingWidth/2, y: data.center[1]-that.hexagonEdge/2 + that.hexagonEdge/3 + 0.5+textPaddingHeight/2-4, - }).hide() + }).hide(); allHexagonRect.push(rect2); allHexagonText.push(text2); @@ -181,16 +181,13 @@ if(str.length>=10){ str=str.slice(0,6)+"..." } - let text3=group.text(str).attr({ - x: data.center[0]-5, - y: data.center[1]-that.hexagonEdge/2+ that.hexagonEdge/3*2 + 10-7.5+3}) - .font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600}); + let text3=group.text(str).attr({x:0,y:0,style:'cursor:default'}).font({size:fontSize}).fill({opacity:0,color:'#fff',weight:600,cursor:'default'}); textPaddingWidth=(that.hexagonEdge+20)-(text3.bbox().width); textPaddingHeight=(that.hexagonEdge/3)-(text3.bbox().height); text3.attr({ x: data.center[0]-that.hexagonEdge/2-10 +textPaddingWidth/2, y: data.center[1]-that.hexagonEdge/2+ that.hexagonEdge/3*2 +5.5+textPaddingHeight/2-4, - }).hide() + }).hide(); allHexagonRect.push(rect3); allHexagonText.push(text3); @@ -211,7 +208,7 @@ item.fill({ color: `rgba(${rgbColor},0)`}) }); allHexagonText.forEach(item=>{ - item.fill({ opacity:0}).hide() + item.fill({ opacity:0}).hide(); }); }, endLoading(){