拖旺项目:聊城公交辅助决策系统
zhaoxing
2022-04-28 88a653523e53b90680a880f3d956ebe61224eeb8
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
106
107
108
109
110
import App from './App.vue'
import Vue from 'vue'
import router from './router'
import store from './store'
import axios from './unit/axiosHttp'
import Interface from './unit/interface'
 
import Vuex from 'vuex'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'
import md5 from 'js-md5';
import ElementUi from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import './assets/font/font.css'
import regular from "./unit/utils.js";
import common from "./unit/common.js";
import VueAMap from "vue-amap"
import dataV from '@jiaminghi/data-view'
import Title from './components/common/title/title';
import homeTitle from './components/common/title/title_home';
import progressRank from './components/common/progress/rank';
import borderDecorate from './components/common/border/decorate';
import rollList from './components/common/animation/rollList.vue';
 
 
 
Vue.use(dataV)
Vue.use(Vuex);
Vue.use(Antd);
Vue.use(ElementUi);
Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
    key: "778ead3aea27954fbcbec30e9ef25420", // 这里写你申请的高德地图的key
    plugin: ["AMap.Autocomplete", "AMap.Geocoder", "AMap.Geolocation"],
});
Vue.config.productionTip = false;
Vue.prototype.$regular = regular;
Vue.prototype.$md5 = md5;
Vue.prototype.$axios = axios;
Vue.prototype.$Interface = Interface;
Vue.prototype.$to = function (path, index) {
    router.push(path)
};
Vue.component('v-title', Title);
Vue.component('v-progress-rank', progressRank);
Vue.component('v-border-decorate', borderDecorate);
Vue.component('v-roll-list', rollList);
Vue.component('v-title-home', homeTitle)
 
 
Vue.prototype.$exportBase = 'http://tw.twgiot.com:39005/twdt-admin/';
// Vue.prototype.$exportBase = 'http://192.168.130.79:8089/twdt-admin/';
Object.keys(common).forEach(key => {
    Vue.prototype[key] = common[key]
});
 
router.beforeEach((to, from, next) => {
 
    let pas = {
        'index': 0,
        'operateC': 2,
        'customer': 2,
        'operate': 2,
        'line': 3,
        'lineCenter': 6,
        'singleLine': 3,
        'road': 4,
        'roadCongestionTable': 8,
        'stationCongestionTable': 8,
        'driverappraise': 5,
        'basicResource': 6,
        'branchOfficeResource': 6,
        'basicResourcesDriverDetail': 6,
        'passengerFlow': 6,
        'map': 1,
        'safety': 7,
        'safetyAccidentReport': 7,
        'safetyAccidentReportDetail': 7,
        'safetyArticleList': 7,
        'safetyArticleEdit': 7,
        'safetyArticleDetail': 7,
        'driverList': 6,
        'data': 8,
        'dataBoard': 8,
        'assessReport': 9,
    };
    let name_index = to.name;
    // if(!localStorage.getItem('mtoken')){
    //     // next('/login')
    // }else{
    //
    //
    // }
    if(store.state.parentCompany){
        localStorage.setItem('companyId', '');
    }
    if (pas[name_index] || pas[name_index] == 0) {
        store.commit('SET_HeaderIndex', pas[name_index]);
    }
    next()
 
 
});
 
let app = new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app');
Vue.prototype.$bus = app;