Commit 5f3570b5 authored by wangqinghua's avatar wangqinghua

告警闪烁

parent e45d61e3
...@@ -85,8 +85,22 @@ TopologyPanel.prototype.loadTopologyByJson = function (topologyJson, backImg) { ...@@ -85,8 +85,22 @@ TopologyPanel.prototype.loadTopologyByJson = function (topologyJson, backImg) {
try { try {
JTopo.replaceStageWithJson(topologyJson) JTopo.replaceStageWithJson(topologyJson)
if (editor.stage && editor.scene && editor.scene.childs && editor.scene.childs.length > 0) { if (editor.stage && editor.scene && editor.scene.childs && editor.scene.childs.length > 0) {
editor.stage.centerAndZoom() editor.stage.centerAndZoom();
console.log(editor.utils.getAllNodes()[0]); var alarmList = editor.utils.getAllNodes();
for(var i = 0;i < alarmList.length;i++){
(function (i) {
setInterval(function(){
if(alarmList[i].alarm == '危险'){
alarmList[i].alarm = '';
}else if(alarmList[i].alarm == ''){
alarmList[i].alarm = '危险'
}
}, 600);
})(i);
}
console.log(editor.utils.getAllNodes());
} }
} catch (e) { } catch (e) {
console.error(e) console.error(e)
......
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