提交 26574fa0 编写于 作者: U unknown

修复办公中心打开文档后点已阅未刷新列表的问题

上级 9c1b7b56
......@@ -20,100 +20,79 @@ MWF.xApplication.Selector.Unit = new Class({
var afterLoadSelectItemFun = this.afterLoadSelectItem.bind(this);
if (this.options.units.length){
var unitList = [];
for( var i=0 ; i<this.options.units.length; i++ ){
var unit = this.options.units[i];
if( typeOf( unit ) === "string" ){
unitList.push(unit);
}else if( typeOf(unit)==="object"){
unitList.push(unit.id || unit.distinguishedName || unit.unique || unit.levelName);
var unitLoaded = 0;
var loadUnitSuccess = function () {
unitLoaded++;
if( unitLoaded === this.options.units.length ){
afterLoadSelectItemFun();
}
}.bind(this);
var loadUnitFailure = loadUnitSuccess;
this.options.units.each(function(unit){
var container = new Element("div").inject( this.itemAreaNode );
// this.action.listUnitByKey(function(json){
// if (json.data.length){
// json.data.each(function(data){
// if (data.subDirectUnitCount) var category = this._newItemCategory("ItemCategory", data, this, this.itemAreaNode);
// }.bind(this));
// }
// }.bind(this), null, comp);
if (typeOf(unit)==="string"){
// this.orgAction.listUnitByKey(function(json){
// if (json.data.length){
// json.data.each(function(data){
// if (data.subDirectUnitCount) var category = this._newItemCategory("ItemCategory", data, this, this.itemAreaNode);
// }.bind(this));
// }
// }.bind(this), null, unit);
this.orgAction.getUnit(function(json){
json.data = typeOf( json.data ) == "object" ? [json.data] : json.data;
if (json.data.length){
json.data.each( function(data){
if( this.options.expandSubEnable ){
if (data.subDirectUnitCount){
var category = this._newItemCategory("ItemCategory", data, this, container );
this.subCategorys.push(category);
}
}else{
var item = this._newItem( data, this, container );
this.items.push( item );
this.subItems.push(item);
}
o2.Actions.load("x_organization_assemble_express").UnitAction.listObject( {"unitList" : unitList} , function (json) {
debugger;
}.bind(this));
}
loadUnitSuccess();
}.bind(this), loadUnitFailure, unit);
}else{
this.orgAction.getUnit(function(json){
json.data = typeOf( json.data ) == "object" ? [json.data] : json.data;
if (json.data.length){
json.data.each( function(data){
if( this.options.expandSubEnable ) {
if (data.subDirectUnitCount){
var category = this._newItemCategory("ItemCategory", data, this, this.itemAreaNode );
var category = this._newItemCategory("ItemCategory", data, this, container );
this.subCategorys.push(category);
}
}else{
var item = this._newItem(data, this, this.itemAreaNode );
var item = this._newItem(data, this, container );
this.items.push( item );
this.subItems.push(item);
}
}.bind(this));
}
afterLoadSelectItemFun();
}.bind(this), afterLoadSelectItemFun )
// var unitLoaded = 0;
//
// var loadUnitSuccess = function () {
// unitLoaded++;
// if( unitLoaded === this.options.units.length ){
// afterLoadSelectItemFun();
// }
// }.bind(this);
// var loadUnitFailure = loadUnitSuccess;
//
// this.options.units.each(function(unit){
//
// var container = new Element("div").inject( this.itemAreaNode );
//
// // this.action.listUnitByKey(function(json){
// // if (json.data.length){
// // json.data.each(function(data){
// // if (data.subDirectUnitCount) var category = this._newItemCategory("ItemCategory", data, this, this.itemAreaNode);
// // }.bind(this));
// // }
// // }.bind(this), null, comp);
//
// if (typeOf(unit)==="string"){
// this.orgAction.getUnit(function(json){
// json.data = typeOf( json.data ) == "object" ? [json.data] : json.data;
// if (json.data.length){
// json.data.each( function(data){
// if( this.options.expandSubEnable ){
// if (data.subDirectUnitCount){
// var category = this._newItemCategory("ItemCategory", data, this, container );
// this.subCategorys.push(category);
// }
// }else{
// var item = this._newItem( data, this, container );
// this.items.push( item );
// this.subItems.push(item);
// }
// }.bind(this));
// }
// loadUnitSuccess();
// }.bind(this), loadUnitFailure, unit);
//
//
// }else{
// this.orgAction.getUnit(function(json){
// json.data = typeOf( json.data ) == "object" ? [json.data] : json.data;
// if (json.data.length){
// json.data.each( function(data){
// if( this.options.expandSubEnable ) {
// if (data.subDirectUnitCount){
// var category = this._newItemCategory("ItemCategory", data, this, container );
// this.subCategorys.push(category);
// }
// }else{
// var item = this._newItem(data, this, container );
// this.items.push( item );
// this.subItems.push(item);
// }
// }.bind(this));
// }
// loadUnitSuccess();
// }.bind(this), loadUnitFailure, unit.id);
// //if (unit.subDirectUnitCount) var category = this._newItemCategory("ItemCategory", unit, this, this.itemAreaNode);
// }
//
// }.bind(this));
loadUnitSuccess();
}.bind(this), loadUnitFailure, unit.id);
//if (unit.subDirectUnitCount) var category = this._newItemCategory("ItemCategory", unit, this, this.itemAreaNode);
}
}.bind(this));
}else{
this.orgAction.listTopUnit(function(json){
json.data.each(function(data){
......
......@@ -163,6 +163,34 @@ MWF.xApplication.process.TaskCenter.ReadList.Item = new Class({
this.close();
}, null, this.list.app.content);
},
openWorkByTaskCompleted: function(e, id){
var _self = this;
var options = {"workId": id, "readonly": true, "appId": "process.Work"+id,
"onQueryLoadForm" : function () {
this.appForm.addEvent("afterReaded", function () {
_self.node.destroy();
_self.list.refresh();
})
}, "onPostLoadForm" :function () {
}
};
this.list.app.desktop.openApplication(e, "process.Work", options);
},
openWorkCompleteedByTaskCompleted: function(e, id){
var _self = this;
var options = {"workCompletedId": id, "readonly": true, "appId": "process.Work"+id,
"onQueryLoadForm" : function () {
this.appForm.addEvent("afterReaded", function () {
_self.node.destroy();
_self.list.refresh();
})
}, "onPostLoadForm" :function () {
}
};
this.list.app.desktop.openApplication(e, "process.Work", options);
},
closeTaskCompleted: function(callback){
this.closeTaskCompletedNode.setStyle("display", "none");
......
......@@ -572,6 +572,13 @@ MWF.xApplication.process.Work.Main = new Class({
};
this.appForm.workAction = this.action;
this.appForm.app = this;
if( this.$events && this.$events.queryLoadForm ){
this.appForm.addEvent( "queryLoad", function () {
this.fireEvent("queryLoadForm");
}.bind(this));
}
this.appForm.load(function(){
if (this.mask) this.mask.hide();
if (window.o2android && window.o2android.appFormLoaded){
......@@ -582,6 +589,9 @@ MWF.xApplication.process.Work.Main = new Class({
layout.appForm = this.appForm;
window.webkit.messageHandlers.appFormLoaded.postMessage(JSON.stringify(this.appForm.mobileTools));
}
this.fireEvent("postLoadForm");
}.bind(this));
}.bind(this));
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册