From 99b0c85cc8d9ee815d76b609e7eb7f92d69b95fc Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Dec 2021 14:43:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A8=E5=8D=95=E5=A2=9E=E5=8A=A0element?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E9=80=89=E6=8B=A9=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Elcolorpicker.js | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 o2web/source/x_component_process_Xform/Elcolorpicker.js diff --git a/o2web/source/x_component_process_Xform/Elcolorpicker.js b/o2web/source/x_component_process_Xform/Elcolorpicker.js new file mode 100644 index 0000000000..729b8c4708 --- /dev/null +++ b/o2web/source/x_component_process_Xform/Elcolorpicker.js @@ -0,0 +1,73 @@ +o2.xDesktop.requireApp("process.Xform", "$Elinput", null, false); +/** @class Elinput 基于Element UI的输入框组件。 + * @example + * //可以在脚本中获取该组件 + * //方法1: + * var input = this.form.get("name"); //获取组件 + * //方法2 + * var input = this.target; //在组件事件脚本中获取 + * @extends MWF.xApplication.process.Xform.$Module + * @o2category FormComponents + * @o2range {Process|CMS|Portal} + * @hideconstructor + */ +MWF.xApplication.process.Xform.Elcolorpicker = MWF.APPElcolorpicker = new Class( + /** @lends o2.xApplication.process.Xform.Elcolorpicker# */ + { + Implements: [Events], + Extends: MWF.APP$Elinput, + options: { + "moduleEvents": ["load", "queryLoad", "postLoad"], + "elEvents": ["change"] + }, + _appendVueData: function(){ + if (!this.json.isReadonly) this.json.isReadonly = false; + if (!this.json.disabled) this.json.disabled = false; + if (!this.json.showAlpha) this.json.showAlpha = false; + if (!this.json.colorFormat) { + if( this.json.showAlpha ){ + this.json.colorFormat = "hex"; + }else{ + this.json.colorFormat = "rgb"; + } + } + + }, + // appendVueExtend: function(app){ + // if (!app.methods) app.methods = {}; + // app.methods.$loadElEvent = function(ev){ + // this.validationMode(); + // if (ev==="change") this._setBusinessData(this.getInputData()); + // if (this.json.events && this.json.events[ev] && this.json.events[ev].code){ + // this.form.Macro.fire(this.json.events[ev].code, this, event); + // } + // }.bind(this); + // }, + _createElementHtml: function(){ + var html = "