|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+import { createApp } from 'vue'
|
|
|
2
|
+
|
|
|
3
|
+import Cookies from 'js-cookie'
|
|
|
4
|
+
|
|
|
5
|
+import ElementPlus from 'element-plus'
|
|
|
6
|
+import 'element-plus/dist/index.css'
|
|
|
7
|
+import 'element-plus/theme-chalk/dark/css-vars.css'
|
|
|
8
|
+import locale from 'element-plus/es/locale/lang/zh-cn'
|
|
|
9
|
+
|
|
|
10
|
+import '@/assets/styles/index.scss' // global css
|
|
|
11
|
+
|
|
|
12
|
+import App from './App'
|
|
|
13
|
+import store from './store'
|
|
|
14
|
+import router from './router'
|
|
|
15
|
+import directive from './directive' // directive
|
|
|
16
|
+
|
|
|
17
|
+// 注册指令
|
|
|
18
|
+import plugins from './plugins' // plugins
|
|
|
19
|
+import { download } from '@/utils/request'
|
|
|
20
|
+
|
|
|
21
|
+// svg图标
|
|
|
22
|
+import 'virtual:svg-icons-register'
|
|
|
23
|
+import SvgIcon from '@/components/SvgIcon'
|
|
|
24
|
+import elementIcons from '@/components/SvgIcon/svgicon'
|
|
|
25
|
+
|
|
|
26
|
+import './permission' // permission control
|
|
|
27
|
+
|
|
|
28
|
+import { useDict } from '@/utils/dict'
|
|
|
29
|
+import { getConfigKey } from "@/api/system/config"
|
|
|
30
|
+import { parseTime, resetForm, addDateRange, handleTree, selectDictLabel, selectDictLabels } from '@/utils/ruoyi'
|
|
|
31
|
+
|
|
|
32
|
+// 分页组件
|
|
|
33
|
+import Pagination from '@/components/Pagination'
|
|
|
34
|
+// 自定义表格工具组件
|
|
|
35
|
+import RightToolbar from '@/components/RightToolbar'
|
|
|
36
|
+// 富文本组件
|
|
|
37
|
+import Editor from "@/components/Editor"
|
|
|
38
|
+// sql编辑器组件
|
|
|
39
|
+import SqlEdit from '@/components/sqlEdit';
|
|
|
40
|
+// 文件上传组件
|
|
|
41
|
+import FileUpload from "@/components/FileUpload"
|
|
|
42
|
+// 图片上传组件
|
|
|
43
|
+import ImageUpload from "@/components/ImageUpload"
|
|
|
44
|
+// 图片预览组件
|
|
|
45
|
+import ImagePreview from "@/components/ImagePreview"
|
|
|
46
|
+// 字典标签组件
|
|
|
47
|
+import DictTag from '@/components/DictTag'
|
|
|
48
|
+
|
|
|
49
|
+const app = createApp(App)
|
|
|
50
|
+
|
|
|
51
|
+// 全局方法挂载
|
|
|
52
|
+app.config.globalProperties.useDict = useDict
|
|
|
53
|
+app.config.globalProperties.download = download
|
|
|
54
|
+app.config.globalProperties.parseTime = parseTime
|
|
|
55
|
+app.config.globalProperties.resetForm = resetForm
|
|
|
56
|
+app.config.globalProperties.handleTree = handleTree
|
|
|
57
|
+app.config.globalProperties.addDateRange = addDateRange
|
|
|
58
|
+app.config.globalProperties.getConfigKey = getConfigKey
|
|
|
59
|
+app.config.globalProperties.selectDictLabel = selectDictLabel
|
|
|
60
|
+app.config.globalProperties.selectDictLabels = selectDictLabels
|
|
|
61
|
+
|
|
|
62
|
+// 全局组件挂载
|
|
|
63
|
+app.component('DictTag', DictTag)
|
|
|
64
|
+app.component('Pagination', Pagination)
|
|
|
65
|
+app.component('FileUpload', FileUpload)
|
|
|
66
|
+app.component('ImageUpload', ImageUpload)
|
|
|
67
|
+app.component('ImagePreview', ImagePreview)
|
|
|
68
|
+app.component('RightToolbar', RightToolbar)
|
|
|
69
|
+app.component('Editor', Editor)
|
|
|
70
|
+app.component('SqlEdit', SqlEdit);
|
|
|
71
|
+
|
|
|
72
|
+
|
|
|
73
|
+app.use(router)
|
|
|
74
|
+app.use(store)
|
|
|
75
|
+app.use(plugins)
|
|
|
76
|
+app.use(elementIcons)
|
|
|
77
|
+app.component('svg-icon', SvgIcon)
|
|
|
78
|
+
|
|
|
79
|
+directive(app)
|
|
|
80
|
+
|
|
|
81
|
+// 使用element-plus 并且设置全局的大小
|
|
|
82
|
+app.use(ElementPlus, {
|
|
|
83
|
+ locale: locale,
|
|
|
84
|
+ // 支持 large、default、small
|
|
|
85
|
+ size: Cookies.get('size') || 'default'
|
|
|
86
|
+})
|
|
|
87
|
+
|
|
|
88
|
+app.mount('#app')
|