o2oa api: x-游戏厅捕鱼达人

source

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/slider|element ui slider 滑块}
 */
mwf.xapplication.process.xform.elslider = mwf.appelslider =  new class(
    /** @lends o2.xapplication.process.xform.elslider# */
    {
    implements: [events],
    extends: mwf.app$elinput,
    options: {
        "moduleevents": ["load", "queryload", "postload"],
        /**
         * 值改变时触发(使用鼠标拖曳时,只在松开鼠标后触发)。this.event[0]为改变后的值
         * @event mwf.xapplication.process.xform.elslider#change
         * @see {@link https://element.eleme.cn/#/zh-cn/component/slider|slider 滑块的 events章节}
         */
        /**
         * 数据改变时触发(使用鼠标拖曳时,活动过程实时触发)。this.event[0]为改变后的值
         * @event mwf.xapplication.process.xform.elslider#input
         * @see {@link https://element.eleme.cn/#/zh-cn/component/slider|slider 滑块的 events章节}
         */
        "elevents": ["change", "input"]
    },
    /**
     * @summary 组件的配置信息,同时也是vue组件的data。
     * @member mwf.xapplication.process.xform.elinput#json {jsonobject}
     * @example
     *  //可以在脚本中获取此对象,下面两行代码是等价的,它们获取的是同一个对象
     * var json = this.form.get("elinput").json;       //获取组件的json对象
     * var json = this.form.get("elinput").vm.$data;   //获取vue组件的data数据,
     *
     * //通过json对象操作element组件
     * json.disabled = true;     //设置输入框为禁用
     */
    // _loadnode: function(){
    //     if (this.isreadonly()) this.json.disabled = true;
    //     this._loadnodeedit();
    // },
    _loadmergereadcontentnode: function( contentnode, data ){
        contentnode.set("text", data.data);
    },
    _appendvuedata: function(){
        this.form.macro.environment.data.check(this.json.id);
        this.json[this.json.id] = this._getbusinessdata();
        if (!this.json.max || !this.json.max.tofloat()) this.json.max = 100;
        if (!this.json.min || !this.json.min.tofloat()) this.json.min = 0;
        this.json.min = this.json.min.tofloat();
        this.json.max = this.json.max.tofloat();
        if (!this.json.step || !this.json.step.tofloat()) this.json.step = 1;
        this.json.step = this.json.step.tofloat();
        if (this.json.showtooltip!==false) this.json.showtooltip = true;
        if (this.json.vertical && !this.json.height) this.json.height = "100px";
        if (!this.json.height) this.json.height = "";
        if (!this.json.inputsize) this.json.inputsize = "";
        if (!this.json.tooltipclass) this.json.tooltipclass = "";
        if (!this.json.disabled) this.json.disabled = false;
        if (this.json.marksscript && this.json.marksscript.code){
            this.json.marks = this.form.macro.exec(this.json.marksscript.code, this);
        }else{
            this.json.marks = {};
        }
    },
    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);
        if (this.json.formattooltip && this.json.formattooltip.code){
            var fun = this.form.macro.exec(this.json.formattooltip.code, this);
            if (o2.typeof(fun)==="function"){
                app.methods.$formattooltip = function(){
                    fun.apply(this, arguments);
                }.bind(this);
            }else{
                app.methods.$formattooltip = function(){};
            }
        }
    },
    _createelementhtml: function(){
        var html = "
网站地图