|
|
@ -248,6 +248,7 @@ export default { |
|
|
|
const ratio = ((width - width * 0.08 * 2) / allActualDis); //减去俩侧空白区域 才是画布要计算的比例 |
|
|
|
window.canvasRatio = ratio; |
|
|
|
window.canvasWidth = width; |
|
|
|
window.offsetRatio = 0.0755; |
|
|
|
|
|
|
|
this.list.forEach(item => this.allInstance += item.distance); |
|
|
|
for (let index in this.list) { |
|
|
@ -256,17 +257,17 @@ export default { |
|
|
|
await this.drawTag(info, graph); |
|
|
|
} |
|
|
|
//文字覆盖问题修复 |
|
|
|
graph.getCellById("K79+010").translate(-10, 0) |
|
|
|
graph.getCellById("K83+885").translate(-10, 0); |
|
|
|
graph.getCellById("K86+499").translate(10, 0); |
|
|
|
graph.getCellById("K79+010_底部文字").translate(-10, 0) |
|
|
|
graph.getCellById("K83+885_底部文字").translate(-10, 0); |
|
|
|
graph.getCellById("K86+499_底部文字").translate(10, 0); |
|
|
|
|
|
|
|
graph.getCellById("K114+405").translate(-10, 0); |
|
|
|
graph.getCellById("K117+878").translate(10, 0); |
|
|
|
graph.getCellById("K114+405_底部文字").translate(-10, 0); |
|
|
|
graph.getCellById("K117+878_底部文字").translate(10, 0); |
|
|
|
|
|
|
|
graph.getCellById("K159+156").translate(8, 0); |
|
|
|
graph.getCellById("K159+156_底部文字").translate(8, 0); |
|
|
|
|
|
|
|
graph.getCellById("K155+652").translate(-10, 0); |
|
|
|
graph.getCellById("K190+495").translate(10, 0); |
|
|
|
graph.getCellById("K155+652_底部文字").translate(-10, 0); |
|
|
|
graph.getCellById("K190+495_底部文字").translate(10, 0); |
|
|
|
|
|
|
|
}, |
|
|
|
async drayLine(text, graph, isFoot = false) { |
|
|
@ -333,14 +334,14 @@ export default { |
|
|
|
}); |
|
|
|
imageNode.translate(width * 0.07, 0); |
|
|
|
|
|
|
|
for (var i = 0; i < info.name.length; i++) { |
|
|
|
for (var i = 0; i < info.name.length; i++) { // |
|
|
|
const imageLabelNode = graph.addNode({ label: info.name[i], x: this.translateX, y: i * 15, attrs: { text: { fill: "#ffffff", fontSize: 12 } } }); |
|
|
|
imageLabelNode.translate(width * 0.0755, 50 + y); |
|
|
|
imageLabelNode.translate(width * window.offsetRatio, 50 + y); |
|
|
|
} |
|
|
|
|
|
|
|
// 修改文字位置 |
|
|
|
const buttomLabelNode = graph.addNode({ label: info.code, x: this.translateX, y: 175, attrs: { text: { fill: "#ffffff", fontSize: 10.5 } }, id: info.code }); |
|
|
|
buttomLabelNode.translate(width * 0.0755, 0); |
|
|
|
const buttomLabelNode = graph.addNode({ label: info.code, x: this.translateX, y: 175, attrs: { text: { fill: "#ffffff", fontSize: 10.5 } }, id: info.code + "_底部文字" }); |
|
|
|
buttomLabelNode.translate(width * window.offsetRatio, 0); |
|
|
|
|
|
|
|
}, |
|
|
|
loadImage(url) { |
|
|
|