跳到主要内容

模态

开发准备​

打开自定义模态​

使用说明:建议在vue组件开发中使用;当content是vue组件时,就只能用在组件开发中使用(V3版本后,可以弹出自定义vue组件)

this.$modal.show({  
title: '标题',
content: xxx,
fullscreen: false,
showFooter: false,
width: '300px | 50%',
customClass: 'xxx',
componentParams: {},
componentOn: {}
});

支持版本​

V8.8.3

输入参数​

参数类型必填说明
titlestring否模态标题
vueComponentId(新增)string否配置了此id,会优先加载此id对应的自定义vue组件
contentstring / htmlString / vue组件是需要打开的模态内容,根据contentRenderType来渲染成字符串、html、vue组件
contentRenderTypeenum(string、html、component)否用来描述模态内容的渲染方式,默认string。1. string表示content是一个字符串;2. html表示content是一个html字符串;3. component表示content是一个组件
componentParamsobject否弹框内容为组件渲染时的组件传参(contentRenderType为component时有效)
componentOnobject否弹框内容为组件渲染时的组件事件绑定(contentRenderType为component时有效)
fullScreenbool否模态展示是否全屏模式
showFooterbool否是否显示底部的确定取消区域(PC端可用)
needConfirmbool否是否显示确认标识(PC端可用)
positionenum(left、right、top、bottom、center)否弹框位置,fullScreen为false时有效,默认center(移动端可用)
roundbool否圆角模式,设置为true之后,模态的边框用圆角展示(移动端可用)
widthpx / %否模态宽度,可以指定像素或百分比
heightpx / %否模态高度,可以指定像素或百分比
minWidthpx / %否模态最小宽度
minHeightpx / %否模态最小高度
maxWidthpx / %否模态最大宽度
maxHeightpx / %否模态最大高度
modalStyleobject否模态样式
beforeConfirmHandlerfunction否确定之前的回调
confirmHandlerfunction否确定之后的回调
cancelHandlerfunction否取消回调

返回内容​

无


消息提示(message)​

message目前支持warning、error、info。

this.$message({  
type: "warning",
message: "保存失败"
});

输入参数​

参数类型必填说明
typeenum('warning', 'error', 'info')否warning:警告类型;error:错误类型;info:普通类型。默认'info'
messagestring是消息内容

返回内容​

无

返回数据样例​

无


弹框(alert)​

this.$alert('保存失败,是否继续', '提示', {  
confirmButtonText: '确定',
cancelButtonText: '取消',
showCancelButton: true
}).then(function () {
// 确定回调
}).catch(function () {
// 取消回调
});

输入参数​

参数类型必填说明
messagestring否内容
titlestring否标题
optionsobject否扩展选项
confirmButtonTextstring否确定按钮显示的名称
cancelButtonTextstring否取消按钮显示的名称
showCancelButtonbool否是否显示取消按钮

返回内容​

无

返回数据样例​

无


打开选人控件​

this.$modal.selectPerson({
isMultiple: true,
filter: [],
confirmHandler: () => {
// 确认的回调
},
cancelHandler: () => {
// 取消的回调
}
});

支持版本​

V8.8.3

输入参数​

参数类型必填说明
isMultiplebool否是否是多选,默认false
filterarray否数据过滤范围
confirmHandlerfunction否确认的回调,回调入参:data(选中的数据)
cancelHandlerfunction否取消的回调

返回内容​

无

返回数据样例​

无


打开组织机构弹框​

this.$modal.selectDepartment({
isMultiple: true,
filter: [],
onlyCheckLeafNode: false,
confirmHandler: () => {
// 确认的回调
},
cancelHandler: () => {
// 取消的回调
}
});

支持版本​

V8.8.3

输入参数​

参数类型必填说明
isMultiplebool否是否是多选,默认false
filterarray否数据过滤范围
onlyCheckLeafNodebool否只能选叶子节点
confirmHandlerfunction否确认的回调,回调入参:data(选中的数据)
cancelHandlerfunction否取消的回调

返回内容​

无

返回数据样例​

无


打开链接地址​

this.$modal.openLink({  
url: 'xxx',
closeHandler: () => {
// 关闭的回调
}
});

支持版本​

V8.8.3

输入参数​

参数类型必填说明
urlstring是url地址,地址里可以配置占位符{Custom_xxx}来获取环境变量,也可以配置占位符{User_xxx}来获取用户信息
closeHandlerfunction否关闭的回调

返回内容​

无

返回数据样例​

无


打开字段选择弹窗​

this.$modal.selectField({
formCode: 'xxx',
isMultiple: true,
filter: [
{
type: 'code', // 根据code过滤
codes: ['f_xx']
},
{
type: 'fieldType', // 根据字段类型过滤
fieldTypes: ['Text']
},
{
type: 'system', // 过滤系统字段
codes: ['CreateBy', 'State'],
fieldTypes: ['DefaultComponent']
},
{
type: 'main', // 过滤主表字段
codes: ['f_xx'],
fieldTypes: ['DefaultComponent']
},
{
type: 'sub', // 过滤子表
codes: ['xxx']
},
{
type: 'subCode', // 过滤子表字段
filter: [
{
type: 'code',
subCode: 'xxx',
codes: ['f_xx'],
fieldTypes: ['DefaultComponent']
},
{
type: 'fieldType',
fieldTypes: ['Text']
}
]
}
],
confirmHandler: () => {
// 确认的回调
},
cancelHandler: () => {
// 取消的回调
}
});

支持版本​

V8.8.3

输入参数​

参数类型必填说明
formCodestring是功能code
isMultiplebool否是否是多选,默认false
confirmHandlerfunction否确认的回调,回调入参:data(选中的数据)
cancelHandlerfunction否取消的回调

返回内容​

无

返回数据样例​

无


打开功能选择弹窗​

this.$modal.selectAppItem({
isMultiple: true,
confirmHandler: () => {
// 确认的回调
},
cancelHandler: () => {
// 取消的回调
}
});

支持版本​

V8.8.3

输入参数​

参数类型必填说明
isMultiplebool否是否是多选,默认false
confirmHandlerfunction否确认的回调,回调入参:data(选中的数据)
cancelHandlerfunction否取消的回调

返回内容​

无

返回数据样例​

无