|
@@ -10,7 +10,9 @@ import lodash from 'lodash'
|
|
|
import qs from 'qs'
|
|
|
import PortalVue from 'portal-vue'
|
|
|
Vue.use(PortalVue)
|
|
|
-import { permission } from "@/utils/directivePage";
|
|
|
+import {
|
|
|
+ permission
|
|
|
+} from "@/utils/directivePage";
|
|
|
|
|
|
dayjs.extend(isSameOrBefore)
|
|
|
dayjs.extend(isSameOrAfter)
|
|
@@ -38,36 +40,38 @@ import './utils/directive'
|
|
|
// Vue.use(vueFilter)
|
|
|
import '@/icons' // icon
|
|
|
import '@/permission' // permission control
|
|
|
-import { Message } from 'element-ui'
|
|
|
+import {
|
|
|
+ Message
|
|
|
+} from 'element-ui'
|
|
|
const showMessage = Symbol('showMessage')
|
|
|
class DonMessage {
|
|
|
- success (options, single = true) {
|
|
|
+ success(options, single = true) {
|
|
|
this[showMessage]('success', options, single)
|
|
|
}
|
|
|
- warning (options, single = true) {
|
|
|
+ warning(options, single = true) {
|
|
|
this[showMessage]('warning', options, single)
|
|
|
}
|
|
|
- info (options, single = true) {
|
|
|
+ info(options, single = true) {
|
|
|
this[showMessage]('info', options, single)
|
|
|
}
|
|
|
- error (options, single = true) {
|
|
|
- this[showMessage]('error', options, single)
|
|
|
- }
|
|
|
- [showMessage] (type, options, single) {
|
|
|
- // console.log(type, options, Message)
|
|
|
- let params = {
|
|
|
- message: options,
|
|
|
- offset: 90
|
|
|
+ error(options, single = true) {
|
|
|
+ this[showMessage]('error', options, single)
|
|
|
}
|
|
|
- if (single) {
|
|
|
- // 判断是否已存在Message
|
|
|
- if (document.getElementsByClassName('el-message').length === 0) {
|
|
|
+ [showMessage](type, options, single) {
|
|
|
+ // console.log(type, options, Message)
|
|
|
+ let params = {
|
|
|
+ message: options,
|
|
|
+ offset: 90
|
|
|
+ }
|
|
|
+ if (single) {
|
|
|
+ // 判断是否已存在Message
|
|
|
+ if (document.getElementsByClassName('el-message').length === 0) {
|
|
|
+ Message[type](params)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
Message[type](params)
|
|
|
}
|
|
|
- } else {
|
|
|
- Message[type](params)
|
|
|
}
|
|
|
- }
|
|
|
}
|
|
|
|
|
|
// 修改默认属性
|
|
@@ -80,7 +84,7 @@ ElementUI.Select.watch.value = function (newValue, oldValue) {
|
|
|
SelectValueWatch.call(this, newValue, oldValue)
|
|
|
if (this.selected && this.selected.value === 0 && this.selected.currentLabel === 0 && newValue !== oldValue) {
|
|
|
this.handleClearClick.call(this, {
|
|
|
- stopPropagation: () => { }
|
|
|
+ stopPropagation: () => {}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -99,10 +103,10 @@ document.addEventListener('mousewheel', function () {
|
|
|
})
|
|
|
document.addEventListener('keydown', function (event) {
|
|
|
// (document.activeElement,event.keyCode)
|
|
|
- if(event.keyCode == 13){
|
|
|
- setTimeout(res=>{
|
|
|
+ if (event.keyCode == 13) {
|
|
|
+ setTimeout(res => {
|
|
|
document.activeElement.blur()
|
|
|
- },300)
|
|
|
+ }, 300)
|
|
|
|
|
|
}
|
|
|
})
|
|
@@ -125,11 +129,18 @@ Vue.use(VueAMap)
|
|
|
|
|
|
// 检测浏览器是否缩放
|
|
|
// import '@/utils/zoom'
|
|
|
-Vue.prototype.$ELEMENT = { size: 'medium', zIndex: 3000 }
|
|
|
+Vue.prototype.$ELEMENT = {
|
|
|
+ size: 'medium',
|
|
|
+ zIndex: 3000
|
|
|
+}
|
|
|
// set ElementUI lang to EN
|
|
|
-Vue.use(ElementUI, { locale })
|
|
|
+Vue.use(ElementUI, {
|
|
|
+ locale
|
|
|
+})
|
|
|
|
|
|
Vue.config.productionTip = false
|
|
|
+Vue.prototype.$bus = new Vue()
|
|
|
+
|
|
|
|
|
|
// 将selects全局混入当前vue实例中
|
|
|
Vue.mixin({
|
|
@@ -156,9 +167,9 @@ Vue.mixin({
|
|
|
const origin = window.location.origin
|
|
|
history.replaceState("", "", `${origin}/#${this.$route.path}?opt=${value}`)
|
|
|
},
|
|
|
- getFullPermission(str){
|
|
|
+ getFullPermission(str) {
|
|
|
let routeName = this.$route.path
|
|
|
- return str+routeName
|
|
|
+ return str + routeName
|
|
|
}
|
|
|
}
|
|
|
})
|