Commit 42b60723 authored by wangqinghua's avatar wangqinghua

update

parent 5e7d4921
......@@ -83,7 +83,7 @@
<div #topologyBody id="topology-body" class="topology-context">
<!-- 鼠标悬浮显示节点信息 -->
<div class="node-infobox" style="display: none;">
<span>节点名称:</span>
<span></span>
</div>
<canvas class="topology-context" id="topology-canvas" width="1190" height="520" #topologyCanvas>
您的浏览器不支持HTML5!
......
......@@ -154,17 +154,6 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
ngAfterViewInit() {
const canvasWidth = this.topologyBody.nativeElement.clientWidth;
const canvasHeight = this.topologyBody.nativeElement.clientHeight;
console.log(canvasWidth, canvasHeight);
let myCanvas = this.topologyCanvas.nativeElement;
let context = myCanvas.getContext('2d');
let ratio = this.getPixelRatio(context);
myCanvas.style.width = canvasWidth + 'px';
myCanvas.style.height = canvasHeight + 'px';
myCanvas.width = myCanvas.width * ratio;
myCanvas.height = myCanvas.height * ratio;
// context.scale(ratio, ratio);
editor.loadTopology('', '', 'img/backimg.png', canvasWidth, canvasHeight);
}
......@@ -416,14 +405,13 @@ export class NeTopologyComponent implements OnInit, DoCheck, AfterViewInit, OnDe
if (e1.status == 1) {
e2.alarm = '危险';
e2.description = e1.description;
// e2.fontColor='0,0,0';
e2.alarmColor = '255,153,18';
e2.alarmColor = '220,20,60';
e2.alarmAlpha = 0.9;
}
if (e1.status == 2) {
e2.alarm = '故障';
e2.description = e1.description;
// e2.fontColor='0,0,0';
e2.fontColor='220,20,60';
e2.alarmAlpha = 0.9;
}
}
......
......@@ -554,9 +554,7 @@ TopologyEditor.prototype.init = function (topologyGuid, backImg, topologyJson,ca
Timer.start()
// 进入某个节点
if (event.target != null && event.target instanceof JTopo.Node && event.target.description && editor.stageMode !== 'edit') {
console.log('scene.mouseover.target')
console.log(event.target.description);
$('.node-infobox span').html(event.target.description);
// 记录鼠标触发位置在canvas中的相对位置
var menuY = event.layerY ? event.layerY : event.offsetY
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment