Procházet zdrojové kódy

表单载入新老表单兼容

huqi před 5 roky
rodič
revize
0d6c0901ed

+ 1 - 0
o2web/source/x_component_process_FormDesigner/Main.js

@@ -141,6 +141,7 @@ MWF.xApplication.process.FormDesigner.Main = new Class({
     pasteModule: function(){
         if (this.shortcut) {
             if (this.form) {
+                debugger;
                 if (!this.form.node.contains(document.activeElement)) return false;
                 //    if (this.form.isFocus){
                 if (MWF.clipboard.data) {

+ 4 - 3
o2web/source/x_component_process_FormDesigner/Module/$Input.js

@@ -123,6 +123,7 @@ MWF.xApplication.process.FormDesigner.Module.$Input = MWF.FC$Input = new Class({
         }
     },
     _preprocessingModuleData: function(){
+        debugger;
         this.node.clearStyles();
         this.recoveryIconNode = this.node.getFirst();
         this.recoveryIconNode.dispose();
@@ -141,7 +142,7 @@ MWF.xApplication.process.FormDesigner.Module.$Input = MWF.FC$Input = new Class({
             "position": "relative",
             "margin-right": "20px",
             "padding-right": "4px"
-        })
+        });
 
         if (this.json.styles){
             this.json.recoveryStyles = Object.clone(this.json.styles);
@@ -187,12 +188,12 @@ MWF.xApplication.process.FormDesigner.Module.$Input = MWF.FC$Input = new Class({
     setCustomStyles: function(){
         this._recoveryModuleData();
         //debugger;
-        var border = this.node.getStyle("border");
+        //var border = this.node.getStyle("border");
         this.node.clearStyles();
         this.node.setStyles(this.css.moduleNode);
 
         if (this.initialStyles) this.node.setStyles(this.initialStyles);
-        this.node.setStyle("border", border);
+        //this.node.setStyle("border", border);
 
         if (this.json.styles) Object.each(this.json.styles, function(value, key){
             if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){

+ 4 - 1
o2web/source/x_component_process_FormDesigner/Module/Datagrid$Data.js

@@ -100,6 +100,7 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Data = MWF.FCDatagrid$Data
 		this.json.recoveryStyles = null;
 	},
     setCustomStyles: function(){
+		debugger;
 		this._recoveryModuleData();
 
         var border = this.node.getStyle("border");
@@ -115,7 +116,9 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Data = MWF.FCDatagrid$Data
                 this.node.setStyle(key, value);
             }
         }.bind(this));
-    },
+
+		this.setCustomNodeStyles(this.node, this.parentContainer.json.contentStyles);
+	},
     checkSequence: function(obj, oldValue){
         if ((this.json.cellType == "sequence") && (oldValue != "sequence")){
             if (this.treeNode.firstChild){

+ 21 - 1
o2web/source/x_component_process_FormDesigner/Module/Datagrid$Title.js

@@ -115,7 +115,27 @@ MWF.xApplication.process.FormDesigner.Module.Datagrid$Title = MWF.FCDatagrid$Tit
 	_dragInLikeElement: function(module){
 		return false;
 	},
-	
+
+	setCustomStyles: function(){
+		this._recoveryModuleData();
+
+		var border = this.node.getStyle("border");
+		this.node.clearStyles();
+		this.node.setStyles(this.css.moduleNode);
+
+		if (this.initialStyles) this.node.setStyles(this.initialStyles);
+		this.node.setStyle("border", border);
+
+		Object.each(this.json.styles, function(value, key){
+			var reg = /^border\w*/ig;
+			if (!key.test(reg)){
+				this.node.setStyle(key, value);
+			}
+		}.bind(this));
+
+		this.setCustomNodeStyles(this.node, this.parentContainer.json.titleStyles);
+	},
+
 	insertCol: function(){
 		var module = this;
 		var url = this.path+"insertCol.html";

+ 0 - 1
o2web/source/x_component_process_FormDesigner/Module/Documenteditor.js

@@ -76,7 +76,6 @@ MWF.xApplication.process.FormDesigner.Module.Documenteditor = MWF.FCDocumentedit
 	_initModule: function(){
 		this._resetContent();
 
-		debugger;
 		var templateJson = this.form.dataTemplate["Documenteditor"];
 		if (!templateJson){
 			var templateUrl = "../x_component_process_FormDesigner/Module/Documenteditor/template.json";

+ 6 - 4
o2web/source/x_component_process_FormDesigner/Module/Form.js

@@ -391,20 +391,22 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
 			return module;
 		}else if( MWF["FC"+json.type] ){
 			var module;
-			var className = ( dom.get("MWFType") || "div" ).capitalize();
+			var className = json.type.capitalize();
 			this.getTemplateData(className, function(data){
 				var moduleData = Object.clone(data);
-				json = Object.merge(moduleData, json);
+				Object.merge(moduleData, json);
+				Object.merge(json, moduleData);
 				module = new MWF["FC"+json.type](this);
 				module.load(json, dom, parent);
 			}.bind(this), false);
 			return module;
 		}else{
 			var module;
-			var className = ( dom.get("MWFType") || "div" ).capitalize();
+			var className = json.type.capitalize();
 			this.getTemplateData(className, function(data){
 				var moduleData = Object.clone(data);
-				json = Object.merge(moduleData, json);
+				Object.merge(moduleData, json);
+				Object.merge(json, moduleData);
 				module = new MWF["FCDiv"](this);
 				module.load(json, dom, parent);
 			}.bind(this), false);

+ 1 - 0
o2web/source/x_component_process_FormDesigner/Module/Htmleditor.js

@@ -9,6 +9,7 @@ MWF.xApplication.process.FormDesigner.Module.Htmleditor = MWF.FCHtmleditor = new
 	},
 	
 	initialize: function(form, options){
+		debugger;
 		this.setOptions(options);
 		
 		this.path = "../x_component_process_FormDesigner/Module/Htmleditor/";

+ 12 - 3
o2web/source/x_component_process_Work/Main.js

@@ -134,6 +134,9 @@ MWF.xApplication.process.Work.Main = new Class({
             this.loadWorkByDraft(this.options.draft);
         }else if (this.options.jobId || this.options.jobid || this.options.job){
             var jobId = this.options.jobId || this.options.jobid || this.options.job;
+            delete this.options.jobId;
+            delete this.options.jobid;
+            delete this.options.job;
             this.loadWorkByJob(jobId);
         }
     },
@@ -166,7 +169,9 @@ MWF.xApplication.process.Work.Main = new Class({
                             this.close();
                         }
                     }
-                }.bind(this), "failure": function(){}}, [this.options.form.id, this.options.form.app], id);
+                }.bind(this), "failure": function(){
+                    this.close();
+                }.bind(this)}, [this.options.form.id, this.options.form.app], id);
         }else{
             o2.Actions.invokeAsync([
                 {"action": this.action, "name": (layout.mobile) ? "getWorkFormMobile": "getWorkForm"},
@@ -193,7 +198,9 @@ MWF.xApplication.process.Work.Main = new Class({
                             this.close();
                         }
                     }
-                }.bind(this), "failure": function(){}}, id);
+                }.bind(this), "failure": function(){
+                    this.close();
+                }.bind(this)}, id);
         }
     },
     loadWorkByJob: function(jobId){
@@ -224,8 +231,10 @@ MWF.xApplication.process.Work.Main = new Class({
 
                 }
             }else{
-
+                this.close();
             }
+        }.bind(this), function(){
+            this.close();
         }.bind(this));
     },
     loadWorkByDraft: function(work, data){