main.js 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 Pagination from "@/components/Pagination";
  23. //自定义表格工具扩展
  24. import RightToolbar from "@/components/RightToolbar"
  25. import FormMaking from 'form-making'
  26. import 'form-making/dist/FormMaking.css'
  27. Vue.use(VueClipboard)
  28. Vue.use(FormMaking)
  29. // 全局方法挂载
  30. Vue.component('ImageUpload',ImageUpload)
  31. import audio from 'vue-mobile-audio'
  32. Vue.use(audio)
  33. Vue.prototype.callNumber = callNumber
  34. Vue.prototype.callOff = callOff
  35. Vue.prototype.callMobile = callMobile
  36. //import LemonIMUI from 'lemon-imui';
  37. import LemonIMUI from '@/components/LemonUI';
  38. Vue.use(LemonIMUI);
  39. import qwIm from "@/utils/webSocket";
  40. Vue.prototype.qwIm = qwIm
  41. // Vue.prototype.callOffMobile = callOffMobile
  42. // Vue.prototype.getSipAccount = getSipAccount
  43. Vue.prototype.getDicts = getDicts
  44. Vue.prototype.getConfigKey = getConfigKey
  45. Vue.prototype.getAge=getAge
  46. Vue.prototype.resetForm = resetForm
  47. Vue.prototype.addDateRange = addDateRange
  48. Vue.prototype.selectDictLabel = selectDictLabel
  49. Vue.prototype.selectDictLabels = selectDictLabels
  50. Vue.prototype.download = download
  51. Vue.prototype.handleTree = handleTree
  52. Vue.prototype.formatMoney = formatMoney
  53. Vue.prototype.parseArr = parseArr
  54. Vue.prototype.parsePost = parsePost
  55. Vue.prototype.parseTime = parseTime
  56. Vue.prototype.transformDateFormat = dateFormat
  57. Vue.prototype.formatDate = formatDate
  58. Vue.prototype.formatTime=formatTime
  59. Vue.prototype.friendlyDate=friendlyDate
  60. import moment from "moment"
  61. Vue.prototype.$moment = moment;
  62. Vue.prototype.msgSuccess = function (msg) {
  63. this.$message({ showClose: true, message: msg, type: "success" });
  64. }
  65. Vue.prototype.msgError = function (msg) {
  66. this.$message({ showClose: true, message: msg, type: "error" });
  67. }
  68. Vue.prototype.msgInfo = function (msg) {
  69. this.$message.info(msg);
  70. }
  71. // 全局组件挂载
  72. Vue.component('Pagination', Pagination)
  73. Vue.component('RightToolbar', RightToolbar)
  74. Vue.use(permission)
  75. /**
  76. * If you don't want to use mock-server
  77. * you want to use MockJs for mock api
  78. * you can execute: mockXHR()
  79. *
  80. * Currently MockJs will be used in the production environment,
  81. * please remove it before going online! ! !
  82. */
  83. Vue.use(Element, {
  84. size: Cookies.get('size') || 'medium' // set element-ui default size
  85. })
  86. Vue.config.productionTip = false
  87. new Vue({
  88. el: '#app',
  89. router,
  90. store,
  91. render: h => h(App)
  92. })