提交 45448f23 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'fix/uncatch-promise-error' into 'wrdp'

修复uncatch promise错误

See merge request o2oa/o2oa!2278
......@@ -1451,7 +1451,7 @@ if (!window.Promise){
}
//Content-Type application/x-www-form-urlencoded; charset=utf-8
res.send(data);
}.bind(this));
}.bind(this)).catch(function(){});
//var oReturn = (callback.success && callback.success.isAG) ? callback.success : callback;
var oReturn = p;
......
......@@ -152,26 +152,31 @@ MWF.xApplication.portal.Portal.Main = new Class({
}.bind(this));
}
},
openPage: function(pageJson, par, callback){
this.setTitle((this.portal && this.portal.name) ? this.portal.name+"-"+pageJson.data.page.name : pageJson.data.page.name);
if (pageJson.data.page){
this.page = (pageJson.data.page.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.page.data)): null;
this.relatedFormMap = pageJson.data.relatedWidgetMap;
this.relatedScriptMap = pageJson.data.relatedScriptMap;
delete pageJson.data.page.data;
this.pageInfor = pageJson.data.page;
}else{
this.page = (pageJson.data.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.data)): null;
delete pageJson.data.data;
this.pageInfor = pageJson.data;
}
this.openPortal(par, callback);
},
loadPortalPage: function(par, callback){
var pageJson = null;
var loadModuleFlag = false;
var check = function(){
if (!!pageJson && loadModuleFlag){
this.pageJson = pageJson;
layout.sessionPromise.finally(function(){
this.setTitle((this.portal && this.portal.name) ? this.portal.name+"-"+pageJson.data.page.name : pageJson.data.page.name);
if (pageJson.data.page){
this.page = (pageJson.data.page.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.page.data)): null;
this.relatedFormMap = pageJson.data.relatedWidgetMap;
this.relatedScriptMap = pageJson.data.relatedScriptMap;
delete pageJson.data.page.data;
this.pageInfor = pageJson.data.page;
}else{
this.page = (pageJson.data.data) ? JSON.decode(MWF.decodeJsonString(pageJson.data.data)): null;
delete pageJson.data.data;
this.pageInfor = pageJson.data;
}
this.openPortal(par, callback);
layout.sessionPromise.then(function(){
this.openPage(pageJson, par, callback);
}.bind(this), function(){
this.openPage(pageJson, par, callback);
}.bind(this));
}
}.bind(this);
......
......@@ -207,10 +207,12 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
if (!!value && o2.typeOf(value.then)=="function"){
var p = o2.promiseAll(value).then(function(v){
this.__setValue(v);
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
p.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this.moduleValueAG = null;
......@@ -306,10 +308,12 @@ MWF.xApplication.process.Xform.$Input = MWF.APP$Input = new Class({
if (!!data && o2.typeOf(data.then)=="function"){
var p = o2.promiseAll(data).then(function(v){
this.__setValue(v);
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
p.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this.moduleValueAG = null;
......
......@@ -27,7 +27,7 @@ MWF.xApplication.process.Xform.Calendar = MWF.APPCalendar = new Class({
if (value && value.isAG){
return value.then(function(v){
this._getValueAg(v, isDate);
}.bind(this));
}.bind(this), function(){});
}else{
var d = (!!value) ? Date.parse(value) : "";
if (isDate){
......
......@@ -152,10 +152,12 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class({
}.bind(this));
}
}.bind(this));
}.bind(this), function(){});
this.moduleSelectAG = p;
if (p) p.then(function(){
this.moduleSelectAG = null;
}.bind(this), function(){
this.moduleSelectAG = null;
}.bind(this));
},
......@@ -169,15 +171,17 @@ MWF.xApplication.process.Xform.Checkbox = MWF.APPCheckbox = new Class({
this.moduleSelectAG.then(function(){
this[mothed](v);
return v;
}.bind(this));
}.bind(this), function(){});
}else{
this[mothed](v)
}
return v;
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this[mothed](value);
......
......@@ -199,10 +199,12 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this.__loadReadDatagrid(callback);
this.moduleValueAG = null;
return v;
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
// if (this.gridData && this.gridData.isAG){
......@@ -310,10 +312,14 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this.__loadEditDatagrid(callback);
this.moduleValueAG = null;
return v;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
......@@ -1319,10 +1325,14 @@ MWF.xApplication.process.Xform.DatagridMobile = new Class({
this.__setData(data);
this.moduleValueAG = null;
return v;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
// if (data && data.isAG){
......
......@@ -121,10 +121,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
this.__loadEditDatagrid(callback);
this.moduleValueAG = null;
return v;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
// if (this.gridData && this.gridData.isAG){
// this.moduleValueAG = this.gridData;
......@@ -827,10 +831,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
this.__loadReadDatagrid(callback);
this.moduleValueAG = null;
return v;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
// if (this.gridData && this.gridData.isAG){
......@@ -1093,10 +1101,14 @@ MWF.xApplication.process.Xform.DatagridPC = new Class({
this.__setData(data);
this.moduleValueAG = null;
return v;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
// if (data && data.isAG){
......
......@@ -51,7 +51,7 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel = new Class({
}else{
o2.promiseAll(value).then(function(v){
this.node.set("text", v || "");
}.bind(this));
}.bind(this), function(){});
//this.node.set("text", value || "");
}
},
......@@ -59,7 +59,7 @@ MWF.xApplication.process.Xform.Label = MWF.APPLabel = new Class({
if (!!text){
o2.promiseAll(text).then(function(v){
this.node.set("text", v || "");
}.bind(this));
}.bind(this), function(){});
}else{
this.node.set("text", v || "");
}
......
......@@ -95,7 +95,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
if (o2.typeOf(v)=="function"){
return v.then(function(re){
this._valueMerge(values, re)
}.bind(this));
}.bind(this), function(){});
}else{
return values.concat(v);
}
......@@ -133,9 +133,9 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
});
return arr;
}.bind(this)).catch(function(){
console.log("catch error : get duty")
console.log("catch error : can not get duty : " + duty.name, + "-" + uName);
});
}.bind(this));
}.bind(this), function(){});
values.push(promise);
}
}.bind(this));
......@@ -884,7 +884,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
promise.then(function(values){
o2.promiseAll(values).then(function(v){
this.checkChange(oldValues, v)
}.bind(this));
}.bind(this), function(){});
// if (values && values.isAG){
// values.then(function(v){
......@@ -893,7 +893,7 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
// }else{
// this.checkChange(oldValues, values)
// }
}.bind(this));
}.bind(this), function(){});
},
// __setData: function(value){
// if (!value) return false;
......@@ -1058,17 +1058,19 @@ MWF.xApplication.process.Xform.Org = MWF.APPOrg = new Class({
flag = true;
this.__setValue(values);
return values;
}.bind(this));
}.bind(this), function(){});
}else{
flag = true;
this.__setValue(values);
return values
}
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
if (p) p.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
return p;
......
......@@ -158,10 +158,14 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class({
}.bind(this));
}.bind(this));
}
}.bind(this), function(){
this.moduleSelectAG = null;
}.bind(this));
this.moduleSelectAG = p;
if (p) p.then(function(){
this.moduleSelectAG = null;
}.bind(this), function(){
this.moduleSelectAG = null;
}.bind(this));
// this.moduleSelectAG = o2.AG.all(optionItems).then(function(radioValues){
......@@ -228,16 +232,18 @@ MWF.xApplication.process.Xform.Radio = MWF.APPRadio = new Class({
this.moduleSelectAG.then(function(){
this[mothed](v);
return v;
}.bind(this));
}.bind(this), function(){});
}else{
this[mothed](v)
}
return v;
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this[mothed](value);
......
......@@ -154,10 +154,14 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class({
}.bind(this));
this.fireEvent("setOptions", [options])
}
}.bind(this), function(){
this.moduleSelectAG = null;
}.bind(this));
this.moduleSelectAG = p;
if (p) p.then(function(){
this.moduleSelectAG = null;
}.bind(this), function(){
this.moduleSelectAG = null;
}.bind(this));
// this.moduleSelectAG = o2.AG.all(optionItems).then(function(options){
......@@ -216,16 +220,18 @@ MWF.xApplication.process.Xform.Select = MWF.APPSelect = new Class({
this.moduleSelectAG.then(function(){
this[mothed](v);
return v;
}.bind(this));
}.bind(this), function(){});
}else{
this[mothed](v)
}
return v;
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
if (this.moduleValueAG) this.moduleValueAG.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
}else{
this[mothed](value);
......
......@@ -41,10 +41,12 @@ MWF.xApplication.process.Xform.Textarea = MWF.APPTextarea = new Class({
this.node.set("html", text);
}
//this.__setValue(v);
}.bind(this));
}.bind(this), function(){});
this.moduleValueAG = p;
p.then(function(){
this.moduleValueAG = null;
}.bind(this), function(){
this.moduleValueAG = null;
}.bind(this));
// this.moduleValueAG = o2.AG.all(value).then(function(v){
......
......@@ -22,7 +22,7 @@
</head>
<body style="overflow: auto; margin:0px">
<div id="layout" style="overflow: auto"></div>
<div id="appContent" style="overflow: auto"></div>
<script>
//动态添加 微信的 jssdk
function addWxJsSdk() {
......@@ -40,4 +40,4 @@
</script>
</body>
</html>
\ No newline at end of file
</html>
......@@ -86,7 +86,7 @@
</script>
</head>
<body style="overflow: auto">
<div id="layout" style="overflow: auto">
<div id="appContent" style="overflow: auto">
<div id="layout_top">
</div>
......
......@@ -33,7 +33,7 @@ layout.addReady(function(){
if (layout.sessionPromise){
layout.sessionPromise.then(function(){
_load();
});
},function(){});
}
}
......
......@@ -490,14 +490,8 @@ o2.addReady(function () {
layout.sessionPromise = new Promise(function(resolve, reject){
o2.Actions.get("x_organization_assemble_authentication").getAuthentication(function (json) {
if (resolve) resolve(json.data);
//this.status = "fulfilled";
// this.resolveReturn = json.data;
// this.runResolve(this.resolveReturn);
}.bind(this), function (xhr, text, error) {
if (reject) reject({"xhr": xhr, "text": text, "error": error});
// this.status = "rejected";
// this.resolveReturn = {"xhr": xhr, "text": text, "error": error};
// this.runReject(this.resolveReturn);
}.bind(this));
});
......
......@@ -37,7 +37,7 @@ layout.addReady(function(){
if (layout.sessionPromise){
layout.sessionPromise.then(function(){
_load();
});
},function(){});
}
}
})(layout);
......
......@@ -124,7 +124,7 @@ layout.addReady(function(){
if (layout.sessionPromise){
layout.sessionPromise.then(function(){
_load();
});
},function(){});
}
}
})(layout);
......
......@@ -37,16 +37,15 @@ layout.addReady(function(){
});
};
layout.sessionPromise.then(function(){
if (layout.session && layout.session.user){
_load();
});
// if (layout.session && layout.session.user){
// _load();
// }else{
// if (layout.sessionPromise){
//
// }
// }
}else{
if (layout.sessionPromise){
layout.sessionPromise.then(function(){
_load();
},function(){});
}
}
})(layout);
});
......
......@@ -8,7 +8,7 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body style="height: 100%; overflow: auto; margin:0px">
<div id="layout" style="overflow: auto; height:100%">
<div id="appContent" style="overflow: auto; height:100%">
<div id="loaddingArea" style="overflow: hidden;width:0px; height:2px; background-color:#4e82bd; position: absolute; top: 0; z-index: 100"></div>
</div>
......
......@@ -18,7 +18,7 @@
<body style="overflow: hidden; margin:0px;background:url(../o2_core/o2/xDesktop/$Default/blue/icons/loading.gif) center no-repeat;">
<div style="-webkit-overflow-scrolling: touch; overflow: auto; height: 100%;">
<div id="loaddingArea" style="overflow: hidden;width:0px; height:2px; background-color:#4e82bd; position: absolute; top: 0; z-index: 100"></div>
<div id="layout" style="overflow: hidden; -webkit-transform: translateZ(0); "></div>
<div id="appContent" style="overflow: hidden; -webkit-transform: translateZ(0); "></div>
</div>
<script src="../o2_core/o2.min.js"></script>
......
......@@ -23,7 +23,7 @@
<div id="loaddingArea"
style="overflow: hidden;width:0px; height:2px; background-color:#4e82bd; position: absolute; top: 0; z-index: 100">
</div>
<div id="layout" style="overflow: hidden; -webkit-transform: translateZ(0); "></div>
<div id="appContent" style="overflow: hidden; -webkit-transform: translateZ(0); "></div>
</div>
<div class="o2_form_mobile_actions"
style="height: 4em;overflow: hidden; border-top: 1px solid #dfdfdf; display: block; position: absolute; bottom: 0px; background: #ffffff; width: 100%; z-index:100;">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册