Eldate.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.Eldate = MWF.FCEldate = new Class({
  4. Extends: MWF.FC$ElElement,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Eldate/eldate.html"
  9. },
  10. _initModuleType: function(){
  11. this.className = "Eldate";
  12. this.moduleType = "element";
  13. this.moduleName = "eldate";
  14. },
  15. _createElementHtml: function(){
  16. var html = "<el-date-picker";
  17. html += " :type=\"selectType\"";
  18. html += " :size=\"size\"";
  19. html += " :prefix-icon=\"prefixIcon\"";
  20. html += " :range-separator=\"rangeSeparator\"";
  21. html += " readonly";
  22. html += " :placeholder=\"id\"";
  23. html += " :start-placeholder=\"id\"";
  24. html += " :end-placeholder=\"id\"";
  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-date-picker>";
  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. });