MWF.xApplication.query = MWF.xApplication.query || {}; MWF.xApplication.query.Query = MWF.xApplication.query.Query || {}; MWF.xDesktop.requireApp("query.Query", "Viewer", null, false); MWF.xApplication.query.Query.Statement = MWF.QStatement = new Class({ Extends: MWF.QViewer, options: { }, initialize: function(container, json, options, app, parentMacro){ //本类有三种事件, //一种是通过 options 传进来的事件,包括 loadView、openDocument、select //一种是用户配置的 事件, 在this.options.moduleEvents 中定义的作为类事件 //还有一种也是用户配置的事件,不在this.options.moduleEvents 中定义的作为 this.node 的DOM事件 this.setOptions(options); this.path = "../x_component_query_Query/$Viewer/"; this.cssPath = "../x_component_query_Query/$Viewer/"+this.options.style+"/css.wcss"; this._loadCss(); this.lp = MWF.xApplication.query.Query.LP; this.app = app; this.container = $(container); debugger; this.json = json || {}; this.parentMacro = parentMacro; this.originalJson = Object.clone(json); this.viewJson = null; this.filterItems = []; this.searchStatus = "none"; //none, custom, default this.items = []; this.selectedItems = []; this.hideColumns = []; this.openColumns = []; this.parameter = {}; this.gridJson = null; if (this.options.isload){ this.init(function(){ this.load(); }.bind(this)); } }, init: function(callback){ if (this.json.view){ this.viewJson = JSON.decode(this.json.view); this.statementJson = this.json; if (callback) callback(); }else{ this.getView(callback); } }, loadMacro: function (callback) { MWF.require("MWF.xScript.Macro", function () { this.Macro = new MWF.Macro.ViewContext(this); if (callback) callback(); }.bind(this)); }, createActionbarNode : function(){ this.actionbarAreaNode.empty(); if( typeOf(this.json.showActionbar) === "boolean" && this.json.showActionbar !== true )return; if( typeOf( this.viewJson.actionbarHidden ) === "boolean" ){ if( this.viewJson.actionbarHidden === true || !this.viewJson.actionbarList || !this.viewJson.actionbarList.length )return; this.actionbar = new MWF.xApplication.query.Query.Statement.Actionbar(this.actionbarAreaNode, this.viewJson.actionbarList[0], this, {}); this.actionbar.load(); } }, _loadPageNode : function(){ this.viewPageAreaNode.empty(); if( !this.paging ){ var json; if( !this.viewJson.pagingList || !this.viewJson.pagingList.length ){ json = { "firstPageText": this.lp.firstPage, "lastPageText": this.lp.lastPage }; }else{ json = this.viewJson.pagingList[0]; } this.paging = new MWF.xApplication.query.Query.Statement.Paging(this.viewPageAreaNode, json, this, {}); this.paging.load(); }else{ this.paging.reload(); } }, // _initPage: function(){ // var i = this.count/this.json.pageSize; // this.pages = (i.toInt()1){ this.viewTable.deleteRow(-1); } //this.createLoadding(); this.loadViewRes = o2.Actions.load("x_query_assemble_surface").StatementAction.executeV2( 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" ){ if( typeOf(json.count) === "number" ){ this.count = json.count; var i = this.count/this.json.pageSize; this.pages = (i.toInt()