diff --git a/spider-flow-web/src/main/resources/static/css/editor.css b/spider-flow-web/src/main/resources/static/css/editor.css index dbee86c..d0e1aaa 100644 --- a/spider-flow-web/src/main/resources/static/css/editor.css +++ b/spider-flow-web/src/main/resources/static/css/editor.css @@ -174,3 +174,7 @@ html,body{ .jsontree_value_string,.jsontree_node{ white-space: nowrap; } +#test-window{ + padding:10px; + padding-top:0px; +} \ No newline at end of file diff --git a/spider-flow-web/src/main/resources/static/js/canvas-viewer.js b/spider-flow-web/src/main/resources/static/js/canvas-viewer.js index dbddcdc..66645e4 100644 --- a/spider-flow-web/src/main/resources/static/js/canvas-viewer.js +++ b/spider-flow-web/src/main/resources/static/js/canvas-viewer.js @@ -124,7 +124,7 @@ function CanvasViewer(options){ animate(); } CanvasViewer.prototype.destory = function(){ - cancelAnimationFrame(animateIndex); + cancelAnimationFrame(this.animateIndex); this.texts = null; } CanvasViewer.prototype.append = function(texts){ diff --git a/spider-flow-web/src/main/resources/static/js/editor.js b/spider-flow-web/src/main/resources/static/js/editor.js index 58839d8..d9a4dde 100644 --- a/spider-flow-web/src/main/resources/static/js/editor.js +++ b/spider-flow-web/src/main/resources/static/js/editor.js @@ -562,10 +562,11 @@ function bindToolbarClickAction(editor){ var LogViewer; var tableMap = {}; var socket; + var first = true; layui.layer.open({ id : 'test-window', - content : '
', - area : ["1000px","600px"], + content : '
    ', + area : ["980px","600px"], shade : 0, title : '测试窗口', btn : ['关闭','显示/隐藏输出','显示/隐藏日志'], @@ -574,7 +575,13 @@ function bindToolbarClickAction(editor){ var $log = $(".test-window-container .log-container"); if($output.is(":hidden")){ $output.show(); - $output.find("canvas").css('height', $log.is(":hidden") ? 460 : 320) + $output.find("canvas").each(function(){ + if($log.is(":hidden")){ + this.height = 420; + }else{ + this.height = 300; + } + }) $log.attr('height',100) LogViewer.resize(); for(var tableId in tableMap){ @@ -582,7 +589,7 @@ function bindToolbarClickAction(editor){ } }else{ $output.hide(); - $log.attr('height',460); + $log.attr('height',500); LogViewer.resize(); for(var tableId in tableMap){ tableMap[tableId].instance.resize(); @@ -595,15 +602,19 @@ function bindToolbarClickAction(editor){ var $log = $(".test-window-container .log-container"); if($log.is(":hidden")){ $log.show(); - $log.attr('height',$output.is(":hidden") ? 460 : 100) - $output.find("canvas").attr('height',320); + $log.attr('height',$output.is(":hidden") ? 500 : 100) + $output.find("canvas").each(function(){ + this.height = 300; + }); LogViewer.resize(); for(var tableId in tableMap){ tableMap[tableId].instance.resize(); } }else{ $log.hide(); - $output.find("canvas").attr('height',460); + $output.find("canvas").each(function(){ + this.height = 420; + }); LogViewer.resize(); for(var tableId in tableMap){ tableMap[tableId].instance.resize(); @@ -654,7 +665,16 @@ function bindToolbarClickAction(editor){ tableMap[tableId] = { index : 0 }; - $table = $('').appendTo($(".test-window-container .output-container")); + var $tab = $(".test-window-container .output-container .layui-tab") + if(first){ + $tab.find(".layui-tab-title").append('
  • 输出-'+tableId+'
  • '); + $tab.find(".layui-tab-content").append('
    '); + first = false; + }else{ + $tab.find(".layui-tab-title").append('
  • 输出-'+tableId+'
  • '); + $tab.find(".layui-tab-content").append('
    '); + } + $table = $('').appendTo($(".test-window-container .output-container .layui-tab-item[data-output="+tableId+"]")); $table.attr('id',tableId); tableMap[tableId].instance = new CanvasViewer({ element : document.getElementById(tableId),