2025-03-17 15:24:14 +08:00
|
|
|
import { ElMessageBox } from 'element-plus'
|
|
|
|
|
|
2025-03-20 08:52:10 +08:00
|
|
|
export const errorBox = (msg) => {
|
2025-03-17 15:24:14 +08:00
|
|
|
ElMessageBox.alert(msg, '错误', {
|
|
|
|
|
autofocus: true,
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
center: true,
|
|
|
|
|
type: 'error',
|
|
|
|
|
closeOnPressEscape: true,
|
|
|
|
|
showClose: false,
|
|
|
|
|
customStyle: {
|
|
|
|
|
whiteSpace: 'pre-wrap'
|
|
|
|
|
},
|
|
|
|
|
callback: (action) => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-20 08:52:10 +08:00
|
|
|
export const successBox = (msg) => {
|
2025-03-17 15:24:14 +08:00
|
|
|
ElMessageBox.alert(msg, '成功', {
|
|
|
|
|
autofocus: true,
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
center: true,
|
|
|
|
|
type: 'success',
|
|
|
|
|
closeOnPressEscape: true,
|
|
|
|
|
showClose: false,
|
|
|
|
|
customStyle: {
|
|
|
|
|
whiteSpace: 'pre-wrap'
|
|
|
|
|
},
|
|
|
|
|
callback: (action) => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-20 08:52:10 +08:00
|
|
|
export const infoBox = (msg) => {
|
2025-03-17 15:24:14 +08:00
|
|
|
ElMessageBox.alert(msg, '提示', {
|
|
|
|
|
autofocus: true,
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
center: true,
|
|
|
|
|
type: 'info',
|
|
|
|
|
closeOnPressEscape: true,
|
|
|
|
|
showClose: false,
|
|
|
|
|
customStyle: {
|
|
|
|
|
whiteSpace: 'pre-wrap'
|
|
|
|
|
},
|
|
|
|
|
callback: (action) => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-20 08:52:10 +08:00
|
|
|
export const warningBox = (msg) => {
|
2025-03-17 15:24:14 +08:00
|
|
|
ElMessageBox.alert(msg, '警告', {
|
|
|
|
|
autofocus: true,
|
|
|
|
|
confirmButtonText: '确认',
|
|
|
|
|
center: true,
|
|
|
|
|
type: 'warning',
|
|
|
|
|
closeOnPressEscape: true,
|
|
|
|
|
showClose: false,
|
|
|
|
|
customStyle: {
|
|
|
|
|
whiteSpace: 'pre-wrap'
|
|
|
|
|
},
|
|
|
|
|
callback: (action) => {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|