StatExplorer.js 2.7 KB

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