main.js
2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import App from './App'
import Vue from 'vue'
import Vuex from 'vuex'
import 'element-ui/lib/theme-chalk/index.css'
import './third-party/lazy_use'
import 'babel-polyfill'
if (Number.parseInt === undefined) Number.parseInt = window.parseInt;
if (Number.parseFloat === undefined) Number.parseFloat = window.parseFloat;
import promise from 'es6-promise'
promise.polyfill();
import api from './api'
import store from './newStore'
// import store from './store'
import recover from './newStore/recover'
// 导入所有过滤器变量
import * as custom from './filters/'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
Vue.use(Vuex)
// local js
import './utils/vproto'
import './styles/fonts/iconfont.css'
import './styles/index.css'
import Charts from '@/components/Charts'
import tableConfig from '@/components/Echarts/tableConfig'
import i18n from './assets/i18n/i18n'
import formatOpt from './components/conditions/formatOption'
import storelevel from './components/conditions/storelevelOption'
import exportData from './views/public/exportData'
// import './permission'
import { getTimer,langFormat } from "./utils"
// import ViewUI from 'view-design';
// Vue.use(ViewUI, {
// capture: false,
// select: {
// arrow: 'md-arrow-dropdown',
// arrowSize: 20
// }
// })
Vue.component('export-data-dialog', exportData)
Vue.component('mix-charts', Charts)
Vue.component('format-option-content', formatOpt)
Vue.component('store-level-content', storelevel)
/*自定义table列配置*/
Vue.component('table-config', tableConfig)
recover.recoverState()
// 全局配置axios
Vue.prototype.$api = api;
Vue.config.productionTip = false;
Vue.config.performance = process.env.NODE_ENV !== 'production';
Vue.prototype.Time = getTimer
Vue.prototype.langFormat = langFormat
// 全局过滤器
Object.keys(custom).forEach(key => {
Vue.filter(key, custom[key]);
});
// 读取配置文件 多项目 默认6.0 平台
const platformName = window._vionConfig.platform || 'mall'
document.title = platformName === 'mall' ?
'智慧商业客流分析平台' :
'智慧连锁客流分析平台'
Vue.prototype.$Project = platformName
// 读取配置文件 菜单权限 默认有菜单权限
Vue.prototype.$Menu = window._vionConfig.allMenu || false;
// if(!store.getters.stateaccid) {
// store.dispatch('GetAccountId')
// }
// if(!window._vionConfig.allMenu){
// if(!store.getters.routers) {
// store.dispatch('GetMenuRoles')
// }
// }
import router from './router'
//import xcroute from './router/xcroute'
//let groupLabel = window._vionConfig.groupLabel;
window.painter = new Vue({
el: '#app',
router: router, //groupLabel == 'xincheng' ? xcroute : router,
store,
i18n,
template: '<App/>',
components: { App }
})