提交 d2155d79 编写于 作者: U unknown

视图自定义

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