StatExplorer.js 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. MWF.xDesktop.requireApp("process.ProcessManager", "ViewExplorer", null, false);
  2. MWF.xApplication.process.ProcessManager.StatExplorer = new Class({
  3. Extends: MWF.xApplication.process.ProcessManager.ViewExplorer,
  4. Implements: [Options, Events],
  5. options: {
  6. "create": MWF.APPPM.LP.stat.create,
  7. "search": MWF.APPPM.LP.stat.search,
  8. "searchText": MWF.APPPM.LP.stat.searchText,
  9. "noElement": MWF.APPPM.LP.stat.noNoticeText
  10. },
  11. _createElement: function(e){
  12. var _self = this;
  13. var options = {
  14. "onQueryLoad": function(){
  15. this.actions = _self.app.restActions;
  16. this.application = _self.app.options.application;
  17. this.explorer = _self;
  18. }
  19. };
  20. this.app.desktop.openApplication(e, "process.StatDesigner", options);
  21. },
  22. _loadItemDataList: function(callback){
  23. this.app.restActions.listStat(this.app.options.application.id,callback);
  24. },
  25. _getItemObject: function(item){
  26. return new MWF.xApplication.process.ProcessManager.StatExplorer.Stat(this, item)
  27. },
  28. setTooltip: function(){
  29. this.options.tooltip = {
  30. "create": MWF.APPPM.LP.stat.create,
  31. "search": MWF.APPPM.LP.stat.search,
  32. "searchText": MWF.APPPM.LP.stat.searchText,
  33. "noElement": MWF.APPPM.LP.stat.noNoticeText
  34. };
  35. },
  36. deleteItems: function(){
  37. while (this.deleteMarkItems.length){
  38. var item = this.deleteMarkItems.shift();
  39. if (this.deleteMarkItems.length){
  40. item.deleteStat();
  41. }else{
  42. item.deleteStat(function(){
  43. // this.reloadItems();
  44. this.hideDeleteAction();
  45. }.bind(this));
  46. }
  47. }
  48. }
  49. });
  50. MWF.xApplication.process.ProcessManager.StatExplorer.Stat = new Class({
  51. Extends: MWF.xApplication.process.ProcessManager.Explorer.Item,
  52. _open: function(e){
  53. var _self = this;
  54. var options = {
  55. "onQueryLoad": function(){
  56. this.actions = _self.explorer.actions;
  57. this.category = _self;
  58. this.options.id = _self.data.id;
  59. this.application = _self.explorer.app.options.application;
  60. this.explorer = _self.explorer;
  61. }
  62. };
  63. this.explorer.app.desktop.openApplication(e, "process.StatDesigner", options);
  64. },
  65. _getIcon: function(){
  66. return "stat.png"
  67. },
  68. _getLnkPar: function(){
  69. return {
  70. "icon": this.explorer.path+this.explorer.options.style+"/statIcon/lnk.png",
  71. "title": this.data.name,
  72. "par": "process.StatDesigner#{\"appId\": \"query.StatDesigner"+this.data.id+"\", \"id\": \""+this.data.id+"\", \"applicationId\": \""+this.explorer.app.options.application.id+"\"}"
  73. };
  74. },
  75. // deleteItem: function(e){
  76. // var _self = this;
  77. // this.explorer.app.confirm("info", e, this.explorer.app.lp.form.deleteFormTitle, this.explorer.app.lp.form.deleteForm, 320, 110, function(){
  78. // _self.deleteForm();
  79. // this.close();
  80. // },function(){
  81. // this.close();
  82. // });
  83. // },
  84. deleteStat: function(callback){
  85. this.explorer.app.restActions.deleteStat(this.data.id, function(){
  86. this.node.destroy();
  87. if (callback) callback();
  88. }.bind(this));
  89. }
  90. });