main.js 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. import Vue from 'vue'
  2. // use code below to debug in mobile devices.
  3. // import vConsole from 'vconsole'
  4. // new vConsole()
  5. import Cookies from 'js-cookie'
  6. import Element from 'element-ui'
  7. import './assets/styles/element-variables.scss'
  8. import '@/assets/styles/common.scss' // common css
  9. import '@/assets/styles/index.scss' // global css
  10. import '@/assets/styles/ruoyi.scss' // ruoyi css
  11. import App from './App'
  12. import store from './store'
  13. import router from './router'
  14. import permission from './directive/permission'
  15. import './assets/icons' // icon
  16. import '@/assets/icons/iconfont.css' // 阿里巴巴icon css
  17. import './permission' // permission control
  18. import { getDicts } from "@/api/system/dict/data";
  19. import { getConfigKey } from "@/api/system/config";
  20. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
  21. import Pagination from "@/components/Pagination";
  22. // 自定义表格工具扩展
  23. import RightToolbar from "@/components/RightToolbar"
  24. import formSearch from "@/components/formSearch"
  25. import EvaluationTitle from "@/components/EvaluationTitle"
  26. import EvaluationCard from "@/components/EvaluationCard"
  27. import EvaluationEmpty from "@/components/EvaluationEmpty"
  28. import StudentCard from "@/components/StudentCard"
  29. import MxDateRangePicker from "@/components/MxDateRangePicker"
  30. import MxSeperator from "@/components/MxSeperator"
  31. import MxTable from "@/components/MxTable"
  32. import MxCheckStatus from "@/components/MxCheckStatus"
  33. import Province from "@/components/Province"
  34. import UploadDialog from "@/components/UploadDialog"
  35. import selectTree from "@/components/selectTree"
  36. import globalVariable from '@/utils/globalVariable'
  37. import BottomP from '@/components/BottomP'
  38. import Top from '@/components/Top'
  39. import MxVideo from '@/components/MxVideo'
  40. import FileUpload from '@/components/FileUpload'
  41. import ImageUpload from '@/components/ImageUpload'
  42. // 用于静态弹窗 函数式调用
  43. import MxDialog from '@/components/MxDialog/index'
  44. Vue.prototype.$imgBase = 'https://mingxuejingbang.oss-cn-beijing.aliyuncs.com/mingxueMainImgs/'
  45. Vue.prototype.$Dialog = MxDialog
  46. Vue.prototype.mxGlobal = globalVariable
  47. // 全局方法挂载
  48. Vue.prototype.getDicts = getDicts
  49. Vue.prototype.getConfigKey = getConfigKey
  50. Vue.prototype.parseTime = parseTime
  51. Vue.prototype.resetForm = resetForm
  52. Vue.prototype.addDateRange = addDateRange
  53. Vue.prototype.selectDictLabel = selectDictLabel
  54. Vue.prototype.selectDictLabels = selectDictLabels
  55. Vue.prototype.download = download
  56. Vue.prototype.handleTree = handleTree
  57. Vue.prototype.msgSuccess = function (msg) {
  58. this.$message({ showClose: true, message: msg, type: "success" });
  59. }
  60. Vue.prototype.msgError = function (msg) {
  61. this.$message({ showClose: true, message: msg, type: "error" });
  62. }
  63. Vue.prototype.msgInfo = function (msg) {
  64. this.$message.info(msg);
  65. }
  66. // 扩展挂载
  67. import ext from "@/common/mx-extension.js"
  68. Vue.use(ext)
  69. // filters
  70. import filters from "@/filters/index"
  71. Object.keys(filters).forEach(key => Vue.filter(key, filters[key]))
  72. // 电子签名
  73. import vueEsign from 'vue-esign'
  74. Vue.use(vueEsign)
  75. // 全局组件挂载
  76. Vue.component('Pagination', Pagination)
  77. Vue.component('RightToolbar', RightToolbar)
  78. Vue.component('formSearch', formSearch)//搜索
  79. Vue.component('EvaluationTitle', EvaluationTitle) // 标题行
  80. Vue.component('EvaluationCard', EvaluationCard)//测评通用卡片样式
  81. Vue.component('EvaluationEmpty', EvaluationEmpty) // 无数据样式
  82. Vue.component('StudentCard', StudentCard) // 学生样式
  83. Vue.component('MxDateRangePicker', MxDateRangePicker) //开始结束分开选
  84. Vue.component('MxSeperator', MxSeperator) // 分割线
  85. Vue.component('MxTable', MxTable) // 通用表格
  86. Vue.component('MxCheckStatus', MxCheckStatus) // 选中样式/true/false
  87. Vue.component('Province', Province)//省市区
  88. Vue.component('UploadDialog', UploadDialog)//上传附件确认组件
  89. Vue.component('selectTree', selectTree)//下拉树
  90. Vue.component('BottomP', BottomP)//底部
  91. Vue.component('Top', Top)//头部
  92. Vue.component('MxVideo', MxVideo) //试图替换系统的video组件
  93. Vue.component('FileUpload', FileUpload) // OSS文件上传
  94. Vue.component('ImageUpload', ImageUpload) // OSS文件上传
  95. Vue.use(permission)
  96. // vue-video-player
  97. import VideoPlayer from 'vue-video-player'
  98. require('video.js/dist/video-js.css')
  99. require('vue-video-player/src/custom-theme.css')
  100. const hls = require('videojs-contrib-hls')
  101. Vue.use(hls)
  102. Vue.use(VideoPlayer)
  103. /**
  104. * If you don't want to use mock-server
  105. * you want to use MockJs for mock api
  106. * you can execute: mockXHR()
  107. *
  108. * Currently MockJs will be used in the production environment,
  109. * please remove it before going online! ! !
  110. */
  111. Vue.use(Element, {
  112. size: Cookies.get('size') || 'medium' // set element-ui default size
  113. })
  114. // /* use mockjs in dev-environment */
  115. // import requireContext from 'require-context.macro';
  116. // if (process.env.NODE_ENV === 'development') {
  117. // const mockModules = requireContext('../mock/modules', false, /\.js$/)
  118. // const mocks = mockModules.keys()
  119. // .map(key => mockModules(key))
  120. // .reduce(function(prev, current) {
  121. // return prev.concat(current)
  122. // }, [])
  123. // const { mockXHR } = require('../mock')
  124. // mockXHR(mocks)
  125. // }
  126. Vue.config.productionTip = false
  127. window.myVue = new Vue({
  128. el: '#app',
  129. router,
  130. store,
  131. render: h => h(App)
  132. })