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;
|