2021-08-23 16:57:25 +08:00
|
|
|
import Vue from 'vue'
|
|
|
|
|
|
|
|
|
|
import Cookies from 'js-cookie'
|
|
|
|
|
|
|
|
|
|
import Element from 'element-ui'
|
2021-09-14 14:34:20 +08:00
|
|
|
import 'normalize.css/normalize.css' // a modern alternative to CSS resets
|
2021-10-10 20:39:35 +08:00
|
|
|
import './assets/styles/element-variables.scss'
|
2021-08-23 16:57:25 +08:00
|
|
|
import '@/assets/styles/index.scss' // global css
|
|
|
|
|
|
|
|
|
|
import App from './App'
|
|
|
|
|
import store from './store'
|
|
|
|
|
import router from './router'
|
|
|
|
|
import permission from './directive/permission'
|
2021-12-26 14:26:48 +08:00
|
|
|
import plugins from './plugins' // plugins
|
2022-02-27 21:11:46 +08:00
|
|
|
import signalR from '@/utils/signalR'
|
2023-01-30 17:40:46 +08:00
|
|
|
import { downFile } from '@/utils/request'
|
2021-08-23 16:57:25 +08:00
|
|
|
|
|
|
|
|
import './assets/icons' // icon
|
|
|
|
|
import './permission' // permission control
|
2022-03-13 19:17:25 +08:00
|
|
|
import { getDicts } from "@/api/system/dict/data";
|
2021-09-29 15:57:56 +08:00
|
|
|
import { getConfigKey } from "@/api/system/config";
|
2022-03-01 21:26:18 +08:00
|
|
|
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree, handleDict } from "@/utils/ruoyi";
|
2021-09-29 15:57:56 +08:00
|
|
|
//分页组件
|
2021-08-23 16:57:25 +08:00
|
|
|
import Pagination from "@/components/Pagination";
|
|
|
|
|
//自定义表格工具扩展
|
|
|
|
|
import RightToolbar from "@/components/RightToolbar"
|
2021-11-29 20:13:26 +08:00
|
|
|
// 富文本组件
|
|
|
|
|
import Editor from "@/components/Editor";
|
2021-09-29 15:57:56 +08:00
|
|
|
// 字典标签组件
|
|
|
|
|
import DictTag from '@/components/DictTag'
|
2021-12-03 21:58:52 +08:00
|
|
|
// 上传图片
|
|
|
|
|
import UploadImage from '@/components/UploadImage/index';
|
2021-12-09 22:21:44 +08:00
|
|
|
// 上传文件
|
|
|
|
|
import UploadFile from '@/components/FileUpload/index';
|
2021-08-23 16:57:25 +08:00
|
|
|
|
|
|
|
|
// 全局方法挂载
|
|
|
|
|
Vue.prototype.getDicts = getDicts
|
2021-09-29 15:57:56 +08:00
|
|
|
Vue.prototype.getConfigKey = getConfigKey
|
2021-08-23 16:57:25 +08:00
|
|
|
Vue.prototype.parseTime = parseTime
|
|
|
|
|
Vue.prototype.resetForm = resetForm
|
|
|
|
|
Vue.prototype.addDateRange = addDateRange
|
|
|
|
|
Vue.prototype.selectDictLabel = selectDictLabel
|
|
|
|
|
Vue.prototype.selectDictLabels = selectDictLabels
|
|
|
|
|
Vue.prototype.download = download
|
|
|
|
|
Vue.prototype.handleTree = handleTree
|
2022-03-01 21:26:18 +08:00
|
|
|
Vue.prototype.handleDict = handleDict
|
2023-01-30 17:40:46 +08:00
|
|
|
Vue.prototype.downFile = downFile
|
2021-08-23 16:57:25 +08:00
|
|
|
|
2021-12-12 21:03:28 +08:00
|
|
|
Vue.prototype.msgSuccess = function (msg) {
|
2021-08-23 16:57:25 +08:00
|
|
|
this.$message({ showClose: true, message: msg, type: "success" });
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-12 21:03:28 +08:00
|
|
|
Vue.prototype.msgError = function (msg) {
|
2021-08-23 16:57:25 +08:00
|
|
|
this.$message({ showClose: true, message: msg, type: "error" });
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-12 21:03:28 +08:00
|
|
|
Vue.prototype.msgInfo = function (msg) {
|
2021-08-23 16:57:25 +08:00
|
|
|
this.$message.info(msg);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 全局组件挂载
|
|
|
|
|
Vue.component('Pagination', Pagination)
|
|
|
|
|
Vue.component('RightToolbar', RightToolbar)
|
2021-09-29 15:57:56 +08:00
|
|
|
Vue.component('DictTag', DictTag)
|
2021-11-29 20:13:26 +08:00
|
|
|
Vue.component('Editor', Editor)
|
2021-12-03 21:58:52 +08:00
|
|
|
Vue.component('UploadImage', UploadImage)
|
2021-12-09 22:21:44 +08:00
|
|
|
Vue.component('UploadFile', UploadFile)
|
2021-08-23 16:57:25 +08:00
|
|
|
|
2021-12-26 14:26:48 +08:00
|
|
|
Vue.use(permission)
|
|
|
|
|
Vue.use(plugins)
|
2021-08-23 16:57:25 +08:00
|
|
|
Vue.use(Element, {
|
2021-12-10 08:29:11 +08:00
|
|
|
size: Cookies.get('size') || 'small' // set element-ui default size
|
2021-08-23 16:57:25 +08:00
|
|
|
})
|
|
|
|
|
|
|
|
|
|
Vue.config.productionTip = false
|
|
|
|
|
|
2022-03-01 14:04:21 +08:00
|
|
|
signalR.init(process.env.VUE_APP_SOCKET_API);
|
|
|
|
|
Vue.prototype.signalr = signalR
|
|
|
|
|
|
2021-08-23 16:57:25 +08:00
|
|
|
new Vue({
|
|
|
|
|
el: '#app',
|
|
|
|
|
router,
|
|
|
|
|
store,
|
|
|
|
|
render: h => h(App)
|
2022-01-13 18:42:32 +08:00
|
|
|
})
|