提交 ce992ec8 编写于 作者: U unknown

VUE-Element

上级 0c6ee21b
MWF.xApplication.process.FormDesigner.Module = MWF.xApplication.process.FormDesigner.Module || {};
MWF.xDesktop.requireApp("process.FormDesigner", "Module.$ElElement", null, false);
MWF.xApplication.process.FormDesigner.Module.Eldatetime = MWF.FCEldatetime = new Class({
Extends: MWF.FC$ElElement,
Implements: [Options, Events],
options: {
"style": "default",
"propertyPath": "../x_component_process_FormDesigner/Module/Eldatetime/eldatetime.html"
},
_initModuleType: function(){
this.className = "Eldatetime";
this.moduleType = "element";
this.moduleName = "eldatetime";
},
_createElementHtml: function(){
//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")+"\"";
html += " :placeholder=\"description\"";
html += " :type=\"inputType\"";
html += " :maxlength=\"maxlength\"";
html += " :show-word-limit=\"showWordLimit\"";
html += " :clearable=\"clearable\"";
html += " :show-password=\"showPassword\"";
html += " :size=\"size\"";
html += " :rows=\"rows\"";
html += " :resize=\"resize\"";
html += " :prefix-icon=\"prefixIcon\"";
html += " :suffix-icon=\"suffixIcon\"";
// 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);
}
html += " :style=\"elStyles\"";
// 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=\"id\">";
if (this.json.vueSlot) html += this.json.vueSlot;
html += "</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 input = this.node.getElement("input");
if (input) input.set("value", this.json.name);
}
},
setPropertyId: function(){
if (!this.json.name){
var input = this.node.getElement("input");
if (input) input.set("value", this.json.id);
}
}
});
{
"moduleNodeMove": {
"border-radius": "5px",
"border": "1px solid #ffa200",
"overflow": "hidden",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "absolute",
"z-index": 10002,
"opacity": 0.7,
"cursor": "move",
"height": "26px",
"line-height": "26px",
"padding": "0 10px",
"display": "block"
},
"moduleNodeShow": {
"border": "1px solid #333",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"top": "auto",
"left": "auto",
"width": "18px",
"height": "2px",
"opacity": 0.5,
"display": "inline-block",
"background": "#ffa200"
},
"moduleNode": {
"border-radius": "5px",
"border-top": "1px dashed #999",
"border-left": "1px dashed #999",
"border-right": "1px dashed #999",
"border-bottom": "1px dashed #999",
"overflow": "hidden",
"cursor": "pointer",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"top": "auto",
"left": "auto",
"opacity": 1,
"display": "inline-block"
},
"moduleNodeError": {
"border-radius": "5px",
"border-top": "1px dashed #999",
"border-left": "1px dashed #999",
"border-right": "1px dashed #999",
"border-bottom": "1px dashed #999",
"height": "40px",
"width": "200px",
"overflow": "hidden",
"cursor": "pointer",
"margin": "3px",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"position": "static",
"top": "auto",
"left": "auto",
"opacity": 1,
"display": "inline-block"
},
"buttonIcon": {
"height": "26px",
"cursor": "pointer",
"border": "0px",
"margin": "0px"
}
}
<div style="background-color: #FFF; overflow: hidden">
<div title="{{$.lp.base}}" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.id}}:</td>
<td class="editTableValue"><input type="text" name="id" value="text{$.id}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.name}}:</td>
<td class="editTableValue"><input type="text" name="name" value="text{$.name}" class="editTableInput"/></td>
</tr>
<tr>
<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">
<tr>
<td class="editTableTitle">{{$.lp.max}}:</td>
<td class="editTableValue"><input type="number" name="max" value="text{$.max}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.min}}:</td>
<td class="editTableValue"><input type="number" name="min" value="text{$.min}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.step}}:</td>
<td class="editTableValue"><input type="number" name="step" value="text{$.step || '1'}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableValue" colspan="2"><b>{{$.lp.step_strictly}}:</b>
<input type="radio" name="stepStrictly" value="true" text{($.stepStrictly===true)?'checked':''}/>{{$.lp.yes}}
<input type="radio" name="stepStrictly" value="false" text{($.stepStrictly!==true)?'checked':''}/>{{$.lp.no}}
</td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.precision}}:</td>
<td class="editTableValue"><input type="number" name="precision" value="text{$.precision || 0}" class="editTableInput"/></td>
</tr>
<tr>
<td class="editTableTitle">{{$.lp.size}}:</td>
<td class="editTableValue">
<input type="radio" name="size" value="default" text{(!$.size || $.size==='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>
<!-- <tr>-->
<!-- <td class="editTableValue" colspan="2"><b>{{$.lp.controls}}:</b>-->
<!-- <input type="radio" name="controls" value="true" text{($.showPassword!==false)?'checked':''}/>{{$.lp.yes}}-->
<!-- <input type="radio" name="controls" value="false" text{($.showPassword===false)?'checked':''}/>{{$.lp.no}}-->
<!-- </td>-->
<!-- </tr>-->
<tr>
<td class="editTableTitle">{{$.lp.controlsPosition}}:</td>
<td class="editTableValue">
<input type="radio" name="controlsPosition" value="default" text{(!$.controlsPosition || $.controlsPosition!=='right')?'checked':''}/>default
<input type="radio" name="controlsPosition" value="right" text{($.controlsPosition==='right')?'checked':''}/>right
</td>
</tr>
</table>
<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">
<div onclick="var node = this.getNext(); node.setStyle('display', ((node.getStyle('display')!='none') ? 'none': 'block'))" style="cursor: pointer; height:24px; padding-left: 5px; line-height: 24px; background-color: #EEE; border-bottom: 1px solid #999;font-weight:bold;">Vue Data</div>
<div style="display: text{($.vueData && $.vueData.code) ? 'block': 'none'}" class="MWFScriptArea" name="vueData" title="Vue Data (S)"></div>
<div onclick="var node = this.getNext(); node.setStyle('display', ((node.getStyle('display')!='none') ? 'none': 'block'))" style="cursor: pointer; height:24px; padding-left: 5px; line-height: 24px; background-color: #EEE; border-bottom: 1px solid #999;font-weight:bold;">Vue Method</div>
<div div style="display: text{($.vueMethods && $.vueMethods.code) ? 'block': 'none'}" class="MWFScriptArea" name="vueMethods" title="Vue Methods (S)"></div>
<div onclick="var node = this.getNext(); node.setStyle('display', ((node.getStyle('display')!='none') ? 'none': 'block'))" style="cursor: pointer; height:24px; padding-left: 5px; line-height: 24px; background-color: #EEE; border-bottom: 1px solid #999;font-weight:bold;">Vue CSS</div>
<div div style="display: text{($.vueCss && $.vueCss.code) ? 'block': 'none'}" class="MWFCssArea" name="vueCss" title="Vue Css (S)"></div>
<div onclick="var node = this.getNext(); node.setStyle('display', ((node.getStyle('display')!='none') ? 'none': 'block'))" style="cursor: pointer; height:24px; padding-left: 5px; line-height: 24px; background-color: #EEE; border-bottom: 1px solid #999;font-weight:bold;">Vue Slots</div>
<div style="display: text{($.vueSlot) ? 'block' : 'none'}">
<div class="MWFHtmlEditorArea" name="vueSlot" title="Input Slot (HTML)"></div>
</div>
</div>
<div title="{{$.lp.section}}" class="MWFTab">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.enableSection}}:</td>
<td class="editTableValue">
<input onclick="if (this.checked){ $('text{$.pid}sectionByEditArea').setStyle('display', 'block')}" type="radio" name="section" value="yes" text{($.section=='yes')?'checked':''}/>{{$.lp.yes}}
<input onclick="if (this.checked){ $('text{$.pid}sectionByEditArea').setStyle('display', 'none')}" type="radio" name="section" value="no" text{($.section!='yes')?'checked':''}/>{{$.lp.no}}
</td>
</tr>
</table>
<div id="text{$.pid}sectionByEditArea" style="display: text{($.section=='yes')?'block':'none'};">
<table width="100%" border="0" cellpadding="5" cellspacing="0" class="editTable">
<tr>
<td class="editTableTitle">{{$.lp.sectionBy}}:</td>
<td class="editTableValue">
<input class="editTableRadio" onclick="if (this.checked){ $('text{$.pid}sectionByScriptEditArea').setStyle('display', 'none');}" name="sectionBy" text{(($.sectionBy=='person') || ($.sectionBy!='unit' && $.sectionBy!='activity' && $.sectionBy!='script'))?'checked':''} type="radio" value="person"/>{{$.lp.handler}}<br/>
<input class="editTableRadio" onclick="if (this.checked){ $('text{$.pid}sectionByScriptEditArea').setStyle('display', 'none');}" name="sectionBy" text{($.sectionBy=='unit')?'checked':''} type="radio" value="unit"/>{{$.lp.handlerUnit}}<br/>
<input class="editTableRadio" onclick="if (this.checked){ $('text{$.pid}sectionByScriptEditArea').setStyle('display', 'none');}" name="sectionBy" text{($.sectionBy=='activity')?'checked':''} type="radio" value="activity"/>{{$.lp.activityId}}<br/>
<input class="editTableRadio" onclick="if (this.checked){ $('text{$.pid}sectionByScriptEditArea').setStyle('display', 'none');}" name="sectionBy" text{($.sectionBy=='splitValue')?'checked':''} type="radio" value="splitValue"/>{{$.lp.splitValue}}<br/>
<input class="editTableRadio" onclick="if (this.checked){ $('text{$.pid}sectionByScriptEditArea').setStyle('display', 'block');}" name="sectionBy" text{($.sectionBy=='script')?'checked':''} type="radio" value="script"/>{{$.lp.script}}<br/>
</td>
</tr>
</table>
<div id="text{$.pid}sectionByScriptEditArea" style="display: text{($.sectionBy=='script')?'block':'none'};">
<div class="MWFScriptArea" name="sectionByScript" title="{{$.lp.sectionBy}} (S)"></div>
</div>
</div>
</div>
<div title="{{$.lp.event}}" class="MWFTab">
<div class="MWFEventsArea" name="events"></div>
</div>
<div title="HTML" class="MWFTab">
<div class="MWFHTMLArea" style="width:100%; height:400px; border:0px;font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
<div title="JSON" class="MWFTab">
<div class="MWFJSONArea" style="font-family: Verdana, Geneva, sans-serif; font-size:14px"></div>
</div>
</div>
{
"id": "",
"name": "",
"type": "Eldatetime",
"description": "",
"isReadonly" : false,
"vueData": {},
"vueMethods": {},
"vueCss": {},
"vueSlot": "",
"elProperties": {},
"elStyles": {},
"events": {
"queryLoad": {
"code": "",
"html": ""
},
"postLoad": {
"code": "",
"html": ""
},
"load": {
"code": "",
"html": ""
},
"input": {
"code": "",
"html": ""
},
"change": {
"code": "",
"html": ""
},
"clear": {
"code": "",
"html": ""
},
"click": {
"code": "",
"html": ""
},
"dblclick": {
"code": "",
"html": ""
},
"keydown": {
"code": "",
"html": ""
},
"keypress": {
"code": "",
"html": ""
},
"keyup": {
"code": "",
"html": ""
},
"mousedown": {
"code": "",
"html": ""
},
"mousemove": {
"code": "",
"html": ""
},
"mouseout": {
"code": "",
"html": ""
},
"mouseover": {
"code": "",
"html": ""
},
"mouseup": {
"code": "",
"html": ""
},
"focus": {
"code": "",
"html": ""
},
"blur": {
"code": "",
"html": ""
}
},
"properties": {},
"class": "",
"styles": {},
"container": ""
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册