提交 d850cc91 编写于 作者: 蔡祥熠

Merge branch 'cherry-pick-d6b267e4' into 'develop'

修复表单设计端Element组件设置display:none组件不可见的问题

See merge request o2oa/o2oa!1254
......@@ -1063,6 +1063,7 @@ o2.widget.Calendar = o2.Calendar = new Class({
range: [0, 23],
initialStep: h.toInt(),
onChange: function(value){
debugger;
var tmp = (value.toInt().toString());
if (tmp.length<2){
tmp = "0"+tmp
......
......@@ -146,6 +146,7 @@ MWF.xApplication.process.FormDesigner.Module.$ElElement = MWF.FC$ElElement = new
_createVueData: function(){
//var data = this.json;
return function(){
this.setElStyles();
return Object.assign(this.json, this.tmpVueData||{});
}.bind(this)
},
......@@ -185,7 +186,37 @@ MWF.xApplication.process.FormDesigner.Module.$ElElement = MWF.FC$ElElement = new
if (callback) callback();
},
_setOtherNodeEvent: function(){},
setPropertiesOrStyles: function(name){
if (name=="styles"){
try{
this.setCustomStyles();
}catch(e){}
}else if (name=="elStyles"){
this.setElStyles();
}else if (name=="properties"){
try{
this.setCustomProperties();
}catch(e){}
}
},
setElStyles: function(){
var tmpElStyles = Object.clone(this.json.elStyles || {});
if( tmpElStyles.display )delete tmpElStyles.display;
if (this.json.elStyles) Object.each(this.json.elStyles, function(value, key){
if (key){
if (key.toString().toLowerCase()==="display"){
if (value.toString().toLowerCase()==="none"){
tmpElStyles["opacity"] = 0.3;
}else{
tmpElStyles["opacity"] = 1;
}
}else{
tmpElStyles[key] = value;
}
}
}.bind(this));
this.json.tmpElStyles = tmpElStyles;
},
_setEditStyle_custom: function(name){
switch (name){
case "name": this.setPropertyName(); break;
......@@ -236,6 +267,9 @@ MWF.xApplication.process.FormDesigner.Module.$ElElement = MWF.FC$ElElement = new
this.node.clearStyles();
this.node.removeAttribute("class");
//if (this.initialStyles) this.node.setStyles(this.initialStyles);
if( this.json.tmpElStyles )delete this.json.tmpElStyles;
this.json.recoveryStyles = Object.clone(this.json.styles);
if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
......
......@@ -39,7 +39,7 @@ MWF.xApplication.process.FormDesigner.Module.Elautocomplete = MWF.FCElautocomple
}, this);
}
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
// if (this.json.elStyles){
// var style = "";
......
......@@ -41,7 +41,7 @@ MWF.xApplication.process.FormDesigner.Module.Elbutton = MWF.FCElbutton = new Cla
}, this);
}
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
// if (this.json.elStyles){
// var style = "";
......
......@@ -40,7 +40,7 @@ MWF.xApplication.process.FormDesigner.Module.Elcarousel = MWF.FCElcarousel = new
}, this);
}
html += " :style=\"elStyles\">";
html += " :style=\"tmpElStyles\">";
if (this.json.vueSlot){
html += this.json.vueSlot;
......
......@@ -23,7 +23,7 @@ MWF.xApplication.process.FormDesigner.Module.Elcascader = MWF.FCElcascader = new
html += " :collapse-tags=\"collapseTags\"";
html += " :separator=\"separator\"";
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
html += " :value=\"id\">";
......
......@@ -30,7 +30,7 @@ MWF.xApplication.process.FormDesigner.Module.Elcheckbox = MWF.FCElcheckbox = new
html += (this.json.buttonRadio) ? " ><el-checkbox-button" : " ><el-checkbox";
html += " :border=\"border\"";
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
html += " :label=\"id\">{{id}}"+((this.json.buttonRadio) ? "</el-checkbox-button></el-checkbox-group>" : "</el-checkbox></el-checkbox-group>");
return html;
......
......@@ -25,7 +25,7 @@ MWF.xApplication.process.FormDesigner.Module.Elcolorpicker = MWF.FCElcolorpicker
}, this);
}
html += " :style=\"elStyles\">";
html += " :style=\"tmpElStyles\">";
if (this.json.vueSlot) html += this.json.vueSlot;
html += "</el-color-picker>";
return html;
......
......@@ -31,7 +31,7 @@ MWF.xApplication.process.FormDesigner.Module.Eldate = MWF.FCEldate = new Class({
}, this);
}
html += " :style=\"elStyles\">";
html += " :style=\"tmpElStyles\">";
if (this.json.vueSlot) html += this.json.vueSlot;
html += "</el-date-picker>";
return html;
......
......@@ -31,7 +31,7 @@ MWF.xApplication.process.FormDesigner.Module.Eldatetime = MWF.FCEldatetime = new
}, this);
}
html += " :style=\"elStyles\">";
html += " :style=\"tmpElStyles\">";
if (this.json.vueSlot) html += this.json.vueSlot;
html += "</el-date-picker>";
return html;
......
......@@ -33,7 +33,7 @@ MWF.xApplication.process.FormDesigner.Module.Eldropdown = MWF.FCEldropdown = new
}, this);
}
html += " :style=\"elStyles\">";
html += " :style=\"tmpElStyles\">";
if (this.json.vueSlot){
html += this.json.vueSlot;
......
......@@ -21,7 +21,7 @@ MWF.xApplication.process.FormDesigner.Module.Elicon = MWF.FCElicon = new Class({
}, this);
}
html += " :style=\"[elStyles, {fontSize: iconSize+'px', color: iconColor}]\"";
html += " :style=\"[tmpElStyles, {fontSize: iconSize+'px', color: iconColor}]\"";
// var styles = {};
// if (this.json.iconSize) styles["font-size"] = this.json.iconSize+"px";
......@@ -68,6 +68,9 @@ MWF.xApplication.process.FormDesigner.Module.Elicon = MWF.FCElicon = new Class({
_preprocessingModuleData: function(){
this.node.clearStyles();
//if (this.initialStyles) this.node.setStyles(this.initialStyles);
if( this.json.tmpElStyles )delete this.json.tmpElStyles;
this.json.recoveryStyles = Object.clone(this.json.styles);
if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
......
......@@ -55,7 +55,7 @@ MWF.xApplication.process.FormDesigner.Module.Elinput = MWF.FCElinput = new Class
}, this);
}
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
// if (this.json.elStyles){
// var style = "";
......
......@@ -40,7 +40,7 @@ MWF.xApplication.process.FormDesigner.Module.Elnumber = MWF.FCElnumber = new Cla
if (this.json.elProperties[k]) html += " "+k+"=\""+this.json.elProperties[k]+"\"";
}, this);
}
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
// if (this.json.elStyles){
// var style = "";
......
......@@ -25,7 +25,7 @@ MWF.xApplication.process.FormDesigner.Module.Elradio = MWF.FCElradio = new Class
html += (this.json.buttonRadio) ? " ><el-radio-button" : " ><el-radio";
html += " :border=\"border\"";
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
html += ">{{id}}"+((this.json.buttonRadio) ? "</el-radio-button></el-radio-group>" : "</el-radio></el-radio-group>");
return html;
......
......@@ -30,7 +30,7 @@ MWF.xApplication.process.FormDesigner.Module.Elrate = MWF.FCElrate = new Class({
}, this);
}
html += " :style=\"elStyles\">";
html += " :style=\"tmpElStyles\">";
if (this.json.vueSlot) html += this.json.vueSlot;
html += "</el-rate>";
return html;
......
......@@ -46,7 +46,7 @@ MWF.xApplication.process.FormDesigner.Module.Elselect = MWF.FCElselect = new Cla
html += " :remote=\"remote\"";
html += " :loading-text=\"loadingText\"";
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
html += " value=\"\"";
html += " :placeholder=\"id\">";
......@@ -60,6 +60,7 @@ MWF.xApplication.process.FormDesigner.Module.Elselect = MWF.FCElselect = new Cla
//var data = this.json;
return function(){
// this.json[this.json.id] = "";
this.setElStyles();
return Object.assign(this.json, this.tmpVueData||{});
}.bind(this)
},
......
......@@ -46,7 +46,7 @@ MWF.xApplication.process.FormDesigner.Module.Elslider = MWF.FCElslider = new Cla
html += " :show-tooltip=\"showTooltip\"";
html += " :tooltip-class=\"tooltipClass\"";
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
html += "></el-slider>";
return html;
},
......@@ -74,6 +74,7 @@ MWF.xApplication.process.FormDesigner.Module.Elslider = MWF.FCElslider = new Cla
};
},
_createVueData: function(){
this.setElStyles();
var data = this.json;
Object.assign(data, this.tmpVueData||{});
......
......@@ -32,7 +32,7 @@ MWF.xApplication.process.FormDesigner.Module.Elswitch = MWF.FCElswitch = new Cla
html += " :active-icon-class=\"activeIconClass\"";
html += " :inactive-icon-class=\"inactiveIconClass\"";
html += " :style=\"elStyles\"";
html += " :style=\"tmpElStyles\"";
html += "></el-switch>";
return html;
......@@ -41,6 +41,7 @@ MWF.xApplication.process.FormDesigner.Module.Elswitch = MWF.FCElswitch = new Cla
//var data = this.json;
return function(){
this.json[this.json.id] = true;
this.setElStyles();
return Object.assign(this.json, this.tmpVueData||{});
}.bind(this);
},
......
......@@ -41,7 +41,7 @@ MWF.xApplication.process.FormDesigner.Module.Eltime = MWF.FCEltime = new Class({
}, this);
}
html += " :style=\"elStyles\">";
html += " :style=\"tmpElStyles\">";
if (this.json.vueSlot) html += this.json.vueSlot;
return html;
},
......
......@@ -2395,6 +2395,7 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
"onChange": function(){
//this.data[name] = maplist.toJson();
//
debugger;
var oldData = this.data[name];
this.changeJsonDate(name, maplist.toJson());
this.changeStyle(name, oldData);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册