main.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. import Vue from 'vue'
  2. import Cookies from 'js-cookie'
  3. import Element from 'element-ui'
  4. import './assets/styles/element-variables.scss'
  5. import '@/assets/styles/index.scss' // global css
  6. import '@/assets/styles/ruoyi.scss' // ruoyi css
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import directive from './directive' // directive
  11. import plugins from './plugins' // plugins
  12. import { download,downloadGet } from '@/utils/request'
  13. import AvueFormDesign from '@sscfaith/avue-form-design'
  14. import './assets/iconfont/iconfont.js'
  15. import './assets/icons' // icon
  16. import './permission' // permission control
  17. import { getDicts } from "@/api/system/dict/data";
  18. import { getConfigKey } from "@/api/system/config";
  19. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
  20. // 分页组件
  21. import Pagination from "@/components/Pagination";
  22. // 自定义表格工具组件
  23. import RightToolbar from "@/components/RightToolbar"
  24. // 富文本组件
  25. import Editor from "@/components/Editor"
  26. // 文件上传组件
  27. import FileUpload from "@/components/FileUpload"
  28. // 图片上传组件
  29. import ImageUpload from "@/components/ImageUpload"
  30. // 图片预览组件
  31. import ImagePreview from "@/components/ImagePreview"
  32. // 字典标签组件
  33. import DictTag from '@/components/DictTag'
  34. // 头部标签组件
  35. import VueMeta from 'vue-meta'
  36. // 字典数据组件
  37. import DictData from '@/components/DictData'
  38. import designer from '@/components/formDesigner';
  39. import axios from 'axios';
  40. import '@/utils/directives'; // 弹窗拖拽
  41. // 全局方法挂载
  42. Vue.prototype.getDicts = getDicts
  43. Vue.prototype.getConfigKey = getConfigKey
  44. Vue.prototype.parseTime = parseTime
  45. Vue.prototype.resetForm = resetForm
  46. Vue.prototype.addDateRange = addDateRange
  47. Vue.prototype.selectDictLabel = selectDictLabel
  48. Vue.prototype.selectDictLabels = selectDictLabels
  49. Vue.prototype.download = download
  50. Vue.prototype.downloadGet = downloadGet
  51. Vue.prototype.handleTree = handleTree
  52. Vue.prototype.$axios = axios
  53. // 全局组件挂载
  54. Vue.component('DictTag', DictTag)
  55. Vue.component('Pagination', Pagination)
  56. Vue.component('RightToolbar', RightToolbar)
  57. Vue.component('Editor', Editor)
  58. Vue.component('FileUpload', FileUpload)
  59. Vue.component('ImageUpload', ImageUpload)
  60. Vue.component('ImagePreview', ImagePreview)
  61. Vue.use(directive)
  62. Vue.use(plugins)
  63. Vue.use(VueMeta)
  64. Vue.use(AvueFormDesign)
  65. Vue.use(designer);
  66. DictData.install()
  67. // 打印设计开始
  68. import Antd from 'ant-design-vue';
  69. import 'ant-design-vue/dist/antd.css';
  70. Vue.use(Antd);
  71. import {hiPrintPlugin} from './index'
  72. Vue.use(hiPrintPlugin)
  73. hiPrintPlugin.disAutoConnect();
  74. // import Storage from 'vue-ls'
  75. let options = {
  76. namespace: 'hiPrint-',
  77. name: 'ls',
  78. // storage: 'local',
  79. };
  80. // Vue.use(Storage, options);
  81. Vue.use(options);
  82. // 打印设计结束
  83. import VueDND from 'awe-dnd'
  84. Vue.use(VueDND)
  85. import dragSelect from 'ty-drag-select'
  86. Vue.use(dragSelect)
  87. /**
  88. * If you don't want to use mock-server
  89. * you want to use MockJs for mock api
  90. * you can execute: mockXHR()
  91. *
  92. * Currently MockJs will be used in the production environment,
  93. * please remove it before going online! ! !
  94. */
  95. Vue.use(Element, {
  96. size: Cookies.get('size') || 'medium' // set element-ui default size
  97. })
  98. Vue.config.productionTip = false
  99. window._AMapSecurityConfig = {
  100. securityJsCode: "e6f76abf5fd8bcffb378b42f4e071218"
  101. }
  102. new Vue({
  103. el: '#app',
  104. router,
  105. store,
  106. render: h => h(App)
  107. })