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

Merge branch 'fix/mobile_form_sort_actionbar' into 'develop'

Merge of fix/mobile_form_sort_actionbar 允许移动端操作条系统操作和自定义操作的混合排序 to develop

See merge request o2oa/o2oa!883
......@@ -137,10 +137,23 @@ MWF.xApplication.process.FormDesigner.Module.Form = MWF.FCForm = new Class({
// 移动端表单加载工具栏
loadMobileActionToos: function() {
if (this.options.mode==="Mobile"){
if (!this.json.defaultTools){
this.json.defaultTools = o2.JSON.get(this.path+"toolbars.json", null,false);
if (!this.json.multiTools){
var tools = [];
if( this.json.defaultTools ){
tools = this.json.defaultTools;
}else{
tools = o2.JSON.get(this.path+"toolbars.json", null,false);
}
tools.map( function (d) { d.system = true; return d; });
if (this.json.tools){
tools = tools.concat( this.json.tools );
}
this.json.multiTools = tools;
}
if (!this.json.tools) this.json.tools=[];
// if (!this.json.defaultTools){
// this.json.defaultTools = o2.JSON.get(this.path+"toolbars.json", null,false);
// }
// if (!this.json.tools) this.json.tools=[];
}
},
_load : function( templateStyles, oldStyleValue ){
......
......@@ -290,8 +290,9 @@
</div>
<div title="{{$.lp.action}}" class="MWFTab" style="overflow: hidden; display: text{($.mode=='Mobile')?'block':'none'}">
<div class="MWFDefaultActionArea" name="defaultTools" data-target="mobileForm"></div>
<div class="MWFActionArea" name="tools"></div>
<!-- <div class="MWFDefaultActionArea" name="defaultTools" data-target="mobileForm"></div>-->
<!-- <div class="MWFActionArea" name="tools"></div>-->
<div class="MWFMultiActionArea" name="multiTools" data-systemToolsAddress="../x_component_process_FormDesigner/Module/Form/toolbars.json"></div>
</div>
<div title="{{$.lp.event}}" class="MWFTab">
<div style="padding: 5px;color:#999;">{{$.lp.noEventInfo}}</div>
......
......@@ -2278,14 +2278,19 @@ MWF.xApplication.process.FormDesigner.Property = MWF.FCProperty = new Class({
var name = node.get("name");
var actionContent = this.data[name];
MWF.xDesktop.requireApp("process.FormDesigner", "widget.ActionsEditor", function(){
var actionEditor = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor(node, this.designer, this.data, {
var options = {
"maxObj": this.propertyNode.parentElement.parentElement.parentElement,
"isSystemTool" : true,
"target" : node.get("data-target"),
"onChange": function(){
this.data[name] = actionEditor.data;
this.changeData(name);
}.bind(this)
});
};
if(node.get("data-systemToolsAddress")){
options.systemToolsAddress = node.get("data-systemToolsAddress");
}
var actionEditor = new MWF.xApplication.process.FormDesigner.widget.ActionsEditor(node, this.designer, this.data, options);
actionEditor.load(actionContent);
}.bind(this));
}.bind(this));
......
......@@ -729,7 +729,9 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class(
}
},
_loadMobileDefaultTools: function (callback) {
if (this.json.defaultTools) {
if (this.json.multiTools) {
if (callback) callback();
}else if (this.json.defaultTools) {
if (callback) callback();
} else {
this.json.defaultTools = o2.JSON.get("../x_component_process_FormDesigner/Module/Form/toolbars.json", function (json) {
......@@ -742,23 +744,36 @@ MWF.xApplication.process.Xform.Form = MWF.APPForm = new Class(
_loadMobileActions: function (node, callback) {
var tools = [];
this._loadMobileDefaultTools(function () {
if (this.json.defaultTools) {
var jsonStr = JSON.stringify(this.json.defaultTools);
var jsonStr;
if( this.json.multiTools ){
jsonStr = JSON.stringify(this.json.multiTools);
jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.process.Xform.LP.form});
this.json.defaultTools = JSON.parse(jsonStr);
this.json.defaultTools.each(function (tool) {
this.multiToolsJson = JSON.parse(jsonStr);
var json = Array.clone(this.multiToolsJson);
json.each(function (tool) {
var flag = this._checkDefaultMobileActionItem(tool, this.options.readonly);
if (flag) tools.push(tool);
}.bind(this));
}
if (this.json.tools) {
var jsonStr = JSON.stringify(this.json.tools);
jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.process.Xform.LP.form});
this.json.tools = JSON.parse(jsonStr);
this.json.tools.each(function (tool) {
var flag = this._checkCustomMobileActionItem(tool, this.options.readonly);
if (flag) tools.push(tool);
}.bind(this));
}else{
if (this.json.defaultTools) {
jsonStr = JSON.stringify(this.json.defaultTools);
jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.process.Xform.LP.form});
this.json.defaultTools = JSON.parse(jsonStr);
this.json.defaultTools.each(function (tool) {
var flag = this._checkDefaultMobileActionItem(tool, this.options.readonly);
if (flag) tools.push(tool);
}.bind(this));
}
if (this.json.tools) {
jsonStr = JSON.stringify(this.json.tools);
jsonStr = o2.bindJson(jsonStr, {"lp": MWF.xApplication.process.Xform.LP.form});
this.json.tools = JSON.parse(jsonStr);
this.json.tools.each(function (tool) {
var flag = this._checkCustomMobileActionItem(tool, this.options.readonly);
if (flag) tools.push(tool);
}.bind(this));
}
}
this.mobileTools = tools;
//app上用原来的按钮样式
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册