Elrate.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.$ElElement", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Elrate = MWF.FCElrate = new Class({
  4. Extends: MWF.FC$ElElement,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Elrate/elrate.html"
  9. },
  10. _initModuleType: function(){
  11. this.className = "Elrate";
  12. this.moduleType = "element";
  13. this.moduleName = "elrate";
  14. },
  15. _createElementHtml: function(){
  16. var html = "<el-rate";
  17. html += " disabled";
  18. html += " :readonly=\"isReadonly\"";
  19. html += " :max=\"max\"";
  20. html += " :allow-half=\"allowHalf\"";
  21. html += " :low-threshold=\"lowThreshold\"";
  22. html += " :high-threshold=\"highThreshold\"";
  23. html += " :void-color=\"voidColor\"";
  24. html += " disabled-void-color=\"#C6D1DE\"";
  25. if (this.json.elProperties){
  26. Object.keys(this.json.elProperties).forEach(function(k){
  27. if (this.json.elProperties[k]) html += " "+k+"=\""+this.json.elProperties[k]+"\"";
  28. }, this);
  29. }
  30. html += " :style=\"tmpElStyles\">";
  31. if (this.json.vueSlot) html += this.json.vueSlot;
  32. html += "</el-rate>";
  33. return html;
  34. },
  35. _createCopyNode: function(){
  36. this.copyNode = new Element("div", {
  37. "styles": this.css.moduleNodeShow
  38. });
  39. this.copyNode.addEvent("selectstart", function(){
  40. return false;
  41. });
  42. },
  43. _getCopyNode: function(){
  44. if (!this.copyNode) this._createCopyNode();
  45. this.copyNode.setStyle("display", "inline-block");
  46. return this.copyNode;
  47. },
  48. setPropertyName: function(){
  49. // if (this.json.name){
  50. // var input = this.node.getElement("input");
  51. // if (input) input.set("value", this.json.name);
  52. // }
  53. },
  54. setPropertyId: function(){
  55. // if (!this.json.name){
  56. // var input = this.node.getElement("input");
  57. // if (input) input.set("value", this.json.id);
  58. // }
  59. }
  60. });