提交 07812fea 编写于 作者: NoSubject's avatar NoSubject

增加VUE-Element组件 elinput

上级 17547014
......@@ -644,7 +644,7 @@ if (window.Promise && !Promise.any){
try{
if (cssText){
op.uuid = uuid;
_loadCssText(cssText, op, callback);
var style = _loadCssText(cssText, op);
// cssText = cssText.replace(/\/\*(\s|\S)*?\*\//g, "");
// if (op.bind) cssText = cssText.bindJson(op.bind);
// if (op.dom){
......
......@@ -5,3 +5,6 @@ if (!window.Promise || !window.fetch){
if (window.Promise && window.Promise.finally){
(function(self, undefined) {function CreateMethodProperty(e,r,t){var a={value:t,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(e,r,a)}function Get(n,t){return n[t]}function IsCallable(n){return"function"==typeof n}function ToObject(e){if(null===e||e===undefined)throw TypeError();return Object(e)}function GetV(t,e){return ToObject(t)[e]}function GetMethod(e,n){var r=GetV(e,n);if(null===r||r===undefined)return undefined;if(!1===IsCallable(r))throw new TypeError("Method not callable: "+n);return r}function Type(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in self&&(e instanceof self.Symbol||e.constructor===self.Symbol)?"symbol":"object"}}function IsConstructor(t){return"object"===Type(t)&&("function"==typeof t&&!!t.prototype)}function SpeciesConstructor(e,o){var r=Get(e,"constructor");if(r===undefined)return o;if("object"!==Type(r))throw new TypeError("O.constructor is not an Object");var n="function"==typeof self.Symbol&&"symbol"==typeof self.Symbol.species?r[self.Symbol.species]:undefined;if(n===undefined||null===n)return o;if(IsConstructor(n))return n;throw new TypeError("No constructor found")}!function(){var t=Function.prototype.bind.call(Function.prototype.call,Promise.prototype.then),o=function(t,o){return new t(function(t){t(o())})};CreateMethodProperty(Promise.prototype,"finally",function(e){var r=this;if("object"!==Type(r))throw new TypeError("Method %PromisePrototype%.finally called on incompatible receiver "+Object.prototype.toString.call(r));var n=SpeciesConstructor(r,Promise);if(!1===IsCallable(e))var i=e,c=e;else i=function(r){return t(o(n,e),function(){return r})},c=function(r){return t(o(n,e),function(){throw r})};return t(r,i,c)})}();})('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
}
if (!Object.assign){
(function(self, undefined) {function Call(t,l){var n=arguments.length>2?arguments[2]:[];if(!1===IsCallable(t))throw new TypeError(Object.prototype.toString.call(t)+"is not a function.");return t.apply(l,n)}function CreateMethodProperty(e,r,t){var a={value:t,writable:!0,enumerable:!1,configurable:!0};Object.defineProperty(e,r,a)}function Get(n,t){return n[t]}function HasOwnProperty(r,t){return Object.prototype.hasOwnProperty.call(r,t)}function IsCallable(n){return"function"==typeof n}function ToObject(e){if(null===e||e===undefined)throw TypeError();return Object(e)}function GetV(t,e){return ToObject(t)[e]}function GetMethod(e,n){var r=GetV(e,n);if(null===r||r===undefined)return undefined;if(!1===IsCallable(r))throw new TypeError("Method not callable: "+n);return r}function Type(e){switch(typeof e){case"undefined":return"undefined";case"boolean":return"boolean";case"number":return"number";case"string":return"string";case"symbol":return"symbol";default:return null===e?"null":"Symbol"in self&&(e instanceof self.Symbol||e.constructor===self.Symbol)?"symbol":"object"}}function OrdinaryToPrimitive(r,t){if("string"===t)var e=["toString","valueOf"];else e=["valueOf","toString"];for(var i=0;i<e.length;++i){var n=e[i],a=Get(r,n);if(IsCallable(a)){var o=Call(a,r);if("object"!==Type(o))return o}}throw new TypeError("Cannot convert to primitive.")}function ToPrimitive(e){var t=arguments.length>1?arguments[1]:undefined;if("object"===Type(e)){if(arguments.length<2)var i="default";else t===String?i="string":t===Number&&(i="number");var r="function"==typeof self.Symbol&&"symbol"==typeof self.Symbol.toPrimitive?GetMethod(e,self.Symbol.toPrimitive):undefined;if(r!==undefined){var n=Call(r,e,[i]);if("object"!==Type(n))return n;throw new TypeError("Cannot convert exotic object to primitive.")}return"default"===i&&(i="number"),OrdinaryToPrimitive(e,i)}return e}function ToString(t){switch(Type(t)){case"symbol":throw new TypeError("Cannot convert a Symbol value to a string");case"object":return ToString(ToPrimitive(t,String));default:return String(t)}}function ToPropertyKey(r){var i=ToPrimitive(r,String);return"symbol"===Type(i)?i:ToString(i)}!function(){var e=Object.getOwnPropertyDescriptor,t=function(){try{return 1===Object.defineProperty(document.createElement("div"),"one",{get:function(){return 1}}).one}catch(e){return!1}},r={}.toString,n="".split;CreateMethodProperty(Object,"getOwnPropertyDescriptor",function c(o,i){var a=ToObject(o);a=("string"===Type(a)||a instanceof String)&&"[object String]"==r.call(o)?n.call(o,""):Object(o);var u=ToPropertyKey(i);if(t)try{return e(a,u)}catch(l){}if(HasOwnProperty(a,u))return{enumerable:!0,configurable:!0,writable:!0,value:a[u]}})}();CreateMethodProperty(Object,"keys",function(){"use strict";function t(){var t;try{t=Object.create({})}catch(r){return!0}return o.call(t,"__proto__")}function r(t){var r=n.call(t),e="[object Arguments]"===r;return e||(e="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===n.call(t.callee)),e}var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,o=Object.prototype.propertyIsEnumerable,c=!o.call({toString:null},"toString"),l=o.call(function(){},"prototype"),i=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],u=function(t){var r=t.constructor;return r&&r.prototype===t},a={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!a["$"+t]&&e.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{u(window[t])}catch(r){return!0}}catch(r){return!0}return!1}(),p=function(t){if("undefined"==typeof window||!f)return u(t);try{return u(t)}catch(r){return!1}};return function s(o){var u="[object Function]"===n.call(o),a=r(o),f="[object String]"===n.call(o),s=[];if(o===undefined||null===o)throw new TypeError("Cannot convert undefined or null to object");var y=l&&u;if(f&&o.length>0&&!e.call(o,0))for(var h=0;h<o.length;++h)s.push(String(h));if(a&&o.length>0)for(var g=0;g<o.length;++g)s.push(String(g));else for(var w in o)t()&&"__proto__"===w||y&&"prototype"===w||!e.call(o,w)||s.push(String(w));if(c)for(var d=p(o),$=0;$<i.length;++$)d&&"constructor"===i[$]||!e.call(o,i[$])||s.push(i[$]);return s}}());CreateMethodProperty(Object,"assign",function e(t,r){var n=ToObject(t);if(1===arguments.length)return n;var o,c,a,l,i=Array.prototype.slice.call(arguments,1);for(o=0;o<i.length;o++){var p=i[o];for(p===undefined||null===p?a=[]:(l="[object String]"===Object.prototype.toString.call(p)?String(p).split(""):ToObject(p),a=Object.keys(l)),c=0;c<a.length;c++){var b,y=a[c];try{var g=Object.getOwnPropertyDescriptor(l,y);b=g!==undefined&&!0===g.enumerable}catch(u){b=Object.prototype.propertyIsEnumerable.call(l,y)}if(b){var j=Get(l,y);n[y]=j}}}return n});})('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {});
}
......@@ -9,6 +9,11 @@
"text": MWF.xApplication.process.FormDesigner.LP.modules.el_input,
"className": "Elinput"
},
"elautocomplete": {
"fontIcon": "el-icon-finished",
"text": MWF.xApplication.process.FormDesigner.LP.modules.el_autocomplete,
"className": "Elautocomplete"
},
"elnumber": {
"fontIcon": "el-icon-edit-outline",
"text": MWF.xApplication.process.FormDesigner.LP.modules.el_number,
......
......@@ -96,6 +96,7 @@ MWF.xApplication.process.FormDesigner.Module.$ElElement = MWF.FC$ElElement = new
},
_resetVueModuleDomNode: function(callback){
if (!this.vm){
if (!this.node.hasClass("o2_vue")) this.node.addClass("o2_vue");
this.node.set("html", this._createElementHtml());
this._loadVue(function(){
this._mountVueApp(callback);
......
MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.$ElElement", null, false);
MWF.xApplication.process.FormDesigner.Module.Elinput = MWF.FCElinput = new Class({
Extends: MWF.FC$ElElement,
Implements: [Options, Events],
options: {
"style": "default",
"propertyPath": "../x_component_process_FormDesigner/Module/Elinput/elinput.html"
},
_initModuleType: function(){
this.className = "Elinput";
this.moduleType = "element";
this.moduleName = "elinput";
},
_createElementHtml: function(){
debugger;
//var html = "<el-input placeholder=\"请输入内容\"></el-input>";
var html = "<el-input";
if (this.json.description) html += " placeholder=\""+this.json.description+"\"";
html += " type=\""+(this.json.inputType || "text")+"\"";
if (this.json.maxlength) html += " maxlength=\""+this.json.maxlength+"\"";
if (this.json.showWordLimit) html += " show-word-limit";
if (this.json.clearable) html += " clearable";
if (this.json.showPassword) html += " show-password";
if (this.json.size && this.json.size!=="default") html += " size=\""+this.json.size+"\"";
html += " rows=\""+(this.json.textareaRows || "2")+"\"";
if (this.json.autosize){
var o = {};
if (this.json.minRows) o.minRows = this.json.minRows;
if (this.json.maxRows) o.maxRows = this.json.maxRows;
html += " autosize=\""+JSON.stringify(o)+"\"";
}
if (this.json.resize) html += " resize=\""+this.json.resize+"\"";
if (this.json.prefixIcon) html += " prefix-icon=\""+this.json.prefixIcon+"\"";
if (this.json.suffixIcon) html += " suffix-icon=\""+this.json.suffixIcon+"\"";
if (this.json.elProperties){
Object.keys(this.json.elProperties).forEach(function(k){
if (this.json.elProperties[k]) html += " "+k+"=\""+this.json.elProperties[k]+"\"";
}, this);
}
if (this.json.elStyles){
var style = "";
Object.keys(this.json.elStyles).forEach(function(k){
if (this.json.elStyles[k]) style += k+":"+this.json.elStyles[k]+";";
}, this);
html += " style=\""+style+"\"";
}
html += " value=\""+this.json.id+"\"></el-input>";
return html;
},
_createCopyNode: function(){
this.copyNode = new Element("div", {
"styles": this.css.moduleNodeShow
});
this.copyNode.addEvent("selectstart", function(){
return false;
});
},
_getCopyNode: function(){
if (!this.copyNode) this._createCopyNode();
this.copyNode.setStyle("display", "inline-block");
return this.copyNode;
},
setPropertyName: function(){
if (this.json.name){
var button = this.node.getElement("button");
if (!button) button = this.node.getFirst("input");
if (button) button.set("text", this.json.name);
}
},
setPropertyId: function(){
if (!this.json.name){
var button = this.node.getElement("button");
if (!button) button = this.node.getFirst("input");
if (button) button.set("text", this.json.id);
}
}
});
......@@ -23,7 +23,7 @@ MWF.xApplication.process.FormDesigner.Module.Elinput = MWF.FCElinput = new Class
if (this.json.showWordLimit) html += " show-word-limit";
if (this.json.clearable) html += " clearable";
if (this.json.showPassword) html += " show-password";
if (this.json.inputSize && this.json.inputSize!=="default") html += " size=\""+this.json.inputSize+"\"";
if (this.json.size && this.json.size!=="default") html += " size=\""+this.json.size+"\"";
html += " rows=\""+(this.json.textareaRows || "2")+"\"";
if (this.json.autosize){
......
......@@ -13,7 +13,7 @@
"height": "26px",
"line-height": "26px",
"padding": "0 10px",
"display": "inline-block"
"display": "block"
},
"moduleNodeShow": {
"border": "1px solid #333",
......
......@@ -13,6 +13,13 @@
<td class="editTableTitle">{{$.lp.description}}:</td>
<td class="editTableValue"><input type="text" name="description" value="text{$.description}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.readonly}}:</td>
<td class="editTableValue">
<input type="radio" name="isReadonly" value="true" text{($.isReadonly)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="isReadonly" value="false" text{(!$.isReadonly)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
</table>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
......@@ -61,10 +68,10 @@
<tr>
<td class="editTableTitle">{{$.lp.size}}:</td>
<td class="editTableValue">
<input type="radio" name="inputSize" value="default" text{(!$.inputSize || $.inputSize==='default')?'checked':''}/>default
<input type="radio" name="inputSize" value="medium" text{($.inputSize==='medium')?'checked':''}/>medium
<input type="radio" name="inputSize" value="small" text{($.inputSize==='small')?'checked':''}/>small
<input type="radio" name="inputSize" value="mini" text{($.inputSize==='mini')?'checked':''}/>mini
<input type="radio" name="size" value="default" text{(!$.size || $.inputSize==='default')?'checked':''}/>default
<input type="radio" name="size" value="medium" text{($.size==='medium')?'checked':''}/>medium
<input type="radio" name="size" value="small" text{($.size==='small')?'checked':''}/>small
<input type="radio" name="size" value="mini" text{($.size==='mini')?'checked':''}/>mini
</td>
</tr>
......@@ -105,6 +112,22 @@
<div class="MWFMaplist" name="elStyles" title="{{$.lp.style}}"></div>
<div class="MWFMaplist" name="elProperties" title="{{$.lp.attribute}}"></div>
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.compute}}:</td>
<td class="editTableValue">
<input type="radio" name="compute" value="create" text{(!$.compute || $.compute=='create')?'checked':''}/>{{$.lp.create}}
<input type="radio" name="compute" value="save" text{($.compute=='save')?'checked':''}/>{{$.lp.save}}
<input type="radio" name="compute" value="show" text{($.compute=='show')?'checked':''}/>{{$.lp.show}}
</td>
</tr>
</table>
<div class="MWFScriptArea" name="defaultValue" title="{{$.lp.defaultValue}} (S)"></div>
<div class="MWFValidation" name="validationConfig"></div>
<div class="MWFScriptArea" name="validation" title="{{$.lp.verificationScript}} (S)"></div>
</div>
<div title="Vue" class="MWFTab">
......
......@@ -16,6 +16,18 @@
"code": "",
"html": ""
},
"input": {
"code": "",
"html": ""
},
"change": {
"code": "",
"html": ""
},
"clear": {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
......
......@@ -57,4 +57,6 @@ MWF.xDesktop.requireApp("process.FormDesigner", "Module.Importer", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.ReadLog", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Elinput", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Elcommon", null, false);
MWF.xDesktop.requireApp("process.FormDesigner", "Module.Elautocomplete", null, false);
......@@ -334,6 +334,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"el_checkbox": "Checkbox",
"el_select": "Select",
"el_input": "Input",
"el_autocomplete": "autocomplete",
"el_cascader": "Cascader",
"el_number": "Number",
"el_switch": "Switch",
......
......@@ -333,6 +333,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"el_checkbox": "多选框",
"el_select": "选择器",
"el_input": "输入框",
"el_autocomplete": "自动完成框",
"el_cascader": "级联选择器",
"el_number": "计数器",
"el_switch": "开关",
......
o2.xDesktop.requireApp("process.Xform", "$ElModule", null, false);
o2.xDesktop.requireApp("process.Xform", "$Input", null, false);
o2.xApplication.process.Xform.$Elinput = o2.APP$Elinput = new Class({
Implements: [Events],
Extends: MWF.APP$ElModule,
});
Object.assign(o2.APP$Elinput.prototype, o2.APP$Input.prototype);
Object.assign(o2.APP$Elinput.prototype, {
__setValue: function(value){
this.moduleValueAG = null;
this._setBusinessData(value);
if (this.readonly || this.json.isReadonly) this.node.set("text", value);
this.fieldModuleLoaded = true;
return value;
},
__setData: function(data){
var old = this.getInputData();
this._setBusinessData(data);
this.json[this.json.id] = data;
if (this.readonly || this.json.isReadonly) this.node.set("text", value);
if (old!==data) this.fireEvent("change");
this.moduleValueAG = null;
},
getInputData: function(){
return this.json[this.json.id] || this._getBusinessData();
},
_loadNodeEdit: function(){
this.node.appendHTML(this._createElementHtml(), "before");
var input = this.node.getPrevious();
this.node.destroy();
this.node = input;
this.node.set({
"id": this.json.id,
"MWFType": this.json.type
});
this.node.addClass("o2_vue");
this._createVueApp();
},
_loadDomEvents: function(){
Object.each(this.json.events, function(e, key){
if (e.code){
if (this.options.moduleEvents.indexOf(key)===-1 && this.options.elEvents.indexOf(key)===-1){
this.node.addEvent(key, function(event){
return this.form.Macro.fire(e.code, this, event);
}.bind(this));
}
}
}.bind(this));
},
_afterLoaded: function(){}
})
......@@ -9,6 +9,25 @@ o2.xApplication.process.Xform.$ElModule = MWF.APP$ElModule = new Class(
{
Implements: [Events],
Extends: MWF.APP$Module,
options: {
/**
* 组件加载前触发。
* @event MWF.xApplication.process.Xform.$Module#queryLoad
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 组件加载时触发.
* @event MWF.xApplication.process.Xform.$Module#load
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
/**
* 组件加载后触发.
* @event MWF.xApplication.process.Xform.$Module#postLoad
* @see {@link https://www.yuque.com/o2oa/ixsnyt/hm5uft#i0zTS|组件事件说明}
*/
"moduleEvents": ["load", "queryLoad", "postLoad"],
"elEvents": ["focus", "blur", "change", "input", "clear"]
},
/**
* @summary 组件的配置信息,同时也是Vue组件的data。
* @member MWF.xApplication.process.Xform.Elinput#json {JsonObject}
......@@ -66,13 +85,16 @@ o2.xApplication.process.Xform.$ElModule = MWF.APP$ElModule = new Class(
_createVueExtend: function(){
var _self = this;
return {
var app = {
data: this._createVueData(),
mounted: function(){
_self._afterMounted(this.$el);
}
};
this.appendVueExtend(app);
return app;
},
appendVueExtend: function(app){},
_createVueData: function(){
if (this.json.vueData && this.json.vueData.code){
var d = this.form.Macro.exec(this.json.vueData.code, this);
......@@ -95,7 +117,6 @@ o2.xApplication.process.Xform.$ElModule = MWF.APP$ElModule = new Class(
this.fireEvent("load");
},
_loadVueCss: function(){
debugger;
if (this.styleNode){
this.node.removeClass(this.styleNode.get("id"));
}
......
......@@ -419,8 +419,10 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
},
getBusinessDataById: function(d){
var data = d || this.form.businessData.data;
var evdata = this.form.Macro.environment.data;
//对id类似于 xx..0..xx 的字段进行拆分
if(this.json.id.indexOf("..") < 1){
if (!data.hasOwnProperty(this.json.id)) evdata.add(this.json.id, data[this.json.id]||"");
return data[this.json.id];
}else{
var idList = this.json.id.split("..");
......@@ -434,8 +436,11 @@ MWF.xApplication.process.Xform.$Module = MWF.APP$Module = new Class(
if( !id && id !== 0 )return null;
if( ["object","array"].contains(o2.typeOf(data)) ){
if( i === lastIndex ){
if (!data.hasOwnProperty(id)) evdata.add(id, data[id]||"");
return data[id];
}else{
if (!data.hasOwnProperty(id)) evdata.add(id, {});
evdata = evdata[id];
data = data[id];
}
}else{
......
......@@ -33,15 +33,15 @@ o2.xApplication.process.Xform.Elcommon = o2.APPElcommon = new Class(
// }
// },
//
// _loadUserInterface: function(){
// this.node.set("html", this._createElementHtml());
// this.node.set({
// "id": this.json.id,
// "MWFType": this.json.type
// });
// this.node.addClass("o2_vue");
// this._createVueApp();
// },
_loadUserInterface: function(){
this.node.set("html", this._createElementHtml());
this.node.set({
"id": this.json.id,
"MWFType": this.json.type
});
this.node.addClass("o2_vue");
this._createVueApp();
},
// _createVueApp: function(){
// if (!this.vm) this._loadVue(this._mountVueApp.bind(this));
// },
......@@ -65,6 +65,7 @@ o2.xApplication.process.Xform.Elcommon = o2.APPElcommon = new Class(
// },
_createVueExtend: function(){
debugger;
var app = {};
if (this.json.vueApp && this.json.vueApp.code) app = this.form.Macro.exec(this.json.vueApp.code, this);
if (app.data){
......
o2.xDesktop.requireApp("process.Xform", "$Module", null, false);
o2.xDesktop.requireApp("process.Xform", "$Elinput", null, false);
/** @class Elinput 基于Element UI的输入框组件。
* @example
* //可以在脚本中获取该组件
......@@ -11,11 +11,15 @@ o2.xDesktop.requireApp("process.Xform", "$Module", null, false);
* @o2range {Process|CMS|Portal}
* @hideconstructor
*/
o2.xApplication.process.Xform.Elinput = MWF.APPElinput = new Class(
v = MWF.APPElinput = new Class(
/** @lends o2.xApplication.process.Xform.Elinput# */
{
Implements: [Events],
Extends: MWF.APP$ElModule,
Extends: MWF.APP$Elinput,
options: {
"moduleEvents": ["load", "queryLoad", "postLoad"],
"elEvents": ["focus", "blur", "change", "input", "clear"]
},
/**
* @summary 组件的配置信息,同时也是Vue组件的data。
* @member MWF.xApplication.process.Xform.Elinput#json {JsonObject}
......@@ -29,26 +33,65 @@ o2.xApplication.process.Xform.Elinput = MWF.APPElinput = new Class(
* json.disabled = true; //设置输入框为禁用
*/
_appendVueData: function(){
if (!this.json.size) this.json.size = "";
if (!this.json.bttype) this.json.bttype = "";
if (!this.json.plain) this.json.plain = false;
if (!this.json.round) this.json.round = false;
if (!this.json.circle) this.json.circle = false;
if (!this.json[this.json.id]){
this.json[this.json.id] = this._getBusinessData();
// this.value = this._getBusinessData();
// Object.defineProperty(this.json, this.json.id, {
// "configurable": true,
// "enumerable": true,
// "get": function(){
// return this.value;
// }.bind(this),
// "set": function(v){
// this._setEnvironmentData(v);
// this.value = v;
// }.bind(this),
// });
}
if (!this.json.maxlength) this.json.maxlength = "";
if (!this.json.minlength) this.json.minlength = "";
if (!this.json.showWordLimit) this.json.showWordLimit = false;
if (!this.json.showPassword) this.json.showPassword = false;
if (!this.json.disabled) this.json.disabled = false;
if (!this.json.loading) this.json.loading = false;
if (!this.json.clearable) this.json.clearable = false;
if (!this.json.size) this.json.size = "";
if (!this.json.prefixIcon) this.json.prefixIcon = "";
if (!this.json.suffixIcon) this.json.suffixIcon = "";
if (!this.json.rows) this.json.rows = "2";
if (!this.json.autosize) this.json.autosize = false;
if (!this.json.readonly) this.json.readonly = false;
if (!this.json.resize) this.json.resize = "none";
},
appendVueExtend: function(app){
if (!app.methods) app.methods = {};
app.methods.$loadElEvent = function(ev){
alert(ev);
//return this.form.Macro.fire(e.code, this, event);
}.bind(this)
},
_createElementHtml: function(){
debugger;
var html = "<el-button";
html += " :size=\"size\"";
html += " :type=\"bttype\"";
html += " :plain=\"plain\"";
html += " :round=\"round\"";
html += " :circle=\"circle\"";
var html = "<el-input";
html += " v-model=\""+this.json.id+"\"";
html += " :maxlength=\"maxlength\"";
html += " :minlength=\"minlength\"";
html += " :show-word-limit=\"showWordLimit\"";
html += " :show-password=\"showPassword\"";
html += " :disabled=\"disabled\"";
html += " :loading=\"loading\"";
html += " :size=\"size\"";
html += " :prefix-icon=\"prefixIcon\"";
html += " :suffix-icon=\"suffixIcon\"";
html += " :rows=\"rows\"";
html += " :autosize=\"autosize\"";
html += " :readonly=\"readonly\"";
html += " :resize=\"resize\"";
html += " :clearable=\"clearable\"";
html += " :type=\"inputType\"";
html += " :placeholder=\"description\"";
if (this.json.autofocus==="yes") html += " autofocus";
Object.keys(this.options.elEvents).forEach(function(k){
html += " @"+k+"=\"$loadElEvent("+k+")\"";
});
if (this.json.elProperties){
Object.keys(this.json.elProperties).forEach(function(k){
......@@ -64,7 +107,7 @@ o2.xApplication.process.Xform.Elinput = MWF.APPElinput = new Class(
html += " style=\""+style+"\"";
}
html += ">"+((this.json.circle!=="yes" && this.json.isText!=="no") ? (this.json.name || this.json.id) : "")+"</el-button>";
html += ">"+((this.json.circle!=="yes" && this.json.isText!=="no") ? (this.json.name || this.json.id) : "")+"</el-input>";
return html;
}
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册