import { ElLoading } from 'element-plus'

let fullscreenLoading = null;
let handleLoading = (flag) => {
    if (flag) {
        fullscreenLoading = ElLoading.service({
            lock: true,
            text: '正在处理，请稍后。。。',
            background: 'rgba(0, 0, 0, 0.7)',
        })
    } else {
        setTimeout(function () {
            fullscreenLoading.close();
        }, 200);
    }
}

export default {
    handleLoading,
}