提交 d2155d79 编写于 作者: U unknown

视图自定义

上级 cbd53790
......@@ -105,6 +105,13 @@
</select>
</td>
</tr>
<tr>
<td class="editTableTitle">操作条</td>
<td class="editTableValue">
<input class="editTableRadio" name="actionbar" text{($.actionbar=='show')?'checked':''} type="radio" value="show"/>显示
<input class="editTableRadio" name="actionbar" text{($.actionbar!='show')?'checked':''} type="radio" value="hidden"/>不显示
</td>
</tr>
<!--<tr>-->
<!--<td class="editTableTitle">打开文件</td>-->
<!--<td class="editTableValue">-->
......
......@@ -107,6 +107,10 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
if (this.viewNode){
this.node.setStyle("background", "transparent");
this.actionbarNode = this.viewNode.getChildren("div")[0];
if( this.actionbarNode ){
this.actionbarNode.destroy();
this.actionbarNode = null;
}
this.viewTable = this.viewNode.getElement("table").setStyles(this.css.viewTitleTableNode);
this.viewLine = this.viewTable.getElement("tr").setStyles(this.css.viewTitleLineNode);
this.viewSelectCell = this.viewLine.getElement("td");
......@@ -192,7 +196,7 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
this.node.set("id", this.json.id);
}
if(name=="actionbar"){
input.get("value") === "show" ? this._showActionbar() : this._hideActionbar();
this.json.actionbar === "show" ? this._showActionbar() : this._hideActionbar();
}
this._setEditStyle_custom(name, input, oldValue);
......@@ -255,7 +259,9 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
if(this.actionbarNode)this.actionbarNode.hide();
},
_showActionbar : function(){
if( this.actionbarLoading )return;
if( !this.actionbarNode )return;
this.actionbarLoading = true;
MWF.require("MWF.widget.Toolbar", null, false);
this.actionbarNode.show();
if( !this.viewData.actionbarList )this.viewData.actionbarList = [];
......@@ -273,10 +279,13 @@ MWF.xApplication.process.FormDesigner.Module.View = MWF.FCView = new Class({
toolbarWidget.load();
this.actionbarList.push( toolbarWidget );
this.actionbarLoading = false;
}.bind(this));
}else{
this.actionbarLoading = false;
}
}else{
this.actionbarLoading = false;
}
},
setToolbars: function(tools, node, json){
......
......@@ -46,6 +46,13 @@
<input type="radio" name="select" value="multi" text{($.select=='multi')?'checked':''}/>多选
</td>
</tr>
<tr>
<td class="editTableTitle">操作条</td>
<td class="editTableValue">
<input class="editTableRadio" name="actionbar" text{($.actionbar=='show')?'checked':''} type="radio" value="show"/>显示
<input class="editTableRadio" name="actionbar" text{($.actionbar!='show')?'checked':''} type="radio" value="hidden"/>不显示
</td>
</tr>
<!--<tr>-->
<!--<td class="editTableTitle"></td>-->
<!--<td class="editTableValue">-->
......
......@@ -59,6 +59,7 @@ MWF.xApplication.process.Xform.View = MWF.APPView = new Class({
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter
};
......@@ -102,6 +103,7 @@ MWF.xApplication.process.Xform.View = MWF.APPView = new Class({
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter
};
MWF.xDesktop.requireApp("process.Application", "Viewer", function(){
......@@ -131,6 +133,7 @@ MWF.xApplication.process.Xform.View = MWF.APPView = new Class({
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter
};
......
......@@ -68,6 +68,7 @@ MWF.xApplication.process.Xform.ViewSelector = MWF.APPViewSelector = new Class({
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter
};
var options = {};
......@@ -175,6 +176,7 @@ MWF.xApplication.process.Xform.ViewSelector = MWF.APPViewSelector = new Class({
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter
};
var options = {};
......@@ -279,11 +281,12 @@ MWF.xApplication.process.Xform.ViewSelector = MWF.APPViewSelector = new Class({
"titleStyles": this.json.titleStyles,
"itemStyles": this.json.itemStyles,
"isExpand": this.json.isExpand || "no",
"showActionbar" : this.json.actionbar === "show",
"filter": filter
};
var options = {};
var width = options.width || "800";
var height = options.height || "600";
var width = options.width || "850";
var height = options.height || "700";
if (layout.mobile){
var size = document.body.getSize();
......
......@@ -13,11 +13,11 @@
},
"viewPageNode": {
"padding-top": "10px",
"height": "30px"
// "padding-top": "10px",
// "height": "30px"
},
"viewPageAreaNode": {
"height": "24px"
// "height": "24px"
//"margin-top": "28px"
},
"viewPageContentNode": {
......
......@@ -182,6 +182,7 @@ MWF.xApplication.query.Query.Viewer = MWF.QViewer = new Class({
},
createActionbarNode : function(){
this.actionbarAreaNode.empty();
if( typeOf(this.json.showActionbar) === "boolean" && this.json.showActionbar !== true )return;
if( typeOf( this.viewJson.actionbarHidden ) === "boolean" ){
if( this.viewJson.actionbarHidden === true || !this.viewJson.actionbarList || !this.viewJson.actionbarList.length )return;
this.actionbar = new MWF.xApplication.query.Query.Viewer.Actionbar(this.actionbarAreaNode, this.viewJson.actionbarList[0], this, {});
......@@ -1987,7 +1988,7 @@ MWF.xApplication.query.Query.Viewer.Actionbar = new Class({
"MWFnodetype": tool.type,
//"MWFButtonImage": this.form.path+""+this.form.options.style+"/actionbar/"+tool.img,
//"MWFButtonImage": path+(this.options.style||"default") +"/tools/"+ (this.json.style || "default") +"/"+tool.img,
"MWFButtonImage": path+this.options.style+"/actionbar/"+tool.img,
"MWFButtonImage": path+this.options.style+"/actionbar/"+ ( this.json.iconStyle || "default" ) +"/"+tool.img,
"title": tool.title,
"MWFButtonAction": tool.action,
"MWFButtonText": tool.text
......
......@@ -85,7 +85,8 @@
},
"actionbar": {
"style": "xform_blue_flat",
"iconOverStyle": "xform_blue_flat_over",
"iconStyle" : "blue",
"iconOverStyle": "white",
"customIconStyle" : "blue",
"customIconOverStyle" : "white",
"forceStyles" : {
......
......@@ -85,6 +85,7 @@
},
"actionbar": {
"style": "cmcc",
"iconStyle" : "white",
"customIconStyle" : "white",
"forceStyles" : {
"container" : {
......
......@@ -13,13 +13,13 @@
"titleTr":{ //viewTitleTrNode viewTitleLineNode
"line-height": "40px",
"height": "40px",
"color": "#666666",
"background-color": "#EEE"
"color": "#fd1113",
"background-color": "#fff"
},
"titleTd":{ //viewTitleColumnNode viewTitleCellNode
"font-weight": "bold",
"padding": "0px 10px",
"border-bottom": "1px solid #CCC"
"border-bottom": "1px solid #fd1113"
},
"contentTr" : {
"background": "#ffffff"
......@@ -31,7 +31,7 @@
"height": "30px",
"line-height": "30px",
"padding": "5px 5px",
"border-bottom": "1px solid #CCC"
"border-bottom": "1px solid #fd1113"
},
"contentGroupTd": {
"padding": "5px 5px",
......
......@@ -1661,6 +1661,7 @@ MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({
},
setTemplateStyles: function(styles){
this.json.style = styles.style;
this.json.iconStyle = styles.iconStyle || "";
this.json.iconOverStyle = styles.iconOverStyle || "";
this.json.customIconStyle = styles.customIconStyle;
this.json.customIconOverStyle = styles.customIconOverStyle || "";
......@@ -1668,6 +1669,7 @@ MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({
},
clearTemplateStyles: function(styles){
this.json.style = "form";
this.json.iconStyle = "";
this.json.iconOverStyle = "";
this.json.customIconStyle = "";
this.json.customIconOverStyle = "";
......@@ -1852,7 +1854,7 @@ MWF.xApplication.query.ViewDesigner.View.Actionbar = new Class({
tools.each(function(tool){
var actionNode = new Element("div", {
"MWFnodetype": tool.type,
"MWFButtonImage": this.imagePath_default+""+this.options.style+"/actionbar/"+tool.img,
"MWFButtonImage": this.imagePath_default+""+this.options.style+"/actionbar/"+( this.json.iconStyle || "default" )+"/"+tool.img,
"title": tool.title,
"MWFButtonAction": tool.action,
"MWFButtonText": tool.text
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册