提交 0bf7eccf 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'feature/new-JSONData' into 'wrdp'

修复内容管理获取数据字典问题  修复setData方法省略参数后报错的问题

See merge request o2oa/o2oa!2230
......@@ -639,7 +639,7 @@ MWF.xDesktop.Actions.RestActions.Callback = new Class({
}
errorText = errorText.replace(/\</g, "&lt;");
errorText = errorText.replace(/\</g, "&gt;");
MWF.xDesktop.notice("error", {x: "right", y:"top"}, errorText);
if (layout.session && layout.session.user) MWF.xDesktop.notice("error", {x: "right", y:"top"}, errorText);
}
// throw "request error: "+errorText;
}
......
......@@ -2270,7 +2270,7 @@ MWF.xScript.createCMSDict = function(application){
options = { name : options };
}
var name = this.name = options.name;
var type = ( options.type && options.application ) ? options.type : "process";
var type = ( options.type && options.application ) ? options.type : "cms";
var applicationId = options.application || application;
var enableAnonymous = options.enableAnonymous || false;
......
......@@ -200,7 +200,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
// this.moduleValueAG = null;
// }.bind(this));
// }else {
if (o2.typeOf(value.then)=="function"){
if (!!value && o2.typeOf(value.then)=="function"){
var p = o2.promiseAll(value).then(function(v){
this.__setValue(v);
}.bind(this));
......@@ -299,7 +299,7 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
// this.moduleValueAG = null;
// }.bind(this));
// }else{
if (o2.typeOf(data.then)=="function"){
if (!!data && o2.typeOf(data.then)=="function"){
var p = o2.promiseAll(data).then(function(v){
this.__setValue(v);
}.bind(this));
......
......@@ -156,23 +156,28 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class({
},
_setValue: function(value){
var p = o2.promiseAll(value).then(function(v){
//if (o2.typeOf(v)=="array") v = v[0];
if (this.moduleSelectAG){
this.moduleValueAG = this.moduleSelectAG;
this.moduleSelectAG.then(function(){
this.__setValue(v);
return v;
}.bind(this));
}else{
this.__setValue(v)
}
return v;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this));
if (!!value){
var p = o2.promiseAll(value).then(function(v){
//if (o2.typeOf(v)=="array") v = v[0];
if (this.moduleSelectAG){
this.moduleValueAG = this.moduleSelectAG;
this.moduleSelectAG.then(function(){
this.__setValue(v);
return v;
}.bind(this));
}else{
this.__setValue(v)
}
return v;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this.__setValue(value);
}
// this.moduleValueAG = o2.AG.all(value).then(function(v){
// if (this.moduleSelectAG){
......
......@@ -56,10 +56,13 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel = new Class({
}
},
setText: function(text){
o2.promiseAll(text).then(function(v){
if (!!text){
o2.promiseAll(text).then(function(v){
this.node.set("text", v || "");
}.bind(this));
}else{
this.node.set("text", v || "");
}.bind(this));
}
//this.node.set("text", text);
}
});
......@@ -215,24 +215,29 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class({
},
_setValue: function(value){
var p = o2.promiseAll(value).then(function(v){
if (o2.typeOf(v)=="array") v = v[0];
if (this.moduleSelectAG){
this.moduleValueAG = this.moduleSelectAG;
this.moduleSelectAG.then(function(){
this.__setValue(v);
return v;
}.bind(this));
}else{
this.__setValue(v)
}
return v;
}.bind(this));
if (!!value){
var p = o2.promiseAll(value).then(function(v){
if (o2.typeOf(v)=="array") v = v[0];
if (this.moduleSelectAG){
this.moduleValueAG = this.moduleSelectAG;
this.moduleSelectAG.then(function(){
this.__setValue(v);
return v;
}.bind(this));
}else{
this.__setValue(v)
}
return v;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this.__setValue(value);
}
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this));
// this.moduleValueAG = o2.AG.all(value).then(function(v){
// if (o2.typeOf(v)=="array") v = v[0];
......
......@@ -203,24 +203,29 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class({
},
_setValue: function(value){
var p = o2.promiseAll(value).then(function(v){
if (o2.typeOf(v)=="array") v = v[0];
if (this.moduleSelectAG){
this.moduleValueAG = this.moduleSelectAG;
this.moduleSelectAG.then(function(){
this.__setValue(v);
return v;
}.bind(this));
}else{
this.__setValue(v)
}
return v;
}.bind(this));
if (!!value){
var p = o2.promiseAll(value).then(function(v){
if (o2.typeOf(v)=="array") v = v[0];
if (this.moduleSelectAG){
this.moduleValueAG = this.moduleSelectAG;
this.moduleSelectAG.then(function(){
this.__setValue(v);
return v;
}.bind(this));
}else{
this.__setValue(v)
}
return v;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this.__setValue(value);
}
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this));
// this.moduleValueAG = o2.AG.all(value).then(function(v){
// if (o2.typeOf(v)=="array") v = v[0];
......
......@@ -24,6 +24,7 @@ MWF.xApplication.process.Xform.Textarea = MWF.APPTextarea = new Class({
_setValue: function(value){
if (!value) value = "";
var p = o2.promiseAll(value).then(function(v){
if (o2.typeOf(v)=="array") v = v[0];
this._setBusinessData(v);
......
......@@ -622,6 +622,9 @@ o2.addReady(function () {
layout.openLogin = function () {
layout.desktop.type = "app";
layout.app = null;
var content = $("appContent") || $("layout");
if (content) content.empty();
layout.authentication = new o2.xDesktop.Authentication({
"style": "flat",
"onLogin": _load.bind(layout)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册