Просмотр исходного кода

修复smapsso.html可能重复打开文件的问题

unknown 5 лет назад
Родитель
Сommit
b3cccda4de
1 измененных файлов с 32 добавлено и 2 удалено
  1. 32 2
      o2web/source/x_component_query_StatementDesigner/Statement.js

+ 32 - 2
o2web/source/x_component_query_StatementDesigner/Statement.js

@@ -592,12 +592,42 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
         this.runMask.loadNode(this.node);
 
         this.saveSilence(function(){
+
+            debugger;
+
             var json = this.jsonEditor.editor.getValue();
             var o = JSON.parse(json);
-            o2.Actions.get("x_query_assemble_designer").executeStatement(this.json.id, 1, 50 , o, function(json){
+
+            var mode = "data";
+            if( this.data.type === "select" ){
+                if( this.data.format === "script" ){
+                    if( this.data.scriptText && this.data.countScriptText ){
+                        mode = "all"
+                    }else if( this.data.scriptText && !this.data.countScriptText ){
+                        mode = "data"
+                    }else if( !this.data.scriptText && this.data.countScriptText ){
+                        mode = "count"
+                    }else{
+                        this.designer.notice(this.designer.lp.inputStatementData, "error");
+                        return false;
+                    }
+                }else{
+                    if( this.data.data && this.data.countData ){
+                        mode = "all"
+                    }else if( this.data.data && !this.data.countData ){
+                        mode = "data"
+                    }else if( !this.data.data && this.data.countData ){
+                        mode = "count"
+                    }else{
+                        this.designer.notice(this.designer.lp.inputStatementData, "error");
+                        return false;
+                    }
+                }
+            }
+            o2.Actions.get("x_query_assemble_designer").StatementAction.executeV2(this.json.id, mode, 1, 50 , o, function(json){
                 o2.require("o2.widget.JsonParse", function(){
                     this.runResultNode.empty();
-                    var jsonResult = new o2.widget.JsonParse(json.data, this.runResultNode);
+                    var jsonResult = new o2.widget.JsonParse(json, this.runResultNode);
                     jsonResult.load();
                 }.bind(this));
                 this.runMask.hide();