// 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 "babel-polyfill";
import Vue from "vue";
import router from "./router";
import {
  sync
} from "vuex-router-sync";
import zrender from 'zrender'; 
import ElementUi from "element-ui";
import axios from './axios'
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
import Vuex from "vuex";
import store from './store'
import jQuery from "jquery";
import postcss from "postcss-pxtorem";
import "./assets/js/jquery-ui.min.js";
import echarts from 'echarts'
import * as filters from "./filters";
// import 'element-ui/lib/theme-chalk/index.css'
import "./assets/css/element-#00C1DE/index.css";
import "./assets/css/iconfont/iconfont.css";
import "./assets/iconfont/iconfont.css";
import App from "./App";
import "./assets/css/element_amend.css";
import '../node_modules/bootstrap/dist/css/bootstrap.min.css';
import '../node_modules/bootstrap/dist/js/bootstrap.min.js';
import '@/permission' // permission control
// import 'jquery'
import 'element-ui/lib/theme-chalk/index.css'
Vue.config.productionTip = false;
// axios.defaults.withCredentials = true
Vue.prototype.$zrender = zrender;
Vue.prototype.$echarts = echarts 
Vue.use(Viewer);
Viewer.setDefaults({
  Options: { "inline": true, "button": true, "navbar": true, "title": true, "toolbar": true, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": false, "keyboard": true, "url": "data-source" }
});
Vue.use(ElementUi);
Vue.use(Vuex);
sync(store, router);
// let _this = this
//     window.onbeforeunload = function (e) {
//       if (_this.$route.name == "dyyPerformanceCenterSale") {
//         e = e || window.event;
//         // 兼容IE8和Firefox 4之前的版本
//         if (e) {
//           e.returnValue = '关闭提示1111';
//         }
//         // Chrome, Safari, Firefox 4+, Opera 12+ , IE 9+
//         return '关闭提示222';
//       } else {
//         window.onbeforeunload = null
//       }
//     };
// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});
window.jQuery = jQuery;
/* eslint-disable no-new */
new Vue({
  el: "#app",
  router,
  store,
  template: "<App/>",
  components: {
    App
  }
});
