main.js
3.98 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
128
129
130
import '../config.js'
import 'normalize.css/normalize.css'
import { createApp, h, defineAsyncComponent } from 'vue'
// configureCompat({
// WATCH_ARRAY: false,
// })
import App from './App.vue'
import router from './router'
const app = createApp(App)
import ElementPlus, { ElNotification } from 'element-plus'
import 'element-plus/theme-chalk/dark/css-vars.css'
import 'element-plus/dist/index.css'
app.use(ElementPlus, {})
import '@/styles/index.scss'
// svg图标
import 'virtual:svg-icons-register'
import SvgIcon from '@/components/SvgIcon'
app.component('SvgIcon', SvgIcon)
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
app.component('ElIcon' + key, component)
}
// 全局异步组件挂载,
// 所有异步组件,在其父组件需要更改其样式时可能会导致同级权重css样式顺序覆盖问题,使用时需注意加权
let components = {
Empty: () => import('./components/Empty.vue'),
Upload: () => import('./components/Upload.vue'),
Pagination: () => import('./components/Pagination.vue'),
RightToolbar: () => import('./components/RightToolbar.vue'),
ButtonSync: () => import('./components/ButtonSync.vue'),
TagEllipsis: () => import('./components/TagEllipsis.vue'),
SelectUser: () => import('./components/SelectUser.vue'),
SelectStaffForm: () => import('./components/SelectStaffForm.vue'),
CoRemoteSelect: () => import('./components/CoRemoteSelect.vue'),
PhoneTemplate: () => import('./components/PhoneTemplate.vue'),
CardGroupIndex: () => import('./components/CardGroupIndex.vue'),
TextareaExtend: () => import('./components/TextareaExtend.vue'), // 带 插入 表情/客户昵称 等扩展工具栏的文本内容框
DateSearchChartTable: () => import('./components/DateSearchChartTable.vue'),
RequestChartTable: () => import('./components/RequestChartTable.vue'),
SearchResetButton: () => import('./components/SearchResetButton.vue'),
}
for (const c in components) {
app.component(c, defineAsyncComponent(components[c]))
}
// 全局方法挂载
import ClipboardJS from 'clipboard'
ClipboardJS.prototype.e = {
success: [
{
fn() {
ElNotification.success({
title: '复制成功',
// message: '链接已复制到剪切板,可粘贴。',
})
},
},
],
error: [
{
fn() {
ElNotification.error({
title: '复制失败',
// message: '链接复制失败',
})
},
},
],
}
import * as methods from '@/utils/common'
import { pickerOptions } from '@/utils/index'
Object.assign(app.config.globalProperties, 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'
// app.use(VideoPlayer)
// import AudioPlayer from '@liripeng/vue-audio-player'
// import '@liripeng/vue-audio-player/lib/vue-audio-player.css'
// app.use(AudioPlayer)
// import Driver from 'driver.js'
// import 'driver.js/dist/driver.min.css'
// app.config.globalProperties.$driver = new Driver({
// className: 'scoped-class',
// allowClose: false, //禁止点击外部关闭
// doneBtnText: '完成', // 完成按钮标题
// closeBtnText: '关闭', // 关闭按钮标题
// stageBackground: '#fff', // 引导对话的背景色
// nextBtnText: '下一步', // 下一步按钮标题
// prevBtnText: '上一步', // 上一步按钮标题
// keyboardControl: false, // 禁止键盘控制
// // showButtons:false
// })
import directive from './directive'
app.use(directive)
import stores, { store } from '@/stores'
app.use(store)
app.use(router)
app.config.globalProperties.$store = stores()
app.mount('#app')