diff --git a/o2web/source/x_component_process_ProcessManager/Main.js b/o2web/source/x_component_process_ProcessManager/Main.js index 939f3c08e0fc151e0d645f4279a7df7acc109c07..33b461241231b730bd4bd68212b2cb33bbca8276 100644 --- a/o2web/source/x_component_process_ProcessManager/Main.js +++ b/o2web/source/x_component_process_ProcessManager/Main.js @@ -773,6 +773,7 @@ MWF.xApplication.process.ProcessManager.ApplicationProperty = new Class({ html += ""+this.app.lp.application.alias+""; html += ""+this.app.lp.application.description+""; html += ""+this.app.lp.application.type+""; + html += ""+this.app.lp.application.defaultForm+""; html += ""+this.app.lp.application.id+""; // html += ""+this.app.lp.application.icon+""; html += ""; @@ -784,6 +785,15 @@ MWF.xApplication.process.ProcessManager.ApplicationProperty = new Class({ this.descriptionInput = new MWF.xApplication.process.ProcessManager.Input(this.propertyContentNode.getElement("#formApplicationDescription"), this.data.description, this.app.css.formInput); this.typeInput = new MWF.xApplication.process.ProcessManager.Input(this.propertyContentNode.getElement("#formApplicationType"), this.data.applicationCategory, this.app.css.formInput); this.idInput = new MWF.xApplication.process.ProcessManager.Input(this.propertyContentNode.getElement("#formApplicationId"), this.data.id, this.app.css.formInput); + this.defaultFormInput = new MWF.xApplication.process.ProcessManager.Select(this.propertyContentNode.getElement("#formApplicationDefaultForm"), this.data.defaultForm, this.app.css.formInput, function(){ + var pages = {}; + this.app.restActions.listForm(this.app.options.application.id, function(json){ + json.data.each(function(page) { + pages[page.id] = page.name; + }.bind(this)); + }.bind(this), null, false); + return pages; + }.bind(this)); }, createControllerListNode: function(){ //if (!this.personActions) this.personActions = new MWF.xAction.org.express.RestActions(); @@ -990,6 +1000,7 @@ MWF.xApplication.process.ProcessManager.ApplicationProperty = new Class({ this.aliasInput.editMode(); this.descriptionInput.editMode(); this.typeInput.editMode(); + this.defaultFormInput.editMode(); this.isEdit = true; }, readMode: function(){ @@ -997,6 +1008,7 @@ MWF.xApplication.process.ProcessManager.ApplicationProperty = new Class({ this.aliasInput.readMode(); this.descriptionInput.readMode(); this.typeInput.readMode(); + this.defaultFormInput.readMode(); this.isEdit = false; }, cancelBaseInfor: function(){ @@ -1043,6 +1055,7 @@ MWF.xApplication.process.ProcessManager.ApplicationProperty = new Class({ this.data.alias = this.aliasInput.input.get("value"); this.data.description = this.descriptionInput.input.get("value"); this.data.applicationCategory = this.typeInput.input.get("value"); + this.data.defaultForm = this.defaultFormInput.input.get("value"); this.app.restActions.saveApplication(this.data, function(json){ this.propertyTitleBar.set("text", this.data.name); @@ -1051,6 +1064,7 @@ MWF.xApplication.process.ProcessManager.ApplicationProperty = new Class({ this.aliasInput.save(); this.descriptionInput.save(); this.typeInput.save(); + this.defaultFormInput.save(); if (callback) callback(); }.bind(this), function(xhr, text, error){ @@ -1100,3 +1114,72 @@ MWF.xApplication.process.ProcessManager.Input = new Class({ return this.value; } }); +MWF.xApplication.process.ProcessManager.Select = new Class({ + Extends: MWF.xApplication.process.ProcessManager.Input, + Implements: [Events], + initialize: function(node, value, style, select){ + this.node = $(node); + this.value = (value) ? value: ""; + this.style = style; + this.select = select; + this.selectList = null; + this.load(); + }, + getSelectList: function(){ + if (this.select){ + return this.select(); + } + return []; + }, + getText: function(value){ + if (value){ + if (this.selectList){ + return this.selectList[value] || ""; + } + } + return ""; + }, + load: function(){ + this.selectList = this.getSelectList(); + this.content = new Element("div", { + "styles": this.style.content, + "text": this.getText(this.value) + }).inject(this.node); + }, + editMode: function(){ + this.content.empty(); + this.input = new Element("select",{ + //"styles": this.style.input, + //"value": this.value + }).inject(this.content); + + Object.each(this.selectList, function(v, k){ + new Element("option", { + "value": k, + "text": v, + "selected": (this.value==k) + }).inject(this.input); + }.bind(this)); + + //this.input.addEvents({ + // //"focus": function(){ + // // this.input.setStyles(this.style.input_focus); + // //}.bind(this), + // //"blur": function(){ + // // this.input.setStyles(this.style.input); + // //}.bind(this), + // //"change": function(){ + // // this.input.setStyles(this.style.input); + // //}.bind(this) + //}); + }, + readMode: function(){ + this.content.empty(); + this.input = null; + this.content.set("text", this.getText(this.value)); + }, + save: function(){ + if (this.input) this.value = this.input.options[this.input.selectedIndex].get("value"); + return this.value; + } +}); diff --git a/o2web/source/x_component_process_ProcessManager/lp/en.js b/o2web/source/x_component_process_ProcessManager/lp/en.js index 8e358b12609afceb4b460e0b1b9c47678a5620f2..e8e360b0955b9306bf15af84ab7e84b3e11fa258 100644 --- a/o2web/source/x_component_process_ProcessManager/lp/en.js +++ b/o2web/source/x_component_process_ProcessManager/lp/en.js @@ -161,6 +161,7 @@ MWF.xApplication.process.ProcessManager.LP = { "id": "Application ID", "controllerList": "Manager", "available": "Available range", + "defaultForm": "Default Form", "changeIcon": "Change Icon", "setManager": "Set Manager", diff --git a/o2web/source/x_component_process_ProcessManager/lp/zh-cn.js b/o2web/source/x_component_process_ProcessManager/lp/zh-cn.js index 4161f5345215a704d7d224cde9210fdc18407b14..e6c7fb1bfbb9ad4f46825bc1b5f91798121b3192 100644 --- a/o2web/source/x_component_process_ProcessManager/lp/zh-cn.js +++ b/o2web/source/x_component_process_ProcessManager/lp/zh-cn.js @@ -165,6 +165,7 @@ MWF.xApplication.process.ProcessManager.LP = { "id": "应用标识", "controllerList": "管理者", "available": "可用范围", + "defaultForm": "默认表单", "changeIcon" : "更改图标", "setManager" : "设置管理者",