MWF.xDesktop.requireApp("query.QueryManager", "package", null, false); MWF.xDesktop.requireApp("Selector", "package", null, false); MWF.require("MWF.widget.Identity", null,false); MWF.xDesktop.requireApp("process.ProcessManager", "", null, false); MWF.xApplication.query = MWF.xApplication.query || {}; MWF.xApplication.query.QueryManager.Main = new Class({ Extends: MWF.xApplication.process.ProcessManager.Main, Implements: [Options, Events], options: { "application": null, "style": "default", "name": "query.QueryManager", "icon": "icon.png", "width": "1100", "height": "700", "title": MWF.xApplication.query.QueryManager.LP.title }, onQueryLoad: function(){ this.lp = MWF.xApplication.query.QueryManager.LP; this.currentContentNode = null; this.restActions = MWF.Actions.get("x_query_assemble_designer"); }, keyCopyItems: function(e){ if (this.viewConfigurator){ this.viewConfigurator.keyCopy(e); } if (this.statConfigurator){ this.statConfigurator.keyCopy(e); } if (this.tableConfigurator){ this.tableConfigurator.keyCopy(e); } if (this.statementConfigurator){ this.statementConfigurator.keyCopy(e); } if (this.importerConfigurator){ this.importerConfigurator.keyCopy(e); } }, keyPasteItems: function(e) { var app = layout.desktop.currentApp || layout.desktop.app; if (app && app.appId === this.appId){ if (this.viewConfigurator) { this.viewConfigurator.keyPaste(e); } if (this.statConfigurator) { this.statConfigurator.keyPaste(e); } if (this.tableConfigurator) { this.tableConfigurator.keyPaste(e); } if (this.statementConfigurator) { this.statementConfigurator.keyPaste(e); } if (this.importerConfigurator) { this.importerConfigurator.keyPaste(e); } } }, loadStartMenu: function(callback){ this.startMenuNode = new Element("div", { "styles": this.css.startMenuNode }).inject(this.node); this.menu = new MWF.xApplication.query.QueryManager.Menu(this, this.startMenuNode, { "onPostLoad": function(){ if (this.status){ if (this.status.navi!=null){ this.menu.doAction(this.menu.startNavis[this.status.navi]); }else{ this.menu.doAction(this.menu.startNavis[0]); } }else{ this.menu.doAction(this.menu.startNavis[0]); } }.bind(this) }); this.addEvent("resize", function(){ if (this.menu) this.menu.onResize(); }.bind(this)); }, clearContent: function(){ //暂时没有启用--------------------- if (this.selectConfiguratorContent){ if (this.selectConfigurator) delete this.selectConfigurator; this.selectConfiguratorContent.destroy(); this.selectConfiguratorContent = null; } if (this.revealConfiguratorContent){ if (this.revealConfigurator) delete this.revealConfigurator; this.revealConfiguratorContent.destroy(); this.revealConfiguratorContent = null; } //------------------------------- if (this.viewConfiguratorContent){ if (this.viewConfigurator) delete this.viewConfigurator; this.viewConfiguratorContent.destroy(); this.viewConfiguratorContent = null; } if (this.propertyConfiguratorContent){ if (this.property) delete this.property; this.propertyConfiguratorContent.destroy(); this.propertyConfiguratorContent = null; } if (this.statConfiguratorContent){ if (this.statConfigurator) delete this.statConfigurator; this.statConfiguratorContent.destroy(); this.statConfiguratorContent = null; } if (this.tableConfiguratorContent){ if (this.tableConfigurator) delete this.tableConfigurator; this.tableConfiguratorContent.destroy(); this.tableConfiguratorContent = null; } if (this.statementConfiguratorContent){ if (this.statementConfigurator) delete this.statementConfigurator; this.statementConfiguratorContent.destroy(); this.statementConfiguratorContent = null; } if (this.importerConfiguratorContent){ if (this.importerConfigurator) delete this.importerConfigurator; this.importerConfiguratorContent.destroy(); this.importerConfiguratorContent = null; } }, queryProperty: function(){ this.clearContent(); this.propertyConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.property = new MWF.xApplication.query.QueryManager.QueryProperty(this, this.propertyConfiguratorContent); this.property.load(); }, selectConfig: function(){ this.clearContent(); this.selectConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.loadSelectConfig(); }, loadSelectConfig: function(){ MWF.xDesktop.requireApp("query.QueryManager", "SelectExplorer", function(){ this.selectConfigurator = new MWF.xApplication.query.QueryManager.SelectExplorer(this.selectConfiguratorContent, this.restActions); this.selectConfigurator.app = this; this.selectConfigurator.load(); }.bind(this)); }, viewConfig: function(){ this.clearContent(); this.viewConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.loadViewConfig(); }, loadViewConfig: function(){ MWF.xDesktop.requireApp("query.QueryManager", "ViewExplorer", function(){ this.viewConfigurator = new MWF.xApplication.query.QueryManager.ViewExplorer(this.viewConfiguratorContent, this.restActions); this.viewConfigurator.app = this; this.viewConfigurator.load(); }.bind(this)); }, statConfig: function(){ this.clearContent(); this.statConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.loadStatConfig(); }, loadStatConfig: function(){ MWF.xDesktop.requireApp("query.QueryManager", "StatExplorer", function(){ this.statConfigurator = new MWF.xApplication.query.QueryManager.StatExplorer(this.statConfiguratorContent, this.restActions); this.statConfigurator.app = this; this.statConfigurator.load(); }.bind(this)); }, revealConfig: function(){ this.clearContent(); this.revealConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.loadRevealConfig(); }, loadRevealConfig: function(){ MWF.xDesktop.requireApp("query.QueryManager", "RevealExplorer", function(){ this.revealConfigurator = new MWF.xApplication.query.QueryManager.RevealExplorer(this.revealConfiguratorContent, this.restActions); this.revealConfigurator.app = this; this.revealConfigurator.load(); }.bind(this)); }, tableConfig: function(){ this.clearContent(); this.tableConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.loadTableConfig(); }, loadTableConfig: function(){ MWF.xDesktop.requireApp("query.QueryManager", "TableExplorer", function(){ this.tableConfigurator = new MWF.xApplication.query.QueryManager.TableExplorer(this.tableConfiguratorContent, this.restActions); this.tableConfigurator.app = this; this.tableConfigurator.load(); }.bind(this)); }, statementConfig: function(){ this.clearContent(); this.statementConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.loadStatementConfig(); }, loadStatementConfig: function(){ MWF.xDesktop.requireApp("query.QueryManager", "StatementExplorer", function(){ this.statementConfigurator = new MWF.xApplication.query.QueryManager.StatementExplorer(this.statementConfiguratorContent, this.restActions); this.statementConfigurator.app = this; this.statementConfigurator.load(); }.bind(this)); }, importerConfig: function(){ this.clearContent(); this.importerConfiguratorContent = new Element("div", { "styles": this.css.rightContentNode }).inject(this.node); this.loadImporterConfig(); }, loadImporterConfig: function(){ MWF.xDesktop.requireApp("query.QueryManager", "ImporterExplorer", function(){ this.importerConfigurator = new MWF.xApplication.query.QueryManager.ImporterExplorer(this.importerConfiguratorContent, this.restActions); this.importerConfigurator.app = this; this.importerConfigurator.load(); }.bind(this)); } }); MWF.xApplication.query.QueryManager.Menu = new Class({ Extends: MWF.xApplication.process.ProcessManager.Menu, Implements: [Options, Events] }); MWF.xApplication.query.QueryManager.QueryProperty = new Class({ Extends: MWF.xApplication.process.ProcessManager.ApplicationProperty, load: function(){ this.app.restActions.getApplication(this.app.options.application.id, function(json){ this.data = json.data; this.propertyTitleBar = new Element("div", { "styles": this.app.css.propertyTitleBar, "text": this.data.name }).inject(this.node); this.contentNode = new Element("div", { "styles": this.app.css.propertyContentNode }).inject(this.node); this.contentAreaNode = new Element("div", { "styles": this.app.css.propertyContentAreaNode }).inject(this.contentNode); this.setContentHeight(); this.setContentHeightFun = this.setContentHeight.bind(this); this.app.addEvent("resize", this.setContentHeightFun); MWF.require("MWF.widget.ScrollBar", function(){ new MWF.widget.ScrollBar(this.contentNode, {"indent": false}); }.bind(this)); this.baseActionAreaNode = new Element("div", { "styles": this.app.css.baseActionAreaNode }).inject(this.contentAreaNode); this.baseActionNode = new Element("div", { "styles": this.app.css.propertyInforActionNode }).inject(this.baseActionAreaNode); this.baseTextNode = new Element("div", { "styles": this.app.css.baseTextNode, "text": this.app.lp.application.property }).inject(this.baseActionAreaNode); this.createEditBaseNode(); this.createPropertyContentNode(); this.createInterfaceNode(); this.createIconContentNode(); this.createAvailableNode(); this.createControllerListNode(); }.bind(this)); }, createInterfaceNode: function(){ this.interfaceAreaNode = new Element("div", { "styles": this.app.css.baseActionAreaNode }).inject(this.contentAreaNode); this.interfaceAreaNode.setStyle("clear","both"); this.interfaceActionNode = new Element("div", { "styles": this.app.css.propertyInforActionNode }).inject(this.interfaceAreaNode); this.interfaceTextNode = new Element("div", { "styles": this.app.css.baseTextNode, "text": this.app.lp.interfaceConfig }).inject(this.interfaceAreaNode); this.interfaceContentNode = new Element("div", {"styles": { "overflow": "hidden", "-webkit-user-select": "text", "-moz-user-select": "text" }}).inject(this.contentAreaNode); var lp = this.app.lp; this.interfaceData = this.data.data ? JSON.parse(this.data.data) : ""; var data = this.interfaceData || { viewShow: "true", viewNumber: 1, viewName: lp.viewName, statShow: "true", statNumber: 2, statName: lp.statName, statementShow: "true", statementNumber: 3, statementName: lp.statementName, importerShow: "true", importerNumber: 4, importerName: lp.importerName }; // var viewStyle = "font-size:14px;color:#666;heigh:16px;margin-top:6px;margin-left:10px;"; // var inputTextStyle = "float:right; width:120px; border:1px solid #ccc"; var html = "
"+lp.naviCategory+" | " + ""+lp.isShow+" | " + ""+lp.showText+" |
↑ "+lp.viewName+" | " +
"" + " | |
↑ "+lp.statName+" | " +
"" + " | |
↑ "+lp.statementName+" | " +
"" + " | |
↑ "+lp.importerName+" | " +
"" + " |
"+this.app.lp.application.name+" | |
"+this.app.lp.application.alias+" | |
"+this.app.lp.application.description+" | |
"+this.app.lp.application.type+" | |
"+this.app.lp.application.firstPage+" | |
"+this.app.lp.application.id+" | |
"+this.app.lp.application.icon+" |