Elcascader.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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.Elcascader = MWF.FCElcascader = new Class({
  4. Extends: MWF.FCElinput,
  5. Implements: [Options, Events],
  6. options: {
  7. "style": "default",
  8. "propertyPath": "../x_component_process_FormDesigner/Module/Elcascader/elcascader.html"
  9. },
  10. _initModuleType: function(){
  11. this.className = "Elcascader";
  12. this.moduleType = "element";
  13. this.moduleName = "elcascader";
  14. },
  15. _createElementHtml: function(){
  16. var html = "<el-cascader";
  17. html += " :placeholder=\"id\"";
  18. html += " :size=\"size\"";
  19. html += " :clearable=\"clearable\"";
  20. html += " :popper-class=\"popperClass\"";
  21. html += " :show-all-levels=\"showAllLevels\"";
  22. html += " :collapse-tags=\"collapseTags\"";
  23. html += " :separator=\"separator\"";
  24. html += " :style=\"tmpElStyles\"";
  25. html += " :value=\"id\">";
  26. if (this.json.vueSlot) html += this.json.vueSlot;
  27. html += "</el-cascader>";
  28. return html;
  29. },
  30. // _createVueData: function(){
  31. // //var data = this.json;
  32. // return function(){
  33. // this.json[this.json.id] = this.json.id;
  34. // return Object.assign(this.json, this.tmpVueData||{});
  35. // }.bind(this)
  36. // },
  37. _setEditStyle_custom: function(name){
  38. // switch (name){
  39. // case "name": this.setPropertyName(); break;
  40. // case "id": this.setPropertyId(); break;
  41. // default: if (this.isPropertyLoaded) if (this.vm) this.resetElement();
  42. // }
  43. },
  44. _afterMounted: function(el, callback){
  45. this.node = el;
  46. this.node.store("module", this);
  47. this._loadVueCss();
  48. if (callback) callback();
  49. //window.setTimeout(function(){
  50. this.node.getElement("input").addEvent("click", function(e){
  51. this.selected();
  52. e.stopPropagation();
  53. }.bind(this));
  54. this.node.getElement(".el-cascader").addEvent("click", function(e){
  55. this.selected();
  56. e.stopPropagation();
  57. }.bind(this));
  58. this.node.getElement("i").addEvent("click", function(e){
  59. this.selected();
  60. e.stopPropagation();
  61. }.bind(this));
  62. },
  63. });