import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import pinia from '@/stores/index'
import { registerIcons } from '@/utils/common'
import mitt from 'mitt'
import VXETable from 'vxe-table'
import XEUtils from 'xe-utils'
import 'vxe-table/lib/style.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css'
import '@fortawesome/fontawesome-free/css/all.css'
import '@/styles/index.scss'
import '@/assets/font/iconfont.css'
import CnDialog from '@/components/CnDialog/CnDialog.vue'
import { applyDialogCssVars } from '@/config/dialog'
import ExcelJS from 'exceljs'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
VXETable.use(VXETablePluginExportXLSX, {
    ExcelJS
})
window.XEUtils = XEUtils

applyDialogCssVars()

const app = createApp(App)

app.use(router)
app.use(pinia)
app.use(ElementPlus)
app.component('ElDialog', CnDialog)
app.use(VXETable)
registerIcons(app) // icons

app.mount('#app')
app.config.globalProperties.eventBus = mitt()
