import Vue from 'vue'
import 'normalize.css/normalize.css' // a modern alternative to CSS resets

import {
  Card,
  MenuItem,
  MenuItemGroup,
  Menu,
  Breadcrumb,
  BreadcrumbItem,
  Form,
  FormItem,
  Input,
  Tooltip,
  Button,
  Row,
  Col,
  Dropdown,
  DropdownItem,
  DropdownMenu,
  Select,
  Option,
  Switch,
  Submenu,
  ColorPicker
} from 'element-ui'

import './styles/element-variables.scss'
import Antd from 'ant-design-vue'
import 'ant-design-vue/dist/antd.css'

import '@/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'

import './icons' // icon
import './permission' // permission control
import './utils/error-log' // error log
import JDictSelectTag from './components/dict/index.js'
import JMultiSelectTag from './components/dict/index.js'
import * as filters from './filters'
import ELScrollbar from '@/components/ELScrollbar'
import './icons/al/iconfont.css' // icon

Vue.use(Antd)
Vue.use(JDictSelectTag)
Vue.use(JMultiSelectTag)
/**
 * If you don't want to use mock-server
 * you want to use MockJs for mock api
 * you can execute: mockXHR()
 *
 * Currently MockJs will be used in the production environment,
 * please remove it before going online ! ! !
 */
// if (process.env.NODE_ENV === 'production') {
//   const { mockXHR } = require('../mock')
//   mockXHR()
// }

Vue.use(ELScrollbar)
Vue.use(ColorPicker)
Vue.use(Switch)
Vue.use(Option)
Vue.use(Select)
Vue.use(Dropdown)
Vue.use(DropdownItem)
Vue.use(DropdownMenu)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Input)
Vue.use(Tooltip)
Vue.use(Button)
Vue.use(Col)
Vue.use(Row)
Vue.use(Submenu)
Vue.use(Card)
Vue.use(Menu)
Vue.use(MenuItem)
Vue.use(MenuItemGroup)
Vue.use(Breadcrumb)
Vue.use(BreadcrumbItem)
import permission from '@/directive/permission/index.js' // 权限判断指令
Vue.use(permission)
// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

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