Elnumber.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
  2. MWF.xDesktop.requireApp("process.FormDesigner", "Module.Elinput", null, false);
  3. MWF.xApplication.process.FormDesigner.Module.Elnumber = MWF.FCElnumber = new Class({
  4. Extends: MWF.FCElinput,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Elnumber/elnumber.html"
  9. },
  10. _initModuleType: function(){
  11. this.className = "Elnumber";
  12. this.moduleType = "element";
  13. this.moduleName = "elnumber";
  14. },
  15. _createElementHtml: function(){
  16. //var html = "<el-input placeholder=\"请输入内容\"></el-input>";
  17. var html = "<el-input-number";
  18. // if (this.json.description) html += " placeholder=\""+this.json.description+"\"";
  19. // if (this.json.max) html += " max=\""+this.json.max+"\"";
  20. // if (this.json.min) html += " min=\""+this.json.min+"\"";
  21. // if (this.json.step) html += " step=\""+this.json.step+"\"";
  22. // if (this.json.stepStrictly) html += " step-strictly";
  23. // if (this.json.precision) html += " precision=\""+this.json.precision+"\"";
  24. // if (this.json.size && this.json.size!=="default") html += " size=\""+this.json.size+"\"";
  25. // //if (this.json.controls===false) html += " controls=\"false\"";
  26. // if (this.json.controlsPosition && this.json.controlsPosition!=="default") html += " controls-position=\""+this.json.controlsPosition+"\"";
  27. html += " :placeholder=\"description\"";
  28. html += " :max=\"max\"";
  29. html += " :min=\"min\"";
  30. html += " :step=\"step\"";
  31. html += " :step-strictly=\"stepStrictly\"";
  32. html += " :precision=\"precision\"";
  33. html += " :size=\"size\"";
  34. html += " :controls-position=\"controlsPosition\"";
  35. if (this.json.elProperties){
  36. Object.keys(this.json.elProperties).forEach(function(k){
  37. if (this.json.elProperties[k]) html += " "+k+"=\""+this.json.elProperties[k]+"\"";
  38. }, this);
  39. }
  40. html += " :style=\"tmpElStyles\"";
  41. // if (this.json.elStyles){
  42. // var style = "";
  43. // Object.keys(this.json.elStyles).forEach(function(k){
  44. // if (this.json.elStyles[k]) style += k+":"+this.json.elStyles[k]+";";
  45. // }, this);
  46. // html += " style=\""+style+"\"";
  47. // }
  48. html += " :value=\"id\">";
  49. if (this.json.vueSlot) html += this.json.vueSlot;
  50. html += "</el-input-number>";
  51. return html;
  52. }
  53. });