API
Component

ImportExcel ($UI/system/components/justep/restDataExcel/importExcel)

使用范围:UI2

Contents

component ImportExcel ($UI/system/components/justep/restDataExcel/importExcel) extends BindComponent

导入excel组件

Constructor Top

  ImportExcel ()
  ImportExcel ( options)

Properties Top

data

导入的Data xid,目前只支持bizData

to = DB

导入的数据方式,取值范围:"UI"/"DB"

Attributes Top

data

导入的Data xid,目前只支持bizData

to = DB

导入的数据方式,取值范围:"UI"/"DB"

xid

xid标识

Methods Top

Object get (String name)
Data getData ()
void importExcel ()
void set (json arg)

Operations Top

importExcel ()
void ImportExcel ()

Events Top

boolean onBeforeImport (BeforeEvent event)
void onError (ErrorEvent event)
void onSuccess (SuccessEvent event)
void onUploadStart (ViewEvent event)
void onUploadSuccess (ViewEvent event)

Constructor details Top

public ImportExcel ()

导入excel组件

public ImportExcel ( options)

构造函数

Inherited from ViewComponent

	
		参数options格式类似{parent:xx, config:{}},parent是组件的父节点,允许为空或不指定,config是组件的参数选项
	 

Parameters

options

参数选项

Properties Detail Top

public data

导入的Data xid,目前只支持bizData

public to = DB

导入的数据方式,取值范围:"UI"/"DB"

 
	UI:excel中的数据以新增方式导入UI;
	DB:将数据导入数据库

Attributes Detail Top

public data

导入的Data xid,目前只支持bizData

public to = DB

导入的数据方式,取值范围:"UI"/"DB"

 
	UI:excel中的数据以新增方式导入UI;
	DB:将数据导入数据库

public xid

xid标识

Methods Detail Top

public Object get (String name)

获取属性值

Parameters

String name

属性名称,取值范围:"data"

Return Value

Object

public Data getData ()

获取导入的data对象

Return Value

Data

public void importExcel ()

导入excel

	this.comp("excelImport1").importExcel();

Return Value

void

public void set (json arg)

设置属性值

Parameters

json arg

属性值对
结构如下:

{ "data" : {string} data xid, }

Return Value

void

Operations Detail Top

public importExcel ()

导入excel

public void ImportExcel ()

导入Excel

Return Value

void

Events Detail Top

public boolean onBeforeImport (BeforeEvent event)

[回调型事件]导入前

Parameters

BeforeEvent event


参数结构如下:

{ "source" : 组件的js对象 "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 "cancel" : 取消导入 }

Return Value

boolean

控制 导入动作是否继续

public void onError (ErrorEvent event)

[回调型事件]导入失败

Parameters

ErrorEvent event


参数结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 "message" : 导出错误信息, "result" : http请求返回 }

Return Value

void

public void onSuccess (SuccessEvent event)

[回调型事件]导入成功

Parameters

SuccessEvent event


参数结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 "response" : 返回的结果 }

Return Value

void

public void onUploadStart (ViewEvent event)

[回调型事件]开始提交Excel文件前

Parameters

ViewEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 }

Return Value

void

public void onUploadSuccess (ViewEvent event)

[回调型事件]提交Excel文件成功

Parameters

ViewEvent event


结构如下:

{ "source" : 组件的js对象, "bindingContext" : 组件绑定的上下文,包含$model、$object等具体请参考bindingContext说明 }

Return Value

void