MyCreatedList.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. MWF.xDesktop.requireApp("process.TaskCenter", "TaskList", null, false);
  2. MWF.xApplication.process.TaskCenter.MyCreatedList = new Class({
  3. Extends: MWF.xApplication.process.TaskCenter.TaskList,
  4. _getCurrentPageData: function(callback, count){
  5. if (this.filterData){
  6. this.filterListNode.empty();
  7. var data = {};
  8. Object.each(this.filterData, function(v, key){
  9. if (key!=="key"){
  10. if (v) {
  11. //data[this.app.options.filterMap[key]] = v.value;
  12. if (!data[this.app.options.filterMap[key]]) data[this.app.options.filterMap[key]] = [];
  13. data[this.app.options.filterMap[key]].push(v.value);
  14. this.createFilterItemNode(key, v);
  15. }
  16. }else{
  17. data.key = v;
  18. }
  19. }.bind(this));
  20. if (this.filterData.key){
  21. this.createFilterItemNode("key", {"name": this.filterData.key});
  22. }
  23. var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
  24. o2.Actions.load("x_processplatform_assemble_surface").ReviewAction.V2ListCreateNext(id, this.pageCount, data).then(function(json){
  25. if (callback) callback(json);
  26. }.bind(this));
  27. }else{
  28. var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
  29. o2.Actions.load("x_processplatform_assemble_surface").ReviewAction.V2ListCreateNext(id, this.pageCount, {}).then(function(json){
  30. if (callback) callback(json);
  31. }.bind(this));
  32. }
  33. },
  34. _getApplicationCount: function(callback){
  35. this.app.getAction(function(){
  36. this.app.action.listReviewApplication(function(json){
  37. if (callback) callback(json);
  38. }.bind(this));
  39. }.bind(this));
  40. },
  41. _createItem: function(task){
  42. return new MWF.xApplication.process.TaskCenter.MyCreatedList.Item(task, this)
  43. },
  44. _getFilterCount: function(callback){
  45. o2.Actions.load("x_processplatform_assemble_surface").ReviewAction.filterCreateEntry().then(function(json){
  46. if (callback) callback(json);
  47. }.bind(this));
  48. }
  49. });
  50. MWF.xApplication.process.TaskCenter.MyCreatedList.Item = new Class({
  51. Extends: MWF.xApplication.process.TaskCenter.TaskList.Item
  52. });