Browse Source

查询中增加视图功能

unknown 5 years ago
parent
commit
58ed3255ef

+ 1 - 1
o2web/source/x_component_process_FormDesigner/Module/StatementSelector/template.json

@@ -1,7 +1,7 @@
 {
 	"id": "",
 	"name": "",
-	"type": "statementSelector",
+	"type": "StatementSelector",
 	"description": "",
     "titleStyles": {},
     "itemStyles": {},

+ 3 - 2
o2web/source/x_component_query_Query/Main.js

@@ -252,11 +252,12 @@ MWF.xApplication.query.Query.StatementItem = new Class({
     loadView: function(){
         MWF.xDesktop.requireApp("query.Query", "Statement",function(){
             this.viewContent.empty();
-            this.viewer = new MWF.QStatement(this.app, this.viewContent, {
+            debugger;
+            this.viewer = new MWF.QStatement( this.viewContent, {
                 "application": this.view.query,
                 "statementName": this.view.name,
                 "statementId" : this.view.id
-            });
+            },{}, this.app);
         }.bind(this));
     }
 });

+ 21 - 5
o2web/source/x_component_query_Query/Statement.js

@@ -155,7 +155,15 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
             if( d.comparison === "like" || d.comparison === "notLike" ){
                 this.parameter[ parameterName ] = "%"+d.value+"%";
             }else{
-                this.parameter[ parameterName ] = d.value;
+                var value = d.value;
+                if( d.formatType === "dateTimeValue" || d.formatType === "datetimeValue"){
+                    value = "{ts '"+value+"'}"
+                }else if( d.formatType === "dateValue" ){
+                    value = "{d '"+value+"'}"
+                }else if( d.formatType === "timeValue" ){
+                    value = "{t '"+value+"'}"
+                }
+                this.parameter[ parameterName ] = value;
             }
             d.value = parameterName;
 
@@ -163,6 +171,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
         }.bind(this))
     },
     loadParameter : function(){
+        this.parameter = {};
         ( this.viewJson.filterList || [] ).each( function (f) {
             var value = f.value;
             debugger;
@@ -177,17 +186,17 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
                     case "@identityList":
                         value =  user.identityList.map( function (d) {
                             return d.distinguishedName;
-                        })
+                        });
                         break;
                     case "@unitList":
                         o2.Actions.load("x_organization_assemble_express").UnitAction.listWithPerson({ "personList" : [user.distinguishedName] }, function (json) {
                             value = json.unitList;
-                        }, null, false)
+                        }, null, false);
                         break;
                     case "@unitAllList":
                         o2.Actions.load("x_organization_assemble_express").UnitAction.listWithIdentitySupNested({ "personList" : [user.distinguishedName] }, function (json) {
                             value = json.unitList;
-                        }, null, false)
+                        }, null, false);
                         break;
                     case "@year":
                         value = (new Date().getFullYear()).toString();
@@ -216,6 +225,13 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
                     default:
                 }
             }
+            if( f.formatType === "dateTimeValue" || f.formatType === "datetimeValue"){
+                value = "{ts '"+value+"'}"
+            }else if( f.formatType === "dateValue" ){
+                value = "{d '"+value+"'}"
+            }else if( f.formatType === "timeValue" ){
+                value = "{t '"+value+"'}"
+            }
             this.parameter[ f.parameter ] = value;
         }.bind(this))
     },
