main.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import Vue from 'vue'
  2. import Cookies from 'js-cookie'
  3. import 'normalize.css/normalize.css' // a modern alternative to CSS resets
  4. import Element from 'element-ui'
  5. import './styles/element-variables.scss'
  6. import '@/styles/index.scss' // global css
  7. import App from './App'
  8. import store from './store'
  9. import router from './router'
  10. import './icons' // icon
  11. import './permission' // permission control
  12. import './utils/error-log' // error log
  13. import * as filters from './filters' // global filters
  14. /**
  15. * If you don't want to use mock-server
  16. * you want to use MockJs for mock api
  17. * you can execute: mockXHR()
  18. *
  19. * Currently, MockJs will be used in the production environment,
  20. * please remove it before going online ! ! !
  21. */
  22. // a-mapLayer
  23. import VueAMap from 'vue-amap'
  24. Vue.use(VueAMap)
  25. VueAMap.initAMapApiLoader({
  26. key: '52dc0f516117d530a2f73538adf20bcc',
  27. plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
  28. // 默认高德 sdk 版本为 1.4.4
  29. v: '1.4.4'
  30. })
  31. window._AMapSecurityConfig = {
  32. securityJsCode: '48f209a1a4600b2bf6247eefcc61549a'
  33. }
  34. // vueAwesomeCountdown
  35. import vueAwesomeCountdown from 'vue-awesome-countdown'
  36. Vue.use(vueAwesomeCountdown, 'vac')
  37. // icon-fonts
  38. import '@/iconfonts/iconfont.css'
  39. // // ECharts
  40. import ECharts from 'vue-echarts' // refers to components/ECharts.vue in webpack
  41. import 'leaflet/dist/leaflet.css'
  42. import '@geoman-io/leaflet-geoman-free/dist/leaflet-geoman.css'
  43. // import ECharts modules manually to reduce bundle size
  44. // import 'echarts/lib/chart/bar'/*
  45. // import 'echarts/lib/component/tooltip'*/
  46. // If you want to use ECharts extensions, just import the extension package, and it will work
  47. // Taking ECharts-GL as an example:
  48. // You only need to install the package with `npm install --save echarts-gl` and import it as follows
  49. // import 'echarts-gl'
  50. Vue.component('v-chart', ECharts)
  51. // vue-quill-editor
  52. import VueQuillEditor from 'vue-quill-editor'
  53. import 'quill/dist/quill.core.css'
  54. import 'quill/dist/quill.snow.css'
  55. import 'quill/dist/quill.bubble.css'
  56. // 组织结构图
  57. import 'vue2-org-tree/dist/style.css'
  58. const toolbarOptions = {
  59. placeholder: '请输入编辑内容',
  60. theme: 'snow',
  61. modules: {
  62. toolbar:
  63. [
  64. ['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线 -----['bold', 'italic', 'underline', 'strike']
  65. ['blockquote', 'code-block'], // 引用 代码块-----['blockquote', 'code-block']
  66. [{ header: 1 }, { header: 2 }], // 1、2 级标题-----[{ header: 1 }, { header: 2 }]
  67. [{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表-----[{ list: 'ordered' }, { list: 'bullet' }]
  68. [{ script: 'sub' }, { script: 'super' }], // 上标/下标-----[{ script: 'sub' }, { script: 'super' }]
  69. [{ indent: '-1' }, { indent: '+1' }], // 缩进-----[{ indent: '-1' }, { indent: '+1' }]
  70. [{ 'direction': 'rtl' }], // 文本方向-----[{'direction': 'rtl'}]
  71. [{ size: ['small', false, 'large', 'huge'] }], // 字体大小-----[{ size: ['small', false, 'large', 'huge'] }]
  72. [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题-----[{ header: [1, 2, 3, 4, 5, 6, false] }]
  73. [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色-----[{ color: [] }, { background: [] }]
  74. [{ font: [] }], // 字体种类-----[{ font: [] }]
  75. [{ align: [] }], // 对齐方式-----[{ align: [] }]
  76. ['clean'], // 清除文本格式-----['clean']
  77. ['image'], // 链接、图片、视频-----['link', 'photo', 'video']
  78. [
  79. { table: 'TD' },
  80. { 'table-insert-row': 'TIR' },
  81. { 'table-insert-column': 'TIC' },
  82. { 'table-delete-row': 'TDR' },
  83. { 'table-delete-column': 'TDC' }
  84. ]
  85. ]
  86. }
  87. }
  88. Vue.use(VueQuillEditor, toolbarOptions)
  89. // Contextmenu
  90. import Contextmenu from 'vue-contextmenujs'
  91. Vue.use(Contextmenu)
  92. Vue.use(Element, {
  93. size: Cookies.get('size') || 'medium' // set element-ui default size
  94. })
  95. // register global utility filters
  96. Object.keys(filters).forEach(key => {
  97. Vue.filter(key, filters[key])
  98. })
  99. Vue.config.productionTip = false
  100. new Vue({
  101. el: '#app',
  102. router,
  103. store,
  104. render: h => h(App)
  105. })