import Vue from "vue";

import "normalize.css/normalize.css"; // A modern alternative to CSS resets

import "./assets/styles/iconfont.css";
import "./assets/styles/common.css";
import "./styles/base.css";
import Element from "element-ui";
import "element-ui/lib/theme-chalk/index.css";
import "@/utils/directives.js";
import "@/styles/index.scss"; // global css
import "@/styles/variables.scss"; // global css
import "@/assets/iconfont/iconfont.css";
import "@/assets/icon/iconfont.css";
import { Message } from "element-ui";
import App from "./App";
import router from "./router";
import store from "./store";
import { Base64 } from "js-base64";
import i18n from "./lang"; // Internationalization
import "./icons"; // icon
import "./errorLog"; // error log
// import './permission' // permission control
import "./xt_permission";
// import './mock' // simulation data

import * as filters from "./filters"; // global filters
import "swiper/dist/css/swiper.css";
import "swiper/dist/css/swiper.min.css";
// 引入mint-ui
import Mint from "mint-ui";
Vue.use(Mint);

// 引入无线滚条

import { read } from "fs";
import BaiduMap from "vue-baidu-map";

import Viewer from "v-viewer";
import "viewerjs/dist/viewer.css";

import preview from "vue-photo-preview";
import "vue-photo-preview/dist/skin.css";
// import "./assets/style/base.scss";
import "element-ui/lib/theme-chalk/index.css";
Vue.use(preview);
import { Grid, GridItem } from "vant";
Vue.use(Grid).use(GridItem);
import "./libs/rem.js";
import {
  DropdownMenu,
  DropdownItem,
  Tab,
  Tabs,
  TreeSelect,
  Area,
  Popup,
  Cell,
  Picker,
  DatetimePicker,
  Icon,
  SwipeCell,
  Button,
  ActionSheet,
  List,
  Field,
  Tabbar,
  TabbarItem
  // eslint-disable-next-line no-irregular-whitespace
} from "vant";

Vue.use(DropdownMenu)
  .use(DropdownItem)
  .use(Tab)
  .use(Tabs)
  .use(TreeSelect)
  .use(Area)
  .use(Popup)
  .use(Cell)
  .use(Picker)
  .use(DatetimePicker)
  .use(Icon)
  .use(SwipeCell)
  .use(Button)
  .use(ActionSheet)
  .use(List)
  .use(Field)
  .use(Tabbar)
  .use(TabbarItem);
Vue.use(Viewer);
Vue.use(Viewer, {
  defaultOptions: {
    zIndex: 9999
  }
});
Vue.use(Element, {
  size: "medium", // set element-ui default size
  i18n: (key, value) => i18n.t(key, value)
});

// register global utility filters.
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});

Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  i18n,
  render: h => h(App)
});

Vue.prototype.Base64 = require("js-base64").Base64;
Vue.use(BaiduMap, {
  ak: "YOUR_APP_KEY"
});
