From e547dcb35e3b6000dd7386071435212bcb932143 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 29 Oct 2020 15:52:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E8=A7=86?= =?UTF-8?q?=E5=9B=BE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../x_component_query_Query/Statement.js | 205 +++++++++++------- 1 file changed, 131 insertions(+), 74 deletions(-) diff --git a/o2web/source/x_component_query_Query/Statement.js b/o2web/source/x_component_query_Query/Statement.js index 0fad5f81b2..65b2268de2 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()