ViewExplorer.js 4.0 KB

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