// import Vue from 'vue'

import Cookies from 'js-cookie'

import 'normalize.css/normalize.css' // a modern alternative to CSS resets
// import './styles/element-variables.scss'

// import Element from 'element-ui'
// import VCharts from 'v-charts' // v-charts图表
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 '@/components/Pagination/index.js' //分页组件
import '@/components/DictSelect/index.js' //数据字典选择组件
import '@/components/EditMode/index.js' //自定义编辑组件
import '@/components/Lookicon/index.js' //脱敏组件（小眼睛）

import { addDateRange, getNowTime, parseTime } from '@/utils/index'
import { carNoValid } from '@/utils/validate'
import * as filters from './filters' // global filters
import VueDOMPurifyHTML from 'vue-dompurify-html'//引用防XSS注入插件替代v-html
import VueBus from 'vue-bus';//事件总线
import { borderBox1 } from '@jiaminghi/data-view'

import BizComp from '@/components/BizComp/index.js'
Vue.use(BizComp)

import debounceClick from "./directive/debounce/index"
Vue.use(debounceClick)

Vue.use(borderBox1)
// import echarts from 'echarts'
// Vue.prototype.$echarts = echarts
Vue.prototype.$cookies = Cookies
Vue.prototype.addDateRange = addDateRange
Vue.prototype.getNowTime = getNowTime
Vue.prototype.parseTime = parseTime
Vue.prototype.carNoValid = carNoValid
Vue.prototype.$showLogo = (process.env.VUE_APP_SHOW_LOGO != 'false')

Vue.config.devtools = true
import { VueJsonp } from 'vue-jsonp'
Vue.use(VueJsonp)
Vue.use(VueDOMPurifyHTML)
Vue.use(VueBus)
Vue.use(borderBox1)

import VDistpicker from 'v-distpicker' // 引用城市三级联动
Vue.component('v-distpicker', VDistpicker)

import * as dd from 'dingtalk-jsapi'
Vue.component('dingtalk-jsapi', dd)
// import fengmap from 'fengmap'  //蜂鸟3D地图
// import fengmap from 'fengmap/build/plugins/fengmap.core.min' // 核心包
// import 'fengmap/build/plugins/fengmap.control.min' // 控件
// Vue.component('fengmap', fengmap)

/* import crypto from 'crypto-js'
Vue.component('crypto', crypto);*/
// Vue.use(VCharts)
Vue.prototype.$ELEMENT = {
  size: Cookies.get('size') || 'medium' // set element-ui default size
}
// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

import mixinsObj from '@/mixins/index'
Vue.mixin(mixinsObj)

import selectScroll from '@/directive/selectScroll'
import inputScroll from '@/directive/inputScroll'
const directives = {selectScroll,inputScroll}
for (const [key, value] of Object.entries(directives)) {
  Vue.directive(key, value)
}

Vue.config.productionTip = false

//引入v-md-editor 以及相关依赖
import VueMarkdownEditor from '@kangc/v-md-editor';
import '@kangc/v-md-editor/lib/style/base-editor.css';
import vuepressTheme from '@kangc/v-md-editor/lib/theme/vuepress.js';
import '@kangc/v-md-editor/lib/theme/style/vuepress.css';

import Prism from 'prismjs';

//编辑
VueMarkdownEditor.use(vuepressTheme, {
  Prism,
});
Vue.use(VueMarkdownEditor);

//浏览组件
import VMdPreview from '@kangc/v-md-editor/lib/preview';
import githubTheme from '@kangc/v-md-editor/lib/theme/github.js';
import hljs from 'highlight.js';
import '@kangc/v-md-editor/lib/theme/style/github.css';
import '@kangc/v-md-editor/lib/style/preview.css';
VMdPreview.use(githubTheme, {
  Hljs: hljs,
});
Vue.use(VMdPreview);



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