main.js 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import Vue from 'vue'
  2. import Cookies from 'js-cookie'
  3. import 'normalize.css/normalize.css' // a modern alternative to CSS resets
  4. import Element from 'element-ui'
  5. import './assets/styles/element-variables.scss'
  6. import '@/assets/styles/index.scss' // global css
  7. import '@/assets/styles/common.scss' // common css
  8. import App from './App'
  9. import store from './store'
  10. import router from './router'
  11. import permission from './directive/permission'
  12. import VueClipboard from 'vue-clipboard2'
  13. //图片上传组件
  14. import ImageUpload from "@/components/ImageUpload"
  15. import './assets/icons' // icon
  16. import './permission' // permission control
  17. import { getDicts } from "@/api/system/dict/data";
  18. import { getConfigKey } from "@/api/company/companyConfig";
  19. import { callMobile } from "@/api/company/companyVoiceApi"
  20. import { getAge,formatDate,parsePost,parseArr,formatMoney, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree,parseTime,dateFormat,friendlyDate,formatTime } from "@/utils/common";
  21. import { callNumber,callOff } from "@/utils/call";
  22. import elementDirective from './directive/select'
  23. import Pagination from "@/components/Pagination";
  24. //自定义表格工具扩展
  25. import RightToolbar from "@/components/RightToolbar"
  26. import FormMaking from 'form-making'
  27. import 'form-making/dist/FormMaking.css'
  28. // 字典标签组件
  29. import DictTag from '@/components/DictTag'
  30. Vue.use(VueClipboard)
  31. Vue.use(FormMaking)
  32. // 全局方法挂载
  33. Vue.component('ImageUpload',ImageUpload)
  34. import audio from 'vue-mobile-audio'
  35. Vue.use(audio)
  36. Vue.prototype.callNumber = callNumber
  37. Vue.prototype.callOff = callOff
  38. Vue.prototype.callMobile = callMobile
  39. //import LemonIMUI from 'lemon-imui';
  40. import LemonIMUI from '@/components/LemonUI';
  41. Vue.use(LemonIMUI);
  42. // import qwIm from "@/utils/webSocket";
  43. // Vue.prototype.qwIm = qwIm
  44. // Vue.prototype.callOffMobile = callOffMobile
  45. // Vue.prototype.getSipAccount = getSipAccount
  46. Vue.prototype.getDicts = getDicts
  47. Vue.prototype.getConfigKey = getConfigKey
  48. Vue.prototype.getAge=getAge
  49. Vue.prototype.resetForm = resetForm
  50. Vue.prototype.addDateRange = addDateRange
  51. Vue.prototype.selectDictLabel = selectDictLabel
  52. Vue.prototype.selectDictLabels = selectDictLabels
  53. Vue.prototype.download = download
  54. Vue.prototype.handleTree = handleTree
  55. Vue.prototype.formatMoney = formatMoney
  56. Vue.prototype.parseArr = parseArr
  57. Vue.prototype.parsePost = parsePost
  58. Vue.prototype.parseTime = parseTime
  59. Vue.prototype.transformDateFormat = dateFormat
  60. Vue.prototype.formatDate = formatDate
  61. Vue.prototype.formatTime=formatTime
  62. Vue.prototype.friendlyDate=friendlyDate
  63. import moment from "moment"
  64. Vue.prototype.$moment = moment;
  65. Vue.prototype.msgSuccess = function (msg) {
  66. this.$message({ showClose: true, message: msg, type: "success" });
  67. }
  68. Vue.prototype.msgError = function (msg) {
  69. this.$message({ showClose: true, message: msg, type: "error" });
  70. }
  71. Vue.prototype.msgInfo = function (msg) {
  72. this.$message.info(msg);
  73. }
  74. // 全局组件挂载
  75. Vue.component('Pagination', Pagination)
  76. Vue.component('RightToolbar', RightToolbar)
  77. Vue.component('DictTag', DictTag)
  78. Vue.use(permission)
  79. Vue.use(elementDirective)
  80. /**
  81. * If you don't want to use mock-server
  82. * you want to use MockJs for mock api
  83. * you can execute: mockXHR()
  84. *
  85. * Currently MockJs will be used in the production environment,
  86. * please remove it before going online! ! !
  87. */
  88. Vue.use(Element, {
  89. size: Cookies.get('size') || 'medium' // set element-ui default size
  90. })
  91. Vue.config.productionTip = false
  92. new Vue({
  93. el: '#app',
  94. router,
  95. store,
  96. render: h => h(App)
  97. })