ReviewList.js 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. MWF.xDesktop.requireApp("process.TaskCenter", "TaskList", null, false);
  2. MWF.xApplication.process.TaskCenter.ReviewList = 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.V2ListNext(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.V2ListNext(id, this.pageCount, {}).then(function(json){
  30. if (callback) callback(json);
  31. }.bind(this));
  32. }
  33. console.log("this.pages="+this.pages)
  34. },
  35. _getApplicationCount: function(callback){
  36. this.app.getAction(function(){
  37. this.app.action.listReviewApplication(function(json){
  38. if (callback) callback(json);
  39. }.bind(this));
  40. }.bind(this));
  41. },
  42. _createItem: function(task){
  43. return new MWF.xApplication.process.TaskCenter.ReviewList.Item(task, this)
  44. },
  45. _getFilterCount: function(callback){
  46. o2.Actions.load("x_processplatform_assemble_surface").ReviewAction.filterEntry().then(function(json){
  47. if (callback) callback(json);
  48. }.bind(this));
  49. }
  50. });
  51. MWF.xApplication.process.TaskCenter.ReviewList.Item = new Class({
  52. Extends: MWF.xApplication.process.TaskCenter.TaskList.Item
  53. });