Explorar o código

debugInfo调整

MaiXinRong %!s(int64=5) %!d(string=hai) anos
pai
achega
43d2f87f60
Modificáronse 2 ficheiros con 16 adicións e 4 borrados
  1. 7 3
      app/extend/helper.js
  2. 9 1
      app/public/report/js/rpt_main.js

+ 7 - 3
app/extend/helper.js

@@ -911,10 +911,14 @@ module.exports = {
      * @param {String}key
      * @param {*}data
      */
-    addDebugInfo(key, data) {
+    addDebugInfo(key, ...data) {
         if (!this.ctx.debugInfo) {
-            this.ctx.debugInfo = {};
+            this.ctx.debugInfo = { key: {}, other: [] };
+        }
+        if (key) {
+             this.ctx.debugInfo.key[key] = data;
+        } else {
+            this.ctx.debugInfo.other.push(data);
         }
-        this.ctx.debugInfo[key] = data;
     }
 };

+ 9 - 1
app/public/report/js/rpt_main.js

@@ -329,7 +329,15 @@ let zTreeOprObj = {
                     JpcCanvasOutput.drawPageBorder(me.currentRptPageRst, canvas, getScreenDPI());
                 }
                 if (is_debug) {
-                    console.log(result.debugInfo);
+                    console.log('含有key的debug信息:');
+                    for (const k in result.debugInfo.key) {
+                        console.log(k + ':', ...result.debugInfo.key[k]);
+                    }
+                    //console.log(result.debugInfo.key);
+                    console.log('其他debug信息:');
+                    for (const di of result.debugInfo.other) {
+                        console.log(...di);
+                    }
                 }
             }, function(err){
                 // hintBox.unWaitBox();