main.js 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 'video.js/dist/video-js.css'
  5. // 该插件局部引入有bug
  6. import SuperFlow from 'vue-super-flow'
  7. import 'vue-super-flow/lib/index.css'
  8. Vue.use(SuperFlow)
  9. import Element from 'element-ui'
  10. import '@/styles/element-variables.scss'
  11. Vue.use(Element, {
  12. size: Cookies.get('size') || 'small', // set element-ui default size
  13. })
  14. import '@/styles/index.scss' // global css
  15. import './config'
  16. import App from './App'
  17. import store from './store'
  18. import router from './router'
  19. import './assets/icons' // icon
  20. import './permission' // permission control
  21. // 全局组件挂载
  22. Vue.component('Pagination', () => import('@/components/Pagination'))
  23. Vue.component('RightToolbar', () => import('@/components/RightToolbar'))
  24. Vue.component('Upload', () => import('@/components/Upload'))
  25. Vue.component('UploadToCos', () => import('@/components/UploadToCos'))
  26. Vue.component('ButtonSync', () => import('@/components/ButtonSync'))
  27. Vue.component('TagEllipsis', () => import('@/components/TagEllipsis'))
  28. Vue.component('SelectUser', () => import('@/components/SelectUser'))
  29. Vue.component('SelectWeUser', () => import('@/components/SelectWeUser'))
  30. Vue.component('SelectStaffForm', () => import('@/components/SelectStaffForm'))
  31. Vue.component('CoRemoteSelect', () => import('@/components/CoRemoteSelect'))
  32. Vue.component('PhoneTemplate', () => import('@/components/PhoneTemplate'))
  33. Vue.component('CardGroupIndex', () => import('@/components/CardGroupIndex'))
  34. // 带 插入 表情/客户昵称 等扩展工具栏的文本内容框
  35. Vue.component('TextareaExtend', () => import('@/components/TextareaExtend'))
  36. // 全局方法挂载
  37. import ClipboardJS from 'clipboard'
  38. // class ClipboardJS extends clipboard {
  39. // constructor(trigger, options) {
  40. // super(trigger, options)
  41. // }
  42. // }
  43. ClipboardJS.prototype.e = {
  44. success: [
  45. {
  46. fn() {
  47. Element.Notification.success({
  48. title: '复制成功',
  49. // message: '链接已复制到剪切板,可粘贴。',
  50. })
  51. },
  52. },
  53. ],
  54. error: [
  55. {
  56. fn() {
  57. Element.Notification.error({
  58. title: '复制失败',
  59. // message: '链接复制失败',
  60. })
  61. },
  62. },
  63. ],
  64. }
  65. import * as methods from '@/utils/common'
  66. import { pickerOptions } from '@/utils/index'
  67. Object.assign(Vue.prototype, methods, {
  68. // 动态配置
  69. lwConfig: window.lwConfig,
  70. // 日期时间控件快捷配置
  71. pickerOptions,
  72. ClipboardJS,
  73. msgSuccess(msg) {
  74. this.$message({
  75. showClose: true,
  76. message: msg,
  77. type: 'success',
  78. })
  79. },
  80. msgError(msg) {
  81. this.$message({ showClose: true, message: msg, type: 'error' })
  82. },
  83. msgInfo(msg) {
  84. this.$message.info(msg)
  85. },
  86. })
  87. // import VideoPlayer from 'vue-video-player'
  88. // Vue.use(VideoPlayer)
  89. // import AudioPlayer from '@liripeng/vue-audio-player'
  90. // import '@liripeng/vue-audio-player/lib/vue-audio-player.css'
  91. // Vue.use(AudioPlayer)
  92. import Driver from 'driver.js'
  93. import 'driver.js/dist/driver.min.css'
  94. Vue.prototype.$driver = new Driver({
  95. className: 'scoped-class',
  96. allowClose: false, //禁止点击外部关闭
  97. doneBtnText: '完成', // 完成按钮标题
  98. closeBtnText: '关闭', // 关闭按钮标题
  99. stageBackground: '#fff', // 引导对话的背景色
  100. nextBtnText: '下一步', // 下一步按钮标题
  101. prevBtnText: '上一步', // 上一步按钮标题
  102. keyboardControl: false, // 禁止键盘控制
  103. // showButtons:false
  104. })
  105. import directive from './directive'
  106. Vue.use(directive)
  107. Vue.config.productionTip = false
  108. // import('@/utils/auth').then(async ({authRedirect}) => {
  109. // let isAuth = await authRedirect()
  110. // })
  111. new Vue({
  112. el: '#app',
  113. router,
  114. store,
  115. render: (h) => h(App),
  116. })