Elcheckbox.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.Checkbox", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Elcheckbox = MWF.FCElcheckbox = new Class({
  4. Extends: MWF.FC$ElElement,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "type": "elcheckbox",
  9. "path": "../x_component_process_FormDesigner/Module/Elcheckbox/",
  10. "propertyPath": "../x_component_process_FormDesigner/Module/Elcheckbox/elcheckbox.html"
  11. },
  12. _initModuleType: function(){
  13. this.className = "Elcheckbox";
  14. this.moduleType = "element";
  15. this.moduleName = "elcheckbox";
  16. },
  17. _filterHtml: function(html){
  18. var reg = /(?:@|v-on|:data)\S*(?:\=)\S*(?:\"|\'|\s)/g;
  19. var v = html.replace(reg, "");
  20. return v;
  21. },
  22. _createElementHtml: function(){
  23. var html = "<el-checkbox-group v-model=\""+this.json.id+"\"";
  24. html += " :text-color=\"textColor\"";
  25. html += " :fill=\"fillColor\"";
  26. html += " :size=\"size\"";
  27. html += " :style=\"elGroupStyles\"";
  28. html += (this.json.buttonRadio) ? " ><el-checkbox-button" : " ><el-checkbox";
  29. html += " :border=\"border\"";
  30. html += " :style=\"tmpElStyles\"";
  31. html += " :label=\"id\">{{id}}"+((this.json.buttonRadio) ? "</el-checkbox-button></el-checkbox-group>" : "</el-checkbox></el-checkbox-group>");
  32. return html;
  33. },
  34. _createCopyNode: function(){
  35. this.copyNode = new Element("div", {
  36. "styles": this.css.moduleNodeShow
  37. });
  38. this.copyNode.addEvent("selectstart", function(){
  39. return false;
  40. });
  41. },
  42. _getCopyNode: function(){
  43. if (!this.copyNode) this._createCopyNode();
  44. this.copyNode.setStyle("display", "inline-block");
  45. return this.copyNode;
  46. },
  47. setPropertyId: function(){
  48. if (this.isPropertyLoaded) if (this.vm) this.resetElement();
  49. }
  50. });