DraftList.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. MWF.xDesktop.requireApp("process.TaskCenter", "TaskCompletedList", null, false);
  2. MWF.xApplication.process.TaskCenter.DraftList = new Class({
  3. Extends: MWF.xApplication.process.TaskCenter.TaskCompletedList,
  4. initData: function(){
  5. this.count = 0;
  6. this.isCountShow = false;
  7. this.currentPage = 1;
  8. this.pageCount = 20;
  9. this.pages = 0;
  10. this.items = [];
  11. this.isItemsLoaded = false;
  12. this.isItemLoadding = false;
  13. this.loadItemQueue = 0;
  14. this.filterApplication = "";
  15. this.currentFilterNode = null;
  16. this.filterListNode = null;
  17. },
  18. refresh: function(){
  19. this.mask = new MWF.widget.Mask({"style": "desktop"});
  20. this.mask.loadNode(this.app.content);
  21. this.initData();
  22. this.filterData = null;
  23. if (this.applicationFilterAreaNode) this.applicationFilterAreaNode.empty();
  24. this.createAppFilterNodes();
  25. this.listAreaNode.empty();
  26. this.resetListAreaHeight();
  27. this.app.getWorkCounts();
  28. },
  29. _getCurrentPageData: function(callback, count){
  30. this.app.getAction(function(){
  31. if (this.filterData){
  32. this.filterListNode.empty();
  33. var data = {};
  34. Object.each(this.filterData, function(v, key){
  35. if (key!="key"){
  36. if (v) {
  37. //data[this.app.options.filterMap[key]] = v.value;
  38. if (!data[this.app.options.filterMap[key]]) data[this.app.options.filterMap[key]] = [];
  39. data[this.app.options.filterMap[key]].push(v.value);
  40. this.createFilterItemNode(key, v);
  41. }
  42. }else{
  43. data.key = v;
  44. }
  45. }.bind(this));
  46. if (this.filterData.key){
  47. this.createFilterItemNode("key", {"name": this.filterData.key});
  48. }
  49. var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
  50. this.app.action.listReviewFilter(function(json){
  51. if (callback) callback(json);
  52. }, null, id, count || this.pageCount, data);
  53. }else{
  54. var id = (this.items.length) ? this.items[this.items.length-1].data.id : "(0)";
  55. this.app.action.listDraftNext(function(json){
  56. if (callback) callback(json);
  57. }, null, id, count || this.pageCount);
  58. }
  59. }.bind(this));
  60. },
  61. // createActionBarNode: function(){
  62. // return false;
  63. // },
  64. _getApplicationCount: function(callback){
  65. // this.app.getAction(function(){
  66. // this.app.action.listReviewApplication(function(json){
  67. // if (callback) callback(json);
  68. // }.bind(this));
  69. // }.bind(this));
  70. },
  71. _createItem: function(task){
  72. return new MWF.xApplication.process.TaskCenter.DraftList.Item(task, this)
  73. },
  74. _getFilterCount: function(callback){
  75. // this.app.action.listReviewFilterCount(function(json){
  76. // if (callback) callback(json);
  77. // });
  78. }
  79. });
  80. MWF.xApplication.process.TaskCenter.DraftList.Item = new Class({
  81. Extends: MWF.xApplication.process.TaskCenter.List.Item,
  82. setContent: function(){
  83. this.applicationTitleNode.set("text", this.data.applicationName);
  84. this.titleNode.set("html", "<font style=\"color: #333;\">["+this.data.processName+"]&nbsp;&nbsp;</font>"+o2.txt(this.data.title || ""));
  85. this.titleNode.set("title", this.data.title);
  86. this.activityNode.set("text", "( "+this.list.app.lp.draftTab+" )");
  87. this.timeContentNode.set("text", this.list.app.lp.list_createDate+": "+this.data.createTime);
  88. this.loadActions();
  89. this.loadApplicationIcon();
  90. //this.setTimeIconNode();
  91. },
  92. openTask: function(e){
  93. // this._getJobByTask(function(data){
  94. var options = {"draftId": this.data.id, "appId": "process.Work"+this.data.id};
  95. this.list.app.desktop.openApplication(e, "process.Work", options);
  96. // }.bind(this));
  97. }
  98. });