main.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. import Vue from 'vue'
  2. import { useAntd } from 'k-form-design/packages/core/useComponents'
  3. import KFormDesign from 'k-form-design/packages/use.js'
  4. import 'k-form-design/lib/k-form-design.css'
  5. import Cookies from 'js-cookie'
  6. import Element from 'element-ui'
  7. import './assets/styles/element-variables.scss'
  8. // 以下为bpmn工作流绘图工具的样式
  9. import 'bpmn-js/dist/assets/diagram-js.css' // 左边工具栏以及编辑节点的样式
  10. import 'bpmn-js/dist/assets/bpmn-font/css/bpmn.css'
  11. import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-codes.css'
  12. import 'bpmn-js/dist/assets/bpmn-font/css/bpmn-embedded.css'
  13. // import 'bpmn-js-properties-panel/dist/assets/bpmn-js-properties-panel.css'
  14. // 左边工具栏以及编辑节点的样式
  15. // import 'bpmn-js-properties-panel/dist/assets/properties-panel.css'
  16. // bpmn样式结束
  17. // bpmnPro start
  18. import { vuePlugin } from "@packages/highlight";
  19. import "highlight.js/styles/atom-one-dark-reasonable.css";
  20. Vue.use(vuePlugin);
  21. import Common from "@packages/common";
  22. Vue.use(Common);
  23. import ResetPopover from "@utils/resetPopover";
  24. Vue.directive("r-popover", ResetPopover);
  25. import "@packages/theme/index.scss";
  26. // bpmnPro end
  27. import '@/assets/styles/index.scss' // global css
  28. import '@/assets/styles/zkqy.scss' // zkqy css
  29. import App from './App'
  30. import store from './store'
  31. import router from './router'
  32. import directive from './directive' // directive
  33. import plugins from './plugins' // plugins
  34. import { download } from '@/utils/request'
  35. import './assets/icons' // icon
  36. import './permission' // permission control
  37. import { getDicts } from "@/api/system/dict/data";
  38. import { getConfigKey } from "@/api/system/config";
  39. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/zkqy";
  40. // 分页组件
  41. import Pagination from "@/components/Pagination";
  42. // 自定义表格工具组件
  43. import RightToolbar from "@/components/RightToolbar"
  44. // 富文本组件
  45. import Editor from "@/components/Editor"
  46. // 文件上传组件
  47. import FileUpload from "@/components/FileUpload"
  48. // 图片上传组件
  49. import ImageUpload from "@/components/ImageUpload"
  50. // 图片预览组件
  51. import ImagePreview from "@/components/ImagePreview"
  52. // 字典标签组件
  53. import DictTag from '@/components/DictTag'
  54. // 头部标签组件
  55. import VueMeta from 'vue-meta'
  56. // 字典数据组件
  57. import DictData from '@/components/DictData'
  58. import JsonExcel from 'vue-json-excel'
  59. // 自定义指令
  60. import Directives from '@/utils/directives'
  61. // import './mock.js'
  62. // 引入 echarts
  63. import * as echarts from 'echarts'
  64. Vue.prototype.$echarts = echarts
  65. // 全局方法挂载
  66. Vue.prototype.getDicts = getDicts
  67. Vue.prototype.getConfigKey = getConfigKey
  68. Vue.prototype.parseTime = parseTime
  69. Vue.prototype.resetForm = resetForm
  70. Vue.prototype.addDateRange = addDateRange
  71. Vue.prototype.selectDictLabel = selectDictLabel
  72. Vue.prototype.selectDictLabels = selectDictLabels
  73. Vue.prototype.download = download
  74. Vue.prototype.handleTree = handleTree
  75. // 全局组件挂载
  76. Vue.component('downloadExcel', JsonExcel)
  77. Vue.component('DictTag', DictTag)
  78. Vue.component('Pagination', Pagination)
  79. Vue.component('RightToolbar', RightToolbar)
  80. Vue.component('Editor', Editor)
  81. Vue.component('FileUpload', FileUpload)
  82. Vue.component('ImageUpload', ImageUpload)
  83. Vue.component('ImagePreview', ImagePreview)
  84. Vue.use(directive)
  85. Vue.use(plugins)
  86. Vue.use(VueMeta)
  87. DictData.install()
  88. useAntd(Vue)
  89. Vue.use(KFormDesign)
  90. Object.keys(Directives).forEach(item => {
  91. Vue.directive(item, Directives[item])
  92. })
  93. /**
  94. * If you don't want to use mock-server
  95. * you want to use MockJs for mock api
  96. * you can execute: mockXHR()
  97. *
  98. * Currently MockJs will be used in the production environment,
  99. * please remove it before going online! ! !
  100. */
  101. Vue.use(Element, {
  102. size: Cookies.get('size') || 'medium' // set element-ui default size
  103. })
  104. Vue.config.productionTip = false
  105. new Vue({
  106. el: '#app',
  107. router,
  108. store,
  109. render: h => h(App)
  110. })