App4Update
提示
App4Update 是基于 BasicForm 和 App1 封装的组件。理论上支持其所有功能。【若发现暂不支持的属性,请及时反馈!!!】
# 一、属性
# mainGrid
object
# mainGrid.hiddenToolbar
boolean | (editType) => boolean
是否隐藏默认的按钮组。
默认值: false
# mainGrid.tbar
array
提示
可通过修改 tbar 默认配置,自定义保存。示例代码如下:
mainGrid: {
// ...
tbar: [
// {
// btnId: 'save',
// text: '保存',
// iconCls: 'save'
// }
{
btnId: 'customSave',
text: '保存',
iconCls: 'save',
method: (params) => this.customSave()
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# detailGridList
object | array
# app
string
标记当前组件是在哪个功能组件中使用的。
默认值: 'app4Update'
# height
number
组件高度。
# formData
object
表单数据。
# 二、方法
# getForm()
获取表单实例。相当于 BasicForm - getForm()。
# getAppDetail(index)
获取表格实例对象。相当于 App1-getAppMain()。
参数说明:
index: number
: 表格所在索引位置
# getFormData()
获取表单数据。
# resetFormGrid()
重置表单、表格数据。
# tOk()
保存方法。
# buildSaveData()
构建保存数据。
# 三、事件
# tSaveBefore
({ that, formRef, detailGridRefs, data, proData, back }) => void
保存前执行。
参数说明:
- obj
that: object
: 当前组件的实例对象 不建议使用formRef: object
: 表单对象 推荐detailGridRefs: array
: 表格对象 推荐data: object
: 数据对象,不一定是待保存数据proData: (data) => void
: 处理数据对象,将其转为待待保存数据back: (continueExec) => void
: 是否需要拦截后续代码时调用,默认继续执行。back(false)
即可拦截。
# tSaveAfter
({ that, formRef, detailGridRefs, toolbar, params, res }) => void
保存后执行。
参数说明:
- obj
that: object
: 当前组件的实例对象 不建议使用formRef: object
: 表单对象 推荐detailGridRefs: array
: 表格对象 推荐toolbar: object
: 按钮配置对象params: object
: 接口请求参数res: object
: 接口响应结果
# formGridChangedBefore
({ grid, columns, value, row, rowIndex, column, columnIndex, formData, back }) => void
表单或表格中输入组件的值变化事件。
参数说明:
- obj
grid: object
: 表格实例对象columns: object
: 列配置对象value: string | number | boolean
: 输入组件的值row: object
: 行记录rowIndex: number
: 行索引位置column: object
: vxe-table 列对象columnIndex: number
: 列索引位置back: (continueExec) => void
: 是否需要拦截后续代码时调用,默认继续执行。back(false)
即可拦截。
# formGridChanged
({ grid, columns, value, row, rowIndex, column, columnIndex, formData }) => void
表单或表格中输入组件的值变化事件。
参数说明:
- obj
grid: object
: 表格实例对象columns: object
: 列配置对象value: string | number | boolean
: 输入组件的值row: object
: 行记录rowIndex: number
: 行索引位置column: object
: vxe-table 列对象columnIndex: number
: 列索引位置