o2.xdesktop.requireapp("process.xform", "$elinput", null, false);
/** @class elinput 基于element ui的评分组件。
* @o2cn 评分组件
* @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
* @see {@link https://element.eleme.cn/#/zh-cn/component/rate|element ui rate 评分}
*/
mwf.xapplication.process.xform.elrate = mwf.appelrate = new class(
/** @lends o2.xapplication.process.xform.elrate# */
{
implements: [events],
extends: mwf.app$elinput,
options: {
"moduleevents": ["load", "queryload", "postload"],
/**
* 分值改变时触发 。this.event[0]为改变后的分值
* @event mwf.xapplication.process.xform.elrate#change
* @see {@link https://element.eleme.cn/#/zh-cn/component/rate|评分组件的events章节}
*/
"elevents": ["change"]
},
// _loadnode: function(){
// debugger;
// if (this.isreadonly()) this.json.disabled = true;
// this._loadnodeedit();
// },
_appendvuedata: function(){
if (!this.json.max) this.json.max = "";
if (!this.json.isreadonly && !this.form.json.isreadonly) this.json.isreadonly = false;
if (!this.json.max) this.json.max = 5;
if (!this.json.allowhalf) this.json.allowhalf = false;
if (!this.json.lowthreshold) this.json.lowthreshold = 2;
if (!this.json.highthreshold) this.json.highthreshold = 4;
this.json.colors = [
this.json.lowcolor, this.json.mediumcolor, this.json.highcolor
];
if( this.json.showafter === "text" ){
this.json.showtext = true;
this.json.showscore = false;
}else if( this.json.showafter === "score" ){
this.json.showtext = false;
this.json.showscore = true;
}else{
this.json.showtext = false;
this.json.showscore = false;
}
if( o2.typeof(this.json.texts) === "string"){
this.json.texts = this.json.texts.split(",");
}
if(!this.json.textcolor)this.json.textcolor = "";
},
// 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 = "