diff --git a/o2web/source/x_component_query_Query/Statement.js b/o2web/source/x_component_query_Query/Statement.js index 0fad5f81b22e2d5e2475a292f5c3bbb451ded80a..65b2268de2eb2dbecb58803be68da7b7d0f6a8f2 100644 --- a/o2web/source/x_component_query_Query/Statement.js +++ b/o2web/source/x_component_query_Query/Statement.js @@ -21,7 +21,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ this.app = app; this.container = $(container); - this.json = json; + this.json = json || {}; this.parentMacro = parentMacro; @@ -36,6 +36,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ this.selectedItems = []; this.hideColumns = []; this.openColumns = []; + this.parameter = {}; this.gridJson = null; @@ -87,68 +88,116 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ this.paging.reload(); } }, - _initPage: function(){ - this.count = this.bundleItems.length; - - var i = this.count/this.json.pageSize; - this.pages = (i.toInt() -1 ){ + debugger; + var user = layout.user; + switch ( f.value ) { + case "@person": + value = user.distinguishedName; + break; + 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) + break; + case "@unitAllList": + o2.Actions.load("x_organization_assemble_express").UnitAction.listWithIdentitySupNested({ "personList" : [user.distinguishedName] }, function (json) { + value = json.unitList; + }, null, false) + break; + case "@year": + value = (new Date().getFullYear()).toString(); + break; + case "@season": + break; + case "@month": + value = new Date().format("%Y-%m"); + break; + case "@time": + value = new Date().format("db"); + break; + case "@date": + value = new Date().format("%Y-%m-%"); + break; + default: + } + } + this.parameter[ f.parameter ] = value; + }.bind(this)) }, loadCurrentPageData: function( callback, async, type ){ //是否需要在翻页的时候清空之前的items ? + debugger; + if( this.pageloading )return; this.pageloading = true; @@ -157,9 +206,7 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ var p = this.currentPage; var d = { "filterList" : [], - "parameter" : { - - } + "parameter" : this.getParameter() }; while (this.viewTable.rows.length>1){ @@ -171,34 +218,44 @@ MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ this.json.statementId || this.json.statementName, type || "data", p, this.json.pageSize, d, function(json){ - this.gridJson = json.data; + if( type === "all" || type === "count" ){ + if( typeOf(json.count) === "number" ){ + this.count = json.count; + var i = this.count/this.json.pageSize; + this.pages = (i.toInt()