You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.5 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
1 year ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
3 years ago
1 year ago
3 years ago
3 years ago
3 years ago
  1. import Vue from 'vue'
  2. import App from '@/App'
  3. import router from '@/router' // api: https://github.com/vuejs/vue-router
  4. import store from '@/store' // api: https://github.com/vuejs/vuex
  5. import VueCookie from 'vue-cookie' // api: https://github.com/alfhen/vue-cookie // 时间处理
  6. import { isAuth } from '@/utils'
  7. import dayjs from 'dayjs';
  8. import '@/element-ui' // api: https://github.com/ElemeFE/element
  9. import '@/icons' // api: http://www.iconfont.cn/
  10. import '@/element-ui-theme'
  11. import 'element-ui/lib/theme-chalk/icon.css'
  12. import '@/assets/scss/index.scss'
  13. import httpRequest from '@/utils/httpRequest' // api: https://github.com/axios/axios
  14. import cloneDeep from 'lodash/cloneDeep'
  15. import JsonExcel from 'vue-json-excel'
  16. import i18n from '@/i18n/i18n'
  17. import './utils/directives'
  18. import decimalUtil from '@/utils/decimalUtil.js'
  19. import getLodop from '@/utils/LodopFuncs.js'
  20. // import pdf from 'vue-pdf'
  21. import { debounce,throttle} from '@/utils/common.js'
  22. import 'element-ui/lib/theme-chalk/drawer.css';
  23. import 'element-ui/lib/theme-chalk/descriptions.css';
  24. import 'element-ui/lib/theme-chalk/popover.css';
  25. import Viewer from 'v-viewer'
  26. import 'viewerjs/dist/viewer.css'
  27. import selectDiv from '@/views/common/selectDiv.vue'
  28. import resizable from '@/utils/resizable.js'
  29. Vue.prototype.isAuth = isAuth // 权限方法
  30. Vue.component('downloadExcel', JsonExcel)
  31. // Vue.component('pdf', pdf)
  32. Vue.use(VueCookie)
  33. Vue.config.productionTip = false
  34. Vue.component('selectDiv', selectDiv);
  35. export const EventBus = new Vue();
  36. Vue.use(Viewer)
  37. Vue.directive('resizable',resizable)
  38. // 非生产环境, 适配mockjs模拟数据 // api: https://github.com/nuysoft/Mock
  39. if (process.env.NODE_ENV !== 'production') {
  40. require('@/mock')
  41. }
  42. // 挂载全局
  43. Vue.prototype.$http = httpRequest // ajax请求方法
  44. Vue.prototype.getLodop = getLodop // 打印
  45. Vue.prototype.decimalUtil = decimalUtil // 计算
  46. Vue.prototype.dayjs = dayjs //时间格式化插件 2021-11-02
  47. Vue.prototype.debounce = debounce // 防抖
  48. Vue.prototype.throttle = throttle // 限流
  49. // 保存整站vuex本地储存初始状态
  50. window.SITE_CONFIG['storeState'] = cloneDeep(store.state)
  51. /* eslint-disable no-new */
  52. new Vue({
  53. el: '#app',
  54. router,
  55. i18n,
  56. store,
  57. template: '<App/>',
  58. components: { App }
  59. })
  60. Viewer.setDefaults({
  61. // 需要配置的属性 注意属性并没有引号
  62. title: false,
  63. toolbar: true,
  64. zIndex: 99999,
  65. })