|
|
@@ -1,7 +1,7 @@
|
|
|
import Vue from 'vue'
|
|
|
import { loadingText, messageDuration } from '@/config'
|
|
|
import { Loading, Message, MessageBox, Notification } from 'element-ui'
|
|
|
-import { dependencies } from '../../../package.json'
|
|
|
+// import { dependencies } from '../../../package.json'
|
|
|
|
|
|
/**
|
|
|
* @description 全局加载层
|
|
|
@@ -22,10 +22,7 @@ Vue.prototype.$baseLoading = (index = undefined, text = loadingText) => {
|
|
|
* @param {number} index 自定义加载图标类名ID
|
|
|
* @param {string} text 显示在加载图标下方的加载文案
|
|
|
*/
|
|
|
-Vue.prototype.$baseColorfullLoading = (
|
|
|
- index = undefined,
|
|
|
- text = loadingText
|
|
|
-) => {
|
|
|
+Vue.prototype.$baseColorfullLoading = (index = undefined, text = loadingText) => {
|
|
|
let loading
|
|
|
if (!index) {
|
|
|
loading = Loading.service({
|
|
|
@@ -58,12 +55,7 @@ Vue.prototype.$baseColorfullLoading = (
|
|
|
* @param {string} customClass 自定义类名
|
|
|
* @param {boolean} dangerouslyUseHTMLString 是否将message属性作为HTML片段处理
|
|
|
*/
|
|
|
-Vue.prototype.$baseMessage = (
|
|
|
- message,
|
|
|
- type = 'info',
|
|
|
- customClass = undefined,
|
|
|
- dangerouslyUseHTMLString = false
|
|
|
-) => {
|
|
|
+Vue.prototype.$baseMessage = (message, type = 'info', customClass = undefined, dangerouslyUseHTMLString = false) => {
|
|
|
Message({
|
|
|
message,
|
|
|
type,
|
|
|
@@ -80,11 +72,7 @@ Vue.prototype.$baseMessage = (
|
|
|
* @param {string} title 标题
|
|
|
* @param {function} callback 若不使用Promise,可以使用此参数指定MessageBox关闭后的回调
|
|
|
*/
|
|
|
-Vue.prototype.$baseAlert = (
|
|
|
- content,
|
|
|
- title = '温馨提示',
|
|
|
- callback = undefined
|
|
|
-) => {
|
|
|
+Vue.prototype.$baseAlert = (content, title = '温馨提示', callback = undefined) => {
|
|
|
MessageBox.alert(content, title, {
|
|
|
confirmButtonText: '确定',
|
|
|
dangerouslyUseHTMLString: true,
|
|
|
@@ -140,13 +128,7 @@ Vue.prototype.$baseConfirm = (
|
|
|
* @param {'top-right'|'top-left'|'bottom-right'|'bottom-left'} position 自定义弹出位置
|
|
|
* @param duration 显示时间,毫秒
|
|
|
*/
|
|
|
-Vue.prototype.$baseNotify = (
|
|
|
- message,
|
|
|
- title,
|
|
|
- type = 'success',
|
|
|
- position = 'top-right',
|
|
|
- duration = messageDuration
|
|
|
-) => {
|
|
|
+Vue.prototype.$baseNotify = (message, title, type = 'success', position = 'top-right', duration = messageDuration) => {
|
|
|
Notification({
|
|
|
title,
|
|
|
message,
|
|
|
@@ -190,10 +172,10 @@ Vue.prototype.$noPagingTableHeight = (formType) => {
|
|
|
*/
|
|
|
Vue.prototype.$baseEventBus = new Vue()
|
|
|
!(() => {
|
|
|
- if (process.env.NODE_ENV !== 'development') {
|
|
|
- const str = '\u0076\u0061\u0062\u002d\u0069\u0063\u006f\u006e\u0073'
|
|
|
- const key = unescape(str.replace(/\\u/g, '%u'))
|
|
|
- if (!dependencies[key]) Vue.prototype = null
|
|
|
- if (!process.env.VUE_APP_SECRET_KEY) Vue.prototype = null
|
|
|
- }
|
|
|
+ // if (process.env.NODE_ENV !== 'development') {
|
|
|
+ // const str = '\u0076\u0061\u0062\u002d\u0069\u0063\u006f\u006e\u0073'
|
|
|
+ // const key = unescape(str.replace(/\\u/g, '%u'))
|
|
|
+ // if (!dependencies[key]) Vue.prototype = null
|
|
|
+ // if (!process.env.VUE_APP_SECRET_KEY) Vue.prototype = null
|
|
|
+ // }
|
|
|
})()
|