o2oa api: elbutton | o2oa开发平台-游戏厅捕鱼达人

class

extends

elbutton 基于element ui的按钮组件。

usable range

process cms portal

see

example

//可以在脚本中获取该组件
//方法1:
var button = this.form.get("name"); //获取组件
//方法2
var button = this.target; //在组件事件脚本中获取

source

members

jsonjsonobject

组件的配置信息,同时也是vue组件的data。

type

  • jsonobject

example

//可以在脚本中获取此对象,下面两行代码是等价的,它们获取的是同一个对象
var json = this.form.get("elbutton").json;       //获取组件的json对象
var json = this.form.get("elbutton").vm.$data;   //获取vue组件的data数据,
//通过json对象操作element组件
json.bttype = "success"; //将按钮样式改为success
json.loading = true;     //将按钮显示为加载中状态
json.disabled = true;    //将按钮设置为禁用

source

parentlinemwf.xapplication.process.xform.datatemplate.line|mwf.xapplication.process.xform.datatablepc.line|mwf.xapplication.process.xform.datatablemobile.line

当前组件在数据表格或者数据模板中时,可以通过此属性获取所在行(条目)对象.

type

  • mwf.xapplication.process.xform.datatemplate.line | mwf.xapplication.process.xform.datatablepc.line | mwf.xapplication.process.xform.datatablemobile.line

example

//获取当前组件所在数据模板/数据表格的行(条目)对象
var line = this.target.parentline;
//获取当前字段所在行下标
var index = line.getindex();
//获取当前字段所在条目的subject字段的值
var data = line.getmodule("subject").getdata();
//设置当前字段所在条目的subject字段的值
line.getmodule("subject").setdata("test1");

source

methods

getsource(typeopt) → {source|subsource|subsourceitem}

当前组件在数据源组件中时,可以通过此方法获取所在的上级数据源/子数据源/子数项组件.

parameters

  • type string

    需要获取的类型,"source"为表示数据源,"subsource"表示子数据源,"subsourceitem"表示子数据项组件。 如果该参数省略,则获取离当前组件最近的上述组件。

returns

  • source subsource subsourceitem

example

var source = this.target.getsource(); //获取当前组件的所在子上级数据源/子数据源/子数项组件.
var data = source.data; //获取数据
var source = this.form.get("fieldid").getsource("source"); //获取数据源组件
var data = source.data; //获取数据

source

getparentmodule(typeopt, validatefunctionopt) → {mwf.xapplication.process.xform.$module}

获取当前组件所在的祖先组件.

parameters

  • type string

    需要获取的组件类型。 如果该参数省略,则获取离当前组件最近的祖先组件。type有效值如下:

    form- 表单
    common- 通用组件
    datatable- 数据表格
    datatableline- 数据表格行
    datatemplate- 数据模板
    datatemplateline- 数据模板行
    div- 容器组件
    elcommon- element通用组件
    elcontainer- element容器组件
    subform- 子表单
    source- 数据源组件
    subsource- 子数据源
    subsourceitem- 子数据项组件
    tab- 分页组件
    tabpage- 分页组件的某个分页
    table- 表格
    tabletd- 单元格
    widget- 部件
  • validatefunction function

    进一步校验,参数为获取到匹配到类型的组件,返回false继续往上取对应类型的组件,返回true返回该组件。

returns

example

var module = this.target.getparentmodule(); //获取最近的祖先。
var datatemplateline = this.target.getparentmodule("datatemplateline"); //获取当前组件所在的数据模板行.
var module = this.target.getparentmodule(null, function(module){
    return module.json.id === "div_1";
}); //获取当前组件id为div_1的父组件。

source

events

网站地图