StatExplorer.js 3.3 KB

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