main.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. import Vue from 'vue'
  2. import $ from 'jquery' ;
  3. import 'bootstrap'
  4. import Cookies from 'js-cookie'
  5. import 'normalize.css/normalize.css' // a modern alternative to CSS resets
  6. import Element from 'element-ui'
  7. import 'element-ui/lib/theme-chalk/index.css';
  8. import './assets/styles/element-variables.scss'
  9. import './assets/css/myCss.css';
  10. import '@/assets/styles/index.scss' // global css
  11. import '@/assets/styles/ruoyi.scss' // ruoyi css
  12. import App from './App'
  13. import store from './store'
  14. import router from './router'
  15. import permission from './directive/permission'
  16. import '@/style/common.scss'
  17. import '@/assets/icons' // icon
  18. import './permission' // permission control
  19. import { getDicts } from "@/api/system/dict/data";
  20. import { getConfigKey } from "@/api/system/config";
  21. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
  22. import Pagination from "@/components/Pagination";
  23. import i18n from './lang'
  24. import "@/components/dialogdrag.js"
  25. import dataV from '@jiaminghi/data-view';
  26. //自定义表格工具扩展
  27. import RightToolbar from "@/components/RightToolbar"
  28. //echarts
  29. import echarts from '@/api/cpms/echarts.min.js'
  30. import officeConvert from '@/utils/officeConvert.js' //全局预览方法
  31. //import { Loading } from 'element-ui'; //全局loading
  32. // 按需引入vue-awesome图标
  33. import Icon from 'vue-awesome/components/Icon';
  34. import 'vue-awesome/icons/chart-bar.js';
  35. import 'vue-awesome/icons/chart-area.js';
  36. import 'vue-awesome/icons/chart-pie.js';
  37. import 'vue-awesome/icons/chart-line.js';
  38. import 'vue-awesome/icons/align-left.js';
  39. import '@/assets/iconfont/iconfont.css'
  40. import '@/assets/iconfont/iconfont.js'
  41. // 适配flex
  42. // 全局注册图标
  43. Vue.component('icon', Icon);
  44. // 全局方法挂载
  45. Vue.prototype.bus = new Vue()
  46. Vue.prototype.getDicts = getDicts
  47. Vue.prototype.getConfigKey = getConfigKey
  48. Vue.prototype.parseTime = parseTime
  49. Vue.prototype.resetForm = resetForm
  50. Vue.prototype.addDateRange = addDateRange
  51. Vue.prototype.selectDictLabel = selectDictLabel
  52. Vue.prototype.selectDictLabels = selectDictLabels
  53. Vue.prototype.download = download
  54. Vue.prototype.handleTree = handleTree
  55. Vue.prototype.echarts = echarts
  56. Vue.prototype.officeConvert = officeConvert
  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. Vue.component('Pagination', Pagination)
  68. Vue.component('RightToolbar', RightToolbar)
  69. Vue.use(permission)
  70. Vue.use(dataV)
  71. /**
  72. * If you don't want to use mock-server
  73. * you want to use MockJs for mock api
  74. * you can execute: mockXHR()
  75. *
  76. * Currently MockJs will be used in the production environment,
  77. * please remove it before going online! ! !
  78. */
  79. Vue.use(Element, {
  80. size: 'mini', // set element-ui default size
  81. i18n: (key, value) => i18n.t(key, value)
  82. })
  83. Vue.config.productionTip = false
  84. new Vue({
  85. el: '#app',
  86. router,
  87. store,
  88. i18n,
  89. render: h => h(App)
  90. })