qms/src/main.js

58 lines
1.5 KiB
JavaScript
Raw Normal View History

2023-01-06 10:03:31 +08:00
/*
* @Author: zwq
* @Date: 2022-08-22 14:57:50
2023-05-12 13:43:45 +08:00
* @LastEditors: zwq
* @LastEditTime: 2023-05-12 13:41:20
2023-01-06 10:03:31 +08:00
* @Description:
*/
import Vue from 'vue'
import Element from 'element-ui'
import App from '@/App'
import i18n from '@/i18n'
import router from '@/router'
import store from '@/store'
import '@/icons'
import '@/element-ui/theme/index.css'
import '@/assets/scss/aui.scss'
import http from '@/utils/request'
import renRadioGroup from '@/components/ren-radio-group'
import renSelect from '@/components/ren-select'
import renDeptTree from '@/components/ren-dept-tree'
import renRegionTree from '@/components/ren-region-tree'
import { hasPermission, getDictLabel } from '@/utils'
import cloneDeep from 'lodash/cloneDeep'
// main.js
import myComponents from 'code-brick-zj'
2023-05-11 16:22:07 +08:00
import * as filters from './filters' // global filters
2023-01-06 10:03:31 +08:00
2023-05-11 16:22:07 +08:00
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
})
2023-01-06 10:03:31 +08:00
Vue.config.productionTip = false
2023-05-11 16:22:07 +08:00
Vue.prototype.$i18nForm = filters.i18nFilterForm
2023-01-06 10:03:31 +08:00
Vue.use(Element, {
size: 'default',
i18n: (key, value) => i18n.t(key, value)
})
Vue.use(renRadioGroup)
Vue.use(renSelect)
Vue.use(renDeptTree)
Vue.use(renRegionTree)
Vue.use(myComponents)
// 挂载全局
Vue.prototype.$http = http
Vue.prototype.$hasPermission = hasPermission
Vue.prototype.$getDictLabel = getDictLabel
// 保存整站vuex本地储存初始状态
window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
new Vue({
i18n,
router,
store,
render: h => h(App)
}).$mount('#app')