import Vue from 'vue'
import './utils/axios'
import App from './App.vue'
import router from './router'
import store from './store'
import constants from './utils/constants'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import api from './api'
import * as echarts from 'echarts'
import Charts from './views/analyse/custom/components/Charts'
import Particles from 'vue-particles'
import { formatTableDate } from "./utils";
import Config from './config'
import Storage from './utils/storage'
require('./assets/css/fix.scss')
require('./assets/css/layout.less')
import './icons'
import lodash from 'lodash'
import "@/icons/icon/iconfont.css"
import "@/icons/icon2/iconfont.css"
import "@/assets/css/theme.css"
import "@/assets/css/main.scss"


//专利数据库权限、报告的权限、是否有功能权限
import permission from './utils/permissions'
Vue.prototype.$permission = permission
// Vue.prototype.$r = permission.hasRole
// Vue.prototype.$permission = permission.hasPermission
Vue.prototype.$reportPermission = permission.reportPermission

import eventVisual from "@/views/event/components/details/showDialog";
Vue.prototype.$eventVisual = eventVisual;
import showTiShi from "./utils/model/tishi/index";
Vue.prototype.$showTiShi = showTiShi;
import showPermissionDialog from "./utils/model/noPermission/index";
Vue.prototype.$showPermissionDialog = showPermissionDialog;

//组件库
import model from './utils/model'
Vue.use(model)

//自定义指令
import directive from './utils/direct'
Vue.use(directive)

import Cookies from "js-cookie";
Vue.prototype.$cookie = Cookies

//全局js
import commonJS from '@/utils/common.js'
Vue.prototype.$commonJS = commonJS

//挂载在窗体上的事件
import vmFunction from './utils/window'
Vue.use(vmFunction)

//el-table滚动加载
import elTableInfiniteScroll from 'el-table-infinite-scroll'
Vue.use(elTableInfiniteScroll)

Vue.config.productionTip = false
Vue.prototype.$constants = constants//公用数据
Vue.prototype.$api = api
Vue.prototype.$echarts = echarts
Vue.prototype.$d = formatTableDate//格式化时间
Vue.prototype.$c = Config//配置信息
Vue.prototype.$s = Storage//本地存储
Vue.prototype.$_ = lodash
Vue.use(Charts)
Vue.use(Particles)

// 首页引导插件
import intro from 'intro.js' // introjs库
import 'intro.js/introjs.css' // introjs默认css样式
import 'intro.js/themes/introjs-modern.css' // introjs主题
Vue.prototype.$intro = intro 

//语言库
import i18n from '@/components/language' 
 Vue.use(Element,{
  i18n: (key, value) => i18n.t(key, value)// 在注册Element时设置i18n的处理方法
})

const vm = new Vue({
  el: '#app',
  router,
  store,
  i18n,
  render: (h) => h(App)
}).$mount('#app')
window.vm = vm 