forked from BaoKaiWms/202501-Wms-Kate-Wuxi
76 lines
1.5 KiB
JavaScript
76 lines
1.5 KiB
JavaScript
|
|
import { ElMessageBox } from 'element-plus'
|
||
|
|
|
||
|
|
function errorBox(msg) {
|
||
|
|
ElMessageBox.alert(msg, '错误', {
|
||
|
|
autofocus: true,
|
||
|
|
confirmButtonText: '确认',
|
||
|
|
center: true,
|
||
|
|
type: 'error',
|
||
|
|
closeOnPressEscape: true,
|
||
|
|
showClose: false,
|
||
|
|
customStyle: {
|
||
|
|
whiteSpace: 'pre-wrap'
|
||
|
|
},
|
||
|
|
callback: (action) => {
|
||
|
|
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
function successBox(msg) {
|
||
|
|
ElMessageBox.alert(msg, '成功', {
|
||
|
|
autofocus: true,
|
||
|
|
confirmButtonText: '确认',
|
||
|
|
center: true,
|
||
|
|
type: 'success',
|
||
|
|
closeOnPressEscape: true,
|
||
|
|
showClose: false,
|
||
|
|
customStyle: {
|
||
|
|
whiteSpace: 'pre-wrap'
|
||
|
|
},
|
||
|
|
callback: (action) => {
|
||
|
|
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
function infoBox(msg) {
|
||
|
|
ElMessageBox.alert(msg, '提示', {
|
||
|
|
autofocus: true,
|
||
|
|
confirmButtonText: '确认',
|
||
|
|
center: true,
|
||
|
|
type: 'info',
|
||
|
|
closeOnPressEscape: true,
|
||
|
|
showClose: false,
|
||
|
|
customStyle: {
|
||
|
|
whiteSpace: 'pre-wrap'
|
||
|
|
},
|
||
|
|
callback: (action) => {
|
||
|
|
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
function warningBox(msg) {
|
||
|
|
ElMessageBox.alert(msg, '警告', {
|
||
|
|
autofocus: true,
|
||
|
|
confirmButtonText: '确认',
|
||
|
|
center: true,
|
||
|
|
type: 'warning',
|
||
|
|
closeOnPressEscape: true,
|
||
|
|
showClose: false,
|
||
|
|
customStyle: {
|
||
|
|
whiteSpace: 'pre-wrap'
|
||
|
|
},
|
||
|
|
callback: (action) => {
|
||
|
|
|
||
|
|
}
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
export {
|
||
|
|
errorBox,
|
||
|
|
successBox,
|
||
|
|
infoBox,
|
||
|
|
warningBox
|
||
|
|
}
|