@@ -241,7 +257,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({
         //this.createLoadding();
 
         this.loadViewRes = o2.Actions.load("x_query_assemble_surface").StatementAction.executeV2(
-            this.json.statementId || this.json.statementName,
+            this.options.statementId || this.options.statementName || this.json.statementId || this.json.statementName,
             type || "data", p, this.json.pageSize, d, function(json){
 
                 if( type === "all" || type === "count" ){

+ 1 - 0
o2web/source/x_component_query_StatementDesigner/$Statement/statementDesigner.html

@@ -39,6 +39,7 @@
             <div style="margin-left: 30px;" class="o2_statement_statementDesignerTitle">{{$.lp.statementTable}}: </div>
             <div class="o2_statement_statementDesignerOfficialTable">
                 <select>
+                    <option value=""></option>
                     <option value="com.x.processplatform.core.entity.content.Task" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Task'}} selected {{end if}}>待办(Task)</option>
                     <option value="com.x.processplatform.core.entity.content.TaskCompleted" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.TaskCompleted'}} selected {{end if}}>已办(TaskCompleted)</option>
                     <option value="com.x.processplatform.core.entity.content.Read" {{if $.data.entityClassName =='com.x.processplatform.core.entity.content.Read'}} selected {{end if}}>待阅(Read)</option>

+ 8 - 8
o2web/source/x_component_query_StatementDesigner/$Statement/view.html

@@ -111,12 +111,12 @@
                         <td class="editTableTitle">标题:</td>
                         <td class="editTableValue"><input type="text" class="editTableInput titleInput_vf"/></td>
                     </tr>
-                    <tr id="text{$.id}parameterInputSelectTr" style="display: none">
-                        <td class="editTableTitle">选择参数:</td>
-                        <td class="editTableValue">
-                            <select class="parameterInputSelect_vf"></select>
-                        </td>
-                    </tr>
+<!--                    <tr id="text{$.id}parameterInputSelectTr" style="display: none">-->
+<!--                        <td class="editTableTitle">选择参数:</td>-->
+<!--                        <td class="editTableValue">-->
+<!--                            <select class="parameterInputSelect_vf"></select>-->
+<!--                        </td>-->
+<!--                    </tr>-->
                     <tr id="text{$.id}parameterInputTr" style="display: none">
                         <td class="editTableTitle">参数:</td>
                         <td class="editTableValue">
@@ -174,7 +174,7 @@
                                 debugger;
                                 $('text{$.id}viewFilterRestrict').setStyle('display', 'block');
                                 $('text{$.id}parameterInputTr').setStyle('display', 'table-row');
-                                $('text{$.id}parameterInputSelectTr').setStyle('display', 'table-row');
+                                // $('text{$.id}parameterInputSelectTr').setStyle('display', 'table-row');
                                 $('text{$.id}viewCustomFilterRestrict').setStyle('display', 'none');
                                 $('text{$.id}pathInputTr').setStyle('display', 'none');
                                 $('text{$.id}pathInputSelectTr').setStyle('display', 'none');
@@ -182,7 +182,7 @@
                             <input type="radio" class="customFilterInput_vf" value="custom" name="text{$.id}viewFilterType" onclick="if (this.checked){
                                 $('text{$.id}viewFilterRestrict').setStyle('display', 'none');
                                 $('text{$.id}parameterInputTr').setStyle('display', 'none');
-                                $('text{$.id}parameterInputSelectTr').setStyle('display', 'none');
+                                // $('text{$.id}parameterInputSelectTr').setStyle('display', 'none');
                                 $('text{$.id}viewCustomFilterRestrict').setStyle('display', 'block');
                                 $('text{$.id}pathInputTr').setStyle('display', 'table-row');
                                 $('text{$.id}pathInputSelectTr').setStyle('display', 'table-row');

+ 3 - 1
o2web/source/x_component_query_StatementDesigner/Statement.js

@@ -576,7 +576,9 @@ MWF.xApplication.query.StatementDesigner.Statement = new Class({
             debugger;
             var entityClassName = e.target.options[e.target.selectedIndex].value;
             this.json.entityClassName = entityClassName;
-            this.changeEditorEntityClassName( entityClassName.split(".").getLast() );
+            if( entityClassName ){
+                this.changeEditorEntityClassName( entityClassName.split(".").getLast() );
+            }
 
 
             //     var className = e.target.options[e.target.selectedIndex].value;

+ 5 - 3
o2web/source/x_component_query_StatementDesigner/widget/ViewFilter.js

@@ -126,7 +126,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
         this.pathInput = this.inputAreaNode.getElement(".pathInput_vf");
         this.pathInputSelect = this.inputAreaNode.getElement(".pathInputSelect_vf");
         this.parameterInput = this.inputAreaNode.getElement(".parameterInput_vf");
-        this.parameterInputSelect = this.inputAreaNode.getElement(".parameterInputSelect_vf");
+        // this.parameterInputSelect = this.inputAreaNode.getElement(".parameterInputSelect_vf");
         this.datatypeInput = this.inputAreaNode.getElement(".datatypeInput_vf");
 
         this.restrictFilterInput = this.inputAreaNode.getElement(".restrictFilterInput_vf");
@@ -275,6 +275,8 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
                     this.switchInputDisplay();
                     if (this.datatypeInput.onchange)this.datatypeInput.onchange();
                 }
+            }else if( type === "official" ){
+
             }
         }.bind(this))
         this.setPathInputSelectOptions()
@@ -355,7 +357,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
                 }
             }.bind(this))
         }else if( d.entityCategory ==='official' ){
-
+            this.pathInputSelect.empty();
         }
     },
     switchInputDisplay: function () {
@@ -713,7 +715,7 @@ MWF.xApplication.query.StatementDesigner.widget.ViewFilter = new Class({
                 break;
             }
         }
-        if(flag)this.pathInputSelect.options[0].set("selected", true);
+        if(flag && this.pathInputSelect.options.length)this.pathInputSelect.options[0].set("selected", true);
 
         switch (data.formatType) {
             case "textValue":