main.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. import Vue from 'vue'
  2. import Cookies from 'js-cookie'
  3. import Element from 'element-ui'
  4. import './assets/styles/element-variables.scss'
  5. import '@/assets/styles/index.scss' // global css
  6. import '@/assets/styles/common.scss'
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import directive from './directive' //directive
  11. import elementDirective from './directive/select'
  12. import './assets/icons' // icon
  13. import './permission' // permission control
  14. import { callNumber,callOff } from "@/utils/call";
  15. import { callMobile } from "@/api/company/companyVoiceApi"
  16. import { getDicts } from "@/api/system/dict/data";
  17. import { getConfigKey } from "@/api/system/config";
  18. import {cloneObject, parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/common";
  19. import Pagination from "@/components/Pagination";
  20. // 自定义表格工具组件
  21. import RightToolbar from "@/components/RightToolbar"
  22. // 富文本组件
  23. import Editor from "@/components/Editor"
  24. // 文件上传组件
  25. import FileUpload from "@/components/FileUpload"
  26. // 图片上传组件
  27. import ImageUpload from "@/components/ImageUpload"
  28. // 字典标签组件
  29. import DictTag from '@/components/DictTag'
  30. // 头部标签组件
  31. import VueMeta from 'vue-meta'
  32. import * as echarts from "echarts";
  33. // 全局方法挂载
  34. import { VueJsonp } from 'vue-jsonp'
  35. Vue.use(VueJsonp)
  36. // 全局配置
  37. Vue.prototype.logImg = require(process.env.VUE_APP_LOG_URL)
  38. Vue.prototype.cloneObject = cloneObject
  39. Vue.prototype.getDicts = getDicts
  40. Vue.prototype.getConfigKey = getConfigKey
  41. Vue.prototype.parseTime = parseTime
  42. Vue.prototype.resetForm = resetForm
  43. Vue.prototype.addDateRange = addDateRange
  44. Vue.prototype.selectDictLabel = selectDictLabel
  45. Vue.prototype.selectDictLabels = selectDictLabels
  46. Vue.prototype.download = download
  47. Vue.prototype.handleTree = handleTree
  48. Vue.prototype.echarts = echarts
  49. Vue.prototype.msgSuccess = function (msg) {
  50. this.$message({ showClose: true, message: msg, type: "success" });
  51. }
  52. Vue.prototype.msgError = function (msg) {
  53. this.$message({ showClose: true, message: msg, type: "error" });
  54. }
  55. Vue.prototype.msgInfo = function (msg) {
  56. this.$message.info(msg);
  57. }
  58. // 拨打电话
  59. import audio from 'vue-mobile-audio'
  60. Vue.use(audio)
  61. Vue.prototype.callNumber = callNumber
  62. Vue.prototype.callOff = callOff
  63. Vue.prototype.callMobile = callMobile
  64. // 全局组件挂载
  65. Vue.component('DictTag', DictTag)
  66. Vue.component('Pagination', Pagination)
  67. Vue.component('RightToolbar', RightToolbar)
  68. Vue.component('Editor', Editor)
  69. Vue.component('FileUpload', FileUpload)
  70. Vue.component('ImageUpload', ImageUpload)
  71. import H5Editor from "@/components/H5Editor";
  72. Vue.component('H5Editor', H5Editor)
  73. Vue.use(directive)
  74. Vue.use(VueMeta)
  75. Vue.use(elementDirective)
  76. /**
  77. * If you don't want to use mock-server
  78. * you want to use MockJs for mock api
  79. * you can execute: mockXHR()
  80. *
  81. * Currently MockJs will be used in the production environment,
  82. * please remove it before going online! ! !
  83. */
  84. Vue.use(Element, {
  85. size: Cookies.get('size') || 'medium' // set element-ui default size
  86. })
  87. Vue.config.productionTip = false
  88. new Vue({
  89. el: '#app',
  90. router,
  91. store,
  92. render: h => h(App)
  93. })