main.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. // with polyfills
  2. import 'core-js/stable'
  3. import 'regenerator-runtime/runtime'
  4. import Vue from 'vue'
  5. import App from './App.vue'
  6. import router from './router'
  7. import permission from './directive/permission'
  8. import store from './store/'
  9. import i18n from './locales'
  10. import { VueAxios } from './utils/request'
  11. // import '@/views/system/securityCheck/styles/index.scss' // global css
  12. import ProLayout, { PageHeaderWrapper } from '@/components/ProLayout'
  13. import FooterToolBar from '@/components/FooterToolbar'
  14. import themePluginConfig from '../config/themePluginConfig'
  15. import * as echarts from 'echarts'
  16. // mock
  17. // WARNING: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.
  18. // import './mock'
  19. import '@/assets/styles/antv-theme.less'
  20. import bootstrap from './core/bootstrap'
  21. import './core/lazy_use' // use lazy load components
  22. import './permission' // permission control
  23. import './utils/filter' // global filter
  24. import draggable from '@/utils/drag'
  25. import './global.less' // global style
  26. import { getDicts, getAllDicts } from '@/api/system/dict/data'
  27. import { getConfigKey } from '@/api/system/config'
  28. import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, downloadTask, downloadByPath, handleTree, appendTreeNode, removeTreeNode, expandTree } from '@/utils/aidex'
  29. import Highlight from './utils/highlight'
  30. // 全局方法挂载
  31. Vue.prototype.getDicts = getDicts
  32. Vue.prototype.getAllDicts = getAllDicts
  33. Vue.prototype.getConfigKey = getConfigKey
  34. Vue.prototype.parseTime = parseTime
  35. Vue.prototype.resetForm = resetForm
  36. Vue.prototype.addDateRange = addDateRange
  37. Vue.prototype.selectDictLabel = selectDictLabel
  38. Vue.prototype.selectDictLabels = selectDictLabels
  39. Vue.prototype.download = download
  40. Vue.prototype.downloadTask = downloadTask
  41. Vue.prototype.downloadByPath = downloadByPath
  42. Vue.prototype.handleTree = handleTree
  43. Vue.prototype.appendTreeNode = appendTreeNode
  44. Vue.prototype.removeTreeNode = removeTreeNode
  45. Vue.prototype.expandTree = expandTree
  46. Vue.config.productionTip = false
  47. Vue.prototype.$echarts = echarts
  48. // mount axios to `Vue.$http` and `this.$http`
  49. Vue.use(VueAxios)
  50. // use pro-layout components
  51. Vue.component('pro-layout', ProLayout)
  52. Vue.component('page-container', PageHeaderWrapper)
  53. Vue.component('page-header-wrapper', PageHeaderWrapper)
  54. Vue.component('footer-tool-bar', FooterToolBar)
  55. Vue.use(permission)
  56. Vue.use(Highlight)
  57. Vue.use(draggable)
  58. import {
  59. Base,
  60. Affix,
  61. Anchor,
  62. AutoComplete,
  63. Alert,
  64. Avatar,
  65. BackTop,
  66. Badge,
  67. Breadcrumb,
  68. Button,
  69. Calendar,
  70. Card,
  71. Collapse,
  72. Carousel,
  73. Cascader,
  74. Checkbox,
  75. Col,
  76. DatePicker,
  77. Divider,
  78. Dropdown,
  79. Form,
  80. FormModel,
  81. Icon,
  82. Input,
  83. InputNumber,
  84. Layout,
  85. List,
  86. LocaleProvider,
  87. Menu,
  88. Mentions,
  89. Modal,
  90. Pagination,
  91. Popconfirm,
  92. Popover,
  93. Progress,
  94. Radio,
  95. Rate,
  96. Row,
  97. Select,
  98. Slider,
  99. Spin,
  100. Statistic,
  101. Steps,
  102. Switch,
  103. Table,
  104. Transfer,
  105. Tree,
  106. TreeSelect,
  107. Tabs,
  108. Tag,
  109. TimePicker,
  110. Timeline,
  111. Tooltip,
  112. Upload,
  113. Drawer,
  114. Skeleton,
  115. Comment,
  116. // ColorPicker,
  117. ConfigProvider,
  118. Empty,
  119. Result,
  120. Descriptions,
  121. PageHeader,
  122. Space,
  123. } from 'ant-design-vue';
  124. // Vue.use(DatePicker);
  125. const components = [
  126. Base,
  127. Affix,
  128. Anchor,
  129. AutoComplete,
  130. Alert,
  131. Avatar,
  132. BackTop,
  133. Badge,
  134. Breadcrumb,
  135. Button,
  136. Calendar,
  137. Card,
  138. Collapse,
  139. Carousel,
  140. Cascader,
  141. Checkbox,
  142. Col,
  143. DatePicker,
  144. Divider,
  145. Dropdown,
  146. Form,
  147. FormModel,
  148. Icon,
  149. Input,
  150. InputNumber,
  151. Layout,
  152. List,
  153. LocaleProvider,
  154. Menu,
  155. Mentions,
  156. Modal,
  157. Pagination,
  158. Popconfirm,
  159. Popover,
  160. Progress,
  161. Radio,
  162. Rate,
  163. Row,
  164. Select,
  165. Slider,
  166. Spin,
  167. Statistic,
  168. Steps,
  169. Switch,
  170. Table,
  171. Transfer,
  172. Tree,
  173. TreeSelect,
  174. Tabs,
  175. Tag,
  176. TimePicker,
  177. Timeline,
  178. Tooltip,
  179. Upload,
  180. Drawer,
  181. Skeleton,
  182. Comment,
  183. ConfigProvider,
  184. Empty,
  185. Result,
  186. Descriptions,
  187. PageHeader,
  188. Space,
  189. ];
  190. Vue.use(VueAxios)
  191. components.map(component => {
  192. Vue.use(component);
  193. });
  194. window.umi_plugin_ant_themeVar = themePluginConfig.theme
  195. new Vue({
  196. router,
  197. store,
  198. i18n,
  199. // init localstorage, vuex
  200. created: bootstrap,
  201. render: h => h(App)
  202. }).$mount('#app')