Răsfoiți Sursa

修复表单设计元素样式问题

huqi 5 ani în urmă
părinte
comite
17736c10b7

+ 3 - 0
o2web/source/x_component_process_FormDesigner/Module/Attachment.js

@@ -67,6 +67,9 @@ MWF.xApplication.process.FormDesigner.Module.Attachment = MWF.FCAttachment = new
 	_initModule: function(){
 	_initModule: function(){
 		this.node.empty();
 		this.node.empty();
 		this.loadAttachmentController(this.json.editorProperties);
 		this.loadAttachmentController(this.json.editorProperties);
+
+		this.setPropertiesOrStyles("styles");
+
 		this._setNodeProperty();
 		this._setNodeProperty();
         if (!this.form.isSubform) this._createIconAction();
         if (!this.form.isSubform) this._createIconAction();
 		this._setNodeEvent();
 		this._setNodeEvent();

+ 2 - 0
o2web/source/x_component_process_FormDesigner/Module/Common.js

@@ -108,6 +108,8 @@ MWF.xApplication.process.FormDesigner.Module.Common = MWF.FCCommon = new Class({
     },
     },
 
 
     setCustomStyles: function(){
     setCustomStyles: function(){
+        this._recoveryModuleData();
+        
         var border = this.node.getStyle("border");
         var border = this.node.getStyle("border");
         this.node.clearStyles();
         this.node.clearStyles();
         var styles = this.node.getStyles("display", "padding");
         var styles = this.node.getStyles("display", "padding");

+ 43 - 3
o2web/source/x_component_process_FormDesigner/Module/Tab$Content.js

@@ -107,9 +107,49 @@ MWF.xApplication.process.FormDesigner.Module.Tab$Content = MWF.FCTab$Content = n
 		this.recoveryWidgetstyle = null;
 		this.recoveryWidgetstyle = null;
 		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
 		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
 		this.json.recoveryStyles = null;
 		this.json.recoveryStyles = null;
-	},
-	setCustomStyles: function(){
-		this._recoveryModuleData();
 	}
 	}
+	// setCustomStyles: function(){
+	// 	this._recoveryModuleData();
+	// 	//debugger;
+	// 	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);
+	//
+	// 	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)){
+	// 			var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+	// 			var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+	// 			if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+	// 				value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+	// 			}else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+	// 				value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+	// 			}
+	// 			if (value.indexOf("/x_portal_assemble_surface")!==-1){
+	// 				value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+	// 			}else if (value.indexOf("x_portal_assemble_surface")!==-1){
+	// 				value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+	// 			}
+	// 		}
+	//
+	// 		var reg = /^border\w*/ig;
+	// 		if (!key.test(reg)){
+	// 			if (key){
+	// 				if (key.toString().toLowerCase()==="display"){
+	// 					if (value.toString().toLowerCase()==="none"){
+	// 						this.node.setStyle("opacity", 0.3);
+	// 					}else{
+	// 						this.node.setStyle("opacity", 1);
+	// 						this.node.setStyle(key, value);
+	// 					}
+	// 				}else{
+	// 					this.node.setStyle(key, value);
+	// 				}
+	// 			}
+	// 		}
+	// 	}.bind(this));
+	// }
 
 
 });
 });

+ 40 - 0
o2web/source/x_component_process_FormDesigner/Module/Tab$Page.js

@@ -261,6 +261,46 @@ MWF.xApplication.process.FormDesigner.Module.Tab$Page = MWF.FCTab$Page = new Cla
 	},
 	},
 	setCustomStyles: function(){
 	setCustomStyles: function(){
 		this._recoveryModuleData();
 		this._recoveryModuleData();
+		//debugger;
+		// 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);
+		//
+		// 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)){
+		// 		var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+		// 		var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+		// 		if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+		// 			value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+		// 		}else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+		// 			value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+		// 		}
+		// 		if (value.indexOf("/x_portal_assemble_surface")!==-1){
+		// 			value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+		// 		}else if (value.indexOf("x_portal_assemble_surface")!==-1){
+		// 			value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+		// 		}
+		// 	}
+		//
+		// 	var reg = /^border\w*/ig;
+		// 	if (!key.test(reg)){
+		// 		if (key){
+		// 			if (key.toString().toLowerCase()==="display"){
+		// 				if (value.toString().toLowerCase()==="none"){
+		// 					this.node.setStyle("opacity", 0.3);
+		// 				}else{
+		// 					this.node.setStyle("opacity", 1);
+		// 					this.node.setStyle(key, value);
+		// 				}
+		// 			}else{
+		// 				this.node.setStyle(key, value);
+		// 			}
+		// 		}
+		// 	}
+		// }.bind(this));
 	}
 	}
 
 
 });
 });

+ 43 - 3
o2web/source/x_component_process_FormDesigner/Module/Tab.js

@@ -402,8 +402,48 @@ MWF.xApplication.process.FormDesigner.Module.Tab = MWF.FCTab = new Class({
 		this.recoveryWidgetstyle = null;
 		this.recoveryWidgetstyle = null;
 		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
 		if (this.json.recoveryStyles) this.json.styles = this.json.recoveryStyles;
 		this.json.recoveryStyles = null;
 		this.json.recoveryStyles = null;
-	},
-	setCustomStyles: function(){
-		this._recoveryModuleData();
 	}
 	}
+	// setCustomStyles: function(){
+	// 	this._recoveryModuleData();
+	// 	//debugger;
+	// 	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);
+	//
+	// 	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)){
+	// 			var host1 = MWF.Actions.getHost("x_processplatform_assemble_surface");
+	// 			var host2 = MWF.Actions.getHost("x_portal_assemble_surface");
+	// 			if (value.indexOf("/x_processplatform_assemble_surface")!==-1){
+	// 				value = value.replace("/x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+	// 			}else if (value.indexOf("x_processplatform_assemble_surface")!==-1){
+	// 				value = value.replace("x_processplatform_assemble_surface", host1+"/x_processplatform_assemble_surface");
+	// 			}
+	// 			if (value.indexOf("/x_portal_assemble_surface")!==-1){
+	// 				value = value.replace("/x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+	// 			}else if (value.indexOf("x_portal_assemble_surface")!==-1){
+	// 				value = value.replace("x_portal_assemble_surface", host2+"/x_portal_assemble_surface");
+	// 			}
+	// 		}
+	//
+	// 		var reg = /^border\w*/ig;
+	// 		if (!key.test(reg)){
+	// 			if (key){
+	// 				if (key.toString().toLowerCase()==="display"){
+	// 					if (value.toString().toLowerCase()==="none"){
+	// 						this.node.setStyle("opacity", 0.3);
+	// 					}else{
+	// 						this.node.setStyle("opacity", 1);
+	// 						this.node.setStyle(key, value);
+	// 					}
+	// 				}else{
+	// 					this.node.setStyle(key, value);
+	// 				}
+	// 			}
+	// 		}
+	// 	}.bind(this));
+	// }
 });
 });

+ 1 - 1
o2web/source/x_component_process_Xform/Documenteditor.js

@@ -2254,7 +2254,7 @@ debugger;
             this.node.setStyles({
             this.node.setStyles({
                 "height":"auto"
                 "height":"auto"
             });
             });
-debugger;
+
             //var content = this.contentNode.getFirst().getFirst().get("html");
             //var content = this.contentNode.getFirst().getFirst().get("html");
             var tmpNode = this.contentNode.getFirst().getFirst().clone(true);
             var tmpNode = this.contentNode.getFirst().getFirst().clone(true);
             var htmlNode = tmpNode.getLast();
             var htmlNode = tmpNode.getLast();