main_20220112150834.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import Vue from 'vue'
  2. import 'normalize.css/normalize.css' // A modern alternative to CSS resets
  3. import ElementUI from 'element-ui'
  4. import 'element-ui/lib/theme-chalk/index.css'
  5. import locale from 'element-ui/lib/locale/lang/en' // lang i18n
  6. import '@/styles/index.scss' // global css
  7. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, downloadBlob, handleTree } from "@/utils/yongtian";
  8. import App from './App'
  9. import store from './store'
  10. import router from './router'
  11. // 引入字体样式
  12. import '@/assets/common/fonts/font.css';
  13. import '@/assets/common/js/flexible.js';
  14. import getPageTitle from '@/utils/get-page-title'
  15. //全局挂载
  16. Vue.prototype.handleTree = handleTree
  17. import '@/icons' // icon
  18. import '@/permission' // permission control
  19. import { stringify } from 'qs'
  20. /* 路由发生变化修改页面title */
  21. router.beforeEach((to, from, next) => {
  22. if (to.meta.title) {
  23. document.title = getPageTitle(to.meta.title)
  24. }
  25. next()
  26. })
  27. /**
  28. * If you don't want to use mock-server
  29. * you want to use MockJs for mock api
  30. * you can execute: mockXHR()
  31. *
  32. * Currently MockJs will be used in the production environment,
  33. * please remove it before going online ! ! !
  34. */
  35. if (process.env.NODE_ENV === 'production') {
  36. const { mockXHR } = require('../mock')
  37. mockXHR()
  38. }
  39. // set ElementUI lang to EN
  40. // Vue.use(ElementUI, { locale })
  41. // 如果想要中文版 element-ui,按如下方式声明
  42. Vue.use(ElementUI)
  43. Vue.config.productionTip = false
  44. new Vue({
  45. el: '#app',
  46. router,
  47. store,
  48. render: h => h(App),
  49. components: {
  50. App
  51. },
  52. template: '<App/>'
  53. })
  54. // Vue.http.options.emulateJSON = true;
  55. // Vue.http.options.headers = {
  56. // 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
  57. // };