|
@@ -901,6 +901,7 @@ import { myGraph } from './common/gragh';
|
|
|
resolve(resultNode)
|
|
|
return
|
|
|
}
|
|
|
+ this.zTreeObj.removeChildNodes(parentNode)
|
|
|
sandInterface.getSandboxClassify({SandboxClassifyId:parentNode.SandboxClassifyId,IsShowMe:this.searchParams.IsShowMe}).then(res=>{
|
|
|
if (res.Ret === 200) {
|
|
|
let nodesData=res.Data.AllNodes || []
|
|
@@ -1075,13 +1076,14 @@ import { myGraph } from './common/gragh';
|
|
|
},{
|
|
|
preserveDimensions:true,//让svg为实际图片大小
|
|
|
beforeSerialize:(svg)=>{
|
|
|
+ const zoom = this.graph.zoom();
|
|
|
const {x,y,width,height} = this.graph.getContentBBox(cells)
|
|
|
let {tx,ty} = this.graph.translate() // 画布偏移量
|
|
|
//给导出的svg增加一点宽高
|
|
|
- svg.setAttribute('width',width+50)
|
|
|
- svg.setAttribute('height',height+50)
|
|
|
+ svg.setAttribute('width',width+60*zoom)
|
|
|
+ svg.setAttribute('height',height+60*zoom)
|
|
|
//设置viewBox使图像居中
|
|
|
- svg.setAttribute('viewBox',`${x-25} ${y-25} ${width+50} ${height+50}`)
|
|
|
+ svg.setAttribute('viewBox',`${x-30*zoom} ${y-30*zoom} ${width+60*zoom} ${height+60*zoom}`)
|
|
|
// 在图表右下方 加上"来源:弘则研究"字样
|
|
|
let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
|
// 去掉不该截图的添加图标
|
|
@@ -1098,8 +1100,8 @@ import { myGraph } from './common/gragh';
|
|
|
i--
|
|
|
}
|
|
|
let textNode = document.createElement('text')
|
|
|
- textNode.setAttribute('x',x-tx+width-90)
|
|
|
- textNode.setAttribute('y',y-ty+height+22)
|
|
|
+ textNode.setAttribute('x',(x-tx+width)/zoom-85)
|
|
|
+ textNode.setAttribute('y',(y-ty+height)/zoom+27)
|
|
|
textNode.setAttribute('font-size','16px')
|
|
|
textNode.setAttribute('font-style','italic')
|
|
|
textNode.innerText = '来源:弘则研究'
|