welfare-admin/src/main.js

73 lines
1.8 KiB
JavaScript
Raw Normal View History

2021-08-11 15:44:50 +08:00
// with polyfills
import 'core-js/stable'
import 'regenerator-runtime/runtime'
import Print from 'vue-print-nb'
2021-08-11 15:44:50 +08:00
2021-08-09 17:28:48 +08:00
import Vue from 'vue'
import App from './App.vue'
import router from './router'
2021-08-11 15:44:50 +08:00
import store from './store/'
import i18n from './locales'
import { VueAxios } from './utils/request'
import ProLayout, { PageHeaderWrapper } from '@ant-design-vue/pro-layout'
2021-08-20 11:14:51 +08:00
import themePluginConfig from '../config/themePluginConfig'
2022-01-07 14:43:46 +08:00
import '@/utils/prototype'
2021-08-09 17:28:48 +08:00
2021-08-11 15:44:50 +08:00
import bootstrap from './core/bootstrap'
import './core/lazy_use'
2021-09-02 11:04:14 +08:00
import './permission' // permission control
2021-08-11 15:44:50 +08:00
import './utils/filter' // global filter
import './global.less'
2021-08-20 11:14:51 +08:00
import moment from 'moment'
2022-02-25 19:47:26 +08:00
import { FormModel, Empty } from 'ant-design-vue'
2021-09-02 11:04:14 +08:00
import { hasBtnPermission } from './utils/permissions'
2022-01-18 17:08:15 +08:00
window.Vue = Vue
// echart
// import { use } from 'echarts/core'
// import { CanvasRenderer } from 'echarts/renderers'
// import { BarChart } from 'echarts/charts'
// import {
// TitleComponent,
// TooltipComponent,
// LegendComponent,
// GridComponent
// } from 'echarts/components'
2021-12-22 09:12:42 +08:00
2021-08-20 11:14:51 +08:00
Vue.use(FormModel)
2022-02-25 19:47:26 +08:00
Vue.use(Empty)
2021-09-02 11:04:14 +08:00
Vue.prototype.hasPerm = hasBtnPermission
2022-02-25 19:47:26 +08:00
Vue.prototype.$emptyImg = Empty.PRESENTED_IMAGE_SIMPLE
2021-08-09 17:28:48 +08:00
Vue.config.productionTip = false
Vue.use(Print); //注册
2021-08-11 15:44:50 +08:00
Vue.use(VueAxios)
Vue.component('pro-layout', ProLayout)
Vue.component('page-header-wrapper', PageHeaderWrapper)
2021-08-20 11:14:51 +08:00
window.umi_plugin_ant_themeVar = themePluginConfig.theme
2021-08-11 15:44:50 +08:00
2022-01-18 17:08:15 +08:00
// use([
// CanvasRenderer,
// BarChart,
// TitleComponent,
// TooltipComponent,
// LegendComponent,
// GridComponent
// ])
2021-08-09 17:28:48 +08:00
new Vue({
router,
store,
i18n,
created: bootstrap,
render: h => h(App)
2021-08-09 17:28:48 +08:00
}).$mount('#app')
2021-08-20 11:14:51 +08:00
Vue.filter('moment', (dataStr, pattern = 'YYYY-MM-DD HH:mm:ss') => {
if (!dataStr) return ''
return moment(dataStr).format(pattern)
})