Преглед изворни кода

[web日志]修复日志查看报错问题

st пре 5 година
родитељ
комит
07fd7de9ec
1 измењених фајлова са 6 додато и 3 уклоњено
  1. 6 3
      o2web/source/x_component_LogViewer/Main.js

+ 6 - 3
o2web/source/x_component_LogViewer/Main.js

@@ -44,8 +44,10 @@ MWF.xApplication.LogViewer.Main = new Class({
         this.initLog();
         this.initLog();
         this.loadLog();
         this.loadLog();
     },
     },
-    initLog: function(){
-        this.screenInforAreaNode.empty();
+    initLog: function(appendFlag){
+        if(!appendFlag){
+            this.screenInforAreaNode.empty();
+        }
         this.date = this.dateSelect.options[this.dateSelect.selectedIndex];
         this.date = this.dateSelect.options[this.dateSelect.selectedIndex];
         this.method = "listPromptErrorLog";
         this.method = "listPromptErrorLog";
         this.count = 20;
         this.count = 20;
@@ -155,7 +157,7 @@ MWF.xApplication.LogViewer.Main = new Class({
         this.startBtn.addEvent("click",function () {
         this.startBtn.addEvent("click",function () {
             this.startBtn.hide();
             this.startBtn.hide();
             this.stopBtn.show();
             this.stopBtn.show();
-            this.initLog();
+            this.initLog(true);
             this.loadLog();
             this.loadLog();
         }.bind(this));
         }.bind(this));
     },
     },
@@ -418,6 +420,7 @@ MWF.xApplication.LogViewer.Log = new Class({
     load: function(){
     load: function(){
         this.node = new Element("div", {"styles": this.css.logItemNode}).inject(this.app.screenInforAreaNode);
         this.node = new Element("div", {"styles": this.css.logItemNode}).inject(this.app.screenInforAreaNode);
 
 
+        if(!this.log) return;
         var m = this.log.message.substr(0, this.log.message.indexOf("\n"));
         var m = this.log.message.substr(0, this.log.message.indexOf("\n"));
         var message = m + ((this.log.person) ? " ("+this.log.person+")": "");
         var message = m + ((this.log.person) ? " ("+this.log.person+")": "");
         var html = "<pre><span  class='MWFLogCheckbox' style='cursor: pointer;float: left; height: 20px; width: 30px; background: url(../x_component_LogViewer/$Main/default/check.png) no-repeat center center'></span>" +
         var html = "<pre><span  class='MWFLogCheckbox' style='cursor: pointer;float: left; height: 20px; width: 30px; background: url(../x_component_LogViewer/$Main/default/check.png) no-repeat center center'></span>" +