主题切换
view/methods 系统方法
系统方法示例
js
//新增按钮执行事件
add() {
this.baseAdd();
}
//编辑按钮执行事件
edit() {
this.baseEdit();
}
//删除按钮执行事件
del() {
this.baseDel();
}
//禁用状态
deactivateData() {
this.baseEnable(0);
}
//启用状态
enableData() {
this.baseEnable();
}
//分派
assign() {
this.baseAssign();
}
//统一更新
batchUpdate() {
this.baseBatchUpdate();
}
//团队共享
teamSharing() {
this.baseTeamSharing();
}
//导入
importData() {
this.baseImportData()
}
//导出
exportData(options) {
this.baseExportData(options)
}
//加载禁用(设置statu值为true)
showLoading()
//解除禁用(延时(t)设置statu值为false)
hideLoading(t = 1500)
//刷新
refresh()
//打开表单
open(options)
//复制数据新增
baseCopyData(options)
//按钮显示和隐藏
baseBtnsStatus(options)
//作为关联视图获取父级表单数据 verificatio是否验证
baseGetParentFormData(verification = true).then(res => {
console.log(res);
})
//关联时 刷新主表+关联视图 同form(表单)refresh方法
baseRelationRefresh(statu = true, list)
//与其他组件进行交互(注:本组件只在设计器内调用生效)
beseDoComponentEvent(options)API 明细
open(options)
打开表单。
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
options | 传入参数 {id,title,width} | Object | - |
| options 字段 | 说明 | 类型 | 默认值 |
|---|---|---|---|
id | 数据ID (非必传) | String | Number | - |
title | 标题 | String | - |
width | 宽度 | String(px/%) | - |
js
this.open({title: '新增',id: 1,width:'800px'})baseBtnsStatus(options)
按钮显示和隐藏。
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
options | 传入参数 {type,list,field,time} | Object | - |
| options 字段 | 说明 | 类型 | 默认值 |
|---|---|---|---|
type | 类型:show/hide | String | show |
list | 操作的数据 | Array | [] |
field | 匹配字段名 | String | id |
manner | 匹配方式:default/single | String | default |
time | 延时时间 | Number | 100 |
js
this.baseBtnsStatus({type: 'show',list: [1,2]});
this.baseBtnsStatus({type: 'hide',list: [1,2],field:'id',manner:'single'})
this.baseBtnsStatus({type: 'hide',list: [1,2],field:'id',time:500})baseGetParentFormData(verification)
作为关联视图获取父级表单数据。
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
verification | 获取数据时是否验证主表单(from)(非必传) | Boolean | false |
js
this.baseGetParentFormData(false).then(res=>{
console.log(res)
})baseRelationRefresh(statu, list)
作为关联组件使用时刷新主表+关联视图。
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
statu | 是否刷新主表单 | Boolean | true |
list | 指定主表单(from)关联视图(componentItem值)列表数据;非必传,默认全部 | Array | 全部 |
js
this.baseRelationRefresh();
this.baseRelationRefresh(true,[1,2,...])baseEnable( t=1 ) 1启用 0停用
禁用/启用状态返回数据说明。
| 返回字段 | 说明 | 类型 | 默认值 |
|---|---|---|---|
action | 确认状态:cancel/confirm | String | - |
res | 接口响应数据 | null | Object | - |
js
this.baseBtnsStatus()
this.baseBtnsStatus().then(res=>{
console.log(res)
});beseDoComponentEvent(options)
与其他组件进行交互。
| 参数 | 说明 | 类型 | 默认值 |
|---|---|---|---|
key | 响应组件的key值(必传) | String | - |
functionName | 响应组件的方法名(必传) | String | - |
data | 传入响应组件的数据 | Any | - |
callback | 是否需要回调(非必传) | Boolean | false |
callbackComponents | 回调的组件key(非必传) | String | - |
callbackFunction | 回调的组件响应的方法名(非必传) | String | - |
js
//只执行调用
this.baseBtnsStatus({
key: key,
functionName: functionName,
data: data,
});
//执行调用后有事件回调(只有部分组件和系统方法有回调,详见设计器组件内部组件说明)
this.baseBtnsStatus({
key: key,
functionName: functionName,
data: data,
callback: callback,
callbackComponents: callbackComponents,
callbackFunction: callbackFunction
})方法速查
| 方法 | 说明 |
|---|---|
baseAdd | 打开新增流程 |
baseEdit | 打开编辑流程 |
baseDel | 删除当前或选中数据 |
baseEnable | 启用或禁用数据 |
baseAssign | 分派业务 |
baseBatchUpdate | 统一更新 |
baseImportData | 导入数据 |
baseExportData | 导出数据 |
showLoading | 打开加载态 |
hideLoading | 关闭加载态 |
refresh | 刷新视图 |
open | 打开表单或窗口 |
baseBtnsStatus | 控制按钮显隐 |
baseGetParentFormData | 获取父级表单数据 |
baseRelationRefresh | 刷新主表与关联视图 |
beseDoComponentEvent | 与其他组件通信 |