Tab$Content.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.$Container", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Tab$Content = MWF.FCTab$Content = new Class({
  4. Extends: MWF.FC$Container,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Tab$Content/tab$Content.html",
  9. "actions": [],
  10. "injectActions" : [
  11. {
  12. "name" : "top",
  13. "styles" : "injectActionTop",
  14. "event" : "click",
  15. "action" : "injectTop",
  16. "title": MWF.APPFD.LP.formAction["insertTop"]
  17. },
  18. {
  19. "name" : "bottom",
  20. "styles" : "injectActionBottom",
  21. "event" : "click",
  22. "action" : "injectBottom",
  23. "title": MWF.APPFD.LP.formAction["insertBottom"]
  24. }
  25. ]
  26. },
  27. initialize: function(tab, page, options){
  28. this.setOptions(options);
  29. this.path = "../x_component_process_FormDesigner/Module/Tab$Content/";
  30. this.cssPath = "../x_component_process_FormDesigner/Module/Tab$Content/"+this.options.style+"/css.wcss";
  31. this._loadCss();
  32. this.moduleType = "container";
  33. this.moduleName = "tab$Content";
  34. this.form = tab.form;
  35. this.tab = tab;
  36. this.page = page;
  37. },
  38. _dragInLikeElement: function(module){
  39. return false;
  40. },
  41. load : function(json, node, parent){
  42. this.json = json;
  43. this.node= node;
  44. this.node.store("module", this);
  45. this.node.setStyles(this.css.moduleNode);
  46. if (!this.json.id){
  47. var id = this._getNewId(parent.json.id);
  48. this.json.id = id;
  49. }
  50. node.set({
  51. "MWFType": "tab$Content",
  52. "id": this.json.id
  53. });
  54. if (!this.form.json.moduleList[this.json.id]){
  55. this.form.json.moduleList[this.json.id] = this.json;
  56. }
  57. this._initModule();
  58. this._loadTreeNode(parent);
  59. this.setCustomStyles();
  60. this.parentContainer = this.treeNode.parentNode.module;
  61. this._setEditStyle_custom("id");
  62. this.parseModules();
  63. this.json.moduleName = this.moduleName;
  64. },
  65. _deleteModule: function(){
  66. this.form.moduleList.erase(this);
  67. this.form.moduleNodeList.erase(this.node);
  68. this.form.moduleElementNodeList.erase(this.node);
  69. //this.tab.containers.erase(this);
  70. this.node.destroy();
  71. this.actionArea.destroy();
  72. delete this.form.json.moduleList[this.json.id];
  73. this.json = null;
  74. delete this.json;
  75. this.treeNode.destroy();
  76. },
  77. _preprocessingModuleData: function(){
  78. this.recoveryWidgetstyle = this.node.get("style");
  79. this.node.clearStyles();
  80. //if (this.initialStyles) this.node.setStyles(this.initialStyles);
  81. this.json.recoveryStyles = Object.clone(this.json.styles);
  82. if (this.json.recoveryStyles) Object.each(this.json.recoveryStyles, function(value, key){
  83. if ((value.indexOf("x_processplatform_assemble_surface")!=-1 || value.indexOf("x_portal_assemble_surface")!=-1)){
  84. //需要运行时处理
  85. }else{
  86. this.node.setStyle(key, value);
  87. delete this.json.styles[key];
  88. }
  89. }.bind(this));
  90. },
  91. _recoveryModuleData: function(){
  92. this.node.set("style", this.recoveryWidgetstyle);
  93. this.recoveryWidgetstyle = null;
  94. },
  95. setCustomStyles: function(){
  96. this._recoveryModuleData();
  97. }
  98. });