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