main.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. // 大屏适配
  28. import VScaleScreen from 'v-scale-screen'
  29. Vue.use(VScaleScreen)
  30. import '@/assets/styles/index.scss' // global css
  31. import '@/assets/styles/zkqy.scss' // zkqy css
  32. import App from './App'
  33. import store from './store'
  34. import router from './router'
  35. import directive from './directive' // directive
  36. import plugins from './plugins' // plugins
  37. import { download } from '@/utils/request'
  38. import './assets/icons' // icon
  39. import './permission' // permission control
  40. import { getDicts } from "@/api/system/dict/data";
  41. import { getConfigKey } from "@/api/system/config";
  42. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/zkqy";
  43. // 分页组件
  44. import Pagination from "@/components/Pagination";
  45. // 自定义表格工具组件
  46. import RightToolbar from "@/components/RightToolbar"
  47. // 富文本组件
  48. import Editor from "@/components/Editor"
  49. // 文件上传组件
  50. import FileUpload from "@/components/FileUpload"
  51. // 图片上传组件
  52. import ImageUpload from "@/components/ImageUpload"
  53. // 图片预览组件
  54. import ImagePreview from "@/components/ImagePreview"
  55. // 字典标签组件
  56. import DictTag from '@/components/DictTag'
  57. // 头部标签组件
  58. import VueMeta from 'vue-meta'
  59. // 字典数据组件
  60. import DictData from '@/components/DictData'
  61. import JsonExcel from 'vue-json-excel'
  62. // 自定义指令
  63. import Directives from '@/utils/directives'
  64. // import './mock.js'
  65. // 引入 echarts
  66. import * as echarts from 'echarts'
  67. Vue.prototype.$echarts = echarts
  68. import Print from 'vue-print-nb'
  69. // Global instruction
  70. Vue.use(Print);
  71. // 全局方法挂载
  72. Vue.prototype.getDicts = getDicts
  73. Vue.prototype.getConfigKey = getConfigKey
  74. Vue.prototype.parseTime = parseTime
  75. Vue.prototype.resetForm = resetForm
  76. Vue.prototype.addDateRange = addDateRange
  77. Vue.prototype.selectDictLabel = selectDictLabel
  78. Vue.prototype.selectDictLabels = selectDictLabels
  79. Vue.prototype.download = download
  80. Vue.prototype.handleTree = handleTree
  81. // 全局组件挂载
  82. Vue.component('downloadExcel', JsonExcel)
  83. Vue.component('DictTag', DictTag)
  84. Vue.component('Pagination', Pagination)
  85. Vue.component('RightToolbar', RightToolbar)
  86. Vue.component('Editor', Editor)
  87. Vue.component('FileUpload', FileUpload)
  88. Vue.component('ImageUpload', ImageUpload)
  89. Vue.component('ImagePreview', ImagePreview)
  90. Vue.use(directive)
  91. Vue.use(plugins)
  92. Vue.use(VueMeta)
  93. DictData.install()
  94. useAntd(Vue)
  95. Vue.use(KFormDesign)
  96. Object.keys(Directives).forEach(item => {
  97. Vue.directive(item, Directives[item])
  98. })
  99. /**
  100. * If you don't want to use mock-server
  101. * you want to use MockJs for mock api
  102. * you can execute: mockXHR()
  103. *
  104. * Currently MockJs will be used in the production environment,
  105. * please remove it before going online! ! !
  106. */
  107. Vue.use(Element, {
  108. size: Cookies.get('size') || 'medium' // set element-ui default size
  109. })
  110. Vue.config.productionTip = false
  111. new Vue({
  112. el: '#app',
  113. router,
  114. store,
  115. render: h => h(App)
  116. })