/*
 * @Descripttion:
 * @version:
 * @Author: kBank
 * @Date: 2022-10-24 10:45:39
 */
import Vue from 'vue'
import Vue2OrgTree from 'vue-tree-color'
Vue.use(Vue2OrgTree)
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import preventReClick from './utils/index'
Vue.use(preventReClick)
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '../theme/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n
ElementUI.Dialog.props.closeOnClickModal.default = false

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

import dataV from '@jiaminghi/data-view'

Vue.use(dataV)

import App from './App'
import store from './store'
import router from './router'
import './utils/rem'
import Pagination from '@/components/Pagination'
import '@/icons' // icon
import '@/permission' // permission control
// 国际化
// import i18n from './i18n/index'
import i18n from '@/assets/i18n/index'
import permission from './directive/permission'

import * as echarts from 'echarts'

import moment from 'moment'
Vue.prototype.$moment = moment
import noImgEditor from '@/components/noImgEditor'

// 下载
// import { download } from "@/utils/ruoyi";
/**
 * 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.component('Pagination', Pagination)
Vue.component('noImgEditor', noImgEditor)

import { download } from '@/utils/request'
Vue.prototype.download = download

// set ElementUI lang to EN
Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
// Vue.use(ElementUI)

import { numberToCurrencyNo, isDollar, isLocal, stateFormat, isLocalSymbol } from '@/utils/numberToCurrency'
Vue.prototype.stateFormat = stateFormat
Vue.prototype.isLocalSymbol = isLocalSymbol
Vue.prototype.systemTypes = []
// 配置全局过滤器，实现数字千分位格式
Vue.filter('numberToCurrency', numberToCurrencyNo)
// 海外pv添加美元
Vue.filter('isDollar', isDollar)
// 海外添加当地币
Vue.filter('isLocal', isLocal)

Vue.use(permission)
Vue.prototype.$echarts = echarts

Vue.config.productionTip = false

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