2018-03-06 11:14:41 +00:00
|
|
|
import Modal from './Modal'
|
2018-03-06 14:53:32 +00:00
|
|
|
import modalConfirm from './confirm'
|
2018-03-06 11:14:41 +00:00
|
|
|
|
|
|
|
// export { ActionButtonProps } from './ActionButton'
|
|
|
|
// export { ModalProps, ModalFuncProps } from './Modal'
|
|
|
|
|
2018-03-06 14:53:32 +00:00
|
|
|
const info = function (props) {
|
2018-03-06 11:14:41 +00:00
|
|
|
const config = {
|
|
|
|
type: 'info',
|
|
|
|
iconType: 'info-circle',
|
|
|
|
okCancel: false,
|
|
|
|
...props,
|
|
|
|
}
|
2018-03-06 14:53:32 +00:00
|
|
|
return modalConfirm(config)
|
2018-03-06 11:14:41 +00:00
|
|
|
}
|
|
|
|
|
2018-03-06 14:53:32 +00:00
|
|
|
const success = function (props) {
|
2018-03-06 11:14:41 +00:00
|
|
|
const config = {
|
|
|
|
type: 'success',
|
|
|
|
iconType: 'check-circle',
|
|
|
|
okCancel: false,
|
|
|
|
...props,
|
|
|
|
}
|
2018-03-06 14:53:32 +00:00
|
|
|
return modalConfirm(config)
|
2018-03-06 11:14:41 +00:00
|
|
|
}
|
|
|
|
|
2018-03-06 14:53:32 +00:00
|
|
|
const error = function (props) {
|
2018-03-06 11:14:41 +00:00
|
|
|
const config = {
|
|
|
|
type: 'error',
|
2018-12-09 09:34:27 +00:00
|
|
|
iconType: 'close-circle',
|
2018-03-06 11:14:41 +00:00
|
|
|
okCancel: false,
|
|
|
|
...props,
|
|
|
|
}
|
2018-03-06 14:53:32 +00:00
|
|
|
return modalConfirm(config)
|
2018-03-06 11:14:41 +00:00
|
|
|
}
|
|
|
|
|
2018-03-06 14:53:32 +00:00
|
|
|
const warning = function (props) {
|
2018-03-06 11:14:41 +00:00
|
|
|
const config = {
|
|
|
|
type: 'warning',
|
|
|
|
iconType: 'exclamation-circle',
|
|
|
|
okCancel: false,
|
|
|
|
...props,
|
|
|
|
}
|
2018-03-06 14:53:32 +00:00
|
|
|
return modalConfirm(config)
|
2018-03-06 11:14:41 +00:00
|
|
|
}
|
2018-03-06 14:53:32 +00:00
|
|
|
const warn = warning
|
2018-03-06 11:14:41 +00:00
|
|
|
|
2018-03-06 14:53:32 +00:00
|
|
|
const confirm = function (props) {
|
2018-03-06 11:14:41 +00:00
|
|
|
const config = {
|
|
|
|
type: 'confirm',
|
|
|
|
okCancel: true,
|
|
|
|
...props,
|
|
|
|
}
|
2018-03-06 14:53:32 +00:00
|
|
|
return modalConfirm(config)
|
|
|
|
}
|
2018-03-07 13:36:15 +00:00
|
|
|
Modal.info = info
|
|
|
|
Modal.success = success
|
|
|
|
Modal.error = error
|
|
|
|
Modal.warning = warning
|
|
|
|
Modal.warn = warn
|
|
|
|
Modal.confirm = confirm
|
2018-03-06 11:14:41 +00:00
|
|
|
|
2018-09-19 05:21:57 +00:00
|
|
|
/* istanbul ignore next */
|
|
|
|
Modal.install = function (Vue) {
|
|
|
|
Vue.component(Modal.name, Modal)
|
|
|
|
}
|
|
|
|
|
2018-03-06 11:14:41 +00:00
|
|
|
export default Modal
|