提交 2093182e 编写于 作者: terrfly's avatar terrfly

infoBox迁移自mgr;

上级 5e3448df
...@@ -9,25 +9,37 @@ import { Modal } from 'ant-design-vue' ...@@ -9,25 +9,37 @@ import { Modal } from 'ant-design-vue'
// 确认提示: 标题, 内容, 点击确定回调函数, 取消回调, 扩展参数 // 确认提示: 标题, 内容, 点击确定回调函数, 取消回调, 扩展参数
export const confirmResult = { export const confirmResult = {
confirm: function (title, content, okFunc, cancelFunc = (() => {}), extConfig = {}) { confirm: function (title, content, okFunc, cancelFunc = (() => {}), extConfig = {}) {
Modal.confirm( return Modal.confirm(
Object.assign({ Object.assign({
okText: '确定', okText: '确定',
cancelText: '取消', cancelText: '取消',
title: title || '提示', title: title || '提示',
content: content, content: content,
onOk: okFunc, onOk: okFunc,
onCancel: cancelFunc, onCancel: cancelFunc,
confirmLoading: true confirmLoading: true
}, extConfig)) }, extConfig))
}, },
confirmPrimary: function (title, content, okFunc, cancelFunc = (() => {}), extConfig = {}) { confirmPrimary: function (title, content, okFunc, cancelFunc = (() => {}), extConfig = {}) {
this.confirm(title, content, okFunc, cancelFunc, Object.assign({ okType: 'primary' }, extConfig)) return this.confirm(title, content, okFunc, cancelFunc, Object.assign({ okType: 'primary' }, extConfig))
}, },
confirmDanger: function (title, content, okFunc, cancelFunc = (() => {}), extConfig = {}) { confirmDanger: function (title, content, okFunc, cancelFunc = (() => {}), extConfig = {}) {
this.confirm(title, content, okFunc, cancelFunc, Object.assign({ okType: 'danger' }, extConfig)) return this.confirm(title, content, okFunc, cancelFunc, Object.assign({ okType: 'danger' }, extConfig))
} },
modalError: function (title, content, okFunc = (() => {})) {
return Modal.error({ title: title, content: content, onOk: okFunc })
},
modalSuccess: function (title, content, okFunc = (() => {})) {
return Modal.success({ title: title, content: content, onOk: okFunc })
},
modalWarning: function (title, content, okFunc = (() => {})) {
return Modal.warning({ title: title, content: content, onOk: okFunc })
}
} }
export default confirmResult export default confirmResult
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册