modal.js 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. // +----------------------------------------------------------------------
  2. // | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
  3. // +----------------------------------------------------------------------
  4. // | Copyright (c) 2016~2025 https://www.crmeb.com All rights reserved.
  5. // +----------------------------------------------------------------------
  6. // | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
  7. // +----------------------------------------------------------------------
  8. // | Author: CRMEB Team <admin@crmeb.com>
  9. // +----------------------------------------------------------------------
  10. import { Message, MessageBox, Notification, Loading } from 'element-ui';
  11. let loadingInstance;
  12. export default {
  13. // 消息提示
  14. msg(content) {
  15. Message.info(content);
  16. },
  17. // 错误消息
  18. msgError(content) {
  19. Message.error(content);
  20. },
  21. // 成功消息
  22. msgSuccess(content) {
  23. Message.success(content);
  24. },
  25. // 警告消息
  26. msgWarning(content) {
  27. Message.warning(content);
  28. },
  29. // 弹出提示
  30. alert(content) {
  31. MessageBox.alert(content, '系统提示');
  32. },
  33. // 错误提示
  34. alertError(content) {
  35. MessageBox.alert(content, '系统提示', { type: 'error' });
  36. },
  37. // 成功提示
  38. alertSuccess(content) {
  39. MessageBox.alert(content, '系统提示', { type: 'success' });
  40. },
  41. // 警告提示
  42. alertWarning(content) {
  43. MessageBox.alert(content, '系统提示', { type: 'warning' });
  44. },
  45. // 通知提示
  46. notify(content) {
  47. Notification.info(content);
  48. },
  49. // 错误通知
  50. notifyError(content) {
  51. Notification.error(content);
  52. },
  53. // 成功通知
  54. notifySuccess(content) {
  55. Notification.success(content);
  56. },
  57. // 警告通知
  58. notifyWarning(content) {
  59. Notification.warning(content);
  60. },
  61. // 确认窗体
  62. confirm(content) {
  63. return MessageBox.confirm(content, '系统提示', {
  64. confirmButtonText: '确定',
  65. cancelButtonText: '取消',
  66. type: 'warning',
  67. });
  68. },
  69. // 打开遮罩层
  70. loading(content) {
  71. loadingInstance = Loading.service({
  72. lock: true,
  73. text: content,
  74. spinner: 'el-icon-loading',
  75. background: 'rgba(0, 0, 0, 0.7)',
  76. });
  77. },
  78. // 关闭遮罩层
  79. closeLoading() {
  80. loadingInstance.close();
  81. },
  82. };