ViewExplorer.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. MWF.xDesktop.requireApp("process.ProcessManager", "Explorer", null, false);
  2. MWF.xApplication.process.ProcessManager.ViewExplorer = new Class({
  3. Extends: MWF.xApplication.process.ProcessManager.Explorer,
  4. Implements: [Options, Events],
  5. options: {
  6. "create": MWF.APPPM.LP.view.create,
  7. "search": MWF.APPPM.LP.view.search,
  8. "searchText": MWF.APPPM.LP.view.searchText,
  9. "noElement": MWF.APPPM.LP.view.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.ViewDesigner", options);
  21. },
  22. _loadItemDataList: function(callback){
  23. this.app.restActions.listView(this.app.options.application.id,callback);
  24. },
  25. _getItemObject: function(item){
  26. return new MWF.xApplication.process.ProcessManager.ViewExplorer.View(this, item)
  27. },
  28. setTooltip: function(){
  29. this.options.tooltip = {
  30. "create": MWF.APPPM.LP.view.create,
  31. "search": MWF.APPPM.LP.view.search,
  32. "searchText": MWF.APPPM.LP.view.searchText,
  33. "noElement": MWF.APPPM.LP.view.noNoticeText
  34. };
  35. },
  36. deleteItems: function(){
  37. while (this.deleteMarkItems.length){
  38. var item = this.deleteMarkItems.shift();
  39. if (this.deleteMarkItems.length){
  40. item.deleteView();
  41. }else{
  42. item.deleteView(function(){
  43. // this.reloadItems();
  44. this.hideDeleteAction();
  45. }.bind(this));
  46. }
  47. }
  48. }
  49. });
  50. MWF.xApplication.process.ProcessManager.ViewExplorer.View = 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.ViewDesigner", options);
  64. //layout.desktop.getFormDesignerStyle(function(){
  65. // var _self = this;
  66. // var options = {
  67. // "style": layout.desktop.formDesignerStyle,
  68. // "onQueryLoad": function(){
  69. // this.actions = _self.explorer.actions;
  70. // this.category = _self;
  71. // this.options.id = _self.data.id;
  72. // this.application = _self.explorer.app.options.application;
  73. // }
  74. // };
  75. // this.explorer.app.desktop.openApplication(e, "process.FormDesigner", options);
  76. //}.bind(this));
  77. },
  78. _getIcon: function(){
  79. //var x = (Math.random()*33).toInt();
  80. //return "process_icon_"+x+".png";
  81. return "view.png"
  82. },
  83. _getLnkPar: function(){
  84. return {
  85. "icon": this.explorer.path+this.explorer.options.style+"/viewIcon/lnk.png",
  86. "title": this.data.name,
  87. "par": "process.ViewDesigner#{\"appId\": \"query.ViewDesigner"+this.data.id+"\", \"id\": \""+this.data.id+"\", \"applicationId\": \""+this.explorer.app.options.application.id+"\"}"
  88. };
  89. },
  90. // deleteItem: function(e){
  91. // var _self = this;
  92. // this.explorer.app.confirm("info", e, this.explorer.app.lp.form.deleteFormTitle, this.explorer.app.lp.form.deleteForm, 320, 110, function(){
  93. // _self.deleteForm();
  94. // this.close();
  95. // },function(){
  96. // this.close();
  97. // });
  98. // },
  99. deleteView: function(callback){
  100. this.explorer.app.restActions.deleteView(this.data.id, function(){
  101. this.node.destroy();
  102. if (callback) callback();
  103. }.bind(this));
  104. }
  105. });