main.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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 elementDirective from './directive/select'
  13. import VueClipboard from 'vue-clipboard2'
  14. import './assets/icons' // icon
  15. import './permission' // permission control
  16. import { getDicts } from "@/api/system/dict/data";
  17. import { getConfigKey } from "@/api/company/companyConfig";
  18. import { callMobile } from "@/api/company/companyVoiceApi"
  19. import { getAge,formatDate,parsePost,parseArr,formatMoney,parseTime,dateFormat, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree,formatTime } from "@/utils/common";
  20. import { callNumber,callOff } from "@/utils/call";
  21. import Pagination from "@/components/Pagination";
  22. import PaginationMore from "@/components/PaginationMore";
  23. //自定义表格工具扩展
  24. import RightToolbar from "@/components/RightToolbar"
  25. import FormMaking from 'form-making'
  26. import 'form-making/dist/FormMaking.css'
  27. // 字典标签组件
  28. import DictTag from '@/components/DictTag'
  29. import * as echarts from "echarts";
  30. Vue.use(VueClipboard)
  31. Vue.use(FormMaking)
  32. // 全局方法挂载
  33. import audio from 'vue-mobile-audio'
  34. Vue.use(audio)
  35. Vue.prototype.callNumber = callNumber
  36. Vue.prototype.callOff = callOff
  37. Vue.prototype.callMobile = callMobile
  38. // Vue.prototype.callOffMobile = callOffMobile
  39. // Vue.prototype.getSipAccount = getSipAccount
  40. import LemonIMUI from '@/components/LemonUI';
  41. Vue.use(LemonIMUI);
  42. import qwIm from "@/utils/webSocket";
  43. Vue.prototype.qwIm = qwIm
  44. Vue.prototype.getDicts = getDicts
  45. Vue.prototype.getConfigKey = getConfigKey
  46. // 全局配置
  47. Vue.prototype.logImg = require(process.env.VUE_APP_LOG_URL)
  48. Vue.prototype.parseTime = parseTime
  49. Vue.prototype.transformDateFormat = dateFormat
  50. Vue.prototype.resetForm = resetForm
  51. Vue.prototype.addDateRange = addDateRange
  52. Vue.prototype.selectDictLabel = selectDictLabel
  53. Vue.prototype.selectDictLabels = selectDictLabels
  54. Vue.prototype.download = download
  55. Vue.prototype.handleTree = handleTree
  56. Vue.prototype.formatMoney = formatMoney
  57. Vue.prototype.parseArr = parseArr
  58. Vue.prototype.parsePost = parsePost
  59. Vue.prototype.formatDate = formatDate
  60. Vue.prototype.getAge=getAge
  61. Vue.prototype.formatTime=formatTime
  62. Vue.prototype.echarts = echarts
  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.msgWarning = function (msg) {
  72. this.$message({ showClose: true, message: msg, type: "warning" });
  73. };
  74. Vue.prototype.msgInfo = function (msg) {
  75. this.$message.info(msg);
  76. }
  77. // 全局组件挂载
  78. Vue.component('Pagination', Pagination)
  79. Vue.component('PaginationMore', PaginationMore)
  80. Vue.component('RightToolbar', RightToolbar)
  81. Vue.component('DictTag', DictTag)
  82. Vue.use(permission)
  83. Vue.use(elementDirective)
  84. /**
  85. * If you don't want to use mock-server
  86. * you want to use MockJs for mock api
  87. * you can execute: mockXHR()
  88. *
  89. * Currently MockJs will be used in the production environment,
  90. * please remove it before going online! ! !
  91. */
  92. Vue.use(Element, {
  93. size: Cookies.get('size') || 'medium' // set element-ui default size
  94. })
  95. Vue.config.productionTip = false
  96. new Vue({
  97. el: '#app',
  98. router,
  99. store,
  100. render: h => h(App)
  101. })