main.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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. import Print from 'vue-print-nb'
  66. // Global instruction
  67. Vue.use(Print);
  68. // 全局方法挂载
  69. Vue.prototype.getDicts = getDicts
  70. Vue.prototype.getConfigKey = getConfigKey
  71. Vue.prototype.parseTime = parseTime
  72. Vue.prototype.resetForm = resetForm
  73. Vue.prototype.addDateRange = addDateRange
  74. Vue.prototype.selectDictLabel = selectDictLabel
  75. Vue.prototype.selectDictLabels = selectDictLabels
  76. Vue.prototype.download = download
  77. Vue.prototype.handleTree = handleTree
  78. // 全局组件挂载
  79. Vue.component('downloadExcel', JsonExcel)
  80. Vue.component('DictTag', DictTag)
  81. Vue.component('Pagination', Pagination)
  82. Vue.component('RightToolbar', RightToolbar)
  83. Vue.component('Editor', Editor)
  84. Vue.component('FileUpload', FileUpload)
  85. Vue.component('ImageUpload', ImageUpload)
  86. Vue.component('ImagePreview', ImagePreview)
  87. Vue.use(directive)
  88. Vue.use(plugins)
  89. Vue.use(VueMeta)
  90. DictData.install()
  91. useAntd(Vue)
  92. Vue.use(KFormDesign)
  93. Object.keys(Directives).forEach(item => {
  94. Vue.directive(item, Directives[item])
  95. })
  96. /**
  97. * If you don't want to use mock-server
  98. * you want to use MockJs for mock api
  99. * you can execute: mockXHR()
  100. *
  101. * Currently MockJs will be used in the production environment,
  102. * please remove it before going online! ! !
  103. */
  104. Vue.use(Element, {
  105. size: Cookies.get('size') || 'medium' // set element-ui default size
  106. })
  107. Vue.config.productionTip = false
  108. new Vue({
  109. el: '#app',
  110. router,
  111. store,
  112. render: h => h(App)
  113. })