| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- // import { ElMessage, ElMessageBox, ElNotification, ElLoading } from 'element-plus'
- let loadingInstance;
- import _this from '../main.js'
- const alertCommon = (content,type) => {
- _this.$alert(content, '系统提示', {
- confirmButtonText: '确定',
- callback: action => {
- this.$message({
- type,
- message: `action: ${ action }`
- });
- }
- });
- }
- const notifyCommon = (content,type) => {
- _this.$notify({
- title: '系统提示',
- message: content,
- type
- });
- }
- export default {
- // 消息提示
- msg(content) {
- _this.$message(content);
- },
- // 错误消息
- msgError(content) {
- _this.$message.error(content);
- },
- // 成功消息
- msgSuccess(content) {
- _this.$message({
- message: content,
- type: 'success'
- });
- },
- // 警告消息
- msgWarning(content) {
- _this.$message({
- message: content,
- type: 'warning'
- });
- },
- // 弹出提示
- alert(content) {
- alertCommon(content,'info');
- },
- // 错误提示
- alertError(content) {
- alertCommon(content,'error');
- },
- // 成功提示
- alertSuccess(content) {
- alertCommon(content,'success');
- },
- // 警告提示
- alertWarning(content) {
- alertCommon(content,'warning');
- },
- // 通知提示
- notify(content) {
- notifyCommon(content,'info');
- },
- // 错误通知
- notifyError(content) {
- notifyCommon(content,'error');
- },
- // 成功通知
- notifySuccess(content) {
- notifyCommon(content,'success');
- },
- // 警告通知
- notifyWarning(content) {
- notifyCommon(content,'warning');
- },
- // 确认窗体
- confirm(content) {
- return _this.$confirm(content, '系统提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- })
- },
- // 提交内容
- prompt(content) {
- return _this.$prompt(content, '系统提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: "warning"
- })
- },
- // 打开遮罩层
- loading(content) {
- // loadingInstance = ElLoading.service({
- // lock: true,
- // text: content,
- // background: "rgba(0, 0, 0, 0.7)",
- // })
- },
- // 关闭遮罩层
- closeLoading() {
- // loadingInstance.close();
- }
- }
|