|
@@ -80,9 +80,9 @@
|
|
<img src="~@/assets/img/sand_new/copy.png" />
|
|
<img src="~@/assets/img/sand_new/copy.png" />
|
|
<span>复制</span>
|
|
<span>复制</span>
|
|
</div>
|
|
</div>
|
|
- <div class="chartHead-options-button" @click="deleteHandle(viewSandbox,'inchart')">
|
|
|
|
|
|
+ <div class="chartHead-options-button" @click="deleteHandle(viewSandbox,'inchart')" v-permission="permissionBtn.sandboxPermission.sandbox_del">
|
|
<img src="~@/assets/img/sand_new/remove.png" />
|
|
<img src="~@/assets/img/sand_new/remove.png" />
|
|
- <span style="color: red;" v-permission="permissionBtn.sandboxPermission.sandbox_del">删除</span>
|
|
|
|
|
|
+ <span style="color: red;" >删除</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -218,8 +218,10 @@ import { myGraph } from './common/gragh';
|
|
this.graph.zoomToFit()
|
|
this.graph.zoomToFit()
|
|
})
|
|
})
|
|
}else{
|
|
}else{
|
|
- this.graph.fromJSON(newval);
|
|
|
|
- this.graph.zoomToFit()
|
|
|
|
|
|
+ this.$nextTick(()=>{
|
|
|
|
+ this.graph.fromJSON(newval);
|
|
|
|
+ this.graph.zoomToFit()
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
},
|
|
@@ -1076,16 +1078,16 @@ import { myGraph } from './common/gragh';
|
|
},{
|
|
},{
|
|
preserveDimensions:true,//让svg为实际图片大小
|
|
preserveDimensions:true,//让svg为实际图片大小
|
|
beforeSerialize:(svg)=>{
|
|
beforeSerialize:(svg)=>{
|
|
- const zoom = this.graph.zoom();
|
|
|
|
|
|
+ // const zoom = this.graph.zoom();
|
|
const {x,y,width,height} = this.graph.getContentBBox(cells)
|
|
const {x,y,width,height} = this.graph.getContentBBox(cells)
|
|
- let {tx,ty} = this.graph.translate() // 画布偏移量
|
|
|
|
|
|
+ // let {tx,ty} = this.graph.translate() // 画布偏移量
|
|
//给导出的svg增加一点宽高
|
|
//给导出的svg增加一点宽高
|
|
- svg.setAttribute('width',width+60*zoom)
|
|
|
|
- svg.setAttribute('height',height+60*zoom)
|
|
|
|
|
|
+ svg.setAttribute('width',width+60)
|
|
|
|
+ svg.setAttribute('height',height+60)
|
|
//设置viewBox使图像居中
|
|
//设置viewBox使图像居中
|
|
- svg.setAttribute('viewBox',`${x-30*zoom} ${y-30*zoom} ${width+60*zoom} ${height+60*zoom}`)
|
|
|
|
- // 在图表右下方 加上"来源:弘则研究"字样
|
|
|
|
- let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
|
|
|
|
+ svg.setAttribute('viewBox',`${x-30} ${y-30} ${width+60} ${height+60}`)
|
|
|
|
+ // // 在图表右下方 加上"来源:弘则研究"字样
|
|
|
|
+ // let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
// 去掉不该截图的添加图标
|
|
// 去掉不该截图的添加图标
|
|
let leftImg = svg.getElementsByClassName('left-topic-image')
|
|
let leftImg = svg.getElementsByClassName('left-topic-image')
|
|
for (let i = 0; i < leftImg.length; i++) {
|
|
for (let i = 0; i < leftImg.length; i++) {
|
|
@@ -1099,13 +1101,13 @@ import { myGraph } from './common/gragh';
|
|
element.parentElement.removeChild(element)
|
|
element.parentElement.removeChild(element)
|
|
i--
|
|
i--
|
|
}
|
|
}
|
|
- let textNode = document.createElement('text')
|
|
|
|
- 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 = '来源:弘则研究'
|
|
|
|
- gNode.appendChild(textNode)
|
|
|
|
|
|
+ // let textNode = document.createElement('text')
|
|
|
|
+ // 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 = '来源:弘则研究'
|
|
|
|
+ // gNode.appendChild(textNode)
|
|
},
|
|
},
|
|
copyStyles:false,
|
|
copyStyles:false,
|
|
stylesheet: `
|
|
stylesheet: `
|
|
@@ -1182,11 +1184,11 @@ import { myGraph } from './common/gragh';
|
|
const {x,y,width,height} = this.graph.getContentBBox(cells)
|
|
const {x,y,width,height} = this.graph.getContentBBox(cells)
|
|
let {tx,ty} = this.graph.translate()
|
|
let {tx,ty} = this.graph.translate()
|
|
//给导出的svg增加一点宽高
|
|
//给导出的svg增加一点宽高
|
|
- svg.setAttribute('width',width+50)
|
|
|
|
- svg.setAttribute('height',height+50)
|
|
|
|
|
|
+ svg.setAttribute('width',width+60)
|
|
|
|
+ svg.setAttribute('height',height+60)
|
|
//设置viewBox使图像居中
|
|
//设置viewBox使图像居中
|
|
- svg.setAttribute('viewBox',`${x-25} ${y-25} ${width+50} ${height+50}`)
|
|
|
|
- let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
|
|
|
|
+ svg.setAttribute('viewBox',`${x-30} ${y-30} ${width+60} ${height+60}`)
|
|
|
|
+ // let gNode = svg.getElementsByClassName('x6-graph-svg-viewport')[0]
|
|
// 去掉不该截图的添加图标
|
|
// 去掉不该截图的添加图标
|
|
let leftImg = svg.getElementsByClassName('left-topic-image')
|
|
let leftImg = svg.getElementsByClassName('left-topic-image')
|
|
for (let i = 0; i < leftImg.length; i++) {
|
|
for (let i = 0; i < leftImg.length; i++) {
|
|
@@ -1200,13 +1202,13 @@ import { myGraph } from './common/gragh';
|
|
element.parentElement.removeChild(element)
|
|
element.parentElement.removeChild(element)
|
|
i--
|
|
i--
|
|
}
|
|
}
|
|
- let textNode = document.createElement('text')
|
|
|
|
- textNode.setAttribute('x',x-tx+width-90)
|
|
|
|
- textNode.setAttribute('y',y-ty+height+22)
|
|
|
|
- textNode.setAttribute('font-size','16px')
|
|
|
|
- textNode.setAttribute('font-style','italic')
|
|
|
|
- textNode.innerText = '来源:弘则研究'
|
|
|
|
- gNode.appendChild(textNode)
|
|
|
|
|
|
+ // let textNode = document.createElement('text')
|
|
|
|
+ // textNode.setAttribute('x',x-tx+width-90)
|
|
|
|
+ // textNode.setAttribute('y',y-ty+height+22)
|
|
|
|
+ // textNode.setAttribute('font-size','16px')
|
|
|
|
+ // textNode.setAttribute('font-style','italic')
|
|
|
|
+ // textNode.innerText = '来源:弘则研究'
|
|
|
|
+ // gNode.appendChild(textNode)
|
|
},
|
|
},
|
|
copyStyles:false,
|
|
copyStyles:false,
|
|
stylesheet: `
|
|
stylesheet: `
|