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